Bug#886105: klystrack: please make the build reproducible with respect to timestamps
Chris Lamb
lamby at debian.org
Tue Jan 2 10:30:34 UTC 2018
Source: klystrack
Version: 0.20171212-1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org
Hi,
Whilst working on the Reproducible Builds effort [0], we noticed
that klystrack could not be built reproducibly.
Patch attached, although the resource files are still not reproducible
as they iterate over the filesystem in a non-determistic order. This
will require a match to makebundle.c.
[0] https://reproducible-builds.org/
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` lamby at debian.org / chris-lamb.co.uk
`-
-------------- next part --------------
--- a/debian/patches/reproducible-build.patch 1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/reproducible-build.patch 2018-01-02 10:18:43.133544155 +0000
@@ -0,0 +1,58 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2018-01-02
+
+--- klystrack-0.20171212.orig/klystron/Makefile
++++ klystrack-0.20171212/klystron/Makefile
+@@ -28,6 +28,13 @@ lib_OBJ = $(patsubst %.c, objs.$(CFG)/li
+ CC = gcc -shared -std=gnu99 --no-strict-aliasing
+ CDEP = gcc -E -std=gnu99
+
++DATE_FMT = %Y%m%d
++ifdef SOURCE_DATE_EPOCH
++ KLYSTRON_REVISION ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u "+$(DATE_FMT)")
++else
++ KLYSTRON_REVISION ?= $(shell date "+$(DATE_FMT)")
++endif
++
+ ifndef CFLAGS
+ CFLAGS = $(MACHINE) -ftree-vectorize
+ endif
+@@ -73,9 +80,7 @@ LDFLAGS =
+ build: Makefile
+ @echo '#ifndef KLYSTRON_VERSION_H' > ./src/version.h
+ @echo '#define KLYSTRON_VERSION_H' >> ./src/version.h
+- @echo -n '#define KLYSTRON_REVISION "' >> ./src/version.h
+- @date +"%Y%m%d" | tr -d '\n' >> ./src/version.h
+- @echo '"' >> ./src/version.h
++ @echo '#define KLYSTRON_REVISION "$(KLYSTRON_REVISION)"' >> ./src/version.h
+ @echo '#define KLYSTRON_VERSION_STRING "klystron " KLYSTRON_REVISION' >> ./src/version.h
+ @echo '#endif' >> ./src/version.h
+ make all CFG=$(CFG)
+--- klystrack-0.20171212.orig/klystrack/Makefile
++++ klystrack-0.20171212/klystrack/Makefile
+@@ -21,6 +21,13 @@ REV := cp -f
+
+ CFLAGS := $(MACHINE) -ftree-vectorize -std=gnu99 --no-strict-aliasing
+
++DATE_FMT = %Y%m%d
++ifdef SOURCE_DATE_EPOCH
++ REVISION ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u "+$(DATE_FMT)")
++else
++ REVISION ?= $(shell date "+$(DATE_FMT)")
++endif
++
+ ifdef COMSPEC
+ TARGET := $(TARGET).exe
+ ARCHIVE := $(ARCHIVE).zip
+@@ -133,9 +140,7 @@ src/version.h: src/version
+ @echo '#ifndef VERSION_H' > ./src/version.h
+ @echo '#define VERSION_H' >> ./src/version.h
+ @echo '#include "version_number.h"' >> ./src/version.h
+- @echo -n '#define REVISION "' >> ./src/version.h
+- @date +"%Y%m%d" | tr -d '\n' >> ./src/version.h
+- @echo '"' >> ./src/version.h
++ @echo '#define REVISION "$(REVISION)"' >> ./src/version.h
+ @echo '#define VERSION_STRING "klystrack " VERSION " " REVISION' >> ./src/version.h
+ @echo '#endif' >> ./src/version.h
+
--- a/debian/patches/series 1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/series 2018-01-02 09:50:15.745957164 +0000
@@ -0,0 +1 @@
+reproducible-build.patch
More information about the pkg-multimedia-maintainers
mailing list