about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2008-02-22 14:09:29 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2008-02-22 14:09:29 +0000
commitd2d8d83f37118153ca92d58acca6ea22dc627fd9 (patch)
tree8c1c7d5f67df7a050a8bfc68bb3c6285341d375c
parent3e72751bd99f1d40760796f34c45e00deef680b6 (diff)
* A clever hack (due to Audrey Tang, see
  http://consttype.blogspot.com/2007_07_01_archive.html) around the 
  fact that Perl 5.10 no longer supports the $* variable, which GHC's
  evil mangler requires.

svn path=/nixpkgs/branches/stdenv-updates-merge/; revision=10833
-rw-r--r--pkgs/development/compilers/ghc/boot.nix17
-rw-r--r--pkgs/top-level/all-packages.nix12
2 files changed, 17 insertions, 12 deletions
diff --git a/pkgs/development/compilers/ghc/boot.nix b/pkgs/development/compilers/ghc/boot.nix
index 254a9fb855a07..02cb9866739ce 100644
--- a/pkgs/development/compilers/ghc/boot.nix
+++ b/pkgs/development/compilers/ghc/boot.nix
@@ -38,7 +38,7 @@ stdenv.mkDerivation {
   # The binaries for Darwin use frameworks, so fake those frameworks,
   # and create some wrapper scripts that set DYLD_FRAMEWORK_PATH so
   # that the executables work with no special setup.
-  postInstall = if stdenv.isDarwin then "
+  postInstall = (if stdenv.isDarwin then ''
 
     ensureDir $out/frameworks/GMP.framework/Versions/A
     ln -s ${gmp}/lib/libgmp.dylib $out/frameworks/GMP.framework/GMP
@@ -50,11 +50,20 @@ stdenv.mkDerivation {
     mv $out/bin $out/bin-orig
     mkdir $out/bin
     for i in $(cd $out/bin-orig && ls); do
-        echo \"#! $SHELL -e\" >> $out/bin/$i
-        echo \"DYLD_FRAMEWORK_PATH=$out/frameworks exec $out/bin-orig/$i -framework-path $out/frameworks \\\"\\$@\\\"\" >> $out/bin/$i
+        echo "#! $SHELL -e" >> $out/bin/$i
+        echo "DYLD_FRAMEWORK_PATH=$out/frameworks exec $out/bin-orig/$i -framework-path $out/frameworks \"\$@\"" >> $out/bin/$i
         chmod +x $out/bin/$i
     done
 
-  " else "";
+  '' else "") + ''
+
+    # Hack for Perl 5.10 compatibility ($* no longer works).
+    substituteInPlace $out/lib/*/ghc-asm --replace 'local($*) = 1;' '
+      BEGIN {
+        require overload; overload::constant( qr => sub { "(?m:$_[1])" } );
+      }
+    '
+  
+  '';
 
 }
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 4ec6eab6aede8..3b5b42aff76b5 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1416,8 +1416,7 @@ rec {
   };
 
   helium = import ../development/compilers/helium {
-    inherit fetchurl stdenv;
-    ghc = ghc661;
+    inherit fetchurl stdenv ghc;
   };
 
   javafront = import ../development/compilers/java-front {
@@ -3172,8 +3171,7 @@ rec {
   };
 
   wxHaskell = import ../development/libraries/haskell/wxHaskell {
-    inherit stdenv fetchurl unzip wxGTK;
-    ghc = ghc661;
+    inherit stdenv fetchurl unzip wxGTK ghc;
   };
 
   # wxHaskell68 = lowPrio (appendToName "ghc68" (import ../development/libraries/haskell/wxHaskell {
@@ -4609,14 +4607,12 @@ rec {
   };
   
   darcs = import ../applications/version-management/darcs {
-    inherit fetchurl stdenv zlib ncurses curl;
-    ghc = ghc661;
+    inherit fetchurl stdenv zlib ncurses curl ghc;
   };
 
   # some speed bottle necks are resolved in this version I think .. perhaps you like to try it? 
   darcs_2_pre = import ../applications/version-management/darcs_2_pre.nix {
-    inherit fetchurl stdenv zlib ncurses curl;
-    ghc = ghc661;
+    inherit fetchurl stdenv zlib ncurses curl ghc;
   };
 
   dia = import ../applications/graphics/dia {