gcc: Deduplicate preConfigure

wip/yesman
John Ericson 5 years ago
parent ca341c2d5b
commit f666c61d20
  1. 10
      pkgs/development/compilers/gcc/4.8/default.nix
  2. 14
      pkgs/development/compilers/gcc/4.9/default.nix
  3. 10
      pkgs/development/compilers/gcc/5/default.nix
  4. 13
      pkgs/development/compilers/gcc/6/default.nix
  5. 10
      pkgs/development/compilers/gcc/7/default.nix
  6. 10
      pkgs/development/compilers/gcc/8/default.nix
  7. 10
      pkgs/development/compilers/gcc/9/default.nix
  8. 12
      pkgs/development/compilers/gcc/common/pre-configure.nix
  9. 10
      pkgs/development/compilers/gcc/snapshot/default.nix

@ -228,12 +228,10 @@ stdenv.mkDerivation ({
++ (optional hostPlatform.isDarwin gnused)
;
preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
'';
preConfigure = import ../common/pre-configure.nix {
inherit (stdenv) lib;
inherit version hostPlatform langJava langGo;
};
dontDisableStatic = true;

@ -234,16 +234,10 @@ stdenv.mkDerivation ({
++ (optional hostPlatform.isDarwin gnused)
;
preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
sed -i -e "s/-lrt//g" libstdc++-v3/configure
export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
''
+ stdenv.lib.optionalString (langJava || langGo) ''
export lib=$out;
'';
preConfigure = import ../common/pre-configure.nix {
inherit (stdenv) lib;
inherit version hostPlatform langJava langGo;
};
dontDisableStatic = true;

@ -242,12 +242,10 @@ stdenv.mkDerivation ({
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
'';
preConfigure = import ../common/pre-configure.nix {
inherit (stdenv) lib;
inherit version hostPlatform langJava langGo;
};
dontDisableStatic = true;

@ -244,15 +244,10 @@ stdenv.mkDerivation ({
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
''
+ stdenv.lib.optionalString (langJava || langGo) ''
export lib=$out;
'';
preConfigure = import ../common/pre-configure.nix {
inherit (stdenv) lib;
inherit version hostPlatform langJava langGo;
};
dontDisableStatic = true;

@ -220,12 +220,10 @@ stdenv.mkDerivation ({
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.cc.isClang && langFortran) "-Wno-unused-command-line-argument";
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
'';
preConfigure = import ../common/pre-configure.nix {
inherit (stdenv) lib;
inherit version hostPlatform langGo;
};
dontDisableStatic = true;

@ -206,12 +206,10 @@ stdenv.mkDerivation ({
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
'';
preConfigure = import ../common/pre-configure.nix {
inherit (stdenv) lib;
inherit version hostPlatform langGo;
};
dontDisableStatic = true;

@ -205,12 +205,10 @@ stdenv.mkDerivation ({
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
'';
preConfigure = import ../common/pre-configure.nix {
inherit (stdenv) lib;
inherit version hostPlatform langGo;
};
dontDisableStatic = true;

@ -0,0 +1,12 @@
{ lib, version, hostPlatform, langJava ? false, langGo }:
assert langJava -> lib.versionOlder version "7";
lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
'' + lib.optionalString (lib.versionOlder version "7" && (langJava || langGo)) ''
export lib=$out;
''

@ -177,12 +177,10 @@ stdenv.mkDerivation ({
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
'';
preConfigure = import ../common/pre-configure.nix {
inherit (stdenv) lib;
inherit version hostPlatform langGo;
};
dontDisableStatic = true;

Loading…
Cancel
Save