From faa4b45a1eff573b5773dd686e2a7f07c9986598 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 10 Sep 2017 14:50:00 -0400 Subject: 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. --- pkgs/development/compilers/ghc/8.2.2.nix | 34 ++++++++++++----------------- pkgs/development/compilers/ghc/head.nix | 37 +++++++++++++------------------- 2 files changed, 29 insertions(+), 42 deletions(-) (limited to 'pkgs/development/compilers') 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 = { -- cgit 1.4.1