homebrew-core/Formula/clojure.rb

27 lines
712 B
Ruby

class Clojure < Formula
desc "The Clojure Programming Language"
homepage "https://clojure.org"
url "https://download.clojure.org/install/clojure-tools-1.10.1.536.tar.gz"
sha256 "b7c5b0cdeb750275ddd98095a1959657b95569b624da7c6163adce5a7d5f7119"
bottle :unneeded
depends_on "openjdk"
depends_on "rlwrap"
uses_from_macos "ruby" => :build
def install
system "./install.sh", prefix
bin.env_script_all_files libexec/"bin", :JAVA_HOME => "${JAVA_HOME:-#{Formula["openjdk"].opt_prefix}}"
end
test do
ENV["TERM"] = "xterm"
system("#{bin}/clj -e nil")
%w[clojure clj].each do |clj|
assert_equal "2", shell_output("#{bin}/#{clj} -e \"(+ 1 1)\"").strip
end
end
end