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-02-26 23:16:50 +00:00
|
|
|
url "https://github.com/clojure/clojurescript/archive/r2913.tar.gz"
|
|
|
|
sha1 "ff33a93516b3c91923667d667d34cc4b404489c8"
|
2013-08-18 21:08:25 +00:00
|
|
|
|
2014-08-21 08:13:25 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-02-28 22:21:54 +00:00
|
|
|
sha1 "aa8b2bd64da090c12d508e63bbf56a5128abfbcf" => :yosemite
|
|
|
|
sha1 "f56c2dfcd8ee828a2734ea1c39c6c1f1c147178b" => :mavericks
|
|
|
|
sha1 "63127cb547b78d3a7fac2770fe3ed56ce39acc10" => :mountain_lion
|
2014-08-21 08:13:25 +00:00
|
|
|
end
|
|
|
|
|
2013-08-18 21:08:25 +00:00
|
|
|
def install
|
|
|
|
system "./script/bootstrap"
|
2015-02-26 23:16:50 +00:00
|
|
|
inreplace %w[bin/cljsc script/repl script/repljs script/browser-repl],
|
2013-08-18 21:08:25 +00:00
|
|
|
"#!/bin/sh", "#!/bin/sh\nCLOJURESCRIPT_HOME=#{libexec}"
|
2014-06-21 20:22:10 +00:00
|
|
|
libexec.install Dir["*"]
|
|
|
|
bin.write_exec_script libexec/"bin/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
|