summary refs log tree commit diff
path: root/pkgs/development/libraries/glibc
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2014-09-13 14:06:27 +0200
committerVladimír Čunát <vcunat@gmail.com>2014-09-13 14:06:27 +0200
commite316672dcb9b5adf57f2e3317d4db4ae9466a0ba (patch)
treedf55d648d71e42b7c30bda088f73b9084641eabd /pkgs/development/libraries/glibc
parentdd673de2a720d976edc0619e43c61f75c234de7a (diff)
downloadnixlib-e316672dcb9b5adf57f2e3317d4db4ae9466a0ba.tar
nixlib-e316672dcb9b5adf57f2e3317d4db4ae9466a0ba.tar.gz
nixlib-e316672dcb9b5adf57f2e3317d4db4ae9466a0ba.tar.bz2
nixlib-e316672dcb9b5adf57f2e3317d4db4ae9466a0ba.tar.lz
nixlib-e316672dcb9b5adf57f2e3317d4db4ae9466a0ba.tar.xz
nixlib-e316672dcb9b5adf57f2e3317d4db4ae9466a0ba.tar.zst
nixlib-e316672dcb9b5adf57f2e3317d4db4ae9466a0ba.zip
glibc: put back the nscd check, by $out instead of date
I don't know why they feel they need to check the compatibility by build date,
so I would keep check against $out, which is a better nix equivalent.

Also, expression refactoring (put comments out of hash-changing bash).
Diffstat (limited to 'pkgs/development/libraries/glibc')
-rw-r--r--pkgs/development/libraries/glibc/2.19/common.nix23
-rw-r--r--pkgs/development/libraries/glibc/2.19/glibc-remove-datetime-from-nscd.patch6
2 files changed, 16 insertions, 13 deletions
diff --git a/pkgs/development/libraries/glibc/2.19/common.nix b/pkgs/development/libraries/glibc/2.19/common.nix
index 09f07d4e67b0..23efc01a3975 100644
--- a/pkgs/development/libraries/glibc/2.19/common.nix
+++ b/pkgs/development/libraries/glibc/2.19/common.nix
@@ -64,22 +64,25 @@ stdenv.mkDerivation ({
 
       /* Remove references to the compilation date.  */
       ./glibc-remove-date-from-compilation-banner.patch
-
-      /* Remove the date and time from nscd.  It is used as a protocol
-         compatibility check, but we assume nix takes care of that for
-         us. */
-      ./glibc-remove-datetime-from-nscd.patch
     ];
 
-  postPatch = ''
+  postPatch =
     # Needed for glibc to build with the gnumake 3.82
     # http://comments.gmane.org/gmane.linux.lfs.support/31227
-    sed -i 's/ot \$/ot:\n\ttouch $@\n$/' manual/Makefile
-
+    ''
+      sed -i 's/ot \$/ot:\n\ttouch $@\n$/' manual/Makefile
+    ''
     # nscd needs libgcc, and we don't want it dynamically linked
     # because we don't want it to depend on bootstrap-tools libs.
-    echo "LDFLAGS-nscd += -static-libgcc" >> nscd/Makefile
-  '';
+    + ''
+      echo "LDFLAGS-nscd += -static-libgcc" >> nscd/Makefile
+    ''
+    # Replace the date and time in nscd by $out.
+    #  It is used as a protocol compatibility check.
+    + ''
+      cat ${./glibc-remove-datetime-from-nscd.patch} \
+        | sed "s,@out@,$out," | patch -p1
+    '';
 
   configureFlags =
     [ "-C"
diff --git a/pkgs/development/libraries/glibc/2.19/glibc-remove-datetime-from-nscd.patch b/pkgs/development/libraries/glibc/2.19/glibc-remove-datetime-from-nscd.patch
index 83b61799c4c7..0a5456ea5c42 100644
--- a/pkgs/development/libraries/glibc/2.19/glibc-remove-datetime-from-nscd.patch
+++ b/pkgs/development/libraries/glibc/2.19/glibc-remove-datetime-from-nscd.patch
@@ -1,11 +1,11 @@
---- a/nscd/nscd_stat.c	2014-04-08 20:35:24.253715420 +0200
-+++ b/nscd/nscd_stat.c	2014-04-08 20:38:32.526634400 +0200
+--- a/nscd/nscd_stat.c
++++ b/nscd/nscd_stat.c
 @@ -37,7 +37,7 @@
  
  
  /* We use this to make sure the receiver is the same.  */
 -static const char compilation[21] = __DATE__ " " __TIME__;
-+static const char compilation[21] = "Thu  1 1970 00:00:01"; /* __DATE__ " " __TIME__; */
++static const char compilation[21] = "@out@";
  
  /* Statistic data for one database.  */
  struct dbstat