aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorAdam Vandenberg2014-03-08 10:13:03 -0800
committerAdam Vandenberg2014-03-08 14:34:42 -0800
commit892446336e91889ec781f4ce0c119b47fff8230e (patch)
tree5e9357a1f23a3ed24314396a67e5af3366e58d00 /Library/Formula
parent4c06432e7bb130c53f6f23d6cec151c71f6e3b2d (diff)
downloadhomebrew-892446336e91889ec781f4ce0c119b47fff8230e.tar.bz2
ghc: put stable into a block
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/ghc.rb41
1 files changed, 24 insertions, 17 deletions
diff --git a/Library/Formula/ghc.rb b/Library/Formula/ghc.rb
index e2a03f07f..5148d2bc0 100644
--- a/Library/Formula/ghc.rb
+++ b/Library/Formula/ghc.rb
@@ -34,9 +34,19 @@ class Ghc < Formula
end
end
+ # These don't work inside of a `stable do` block
if build.stable?
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
+
+ stable do
# http://hackage.haskell.org/trac/ghc/ticket/6009
depends_on :macos => :snow_leopard
depends_on "apple-gcc42" if MacOS.version >= :mountain_lion
@@ -44,29 +54,20 @@ class Ghc < Formula
option "32-bit"
- # build is not available in the resource's context, so exploit the closure.
- build_32_bit = build.build_32_bit?
resource "binary" do
- if Hardware.is_64_bit? and not 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
+ url "http://www.haskell.org/ghc/dist/7.4.2/ghc-7.4.2-x86_64-apple-darwin.tar.bz2"
+ sha1 "7c655701672f4b223980c3a1068a59b9fbd08825"
+ end
+
+ resource "binary32" do
+ url "http://www.haskell.org/ghc/dist/7.4.2/ghc-7.4.2-i386-apple-darwin.tar.bz2"
+ sha1 "60f749893332d7c22bb4905004a67510992d8ef6"
end
resource "testsuite" do
url "https://github.com/ghc/testsuite/archive/ghc-7.6.3-release.tar.gz"
sha1 "6a1973ae3cccdb2f720606032ae84ffee8680ca1"
end
-
- 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 patches
@@ -80,7 +81,13 @@ class Ghc < Formula
# Move the main tarball contents into a subdirectory
(buildpath+"Ghcsource").install Dir["*"]
- resource("binary").stage do
+ if (not build.stable?) or (Hardware.is_64_bit? and not build.build_32_bit?)
+ binary_resource = "binary"
+ else
+ binary_resource = "binary32"
+ end
+
+ resource(binary_resource).stage do
# Define where the subformula will temporarily install itself
subprefix = buildpath+"subfo"