ghc: Normalize derivations a bit before cross

These changes will affect the final derivation
This commit is contained in:
John Ericson 2017-09-10 18:29:27 -04:00
parent 4532826e99
commit 5a6b6b4ac5
9 changed files with 47 additions and 28 deletions

View file

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

View file

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

View file

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

View file

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

View file

@ -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"
'';

View file

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

View file

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

View file

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

View file

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