about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2010-05-12 23:54:20 +0000
committerLudovic Courtès <ludo@gnu.org>2010-05-12 23:54:20 +0000
commit7a34b3a7a9bdce073e0ab612b320f3c3d6b8bb06 (patch)
tree53c984b167b048e629addb0c3a9a5ed4008dad6e
parenta07de1d9b1e8237ba8c7b560a30f7153b22e7980 (diff)
downloadnixlib-7a34b3a7a9bdce073e0ab612b320f3c3d6b8bb06.tar
nixlib-7a34b3a7a9bdce073e0ab612b320f3c3d6b8bb06.tar.gz
nixlib-7a34b3a7a9bdce073e0ab612b320f3c3d6b8bb06.tar.bz2
nixlib-7a34b3a7a9bdce073e0ab612b320f3c3d6b8bb06.tar.lz
nixlib-7a34b3a7a9bdce073e0ab612b320f3c3d6b8bb06.tar.xz
nixlib-7a34b3a7a9bdce073e0ab612b320f3c3d6b8bb06.tar.zst
nixlib-7a34b3a7a9bdce073e0ab612b320f3c3d6b8bb06.zip
glibc: Get the Hurd-specific glibc branch.
svn path=/nixpkgs/trunk/; revision=21761
-rw-r--r--pkgs/development/libraries/glibc-2.11/common.nix44
-rw-r--r--pkgs/development/libraries/glibc-2.11/default.nix7
-rw-r--r--pkgs/top-level/all-packages.nix5
3 files changed, 40 insertions, 16 deletions
diff --git a/pkgs/development/libraries/glibc-2.11/common.nix b/pkgs/development/libraries/glibc-2.11/common.nix
index cdd968b45823..178dfcdcbeb3 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 <http://www.gnu.org/software/hurd/source_repositories/glibc.html>.
+      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
    # <hurd/version.h> 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 9bbc77408969..7c92a0fe41b4 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 23c8cc02bbb4..0a976860bf48 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;