diff --git a/pkgs/development/libraries/glibc-2.11/common.nix b/pkgs/development/libraries/glibc-2.11/common.nix index cdd968b4582..178dfcdcbeb 100644 --- a/pkgs/development/libraries/glibc-2.11/common.nix +++ b/pkgs/development/libraries/glibc-2.11/common.nix @@ -5,14 +5,21 @@ cross : { name, fetchurl, stdenv, installLocales ? false , gccCross ? null, kernelHeaders ? null -, machHeaders ? null, hurdHeaders ? null, mig ? null +, machHeaders ? null, hurdHeaders ? null, mig ? null, fetchgit ? null , profilingLibraries ? false, meta , preConfigure ? "", ... }@args : -let version = "2.11.1"; in +let + rev = "df4c3faf0ccc848b5a8086c222bdb42679a9798f"; + version = if hurdHeaders != null then "0.0-pre" + rev else "2.11.1"; +in assert (cross != null) -> (gccCross != null); +assert (mig != null) -> (machHeaders != null); +assert (machHeaders != null) -> (hurdHeaders != null); +assert (hurdHeaders != null) -> (fetchgit != null); + stdenv.mkDerivation ({ inherit kernelHeaders installLocales; @@ -21,7 +28,8 @@ stdenv.mkDerivation ({ inherit (stdenv) is64bit; - patches = [ + patches = + stdenv.lib.optional (fetchgit == null) /* Fix for NIXPKGS-79: when doing host name lookups, when nsswitch.conf contains a line like @@ -45,6 +53,7 @@ stdenv.mkDerivation ({ failure to find mdns4_minimal. */ ./nss-skip-unavail.patch + ++ [ /* Make it possible to override the locale-archive in NixOS. */ ./locale-override.patch @@ -53,10 +62,11 @@ stdenv.mkDerivation ({ /* Make sure `nscd' et al. are linked against `libssp'. */ ./stack-protector-link.patch + ] + ++ stdenv.lib.optional (fetchgit == null) /* MOD_NANO definition, for ntp (taken from glibc upstream) */ - ./mod_nano.patch - ]; + ./mod_nano.patch; configureFlags = [ "-C" @@ -100,10 +110,20 @@ stdenv.mkDerivation ({ name = name + "-${version}" + stdenv.lib.optionalString (cross != null) "-${cross.config}"; - src = fetchurl { - url = "mirror://gnu/glibc/glibc-${version}.tar.bz2"; - sha256 = "18azb6518ryqhkfmddr25p0h1s2msrmx7dblij58sjlnzh61vq34"; - }; + src = + if hurdHeaders != null + then fetchgit { + # Shamefully the "official" glibc won't build on GNU, so use the one + # maintained by the Hurd folks, `tschwinge/Roger_Whittaker' branch. + # See . + url = "git://git.sv.gnu.org/hurd/glibc.git"; + sha256 = "f3590a54a9d897d121f91113949edbaaf3e30cdeacbb8d0a44de7b6564f6643e"; + inherit rev; + } + else fetchurl { + url = "mirror://gnu/glibc/glibc-${version}.tar.bz2"; + sha256 = "18azb6518ryqhkfmddr25p0h1s2msrmx7dblij58sjlnzh61vq34"; + }; srcPorts = fetchurl { url = "mirror://gnu/glibc/glibc-ports-2.11.tar.bz2"; @@ -155,11 +175,15 @@ stdenv.mkDerivation ({ // -(if (cross != null && cross.config == "i586-pc-gnu") +(if hurdHeaders != null then { # Work around the fact that the configure snippet that looks for # does not honor `--with-headers=$sysheaders' and that # glibc expects both Mach and Hurd headers to be in the same place. CPATH = "${hurdHeaders}/include:${machHeaders}/include"; + + # `fetchgit' is a function and thus should not be passed to the + # `derivation' primitive. + fetchgit = null; } else { })) diff --git a/pkgs/development/libraries/glibc-2.11/default.nix b/pkgs/development/libraries/glibc-2.11/default.nix index 9bbc7740896..7c92a0fe41b 100644 --- a/pkgs/development/libraries/glibc-2.11/default.nix +++ b/pkgs/development/libraries/glibc-2.11/default.nix @@ -1,14 +1,11 @@ { stdenv, fetchurl, kernelHeaders -, machHeaders ? null, hurdHeaders ? null +, machHeaders ? null, hurdHeaders ? null, mig ? null, fetchgit ? null , installLocales ? true , profilingLibraries ? false , gccCross ? null -, mig ? null }: assert stdenv.gcc.gcc != null; -assert (mig != null) -> (machHeaders != null); -assert (machHeaders != null) -> (hurdHeaders != null); let build = import ./common.nix; @@ -42,7 +39,7 @@ in // (if hurdHeaders != null - then { inherit machHeaders hurdHeaders mig; } + then { inherit machHeaders hurdHeaders mig fetchgit; } else { }) // diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 23c8cc02bbb..0a976860bf4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3913,7 +3913,10 @@ let // (if crossGNU - then { inherit machHeaders hurdHeaders; mig = migCross; } + then { + inherit machHeaders hurdHeaders fetchgit; + mig = migCross; + } else { })))); glibcCross = glibc211Cross;