2013-08-18 21:08:25 +00:00
|
|
|
class Clojurescript < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Clojure to JS compiler"
|
2014-06-21 20:22:10 +00:00
|
|
|
homepage "https://github.com/clojure/clojurescript"
|
|
|
|
head "https://github.com/clojure/clojurescript.git"
|
2015-07-19 16:16:26 +00:00
|
|
|
url "https://github.com/clojure/clojurescript/releases/download/r3308/cljs.jar", :using => :nounzip
|
|
|
|
sha256 "8ec232b2d5660083cb3038bc6e0f509faee398af7c88d01fe7585f68dd3eeac6"
|
|
|
|
version "r3308"
|
2013-08-18 21:08:25 +00:00
|
|
|
|
2014-08-21 08:13:25 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-07-19 17:37:24 +00:00
|
|
|
sha256 "523451b9de06fc49ab0f7a6e2193c105d5ba12fa6e22268c114bfb2afe40bf59" => :yosemite
|
|
|
|
sha256 "d3105232788d6000b37d229ceba4cb872891a78f01b307baf232a7adb6613bbb" => :mavericks
|
|
|
|
sha256 "ce2f3e9931c789cff5dd217432b08167cdfd4670879d597ef2f1d1bab4dcead0" => :mountain_lion
|
2014-08-21 08:13:25 +00:00
|
|
|
end
|
|
|
|
|
2013-08-18 21:08:25 +00:00
|
|
|
def install
|
2015-07-19 16:16:26 +00:00
|
|
|
mv "cljs.jar", "cljs-#{version}.jar"
|
|
|
|
libexec.install "cljs-#{version}.jar"
|
|
|
|
bin.write_jar_script libexec/"cljs-#{version}.jar", "cljsc"
|
2013-08-18 21:08:25 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
This formula is useful if you need to use the ClojureScript compiler directly.
|
|
|
|
For a more integrated workflow, Leiningen with lein-cljsbuild is recommended.
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2014-12-15 22:57:10 +00:00
|
|
|
(testpath/"t.cljs").write <<-EOF.undent
|
|
|
|
(ns hello)
|
|
|
|
(defn ^:export greet [n]
|
|
|
|
(str "Hello " n))
|
|
|
|
EOF
|
|
|
|
|
|
|
|
system "#{bin}/cljsc", testpath/"t.cljs"
|
2013-08-18 21:08:25 +00:00
|
|
|
end
|
|
|
|
end
|