summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@Yahoo.com>2017-04-25 23:55:03 -0400
committerJohn Ericson <Ericson2314@Yahoo.com>2017-05-19 18:44:24 -0400
commit7e096024d7cf0ea1ca2a0d0d79d33d3f3e4e9965 (patch)
treebca14bb07f68c03e700b4bb6415924d71903315d /pkgs/development/libraries
parentdf91297181d0d62da0d090039af52a44ff70467d (diff)
downloadnixlib-7e096024d7cf0ea1ca2a0d0d79d33d3f3e4e9965.tar
nixlib-7e096024d7cf0ea1ca2a0d0d79d33d3f3e4e9965.tar.gz
nixlib-7e096024d7cf0ea1ca2a0d0d79d33d3f3e4e9965.tar.bz2
nixlib-7e096024d7cf0ea1ca2a0d0d79d33d3f3e4e9965.tar.lz
nixlib-7e096024d7cf0ea1ca2a0d0d79d33d3f3e4e9965.tar.xz
nixlib-7e096024d7cf0ea1ca2a0d0d79d33d3f3e4e9965.tar.zst
nixlib-7e096024d7cf0ea1ca2a0d0d79d33d3f3e4e9965.zip
glibc: Fix for cross
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/glibc/common.nix17
-rw-r--r--pkgs/development/libraries/glibc/default.nix12
2 files changed, 16 insertions, 13 deletions
diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix
index ec9f94d00d82..74fb00501096 100644
--- a/pkgs/development/libraries/glibc/common.nix
+++ b/pkgs/development/libraries/glibc/common.nix
@@ -4,17 +4,20 @@
 cross:
 
 { name, fetchurl, lib, stdenv, installLocales ? false
-, gccCross ? null, linuxHeaders ? null
+, linuxHeaders ? null
 , profilingLibraries ? false, meta
 , withGd ? false, gd ? null, libpng ? null
-, preConfigure ? "", ... }@args:
+, preConfigure ? ""
+, buildPackages ? {}
+, ...
+} @ args:
 
 let
   version = "2.25";
   sha256 = "067bd9bb3390e79aa45911537d13c3721f1d9d3769931a30c2681bfee66f23a0";
 in
 
-assert cross != null -> gccCross != null;
+assert cross != null -> buildPackages.stdenv ? cc;
 
 stdenv.mkDerivation ({
   inherit linuxHeaders installLocales;
@@ -113,8 +116,8 @@ stdenv.mkDerivation ({
 
   outputs = [ "out" "bin" "dev" "static" ];
 
-  buildInputs = lib.optionals (cross != null) [ gccCross ]
-    ++ lib.optionals withGd [ gd libpng ];
+  nativeBuildInputs = lib.optional (cross != null) buildPackages.stdenv.cc;
+  buildInputs = lib.optionals withGd [ gd libpng ];
 
   # Needed to install share/zoneinfo/zone.tab.  Set to impure /bin/sh to
   # prevent a retained dependency on the bootstrap tools in the stdenv-linux
@@ -122,9 +125,7 @@ stdenv.mkDerivation ({
   BASH_SHELL = "/bin/sh";
 }
 
-# Remove the `gccCross' attribute so that the *native* glibc store path
-# doesn't depend on whether `gccCross' is null or not.
-// (removeAttrs args [ "lib" "gccCross" "fetchurl" "withGd" "gd" "libpng" ]) //
+// (removeAttrs args [ "lib" "buildPackages" "fetchurl" "withGd" "gd" "libpng" ]) //
 
 {
   name = name + "-${version}" +
diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix
index 4f9eb2d0714f..7295e4d62f4f 100644
--- a/pkgs/development/libraries/glibc/default.nix
+++ b/pkgs/development/libraries/glibc/default.nix
@@ -1,21 +1,23 @@
-{ lib, stdenv, fetchurl, linuxHeaders
+{ lib, stdenv, fetchurl
 , installLocales ? true
 , profilingLibraries ? false
-, gccCross ? null
 , withGd ? false, gd ? null, libpng ? null
+, buildPlatform, hostPlatform
+, buildPackages
 }:
 
 assert stdenv.cc.isGNU;
 
 let
   build = import ./common.nix;
-  cross = if gccCross != null then gccCross.target else null;
+  cross = if buildPlatform != hostPlatform then hostPlatform else null;
+  inherit (buildPackages) linuxHeaders;
 in
   build cross ({
     name = "glibc" + lib.optionalString withGd "-gd";
 
-    inherit lib stdenv fetchurl linuxHeaders installLocales
-      profilingLibraries gccCross withGd gd libpng;
+    inherit lib stdenv buildPackages fetchurl linuxHeaders installLocales
+      profilingLibraries withGd gd libpng;
 
     NIX_NO_SELF_RPATH = true;