From 5a6b6b4ac56f1731abfbc48c7506fecf628a84d7 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 10 Sep 2017 18:29:27 -0400 Subject: [PATCH] ghc: Normalize derivations a bit before cross These changes will affect the final derivation --- pkgs/development/compilers/ghc/7.10.3.nix | 11 ++++++++--- pkgs/development/compilers/ghc/7.2.2.nix | 2 +- pkgs/development/compilers/ghc/7.4.2.nix | 4 ++-- pkgs/development/compilers/ghc/7.6.3.nix | 4 ++-- pkgs/development/compilers/ghc/7.8.4.nix | 4 ++-- pkgs/development/compilers/ghc/8.0.2.nix | 11 ++++++++--- pkgs/development/compilers/ghc/8.2.2.nix | 13 ++++++++----- pkgs/development/compilers/ghc/8.4.1.nix | 13 ++++++++----- pkgs/development/compilers/ghc/head.nix | 13 ++++++++----- 9 files changed, 47 insertions(+), 28 deletions(-) diff --git a/pkgs/development/compilers/ghc/7.10.3.nix b/pkgs/development/compilers/ghc/7.10.3.nix index 3fb70c31a7c..376b548b178 100644 --- a/pkgs/development/compilers/ghc/7.10.3.nix +++ b/pkgs/development/compilers/ghc/7.10.3.nix @@ -28,6 +28,12 @@ let sha256 = "1j45z4kcd3w1rzm4hapap2xc16bbh942qnzzdbdjcwqznsccznf0"; }; + buildMK = stdenv.lib.optionalString enableIntegerSimple '' + INTEGER_LIBRARY = integer-simple + '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + BuildFlavour = perf-cross + ''; + in stdenv.mkDerivation rec { @@ -51,13 +57,12 @@ stdenv.mkDerivation rec { outputs = [ "out" "doc" ]; preConfigure = '' + echo "${buildMK}" > mk/build.mk sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' - export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" + export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" '' + stdenv.lib.optionalString stdenv.isDarwin '' export NIX_LDFLAGS+=" -no_dtrace_dof" - '' + stdenv.lib.optionalString enableIntegerSimple '' - echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk ''; configureFlags = [ diff --git a/pkgs/development/compilers/ghc/7.2.2.nix b/pkgs/development/compilers/ghc/7.2.2.nix index cb8470bcff1..7de33b7b5a5 100644 --- a/pkgs/development/compilers/ghc/7.2.2.nix +++ b/pkgs/development/compilers/ghc/7.2.2.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib" ''} '' + (if enableIntegerSimple then '' - INTEGER_LIBRARY=integer-simple + INTEGER_LIBRARY = integer-simple '' else '' libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib" libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include" diff --git a/pkgs/development/compilers/ghc/7.4.2.nix b/pkgs/development/compilers/ghc/7.4.2.nix index 6f30b03efb9..5fb5dabd438 100644 --- a/pkgs/development/compilers/ghc/7.4.2.nix +++ b/pkgs/development/compilers/ghc/7.4.2.nix @@ -32,7 +32,7 @@ stdenv.mkDerivation rec { libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib" ''} '' + (if enableIntegerSimple then '' - INTEGER_LIBRARY=integer-simple + INTEGER_LIBRARY = integer-simple '' else '' libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib" libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include" @@ -42,7 +42,7 @@ stdenv.mkDerivation rec { echo "${buildMK}" > mk/build.mk sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' - export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" + export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" '' + stdenv.lib.optionalString stdenv.isDarwin '' find . -name '*.hs' | xargs sed -i -e 's|ASSERT (|ASSERT(|' -e 's|ASSERT2 (|ASSERT2(|' -e 's|WARN (|WARN(|' find . -name '*.lhs' | xargs sed -i -e 's|ASSERT (|ASSERT(|' -e 's|ASSERT2 (|ASSERT2(|' -e 's|WARN (|WARN(|' diff --git a/pkgs/development/compilers/ghc/7.6.3.nix b/pkgs/development/compilers/ghc/7.6.3.nix index 78202297686..181d3967fb2 100644 --- a/pkgs/development/compilers/ghc/7.6.3.nix +++ b/pkgs/development/compilers/ghc/7.6.3.nix @@ -43,7 +43,7 @@ in stdenv.mkDerivation rec { SRC_HC_OPTS += ${ghcFlags} SRC_CC_OPTS += ${cFlags} '' + (if enableIntegerSimple then '' - INTEGER_LIBRARY=integer-simple + INTEGER_LIBRARY = integer-simple '' else '' libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib" libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include" @@ -58,7 +58,7 @@ in stdenv.mkDerivation rec { sed -i -e 's|"\$topdir"|"\$topdir" ${ghcFlags}|' ghc/ghc.wrapper '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' - export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" + export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" '' + stdenv.lib.optionalString stdenv.isDarwin '' find . -name '*.hs' | xargs sed -i -e 's|ASSERT (|ASSERT(|' -e 's|ASSERT2 (|ASSERT2(|' -e 's|WARN (|WARN(|' find . -name '*.lhs' | xargs sed -i -e 's|ASSERT (|ASSERT(|' -e 's|ASSERT2 (|ASSERT2(|' -e 's|WARN (|WARN(|' diff --git a/pkgs/development/compilers/ghc/7.8.4.nix b/pkgs/development/compilers/ghc/7.8.4.nix index b5e2ac256a7..67ab1423993 100644 --- a/pkgs/development/compilers/ghc/7.8.4.nix +++ b/pkgs/development/compilers/ghc/7.8.4.nix @@ -34,7 +34,7 @@ stdenv.mkDerivation (rec { libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib" ''} '' + (if enableIntegerSimple then '' - INTEGER_LIBRARY=integer-simple + INTEGER_LIBRARY = integer-simple '' else '' libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib" libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include" @@ -44,7 +44,7 @@ stdenv.mkDerivation (rec { echo "${buildMK}" > mk/build.mk sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' - export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" + export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" '' + stdenv.lib.optionalString stdenv.isDarwin '' export NIX_LDFLAGS+=" -no_dtrace_dof" ''; diff --git a/pkgs/development/compilers/ghc/8.0.2.nix b/pkgs/development/compilers/ghc/8.0.2.nix index bb706aa6bbc..51e60419025 100644 --- a/pkgs/development/compilers/ghc/8.0.2.nix +++ b/pkgs/development/compilers/ghc/8.0.2.nix @@ -21,6 +21,12 @@ let targetPrefix = stdenv.lib.optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-"; + + buildMK = stdenv.lib.optionalString enableIntegerSimple '' + INTEGER_LIBRARY = integer-simple + '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + BuildFlavour = perf-cross + ''; in stdenv.mkDerivation rec { version = "8.0.2"; @@ -42,13 +48,12 @@ stdenv.mkDerivation rec { outputs = [ "out" "man" "doc" ]; preConfigure = '' + echo "${buildMK}" > mk/build.mk sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' - export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" + export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" '' + stdenv.lib.optionalString stdenv.isDarwin '' export NIX_LDFLAGS+=" -no_dtrace_dof" - '' + stdenv.lib.optionalString enableIntegerSimple '' - echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk ''; configureFlags = [ diff --git a/pkgs/development/compilers/ghc/8.2.2.nix b/pkgs/development/compilers/ghc/8.2.2.nix index 0e87ea68649..6eeff74160b 100644 --- a/pkgs/development/compilers/ghc/8.2.2.nix +++ b/pkgs/development/compilers/ghc/8.2.2.nix @@ -22,6 +22,12 @@ let targetPrefix = stdenv.lib.optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-"; + + buildMK = stdenv.lib.optionalString enableIntegerSimple '' + INTEGER_LIBRARY = integer-simple + '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + BuildFlavour = perf-cross + ''; in stdenv.mkDerivation (rec { version = "8.2.2"; @@ -35,15 +41,12 @@ stdenv.mkDerivation (rec { postPatch = "patchShebangs ."; preConfigure = '' + echo "${buildMK}" > mk/build.mk sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' - export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" + export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" '' + stdenv.lib.optionalString stdenv.isDarwin '' export NIX_LDFLAGS+=" -no_dtrace_dof" - '' + stdenv.lib.optionalString enableIntegerSimple '' - echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' - sed 's|#BuildFlavour = quick-cross|BuildFlavour = perf-cross|' mk/build.mk.sample > mk/build.mk ''; buildInputs = [ alex autoconf automake ghc happy hscolour perl python3 sphinx ] ++ stdenv.lib.optionals (targetPlatform.isArm || targetPlatform.isAarch64) [ llvm_39 ]; diff --git a/pkgs/development/compilers/ghc/8.4.1.nix b/pkgs/development/compilers/ghc/8.4.1.nix index b5db328a8a2..45e34a775ed 100644 --- a/pkgs/development/compilers/ghc/8.4.1.nix +++ b/pkgs/development/compilers/ghc/8.4.1.nix @@ -26,6 +26,12 @@ let targetPrefix = stdenv.lib.optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-"; + + buildMK = stdenv.lib.optionalString enableIntegerSimple '' + INTEGER_LIBRARY = integer-simple + '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + BuildFlavour = perf-cross + ''; in stdenv.mkDerivation (rec { inherit version rev; @@ -40,18 +46,15 @@ stdenv.mkDerivation (rec { postPatch = "patchShebangs ."; preConfigure = '' + echo "${buildMK}" > mk/build.mk echo ${version} >VERSION echo ${rev} >GIT_COMMIT_ID ./boot sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' - export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" + export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" '' + stdenv.lib.optionalString stdenv.isDarwin '' export NIX_LDFLAGS+=" -no_dtrace_dof" - '' + stdenv.lib.optionalString enableIntegerSimple '' - echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' - sed 's|#BuildFlavour = quick-cross|BuildFlavour = perf-cross|' mk/build.mk.sample > mk/build.mk ''; buildInputs = [ ghc perl autoconf automake happy alex python3 ]; diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index 9b4c932eb11..18a00202dc2 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -26,6 +26,12 @@ let targetPrefix = stdenv.lib.optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-"; + + buildMK = stdenv.lib.optionalString enableIntegerSimple '' + INTEGER_LIBRARY = integer-simple + '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + BuildFlavour = perf-cross + ''; in stdenv.mkDerivation (rec { inherit version rev; @@ -40,18 +46,15 @@ stdenv.mkDerivation (rec { postPatch = "patchShebangs ."; preConfigure = '' + echo "${buildMK}" > mk/build.mk echo ${version} >VERSION echo ${rev} >GIT_COMMIT_ID ./boot sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' - export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" + export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" '' + stdenv.lib.optionalString stdenv.isDarwin '' export NIX_LDFLAGS+=" -no_dtrace_dof" - '' + stdenv.lib.optionalString enableIntegerSimple '' - echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' - sed 's|#BuildFlavour = quick-cross|BuildFlavour = perf-cross|' mk/build.mk.sample > mk/build.mk ''; buildInputs = [ ghc perl autoconf automake happy alex python3 ];