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).
This commit is contained in:
Vladimír Čunát 2014-09-13 14:06:27 +02:00
parent dd673de2a7
commit e316672dcb
2 changed files with 16 additions and 13 deletions

View file

@ -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"

View file

@ -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