about summary refs log tree commit diff
path: root/pkgs/development/compilers/ghc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2017-09-10 14:38:55 -0400
committerDomen Kožar <domen@dev.si>2017-12-25 16:36:43 +0000
commit26a46295eb4e47dff8997d2d97b50fe409535439 (patch)
tree42125cddd0ba382aac68273ffc69278cb29dcf3c /pkgs/development/compilers/ghc
parent407198c1ccda110cca5d8dab2f153cfa3d7697c1 (diff)
downloadnixlib-26a46295eb4e47dff8997d2d97b50fe409535439.tar
nixlib-26a46295eb4e47dff8997d2d97b50fe409535439.tar.gz
nixlib-26a46295eb4e47dff8997d2d97b50fe409535439.tar.bz2
nixlib-26a46295eb4e47dff8997d2d97b50fe409535439.tar.lz
nixlib-26a46295eb4e47dff8997d2d97b50fe409535439.tar.xz
nixlib-26a46295eb4e47dff8997d2d97b50fe409535439.tar.zst
nixlib-26a46295eb4e47dff8997d2d97b50fe409535439.zip
ghc prebuilt: Clean up derivations ever so slightly
These changes do break hashes, but are good to have everywhere for
consistency. Plus, changing the bootstrap causes a Haskell mass rebuild
anyways.
Diffstat (limited to 'pkgs/development/compilers/ghc')
-rw-r--r--pkgs/development/compilers/ghc/6.10.2-binary.nix13
-rw-r--r--pkgs/development/compilers/ghc/7.0.4-binary.nix15
-rw-r--r--pkgs/development/compilers/ghc/7.4.2-binary.nix15
3 files changed, 25 insertions, 18 deletions
diff --git a/pkgs/development/compilers/ghc/6.10.2-binary.nix b/pkgs/development/compilers/ghc/6.10.2-binary.nix
index 84250c1a6d33..2030e0e5fc29 100644
--- a/pkgs/development/compilers/ghc/6.10.2-binary.nix
+++ b/pkgs/development/compilers/ghc/6.10.2-binary.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   }.${stdenv.hostPlatform.system}
     or (throw "cannot bootstrap GHC on this platform"));
 
-  buildInputs = [perl];
+  nativeBuildInputs = [ perl ];
 
   postUnpack =
     # Strip is harmful, see also below. It's important that this happens
@@ -48,9 +48,11 @@ stdenv.mkDerivation rec {
       done
     '';
 
-  configurePhase = ''
-    ./configure --prefix=$out --with-gmp-libraries=${stdenv.lib.getLib gmp}/lib --with-gmp-includes=${stdenv.lib.getDev gmp}/include
-  '';
+  configurePlatforms = [ ];
+  configureFlags = [
+    "--with-gmp-libraries=${stdenv.lib.getLib gmp}/lib"
+    "--with-gmp-includes=${stdenv.lib.getDev gmp}/include"
+  ];
 
   # Stripping combined with patchelf breaks the executables (they die
   # with a segfault or the kernel even refuses the execve). (NIXPKGS-85)
@@ -63,7 +65,10 @@ stdenv.mkDerivation rec {
   postInstall = ''
     # 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.out}/lib\",\2@" $out/lib/ghc-${version}/package.conf
+  '';
 
+  doInstallCheck = true;
+  installCheckPhase = ''
     # Sanity check, can ghc create executables?
     cd $TMP
     mkdir test-ghc; cd test-ghc
diff --git a/pkgs/development/compilers/ghc/7.0.4-binary.nix b/pkgs/development/compilers/ghc/7.0.4-binary.nix
index 394e4239e9a0..918e649f8fe0 100644
--- a/pkgs/development/compilers/ghc/7.0.4-binary.nix
+++ b/pkgs/development/compilers/ghc/7.0.4-binary.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
   }.${stdenv.hostPlatform.system}
     or (throw "cannot bootstrap GHC on this platform"));
 
-  buildInputs = [perl];
+  nativeBuildInputs = [ perl ];
 
   postUnpack =
     # GHC has dtrace probes, which causes ld to try to open /usr/lib/libdtrace.dylib
@@ -87,11 +87,11 @@ stdenv.mkDerivation rec {
       done
     '';
 
-  configurePhase = ''
-    ./configure --prefix=$out \
-      --with-gmp-libraries=${gmp.out or gmp}/lib --with-gmp-includes=${gmp.dev or gmp}/include \
-      ${stdenv.lib.optionalString stdenv.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}"}
-  '';
+  configurePlatforms = [ ];
+  configureFlags = [
+    "--with-gmp-libraries=${stdenv.lib.getLib gmp}/lib"
+    "--with-gmp-includes=${stdenv.lib.getDev gmp}/include"
+  ] ++ stdenv.lib.optional stdenv.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}";
 
   # Stripping combined with patchelf breaks the executables (they die
   # with a segfault or the kernel even refuses the execve). (NIXPKGS-85)
@@ -101,7 +101,8 @@ stdenv.mkDerivation rec {
   # calls install-strip ...
   dontBuild = true;
 
-  postInstall = ''
+  doInstallCheck = true;
+  installCheckPhase = ''
     # Sanity check, can ghc create executables?
     cd $TMP
     mkdir test-ghc; cd test-ghc
diff --git a/pkgs/development/compilers/ghc/7.4.2-binary.nix b/pkgs/development/compilers/ghc/7.4.2-binary.nix
index 9d85253f6309..4554d56d2742 100644
--- a/pkgs/development/compilers/ghc/7.4.2-binary.nix
+++ b/pkgs/development/compilers/ghc/7.4.2-binary.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
   }.${stdenv.hostPlatform.system}
     or (throw "cannot bootstrap GHC on this platform"));
 
-  buildInputs = [perl];
+  nativeBuildInputs = [ perl ];
 
   postUnpack =
     # GHC has dtrace probes, which causes ld to try to open /usr/lib/libdtrace.dylib
@@ -92,11 +92,11 @@ stdenv.mkDerivation rec {
       done
     '';
 
-  configurePhase = ''
-    ./configure --prefix=$out \
-      --with-gmp-libraries=${gmp.out or gmp}/lib --with-gmp-includes=${gmp.dev or gmp}/include \
-      ${stdenv.lib.optionalString stdenv.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}"}
-  '';
+  configurePlatforms = [ ];
+  configureFlags = [
+    "--with-gmp-libraries=${stdenv.lib.getLib gmp}/lib"
+    "--with-gmp-includes=${stdenv.lib.getDev gmp}/include"
+  ] ++ stdenv.lib.optional stdenv.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}";
 
   # Stripping combined with patchelf breaks the executables (they die
   # with a segfault or the kernel even refuses the execve). (NIXPKGS-85)
@@ -114,7 +114,8 @@ stdenv.mkDerivation rec {
     ln -s ${libiconv}/lib/libiconv.dylib utils/ghc-cabal/dist-install/build/tmp
   '';
 
-  postInstall = ''
+  doInstallCheck = true;
+  installCheckPhase = ''
     # Sanity check, can ghc create executables?
     cd $TMP
     mkdir test-ghc; cd test-ghc