-
Notifications
You must be signed in to change notification settings - Fork 0
/
ghc762x86.rb
40 lines (34 loc) · 1.27 KB
/
ghc762x86.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 Ghc762x86 < Formula
homepage "http://github.com/rodlogic/homebrew-ghc"
url "http://www.haskell.org/ghc/dist/7.6.2/ghc-7.6.2-i386-apple-darwin.tar.bz2"
sha1 "8d93dc97bffdaf33e82a9425b8132aef054a001d"
version '7.6.2_x86'
# 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