Skip to content
This repository
Browse code

ghc - remove custom .pkg support

  • Loading branch information...
commit 17a63e004e42ecc4dc031b9d6648d19db1b87696 1 parent ec6f826
Adam Vandenberg authored June 28, 2010

Showing 1 changed file with 9 additions and 17 deletions. Show diff stats Hide diff stats

  1. 26  Library/Formula/ghc.rb
26  Library/Formula/ghc.rb
... ...
@@ -1,27 +1,15 @@
1 1
 require 'formula'
2 2
 
3  
-class PkgCurlDownloadStrategy <CurlDownloadStrategy
4  
-  def stage
5  
-    safe_system '/usr/sbin/pkgutil', '--expand', @tarball_path, File.basename(@url)
6  
-    chdir
7  
-  end
8  
-end
9  
-
10  
-# Remember to update the formula for Cabal when updating this formula
11 3
 class Ghc <Formula
12 4
   homepage 'http://haskell.org/ghc/'
13 5
   version '6.12.3'
14 6
   url "http://darcs.haskell.org/download/dist/#{version}/GHC-#{version}-i386.pkg"
15 7
   md5 '58399e3af68f50a23a847bdfe3de5aca'
16 8
 
17  
-  # Avoid stripping the Haskell binaries AND libraries; http://hackage.haskell.org/trac/ghc/ticket/2458
  9
+  # Avoid stripping the Haskell binaries & libraries.
  10
+  # See: http://hackage.haskell.org/trac/ghc/ticket/2458
18 11
   skip_clean ['bin', 'lib']
19 12
 
20  
-  def download_strategy
21  
-    # Extract files from .pkg while caching the .pkg
22  
-    PkgCurlDownloadStrategy
23  
-  end
24  
-
25 13
   def replace_all foo, bar
26 14
     # Find all text files containing foo and replace it with bar
27 15
     files = `/usr/bin/grep -lsIR #{foo} .`.split
@@ -38,10 +26,14 @@ def install
38 26
     # Fix paths
39 27
     replace_all "/Library/Frameworks/GHC.framework/Versions/#{short_version}/usr/lib/ghc-#{version}", "#{lib}/ghc"
40 28
     replace_all "/Library/Frameworks/GHC.framework/Versions/#{short_version}/usr", prefix
41  
-    inreplace "lib/ghc-#{version}/ghc-asm", "#!/opt/local/bin/perl", "#!/usr/bin/env perl"
42  
-    mv "lib/ghc-#{version}", 'lib/ghc'
43 29
 
44  
-    prefix.install ['bin', 'lib', 'share']
  30
+    prefix.install ['bin', 'share']
  31
+
  32
+    # Remove version from lib folder
  33
+    lib.install "lib/ghc-#{version}" => 'ghc'
  34
+
  35
+    # Fix ghc-asm Perl reference
  36
+    inreplace "#{lib}/ghc/ghc-asm", "#!/opt/local/bin/perl", "#!/usr/bin/env perl"
45 37
 
46 38
     # Regenerate GHC package cache
47 39
     rm "#{lib}/ghc/package.conf.d/package.cache"

0 notes on commit 17a63e0

Please sign in to comment.
Something went wrong with that request. Please try again.