aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorAku2011-03-28 12:37:52 +0300
committerAdam Vandenberg2011-04-03 11:07:12 -0700
commit9a5398d181448fc5cc348c57a627a49e2c59cf60 (patch)
treedcf0fcd5dd2590cb4190250eee43ccec332eb79e /Library/Formula
parent95737dcc782481df02c2d85a2cfe03870da38c42 (diff)
downloadhomebrew-9a5398d181448fc5cc348c57a627a49e2c59cf60.tar.bz2
Update GHC to v7.0.3.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/ghc.rb54
1 files changed, 28 insertions, 26 deletions
diff --git a/Library/Formula/ghc.rb b/Library/Formula/ghc.rb
index 3ee863345..3ac76a9b9 100644
--- a/Library/Formula/ghc.rb
+++ b/Library/Formula/ghc.rb
@@ -1,42 +1,44 @@
require 'formula'
+# require 'hardware'
class Ghc < Formula
homepage 'http://haskell.org/ghc/'
- url "http://darcs.haskell.org/download/dist/6.12.3/GHC-6.12.3-i386.pkg"
- version '6.12.3'
- md5 '58399e3af68f50a23a847bdfe3de5aca'
+ version '7.0.3'
+ if ARGV.include? '--64bit'
+ url "http://www.haskell.org/ghc/dist/7.0.3/ghc-7.0.3-x86_64-apple-darwin.tar.bz2"
+ md5 '8a514a022ce21b8672f00054244faf26'
+ else
+ url "http://www.haskell.org/ghc/dist/7.0.3/ghc-7.0.3-i386-apple-darwin.tar.bz2"
+ md5 '649912037de756cf4570f84e5d53cf9c'
+ end
# Avoid stripping the Haskell binaries & libraries.
# See: http://hackage.haskell.org/trac/ghc/ticket/2458
skip_clean ['bin', 'lib']
- def replace_all foo, bar
- # Find all text files containing foo and replace it with bar
- files = `/usr/bin/grep -lsIR #{foo} .`.split
- inreplace files, foo, bar
+ def options
+ [['--64bit', 'Install 64-bit version of GHC (experimental).']]
end
def install
- short_version = version.split('.').first(2).join('')
-
- # Extract files from .pax.gz
- system '/bin/pax -f ghc.pkg/Payload -p p -rz'
- cd "GHC.framework/Versions/#{short_version}/usr"
-
- # Fix paths
- replace_all "/Library/Frameworks/GHC.framework/Versions/#{short_version}/usr/lib/ghc-#{version}", "#{lib}/ghc"
- replace_all "/Library/Frameworks/GHC.framework/Versions/#{short_version}/usr", prefix
-
- prefix.install ['bin', 'share']
-
- # Remove version from lib folder
- lib.install "lib/ghc-#{version}" => 'ghc'
+ if ARGV.include? '--64bit'
+ if Hardware.is_64_bit?
+ onoe "The x86_64 version is experimental!"
+ else
+ onoe "The x86_64 version is only for 64-bit hardware."
+ exit 1
+ end
+ end
+
+ system "./configure --prefix=#{prefix}"
+ system "make install"
+ end
- # Fix ghc-asm Perl reference
- inreplace "#{lib}/ghc/ghc-asm", "#!/opt/local/bin/perl", "#!/usr/bin/env perl"
+ def caveats; <<-EOS.undent
+ The 32-bit version of GHC is installed by default, as the x84_64 version is
+ labelled experimental. Override with `--64bit`.
- # Regenerate GHC package cache
- rm "#{lib}/ghc/package.conf.d/package.cache"
- system "#{bin}/ghc-pkg", 'recache', '--package-conf', "#{lib}/ghc/package.conf.d"
+ This brew is for GHC only; you might also be interested in haskell-platform.
+ EOS
end
end