homebrew-core/Formula/clojure.rb
Adam Vandenberg 8c56f544b7 Add ARGV.build_head? and use it.
This allows both "--HEAD" and "-H" to be used consistently, which was the
intention in the first place.
2010-07-16 09:09:39 -07:00

31 lines
614 B
Ruby

require 'formula'
class Clojure <Formula
url 'http://clojure.googlecode.com/files/clojure-1.1.0.zip'
md5 '9c9e92f85351721b76f40578f5c1a94a'
head 'git://github.com/richhickey/clojure.git'
homepage 'http://clojure.org/'
def jar
'clojure.jar'
end
def script
<<-EOS
#!/bin/sh
# Runs clojure.
# With no arguments, runs Clojure's REPL.
# resolve links - $0 may be a softlink
CLOJURE=$CLASSPATH:$(brew --cellar)/#{name}/#{version}/#{jar}
java -cp $CLOJURE clojure.main "$@"
EOS
end
def install
system "ant" if ARGV.build_head?
prefix.install jar
(bin+'clj').write script
end
end