homebrew-core/Formula/sbt.rb
Max Howell 61b2307139 s/require 'brewkit'/require 'formula'/g
brewkit.rb changes ENV destructively, so lets not do that everytime a formula
is required. Now it's possible for other tools to require a formula
description without worrying about side-effects.
2009-10-15 16:48:03 +01:00

29 lines
618 B
Ruby

require 'formula'
# even though "file -b" reports this as a zip archive, it's just a binary
class SbtHttpDownloadStrategy <CurlDownloadStrategy
def stage
FileUtils.mv @dl, File.basename(@url)
end
end
class Sbt <Formula
JAR = 'sbt-launcher-0.5.5.jar'
url "http://simple-build-tool.googlecode.com/files/#{JAR}"
homepage 'http://code.google.com/p/simple-build-tool'
md5 'e3593448b3be17ce1666c6241b8d2f90'
def download_strategy
SbtHttpDownloadStrategy
end
def install
(bin+'sbt').write <<-EOS
#!/bin/sh
java -Xmx512M -jar #{prefix}/#{JAR} "$@"
EOS
prefix.install Dir['*']
end
end