aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/clojure.rb
blob: 5af029cb5e480642f35e1b643de68ba5336c0e03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require 'formula'

class Clojure <Formula
  url 'http://clojure.googlecode.com/files/clojure-1.1.0.zip'
  md5 '9c9e92f85351721b76f40578f5c1a94a'
  head 'git://github.com/richhickey/clojure.git'
  homepage 'http://clojure.org/'

  def jar
    'clojure.jar'
  end

  def script
<<-EOS
#!/bin/sh
# Runs clojure.
# With no arguments, runs Clojure's REPL.

# resolve links - $0 may be a softlink
CLOJURE=$CLASSPATH:$(brew --cellar)/#{name}/#{version}/#{jar}

java -cp $CLOJURE clojure.main "$@"
EOS
  end

  def install
    system "ant" if ARGV.include? '--HEAD'
    prefix.install jar
    (bin+'clj').write script
  end
end