Clojure: update CLASSPATH in the wrapper

Also add a test:
  brew test -v clojure
master
Adam Vandenberg 2011-06-19 11:20:30 -07:00
parent 16e9c013df
commit d84b1e9eb2
1 changed files with 18 additions and 14 deletions

View File

@ -6,26 +6,26 @@ class Clojure < Formula
head 'https://github.com/clojure/clojure.git'
homepage 'http://clojure.org/'
def jar
'clojure.jar'
end
def script; <<-EOS.undent
#!/bin/sh
# Clojure wrapper script.
# With no arguments runs Clojure's REPL.
def script
<<-EOS
#!/bin/sh
# Runs clojure.
# With no arguments, runs Clojure's REPL.
# Put the Clojure jar from the cellar and the current folder in the classpath.
CLOJURE=$CLASSPATH:#{prefix}/clojure.jar:${PWD}
# resolve links - $0 may be a softlink
CLOJURE=$CLASSPATH:$(brew --cellar)/#{name}/#{version}/#{jar}
java -cp $CLOJURE clojure.main "$@"
EOS
if [ "$#" -eq 0 ]; then
java -cp $CLOJURE clojure.main --repl
else
java -cp $CLOJURE clojure.main "$@"
fi
EOS
end
def install
system "ant" if ARGV.build_head?
prefix.install jar
prefix.install 'clojure.jar'
(prefix+'classes').mkpath
(bin+'clj').write script
end
@ -35,4 +35,8 @@ EOS
http://trac.macports.org/browser/trunk/dports/lang/clojure/files/clj-rlwrap.sh?format=txt
EOS
end
def test
system "clj -e \"(println \\\"Hello World\\\")\""
end
end