ghc: use resource

This commit is contained in:
Jack Nagel 2013-09-22 00:20:28 -05:00
parent 0a844c708e
commit 5595d1901f

View file

@ -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'