summary refs log tree commit diff
path: root/pkgs/development/compilers/ghc
diff options
context:
space:
mode:
authorAndres Löh <mail@andres-loeh.de>2009-01-06 16:29:49 +0000
committerAndres Löh <mail@andres-loeh.de>2009-01-06 16:29:49 +0000
commit77d9eec2a1082173ea7fa415f73be62119fa6cf8 (patch)
tree8245c2b681c381907547a3d90384c90fa9ebc68f /pkgs/development/compilers/ghc
parented62007229810cef74753f6ad1c292b7a5d9735d (diff)
downloadnixpkgs-77d9eec2a1082173ea7fa415f73be62119fa6cf8.tar
nixpkgs-77d9eec2a1082173ea7fa415f73be62119fa6cf8.tar.gz
nixpkgs-77d9eec2a1082173ea7fa415f73be62119fa6cf8.tar.bz2
nixpkgs-77d9eec2a1082173ea7fa415f73be62119fa6cf8.tar.lz
nixpkgs-77d9eec2a1082173ea7fa415f73be62119fa6cf8.tar.xz
nixpkgs-77d9eec2a1082173ea7fa415f73be62119fa6cf8.tar.zst
nixpkgs-77d9eec2a1082173ea7fa415f73be62119fa6cf8.zip
Changed the bootstrapping version of ghc-6.10.1.
Several binaries (except for ghc itself, for which there was a
workaround) were broken before because they were stripped
during installation. Now, all binaries should work, in particular
ghc-pkg ...

svn path=/nixpkgs/trunk/; revision=13717
Diffstat (limited to 'pkgs/development/compilers/ghc')
-rw-r--r--pkgs/development/compilers/ghc/boot610.nix51
1 files changed, 28 insertions, 23 deletions
diff --git a/pkgs/development/compilers/ghc/boot610.nix b/pkgs/development/compilers/ghc/boot610.nix
index 679f2c94dd8..7cfafaa13e8 100644
--- a/pkgs/development/compilers/ghc/boot610.nix
+++ b/pkgs/development/compilers/ghc/boot610.nix
@@ -27,34 +27,42 @@ stdenv.mkDerivation rec {
 
   buildInputs = [perl makeWrapper];
 
-  # On Linux, use patchelf to modify the executables so that they can
-  # find editline/gmp.
-  postUnpack = (if stdenv.isLinux then ''
-    find . -type f -perm +100 \
-        -exec patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
-        --set-rpath "${editline}/lib:${ncurses}/lib:${gmp}/lib" {} \;
-    for prog in strip ranlib; do
-      find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \;
-    done
-  '' else "")
-  + ''
-    mkdir "$TMP/bin"
-    for i in strip; do
-      echo '#!/bin/sh' >> "$TMP/bin/$i"
-      chmod +x "$TMP/bin/$i"
-      PATH="$TMP/bin:$PATH"
-    done
-  ''
-  
-  ;
+  postUnpack =
+    # Strip is harmful, see also below. It's important that this happens
+    # first. The GHC Cabal build system makes use of strip by default and
+    # has hardcoded paths to /usr/bin/strip in many places. We replace
+    # those below, making them point to our dummy script.
+     ''
+      mkdir "$TMP/bin"
+      for i in strip; do
+        echo '#!/bin/sh' >> "$TMP/bin/$i"
+        chmod +x "$TMP/bin/$i"
+        PATH="$TMP/bin:$PATH"
+      done
+     '' +
+    # On Linux, use patchelf to modify the executables so that they can
+    # find editline/gmp.
+    (if stdenv.isLinux then ''
+      find . -type f -perm +100 \
+          -exec patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+          --set-rpath "${editline}/lib:${ncurses}/lib:${gmp}/lib" {} \;
+      for prog in ld ar gcc strip ranlib; do
+        find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \;
+      done
+     '' else "");
 
   configurePhase = ''
     ./configure --prefix=$out --with-gmp-libraries=${gmp}/lib --with-gmp-includes=${gmp}/include
   '';
+
   # Stripping combined with patchelf breaks the executables (they die
   # with a segfault or the kernel even refuses the execve). (NIXPKGS-85)
   dontStrip = true;
 
+  # No building is necessary, but calling make without flags ironically
+  # calls install-strip ...
+  buildPhase = ":";
+
   # 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.
@@ -78,9 +86,6 @@ stdenv.mkDerivation rec {
   " else "")
   +
   ''
-  # the installed ghc executable segfaults, maybe some stripping or such has been done somewhere?
-  # Just copy teh version from the $TMP dir over
-  cp ghc/dist-stage2/build/ghc/ghc $out/lib/ghc-${version}/ghc
   # bah, the passing gmp doesn't work, so let's add it to the final package.conf in a quick but dirty way
   sed -i "s@^\(.*pkgName = PackageName \"rts\".*\libraryDirs = \\[\)\(.*\)@\\1\"${gmp}/lib\",\2@" $out/lib/ghc-${version}/package.conf