Source: terminix
Version: 1.3.0-5
Severity: wishlist
Tags: patch upstream
User: reproducible-bui...@lists.alioth.debian.org
Usertags: fileordering
X-Debbugs-Cc: reproducible-bui...@lists.alioth.debian.org

Hi!

While working on the "reproducible builds" effort [1], we have noticed
that terminix could not be built reproducibly.
Source files are linked in non-deterministic order.

The attached patch fixes this by sorting the file list.

Regards,
 Reiner

[1]: https://wiki.debian.org/ReproducibleBuilds
diff --git a/debian/patches/02_reproducible-build.patch b/debian/patches/02_reproducible-build.patch
new file mode 100644
index 0000000..1cacd85
--- /dev/null
+++ b/debian/patches/02_reproducible-build.patch
@@ -0,0 +1,12 @@
+Author: Reiner Herrmann <rei...@reiner-h.de>
+Description: Sort source files for deterministic linking order
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,5 +1,5 @@
+ bin_PROGRAMS = terminix
+-terminix_SOURCES = $(shell find $(srcdir)/source -name '*\.d')
++terminix_SOURCES = $(shell find $(srcdir)/source -name '*\.d' | LC_ALL=C sort)
+ terminix.o: $(terminix_SOURCES)
+ 	$(DC) $(DCFLAGS) $(GTKD_CFLAGS) $(GTKD_LIBS) -c $^ -of$@
+ # libx11 is a C library, so we need to precede with -L
diff --git a/debian/patches/series b/debian/patches/series
index 8e87075..3590201 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 01_32bit-support.patch
+02_reproducible-build.patch

Attachment: signature.asc
Description: PGP signature

Reply via email to