ghc: Normalize derivations in hash-preserving ways

This commit is contained in:
John Ericson 2018-01-03 16:29:18 -05:00
parent 0df29e1259
commit 3fb5fd0060
4 changed files with 5 additions and 10 deletions

View file

@ -72,7 +72,7 @@ stdenv.mkDerivation rec {
# required, because otherwise all symbols from HSffi.o are stripped, and
# that in turn causes GHCi to abort
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
postInstall = ''
# Install the bash completion file.

View file

@ -66,7 +66,7 @@ stdenv.mkDerivation rec {
# required, because otherwise all symbols from HSffi.o are stripped, and
# that in turn causes GHCi to abort
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
postInstall = ''
paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"}

View file

@ -17,7 +17,6 @@ assert !enableIntegerSimple -> gmp != null;
let
inherit (bootPkgs) ghc;
version = "8.2.2";
# TODO(@Ericson2314) Make unconditional
targetPrefix = stdenv.lib.optionalString
@ -25,8 +24,8 @@ let
"${targetPlatform.config}-";
in
stdenv.mkDerivation (rec {
inherit version;
name = "ghc-${version}";
version = "8.2.2";
name = "${targetPrefix}ghc-${version}";
src = fetchurl {
url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz";
@ -100,8 +99,6 @@ stdenv.mkDerivation (rec {
};
} // stdenv.lib.optionalAttrs (cross != null) {
name = "${cross.config}-ghc-${version}";
configureFlags = [
"CC=${stdenv.cc}/bin/${cross.config}-cc"
"LD=${stdenv.cc.bintools}/bin/${cross.config}-ld"

View file

@ -29,7 +29,7 @@ let
in
stdenv.mkDerivation (rec {
inherit version rev;
name = "ghc-${version}";
name = "${targetPrefix}ghc-${version}";
src = fetchgit {
url = "git://git.haskell.org/ghc.git";
@ -107,8 +107,6 @@ stdenv.mkDerivation (rec {
};
} // stdenv.lib.optionalAttrs (cross != null) {
name = "${cross.config}-ghc-${version}";
configureFlags = [
"CC=${stdenv.cc}/bin/${cross.config}-cc"
"LD=${stdenv.cc.bintools}/bin/${cross.config}-ld"