2010-08-25 19:28:32 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
# Installs the binary build of MLton.
|
|
|
|
# Since MLton is written in ML, building from source
|
|
|
|
# would require an existing ML compiler/interpreter for bootstrapping.
|
|
|
|
|
2012-04-28 18:59:28 +00:00
|
|
|
class StandardHomebrewLocation < Requirement
|
2013-01-20 02:45:59 +00:00
|
|
|
satisfy HOMEBREW_PREFIX.to_s == "/usr/local"
|
|
|
|
|
2012-04-28 18:59:28 +00:00
|
|
|
def message; <<-EOS.undent
|
|
|
|
mlton won't work outside of /usr/local
|
|
|
|
|
|
|
|
Because this uses pre-compiled binaries, it will not work if
|
|
|
|
Homebrew is installed somewhere other than /usr/local; mlton
|
|
|
|
will be unable to find GMP.
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2010-08-25 19:28:32 +00:00
|
|
|
class Mlton < Formula
|
2011-05-11 17:12:45 +00:00
|
|
|
homepage 'http://mlton.org'
|
2012-06-04 00:05:14 +00:00
|
|
|
url 'http://downloads.sourceforge.net/project/mlton/mlton/20100608/mlton-20100608-1.amd64-darwin.gmp-static.tgz'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 'b5e067f2f3d2166d074602f83b03004587f3adab'
|
2010-08-25 19:28:32 +00:00
|
|
|
|
2012-01-10 18:09:41 +00:00
|
|
|
# We download and install the version of MLton which is statically linked to libgmp, but all
|
|
|
|
# generated executables will require gmp anyway, hence the dependency
|
2012-04-28 18:59:28 +00:00
|
|
|
depends_on StandardHomebrewLocation.new
|
2010-08-25 19:28:32 +00:00
|
|
|
depends_on 'gmp'
|
|
|
|
|
|
|
|
skip_clean :all
|
|
|
|
|
|
|
|
def install
|
2012-02-21 06:04:21 +00:00
|
|
|
cd "local" do
|
2010-08-25 19:28:32 +00:00
|
|
|
# Remove OS X droppings
|
|
|
|
rm Dir["man/man1/._*"]
|
|
|
|
mv "man", "share"
|
|
|
|
prefix.install Dir['*']
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|