[nethack] 01/04: Add patch to enable reproducible building. (Closes: #818128)

James Cowgill jcowgill-guest at moszumanska.debian.org
Mon Mar 21 17:58:25 UTC 2016


This is an automated email from the git hooks/post-receive script.

jcowgill-guest pushed a commit to branch master
in repository nethack.

commit 4dd4d9c32fb530e607f3cf0c8e58d80efc44434b
Author: Reiner Herrmann <reiner at reiner-h.de>
Date:   Mon Mar 21 13:15:35 2016 +0000

    Add patch to enable reproducible building. (Closes: #818128)
---
 debian/patches/0025-reproducible-build.patch | 50 ++++++++++++++++++++++++++++
 debian/patches/series                        |  1 +
 2 files changed, 51 insertions(+)

diff --git a/debian/patches/0025-reproducible-build.patch b/debian/patches/0025-reproducible-build.patch
new file mode 100644
index 0000000..cf62502
--- /dev/null
+++ b/debian/patches/0025-reproducible-build.patch
@@ -0,0 +1,50 @@
+Author: Reiner Herrmann <reiner at reiner-h.de>
+Description: enable reproducible building
+ - set LC_ALL to C so the shell sorts files in DATDLB after
+   wildcard expansion independent of the configured locale
+ - read timestamp for the build date from environment.
+   https://reproducible-builds.org/specs/source-date-epoch/
+
+--- a/sys/unix/Makefile.top
++++ b/sys/unix/Makefile.top
+@@ -186,7 +186,7 @@
+ 
+ dlb:
+ 	( cd util ; $(MAKE) dlb )
+-	( cd dat ; ../util/dlb cf nhdat $(DATDLB) )
++	( cd dat ; LC_ALL=C ; ../util/dlb cf nhdat $(DATDLB) )
+ 
+ # recover can be used when INSURANCE is defined in include/config.h
+ # and the checkpoint option is true
+--- a/util/makedefs.c
++++ b/util/makedefs.c
+@@ -1222,7 +1222,7 @@
+ #else
+     time_t clocktim = 0;
+ #endif
+-    char *c, cbuf[60], buf[BUFSZ];
++    char *c, cbuf[60], buf[BUFSZ], *source_date_epoch;
+     const char *ul_sfx;
+ 
+     /* before creating date.h, make sure that xxx_GRAPHICS and
+@@ -1244,7 +1244,10 @@
+     Fprintf(ofp, "%s", Dont_Edit_Code);
+ 
+     (void) time(&clocktim);
+-    Strcpy(cbuf, ctime(&clocktim));
++    source_date_epoch = getenv("SOURCE_DATE_EPOCH");
++    if (source_date_epoch)
++        clocktim = strtoull(source_date_epoch, NULL, 10);
++    Strcpy(cbuf, asctime(gmtime(&clocktim)));
+ 
+     for (c = cbuf; *c; c++)
+         if (*c == '\n')
+@@ -1281,7 +1284,7 @@
+     Fprintf(ofp, "\n");
+ #ifdef AMIGA
+     {
+-        struct tm *tm = localtime((time_t *) &clocktim);
++        struct tm *tm = gmtime((time_t *) &clocktim);
+         Fprintf(ofp, "#define AMIGA_VERSION_STRING ");
+         Fprintf(ofp, "\"\\0$VER: NetHack %d.%d.%d (%d.%d.%d)\"\n",
+                 VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL, tm->tm_mday,
diff --git a/debian/patches/series b/debian/patches/series
index ea58e42..4a93708 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -14,3 +14,4 @@
 0021-fix-kfreebsd-ftbfs.patch
 0023-gcc-warning-fixes.patch
 0024-lisp-3.6.patch
+0025-reproducible-build.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/nethack.git



More information about the Pkg-games-commits mailing list