[Reproducible-builds] Bug#831376: nbc: please make the build reproducible
Chris Lamb
lamby at debian.org
Fri Jul 15 08:47:25 UTC 2016
Source: nbc
Version: 1.2.1.r4+dfsg-1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-builds at lists.alioth.debian.org
Hi,
Whilst working on the "reproducible builds" effort [0], we noticed
that nbc could not be built reproducibly.
Patch attached.
[0] https://wiki.debian.org/ReproducibleBuilds
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` lamby at debian.org / chris-lamb.co.uk
`-
-------------- next part --------------
--- a/debian/patches/10-reproducible-build.patch 1970-01-01 02:00:00.000000000 +0200
--- b/debian/patches/10-reproducible-build.patch 2016-07-15 10:35:38.809465962 +0200
@@ -0,0 +1,27 @@
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2016-07-15
+
+--- nbc-1.2.1.r4+dfsg.orig/NXT/nbcunix.mak
++++ nbc-1.2.1.r4+dfsg/NXT/nbcunix.mak
+@@ -3,6 +3,12 @@ VER = 1.2.1.r4
+ DOBJECTS=uNXTClasses.o uPreprocess.o Parser10.o P10Build.o uNXCComp.o uRPGComp.o uRIC.o uRICComp.o uNBCCommon.o uNXTConstants.o uNBCInterface.o nbc.dpr
+ DEFAULT_INCLUDE_DIR=/usr/local/include/nbc
+
++ifdef SOURCE_DATE_EPOCH
++ BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" 2>/dev/null || date -u)
++else
++ BUILD_DATE ?= $(shell date)
++endif
++
+ all:: $(DOBJECTS) $(PROGRAMS)
+
+ clean::
+@@ -34,7 +40,7 @@ nbc_preproc.inc:
+ echo '// '$@ > $@
+ echo 'const' >> $@
+ echo ' DEFAULT_INCLUDE_DIR = '\'$(DEFAULT_INCLUDE_DIR)\'';' >> $@
+- echo ' COMPILATION_TIMESTAMP = '\'`date`\'';' >> $@
++ echo ' COMPILATION_TIMESTAMP = '\'$(BUILD_DATE)\'';' >> $@
+
+ # how to create the mkdata utility
+ mkdata: mkdata.dpr
--- a/debian/patches/series 2016-07-15 10:27:36.212169908 +0200
--- b/debian/patches/series 2016-07-15 10:35:27.193338888 +0200
@@ -1,2 +1,3 @@
20-correct-spelling-errors.patch
fix_makefile_clean.patch
+10-reproducible-build.patch
More information about the Reproducible-builds
mailing list