diff options
| author | Adam Vandenberg | 2013-05-22 09:59:48 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2013-05-22 10:00:02 -0700 |
| commit | 569c2c0884e05588925b797bccb091002216adae (patch) | |
| tree | 7d001e66f4f1d4375e76984e2c7913e79f855d05 /Library/Formula | |
| parent | 61ac5d905cc15251cd9405ff68178f8ce46ec1fc (diff) | |
| download | homebrew-569c2c0884e05588925b797bccb091002216adae.tar.bz2 | |
clojure: optionally use rlwrap
Closes #18010.
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/clojure.rb | 37 |
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 |
