homebrew-core/Formula/clojurescript.rb

43 lines
1.1 KiB
Ruby

class Clojurescript < Formula
desc "Clojure to JS compiler"
homepage "https://github.com/clojure/clojurescript"
url "https://github.com/clojure/clojurescript/releases/download/r1.11.4/cljs.jar"
sha256 "d1a7c82930428e5e844be0f30c599f0f1e101be7cec7e00e13f0a8708f635cd6"
license "EPL-1.0"
head "https://github.com/clojure/clojurescript.git", branch: "master"
livecheck do
url :stable
strategy :github_latest
regex(%r{href=.*?/tag/r?(\d+(?:\.\d+)+)["' >]}i)
end
bottle do
sha256 cellar: :any_skip_relocation, all: "2748feab333c8d593dc9395c6a546ebeec6d7a9691ba5b0fa179e94dd0f8d6a0"
end
depends_on "openjdk"
def install
libexec.install "cljs.jar"
bin.write_jar_script libexec/"cljs.jar", "cljsc"
end
def caveats
<<~EOS
This formula is useful if you need to use the ClojureScript compiler directly.
For a more integrated workflow use Leiningen, Boot, or Maven.
EOS
end
test do
(testpath/"t.cljs").write <<~EOS
(ns hello)
(defn ^:export greet [n]
(str "Hello " n))
EOS
system "#{bin}/cljsc", testpath/"t.cljs"
end
end