53473b6bf5
The MacOS.version? family of methods (other than "leopard?") are poorly defined and lead to confusing code. Replace them in formulae with more explicit comparisons. "MacOS.version" is a special version object that can be compared to numerics, symbols, and strings using the standard Ruby comparison methods. The old methods were moved to compat when the version comparison code was merged, and they must remain there "forever", but they should not be used in new code. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
52 lines
1.4 KiB
Ruby
52 lines
1.4 KiB
Ruby
require 'formula'
|
|
|
|
class NeedsSnowLeopard < Requirement
|
|
def satisfied?
|
|
MacOS.version >= :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
|
|
|
|
class Ghc < Formula
|
|
homepage 'http://haskell.org/ghc/'
|
|
version '7.4.2'
|
|
if Hardware.is_64_bit? and not build.build_32_bit?
|
|
url 'http://www.haskell.org/ghc/dist/7.4.2/ghc-7.4.2-x86_64-apple-darwin.tar.bz2'
|
|
sha1 '7c655701672f4b223980c3a1068a59b9fbd08825'
|
|
else
|
|
url 'http://www.haskell.org/ghc/dist/7.4.2/ghc-7.4.2-i386-apple-darwin.tar.bz2'
|
|
sha1 '60f749893332d7c22bb4905004a67510992d8ef6'
|
|
end
|
|
|
|
depends_on NeedsSnowLeopard.new
|
|
|
|
option '32-bit'
|
|
|
|
# Avoid stripping the Haskell binaries & libraries.
|
|
# See: http://hackage.haskell.org/trac/ghc/ticket/2458
|
|
skip_clean ['bin', 'lib']
|
|
|
|
fails_with :clang do
|
|
build 421
|
|
cause <<-EOS.undent
|
|
Building with Clang configures GHC to use Clang as its preprocessor,
|
|
which causes subsequent GHC-based builds to fail.
|
|
EOS
|
|
end
|
|
|
|
def install
|
|
system "./configure", "--prefix=#{prefix}"
|
|
system "make install"
|
|
end
|
|
|
|
def caveats; <<-EOS.undent
|
|
This brew is for GHC only; you might also be interested in haskell-platform.
|
|
EOS
|
|
end
|
|
end
|