2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-25 21:44:35 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Clojure < Formula
|
2012-06-13 03:45:23 +00:00
|
|
|
homepage 'http://clojure.org/'
|
2012-04-16 15:53:37 +00:00
|
|
|
url 'http://repo1.maven.org/maven2/org/clojure/clojure/1.4.0/clojure-1.4.0.zip'
|
2012-06-13 03:45:23 +00:00
|
|
|
sha1 '34daf1bb035aba4c0e5ff3b4afef837d21700e72'
|
|
|
|
|
2011-05-27 05:02:55 +00:00
|
|
|
head 'https://github.com/clojure/clojure.git'
|
Many fixes for clojure and clojure-contrib formulae.
- clojure formula now works with HEAD installs.
- Use /bin/sh rather than /bin/bash in the clj script.
- Fix argument-passing in the clj script. (Fixes Homebrew/homebrew#867)
- Remove the Java -server flag in the clj script. This is the default
option on 64-bit Macs running 10.5 and 10.6 anyway, unless the user
has used Java Preferences to make the 32-bit VM the preferred VM, in
which case the default is -client. Choosing the 32-bit VM happens to
be the only way to use the client HotSpot VM, as the client VM is
not currently supported on 64-bit architectures. Presumably, if the
user prefers the 32-bit client VM, he has his reasons, and the clj
script should respect them. (The client VM has a faster start-up
time, for example, which may benefit command-line scripts written
in Clojure and invoked using clj.)
It would be nice to allow the user to be explicit about which VM to
use when invoking the clj script, but this would almost certainly
not be portable to other systems' implementations of the 'clj'
script, and would be difficult to document due to the fact that
clojure.main outputs its own usage message when supplied with a
--help/-h/-? argument. Anyone with special needs can simply write
his own wrapper script.
In any case, users of 64-bit Macs who haven't explicitly chosen the
32-bit Java VM in Java Preferences (i.e., probably most Homebrew
users) are unaffected by this change.
- clojure-contrib formula now installs the latest stable release
(1.1.0) by default (it used to install HEAD always). HEAD installs
are still supported via the --HEAD flag but require the HEAD version
of clojure; the build will break if the HEAD version of clojure is
not installed.
- clojure-contrib installs the pre-packaged JAR file, supplied in the
release ZIP file, if installing the release version.
- clojure-contrib only conditionally depends on maven, if installing
HEAD.
- clojure-contrib HEAD builds explicitly use the installed clojure HEAD
JAR file, per the clojure-contrib documentation. (HEAD builds prior
to this change would often mysteriously create a nearly-empty
clojure-contrib JAR file.)
- clojure-contrib always installs the JAR file as clojure-contrib.jar,
rather than adding a version suffix. The Cellar path is sufficient to
discriminate versions, and this way the JAR file name is consistent.
- Change the clojure-contrib homepage to point to the clojure-contrib
documentation, rather than the project's GitHub homepage.
- Clojure does not find the clojure-contrib JAR file unless the
CLASSPATH includes the JAR file name. Fix the clojure-contrib
caveat to reflect this behavior.
- Fix "already initialized constant JAR" warnings in both formulae.
Signed-off-by: David Höppner <0xffea@gmail.com>
2010-03-20 08:37:57 +00:00
|
|
|
|
2012-08-19 18:08:06 +00:00
|
|
|
devel do
|
2012-12-13 01:53:28 +00:00
|
|
|
url 'http://central.maven.org/maven2/org/clojure/clojure/1.5.0-beta2/clojure-1.5.0-beta2.zip'
|
|
|
|
sha1 '54785a5de0b20e4da2d98703c3fb15b16fa3bbb1'
|
2012-08-19 18:08:06 +00:00
|
|
|
end
|
|
|
|
|
2011-06-19 18:20:30 +00:00
|
|
|
def script; <<-EOS.undent
|
|
|
|
#!/bin/sh
|
|
|
|
# Clojure wrapper script.
|
|
|
|
# With no arguments runs Clojure's REPL.
|
2010-10-04 04:17:23 +00:00
|
|
|
|
2011-06-19 18:20:30 +00:00
|
|
|
# Put the Clojure jar from the cellar and the current folder in the classpath.
|
2012-08-19 18:08:06 +00:00
|
|
|
CLOJURE=$CLASSPATH:#{prefix}/#{jar}:${PWD}
|
2010-10-04 04:17:23 +00:00
|
|
|
|
2011-06-19 18:20:30 +00:00
|
|
|
if [ "$#" -eq 0 ]; then
|
2012-01-27 08:57:06 +00:00
|
|
|
java -cp "$CLOJURE" clojure.main --repl
|
2011-06-19 18:20:30 +00:00
|
|
|
else
|
2012-01-27 08:57:06 +00:00
|
|
|
java -cp "$CLOJURE" clojure.main "$@"
|
2011-06-19 18:20:30 +00:00
|
|
|
fi
|
|
|
|
EOS
|
2010-02-18 21:26:41 +00:00
|
|
|
end
|
|
|
|
|
2012-08-19 18:08:06 +00:00
|
|
|
def jar
|
|
|
|
"clojure-#{version}.jar"
|
|
|
|
end
|
|
|
|
|
2010-02-18 21:26:41 +00:00
|
|
|
def install
|
2012-08-27 05:15:40 +00:00
|
|
|
system "ant" if build.head?
|
2012-08-19 18:08:06 +00:00
|
|
|
prefix.install jar
|
|
|
|
(prefix+jar).chmod(0644) # otherwise it's 0600
|
2011-06-19 18:20:30 +00:00
|
|
|
(prefix+'classes').mkpath
|
2010-02-18 21:26:41 +00:00
|
|
|
(bin+'clj').write script
|
|
|
|
end
|
2010-10-02 05:22:01 +00:00
|
|
|
|
|
|
|
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
|
2011-06-19 18:20:30 +00:00
|
|
|
|
|
|
|
def test
|
2012-05-15 21:36:45 +00:00
|
|
|
system "#{bin}/clj", "-e", '(println "Hello World")'
|
2011-06-19 18:20:30 +00:00
|
|
|
end
|
2010-02-18 21:26:41 +00:00
|
|
|
end
|