2010-02-23 19:45:44 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Ghc < Formula
|
2010-02-23 19:45:44 +00:00
|
|
|
homepage 'http://haskell.org/ghc/'
|
2012-01-23 04:32:15 +00:00
|
|
|
version '7.0.4'
|
|
|
|
if ARGV.include? '--64bit'
|
|
|
|
url "http://www.haskell.org/ghc/dist/7.0.4/ghc-7.0.4-x86_64-apple-darwin.tar.bz2"
|
|
|
|
md5 'af89d3d2ca6e9b23384baacb7d8161dd'
|
2011-03-28 09:37:52 +00:00
|
|
|
else
|
2012-01-23 04:32:15 +00:00
|
|
|
url "http://www.haskell.org/ghc/dist/7.0.4/ghc-7.0.4-i386-apple-darwin.tar.bz2"
|
|
|
|
md5 'ce297e783d113cf1547386703d1b1061'
|
|
|
|
end
|
|
|
|
|
|
|
|
devel do
|
2011-10-03 12:16:52 +00:00
|
|
|
version '7.2.2'
|
|
|
|
if ARGV.include? '--64bit'
|
|
|
|
url "http://www.haskell.org/ghc/dist/7.2.2/ghc-7.2.2-x86_64-apple-darwin.tar.bz2"
|
|
|
|
md5 '97c9dc221fcf9eb8635f05ba08eca0c9'
|
|
|
|
else
|
|
|
|
url "http://www.haskell.org/ghc/dist/7.2.2/ghc-7.2.2-i386-apple-darwin.tar.bz2"
|
|
|
|
md5 '1084f44b0d9e5ea5d3bf9b699b6e3e35'
|
|
|
|
end
|
2011-03-28 09:37:52 +00:00
|
|
|
end
|
2010-02-23 19:45:44 +00:00
|
|
|
|
2010-06-29 04:42:12 +00:00
|
|
|
# Avoid stripping the Haskell binaries & libraries.
|
|
|
|
# See: http://hackage.haskell.org/trac/ghc/ticket/2458
|
2010-02-24 11:16:15 +00:00
|
|
|
skip_clean ['bin', 'lib']
|
2010-02-23 19:45:44 +00:00
|
|
|
|
2011-03-28 09:37:52 +00:00
|
|
|
def options
|
|
|
|
[['--64bit', 'Install 64-bit version of GHC (experimental).']]
|
2010-02-23 19:45:44 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
2011-10-03 12:16:52 +00:00
|
|
|
if ARGV.build_devel?
|
|
|
|
opoo "The current version of haskell-platform will NOT work with this version of GHC!"
|
|
|
|
end
|
2011-03-28 09:37:52 +00:00
|
|
|
if ARGV.include? '--64bit'
|
|
|
|
if Hardware.is_64_bit?
|
2011-08-25 14:29:08 +00:00
|
|
|
opoo "The x86_64 version is experimental!"
|
2011-03-28 09:37:52 +00:00
|
|
|
else
|
|
|
|
onoe "The x86_64 version is only for 64-bit hardware."
|
|
|
|
exit 1
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
system "./configure --prefix=#{prefix}"
|
|
|
|
system "make install"
|
|
|
|
end
|
2010-06-29 04:42:12 +00:00
|
|
|
|
2011-03-28 09:37:52 +00:00
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
The 32-bit version of GHC is installed by default, as the x84_64 version is
|
|
|
|
labelled experimental. Override with `--64bit`.
|
2010-02-23 19:45:44 +00:00
|
|
|
|
2011-03-28 09:37:52 +00:00
|
|
|
This brew is for GHC only; you might also be interested in haskell-platform.
|
|
|
|
EOS
|
2010-02-23 19:45:44 +00:00
|
|
|
end
|
|
|
|
end
|