about summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2017-09-10 14:50:00 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-01-02 21:00:23 -0500
commitfaa4b45a1eff573b5773dd686e2a7f07c9986598 (patch)
tree9f06dae25f26214d48ca317a557333e3b3968983 /pkgs/development/compilers
parenta224dfc2532fd3b06ba12bd81bd76f6cecb08d9d (diff)
downloadnixlib-faa4b45a1eff573b5773dd686e2a7f07c9986598.tar
nixlib-faa4b45a1eff573b5773dd686e2a7f07c9986598.tar.gz
nixlib-faa4b45a1eff573b5773dd686e2a7f07c9986598.tar.bz2
nixlib-faa4b45a1eff573b5773dd686e2a7f07c9986598.tar.lz
nixlib-faa4b45a1eff573b5773dd686e2a7f07c9986598.tar.xz
nixlib-faa4b45a1eff573b5773dd686e2a7f07c9986598.tar.zst
nixlib-faa4b45a1eff573b5773dd686e2a7f07c9986598.zip
ghc 8.2.2, head: Inline `common*` bindings
Cross case purposely changed as it will be rewritten anyways. But no
native hashes should be changed.
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/ghc/8.2.2.nix34
-rw-r--r--pkgs/development/compilers/ghc/head.nix37
2 files changed, 29 insertions, 42 deletions
diff --git a/pkgs/development/compilers/ghc/8.2.2.nix b/pkgs/development/compilers/ghc/8.2.2.nix
index 7ff172ff3b1c..f39edff5ef3d 100644
--- a/pkgs/development/compilers/ghc/8.2.2.nix
+++ b/pkgs/development/compilers/ghc/8.2.2.nix
@@ -23,18 +23,8 @@ let
   targetPrefix = stdenv.lib.optionalString
     (targetPlatform != hostPlatform)
     "${targetPlatform.config}-";
-
-  commonBuildInputs = [ alex autoconf automake ghc happy hscolour perl python3 sphinx ];
-  commonPreConfigure =  ''
-    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}"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
-    export NIX_LDFLAGS+=" -no_dtrace_dof"
-  '' + stdenv.lib.optionalString enableIntegerSimple ''
-    echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk
-  '';
-in stdenv.mkDerivation (rec {
+in
+stdenv.mkDerivation (rec {
   inherit version;
   name = "ghc-${version}";
 
@@ -45,9 +35,19 @@ in stdenv.mkDerivation (rec {
 
   postPatch = "patchShebangs .";
 
-  preConfigure = commonPreConfigure;
+  preConfigure = ''
+    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}"
+  '' + 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 = commonBuildInputs;
+  buildInputs = [ alex autoconf automake ghc happy hscolour perl python3 sphinx ];
 
   enableParallelBuilding = true;
 
@@ -102,10 +102,6 @@ in stdenv.mkDerivation (rec {
 } // stdenv.lib.optionalAttrs (cross != null) {
   name = "${cross.config}-ghc-${version}";
 
-  preConfigure = commonPreConfigure + ''
-    sed 's|#BuildFlavour  = quick-cross|BuildFlavour  = perf-cross|' mk/build.mk.sample > mk/build.mk
-  '';
-
   configureFlags = [
     "CC=${stdenv.cc}/bin/${cross.config}-cc"
     "LD=${stdenv.cc.bintools}/bin/${cross.config}-ld"
@@ -118,8 +114,6 @@ in stdenv.mkDerivation (rec {
     # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
     stdenv.lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
 
-  buildInputs = commonBuildInputs;
-
   configurePlatforms = [];
 
   passthru = {
diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix
index 00cf46abd522..c5be301baf68 100644
--- a/pkgs/development/compilers/ghc/head.nix
+++ b/pkgs/development/compilers/ghc/head.nix
@@ -26,20 +26,6 @@ let
   targetPrefix = stdenv.lib.optionalString
     (targetPlatform != hostPlatform)
     "${targetPlatform.config}-";
-
-  commonBuildInputs = [ ghc perl autoconf automake happy alex python3 ];
-  commonPreConfigure =  ''
-    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}"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
-    export NIX_LDFLAGS+=" -no_dtrace_dof"
-  '' + stdenv.lib.optionalString enableIntegerSimple ''
-    echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk
-  '';
 in
 stdenv.mkDerivation (rec {
   inherit version rev;
@@ -53,9 +39,22 @@ stdenv.mkDerivation (rec {
 
   postPatch = "patchShebangs .";
 
-  preConfigure = commonPreConfigure;
+  preConfigure = ''
+    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}"
+  '' + 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 = commonBuildInputs;
+  buildInputs = [ ghc perl autoconf automake happy alex python3 ];
 
   enableParallelBuilding = true;
 
@@ -110,10 +109,6 @@ stdenv.mkDerivation (rec {
 } // stdenv.lib.optionalAttrs (cross != null) {
   name = "${cross.config}-ghc-${version}";
 
-  preConfigure = commonPreConfigure + ''
-    sed 's|#BuildFlavour  = quick-cross|BuildFlavour  = perf-cross|' mk/build.mk.sample > mk/build.mk
-  '';
-
   configureFlags = [
     "CC=${stdenv.cc}/bin/${cross.config}-cc"
     "LD=${stdenv.cc.bintools}/bin/${cross.config}-ld"
@@ -126,8 +121,6 @@ stdenv.mkDerivation (rec {
     # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
     stdenv.lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
 
-  buildInputs = commonBuildInputs;
-
   configurePlatforms = [];
 
   passthru = {