blob: fd73c877cd36cc9bcfd77351c43b759da5013687 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
 | class Clojurescript < Formula
  homepage "https://github.com/clojure/clojurescript"
  head "https://github.com/clojure/clojurescript.git"
  url "https://github.com/clojure/clojurescript/archive/r2760.tar.gz"
  sha1 "c07900e9f63af89954722661f9a817ca9ea3417b"
  bottle do
    cellar :any
    sha1 "a1e0a6ab52df6fc41697c5b669b0088a071fca94" => :yosemite
    sha1 "58e46c032fb6059f6ce1ebb54e1ec9eb4bb17183" => :mavericks
    sha1 "dd099b7132450b0458076e8eaa0db42ae2611ecc" => :mountain_lion
  end
  def install
    system "./script/bootstrap"
    inreplace %w(bin/cljsc script/repl script/repljs script/browser-repl),
      "#!/bin/sh", "#!/bin/sh\nCLOJURESCRIPT_HOME=#{libexec}"
    libexec.install Dir["*"]
    bin.write_exec_script libexec/"bin/cljsc"
  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
    (testpath/"t.cljs").write <<-EOF.undent
    (ns hello)
    (defn ^:export greet [n]
      (str "Hello " n))
    EOF
    system "#{bin}/cljsc", testpath/"t.cljs"
  end
end
 |