aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorJack Nagel2013-09-22 00:20:28 -0500
committerJack Nagel2013-09-22 00:20:56 -0500
commit73705151b479163f5fa1abf407135410a8f05495 (patch)
treef9f94ce23169d73f9c1fb52ea2ab97467514f339 /Library/Formula
parent9a9c42078358a007a73959acc3be5c9f13e306af (diff)
downloadhomebrew-73705151b479163f5fa1abf407135410a8f05495.tar.bz2
ghc: use resource
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/ghc.rb25
1 files changed, 13 insertions, 12 deletions
diff --git a/Library/Formula/ghc.rb b/Library/Formula/ghc.rb
index a9edd45e0..91d08f856 100644
--- a/Library/Formula/ghc.rb
+++ b/Library/Formula/ghc.rb
@@ -1,16 +1,5 @@
require 'formula'
-class Ghcbinary < Formula
- 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
- version '7.4.2'
-end
-
class Ghc < Formula
homepage 'http://haskell.org/ghc/'
url 'http://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-src.tar.bz2'
@@ -30,6 +19,18 @@ class Ghc < Formula
option '32-bit'
option 'tests', 'Verify the build using the testsuite in Fast Mode, 5 min'
+ # 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
+ end
+
resource 'testsuite' do
url 'https://github.com/ghc/testsuite/archive/ghc-7.6.3-release.tar.gz'
sha1 '6a1973ae3cccdb2f720606032ae84ffee8680ca1'
@@ -51,7 +52,7 @@ class Ghc < Formula
# Move the main tarball contents into a subdirectory
(buildpath+'Ghcsource').install Dir['*']
- Ghcbinary.new.brew do
+ resource('binary').stage do
# Define where the subformula will temporarily install itself
subprefix = buildpath+'subfo'