3
0
Fork 0
forked from mirrors/nixpkgs

glibc: Remove old-style nullable "cross" variable

Much better to just use {build,host}Platform directly.
This commit is contained in:
John Ericson 2018-05-10 17:42:48 -04:00
parent 1fe81a4bcd
commit e98814461d
2 changed files with 12 additions and 20 deletions

View file

@ -23,7 +23,6 @@ let
version = "2.27";
patchSuffix = "";
sha256 = "0wpwq7gsm7sd6ysidv0z575ckqdg13cr2njyfgrbgh4f65adwwji";
cross = if buildPlatform != hostPlatform then hostPlatform else null;
in
assert withLinuxHeaders -> linuxHeaders != null;
@ -33,9 +32,6 @@ stdenv.mkDerivation ({
inherit installLocales;
linuxHeaders = if withLinuxHeaders then linuxHeaders else null;
# The host/target system.
crossConfig = if cross != null then cross.config else null;
inherit (stdenv) is64bit;
enableParallelBuilding = true;
@ -106,11 +102,12 @@ stdenv.mkDerivation ({
else "--disable-profile")
] ++ lib.optionals withLinuxHeaders [
"--enable-kernel=3.2.0" # can't get below with glibc >= 2.26
] ++ lib.optionals (cross != null) [
(if cross ? float && cross.float == "soft" then "--without-fp" else "--with-fp")
] ++ lib.optionals (cross != null) [
] ++ lib.optionals (hostPlatform != buildPlatform) [
(if hostPlatform.platform.gcc.float or (hostPlatform.parsed.abi.float or "hard") == "soft"
then "--without-fp"
else "--with-fp")
"--with-__thread"
] ++ lib.optionals (cross == null && stdenv.isAarch32) [
] ++ lib.optionals (hostPlatform == buildPlatform && hostPlatform.isAarch32) [
"--host=arm-linux-gnueabi"
"--build=arm-linux-gnueabi"
@ -162,7 +159,7 @@ stdenv.mkDerivation ({
}
'' + lib.optionalString (cross != null) ''
'' + lib.optionalString (hostPlatform != buildPlatform) ''
sed -i s/-lgcc_eh//g "../$sourceRoot/Makeconfig"
cat > config.cache << "EOF"
@ -196,7 +193,7 @@ stdenv.mkDerivation ({
passthru = { inherit version; };
}
// lib.optionalAttrs (cross != null) {
// lib.optionalAttrs (hostPlatform != buildPlatform) {
preInstall = null; # clobber the native hook
dontStrip = true;

View file

@ -22,7 +22,6 @@ let
version = "2.26";
patchSuffix = "-131";
sha256 = "1ggnj1hzjym7sn93rbwydcqd562q73lsb7g7kd199g6j9j9hlkp5";
cross = if buildPlatform != hostPlatform then hostPlatform else null;
in
assert withLinuxHeaders -> linuxHeaders != null;
@ -32,9 +31,6 @@ stdenv.mkDerivation ({
inherit installLocales;
linuxHeaders = if withLinuxHeaders then linuxHeaders else null;
# The host/target system.
crossConfig = if cross != null then cross.config else null;
inherit (stdenv) is64bit;
enableParallelBuilding = true;
@ -126,13 +122,12 @@ stdenv.mkDerivation ({
else "--disable-profile")
] ++ lib.optionals withLinuxHeaders [
"--enable-kernel=3.2.0" # can't get below with glibc >= 2.26
] ++ lib.optionals (cross != null) [
(if cross.platform.gcc.float or (cross.parsed.abi.float or "hard") == "soft"
] ++ lib.optionals (hostPlatform != buildPlatform) [
(if hostPlatform.platform.gcc.float or (hostPlatform.parsed.abi.float or "hard") == "soft"
then "--without-fp"
else "--with-fp")
] ++ lib.optionals (cross != null) [
"--with-__thread"
] ++ lib.optionals (cross == null && stdenv.isAarch32) [
] ++ lib.optionals (hostPlatform == buildPlatform && hostPlatform.isAarch32) [
"--host=arm-linux-gnueabi"
"--build=arm-linux-gnueabi"
@ -183,7 +178,7 @@ stdenv.mkDerivation ({
}
'' + lib.optionalString (cross != null) ''
'' + lib.optionalString (hostPlatform != buildPlatform) ''
sed -i s/-lgcc_eh//g "../$sourceRoot/Makeconfig"
cat > config.cache << "EOF"
@ -215,7 +210,7 @@ stdenv.mkDerivation ({
} // meta;
}
// lib.optionalAttrs (cross != null) {
// lib.optionalAttrs (hostPlatform != buildPlatform) {
preInstall = null; # clobber the native hook
dontStrip = true;