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.
This commit is contained in:
John Ericson 2017-09-10 14:38:55 -04:00 committed by Domen Kožar
parent 407198c1cc
commit 26a46295eb
No known key found for this signature in database
GPG key ID: C2FFBCAFD2C24246
3 changed files with 25 additions and 18 deletions

View file

@ -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

View file

@ -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

View file

@ -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