2010-02-23 19:45:44 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2012-04-17 13:50:31 +00:00
|
|
|
class NeedsSnowLeopard < Requirement
|
|
|
|
def satisfied?
|
|
|
|
MacOS.snow_leopard?
|
|
|
|
end
|
|
|
|
|
|
|
|
def message; <<-EOS.undent
|
|
|
|
GHC requires OS X 10.6 or newer. The binary releases no longer work on
|
|
|
|
Leopard. See the following issue for details:
|
|
|
|
http://hackage.haskell.org/trac/ghc/ticket/6009
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
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-06-11 12:32:55 +00:00
|
|
|
version '7.4.2'
|
2012-04-17 19:08:58 +00:00
|
|
|
if Hardware.is_64_bit? and not ARGV.build_32_bit?
|
2012-06-11 12:32:55 +00:00
|
|
|
url 'http://www.haskell.org/ghc/dist/7.4.2/ghc-7.4.2-x86_64-apple-darwin.tar.bz2'
|
|
|
|
sha1 '7c655701672f4b223980c3a1068a59b9fbd08825'
|
2011-03-28 09:37:52 +00:00
|
|
|
else
|
2012-06-11 12:32:55 +00:00
|
|
|
url 'http://www.haskell.org/ghc/dist/7.4.2/ghc-7.4.2-i386-apple-darwin.tar.bz2'
|
|
|
|
sha1 '60f749893332d7c22bb4905004a67510992d8ef6'
|
2011-03-28 09:37:52 +00:00
|
|
|
end
|
2010-02-23 19:45:44 +00:00
|
|
|
|
2012-04-17 13:50:31 +00:00
|
|
|
depends_on NeedsSnowLeopard.new
|
|
|
|
|
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
|
|
|
|
2012-03-18 20:33:24 +00:00
|
|
|
fails_with :clang do
|
|
|
|
build 318
|
|
|
|
cause <<-EOS.undent
|
|
|
|
Building with Clang configures GHC to use Clang as its preprocessor,
|
|
|
|
which causes subsequent GHC-based builds to fail.
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
2011-03-28 09:37:52 +00:00
|
|
|
def options
|
2012-04-17 19:08:58 +00:00
|
|
|
[['--32-bit', 'Build 32-bit only.']]
|
2010-02-23 19:45:44 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
2012-05-15 21:36:45 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}"
|
2011-03-28 09:37:52 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
2010-06-29 04:42:12 +00:00
|
|
|
|
2011-03-28 09:37:52 +00:00
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
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
|