aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorAdam Vandenberg2013-05-22 09:59:48 -0700
committerAdam Vandenberg2013-05-22 10:00:02 -0700
commit569c2c0884e05588925b797bccb091002216adae (patch)
tree7d001e66f4f1d4375e76984e2c7913e79f855d05 /Library/Formula
parent61ac5d905cc15251cd9405ff68178f8ce46ec1fc (diff)
downloadhomebrew-569c2c0884e05588925b797bccb091002216adae.tar.bz2
clojure: optionally use rlwrap
Closes #18010.
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/clojure.rb37
1 files changed, 19 insertions, 18 deletions
diff --git a/Library/Formula/clojure.rb b/Library/Formula/clojure.rb
index 01f449c69..7b665849f 100644
--- a/Library/Formula/clojure.rb
+++ b/Library/Formula/clojure.rb
@@ -7,19 +7,27 @@ class Clojure < Formula
head 'https://github.com/clojure/clojure.git'
- def script; <<-EOS.undent
- #!/bin/sh
- # Clojure wrapper script.
- # With no arguments runs Clojure's REPL.
+ depends_on 'rlwrap' => :optional
- # Put the Clojure jar from the cellar and the current folder in the classpath.
- CLOJURE=$CLASSPATH:#{prefix}/#{jar}:${PWD}
-
- if [ "$#" -eq 0 ]; then
- java -cp "$CLOJURE" clojure.main --repl
+ def script
+ if build.with? 'rlwrap'
+ rlwrap = "rlwrap "
else
- java -cp "$CLOJURE" clojure.main "$@"
- fi
+ rlwrap = ""
+ end
+ <<-EOS.undent
+ #!/bin/sh
+ # Clojure wrapper script.
+ # With no arguments runs Clojure's REPL.
+
+ # Put the Clojure jar from the cellar and the current folder in the classpath.
+ CLOJURE=$CLASSPATH:#{prefix}/#{jar}:${PWD}
+
+ if [ "$#" -eq 0 ]; then
+ #{rlwrap}java -cp "$CLOJURE" clojure.main --repl
+ else
+ java -cp "$CLOJURE" clojure.main "$@"
+ fi
EOS
end
@@ -35,13 +43,6 @@ class Clojure < Formula
(bin+'clj').write script
end
- def caveats; <<-EOS.undent
- If you `brew install repl` then you may find this wrapper script from
- MacPorts useful:
- http://trac.macports.org/browser/trunk/dports/lang/clojure/files/clj-rlwrap.sh?format=txt
- EOS
- end
-
def test
system "#{bin}/clj", "-e", '(println "Hello World")'
end