Permalink
Browse files

clojure 1.4.0

  • Loading branch information...
1 parent 6a4d043 commit 990c483d4e27eead8b6122bd616e36717510adfc @jacknagel jacknagel committed Mar 3, 2013
Showing with 46 additions and 0 deletions.
  1. +46 −0 clojure14.rb
View
@@ -0,0 +1,46 @@
+require 'formula'
+
+class Clojure14 < Formula
+ homepage 'http://clojure.org/'
+ url 'http://repo1.maven.org/maven2/org/clojure/clojure/1.4.0/clojure-1.4.0.zip'
+ sha1 '34daf1bb035aba4c0e5ff3b4afef837d21700e72'
+
+ def script; <<-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
+ java -cp "$CLOJURE" clojure.main --repl
+ else
+ java -cp "$CLOJURE" clojure.main "$@"
+ fi
+ EOS
+ end
+
+ def jar
+ "clojure-#{version}.jar"
+ end
+
+ def install
+ system "ant" if build.head?
+ prefix.install jar
+ (prefix+jar).chmod(0644) # otherwise it's 0600
+ (prefix+'classes').mkpath
+ (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
+end

0 comments on commit 990c483

Please sign in to comment.