-
Notifications
You must be signed in to change notification settings - Fork 0
/
ghc782.rb
40 lines (34 loc) · 1.27 KB
/
ghc782.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
require 'formula'
class Ghc782 < Formula
homepage "http://github.com/rodlogic/homebrew-ghc"
url "http://www.haskell.org/ghc/dist/7.8.2/ghc-7.8.2-x86_64-apple-darwin-mavericks.tar.xz"
sha1 "5219737fb38f882532712047f6af32fc73a91f0f"
version '7.8.2'
# http://hackage.haskell.org/trac/ghc/ticket/6009
depends_on :macos => :snow_leopard
depends_on "gmp"
# These don't work inside of a `stable do` block
if MacOS.version < :mavericks
depends_on "gcc" if MacOS.version >= :mountain_lion
env :std
fails_with :clang do
cause <<-EOS.undent
Building with Clang configures GHC to use Clang as its preprocessor,
which causes subsequent GHC-based builds to fail.
EOS
end
end
def install
# ensure configure does not use Xcode 5 "gcc" which is actually clang
system "./configure --prefix=#{prefix} --with-gcc=#{ENV.cc}"
if MacOS.version <= :lion
# __thread is not supported on Lion but configure enables it anyway.
File.open("mk/config.h", "a") do |file|
file.write("#undef CC_SUPPORTS_TLS")
end
end
# -j1 fixes an intermittent race condition
system "make", "-j1", "install"
ENV.prepend_path "PATH", "#{prefix}/bin"
end
end