From 26a46295eb4e47dff8997d2d97b50fe409535439 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 10 Sep 2017 14:38:55 -0400 Subject: [PATCH] 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. --- pkgs/development/compilers/ghc/6.10.2-binary.nix | 13 +++++++++---- pkgs/development/compilers/ghc/7.0.4-binary.nix | 15 ++++++++------- pkgs/development/compilers/ghc/7.4.2-binary.nix | 15 ++++++++------- 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 84250c1a6d3..2030e0e5fc2 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 394e4239e9a..918e649f8fe 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 9d85253f630..4554d56d274 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