Source: garmin-plugin
Version: 0.3.23-2
Severity: wishlist
Tags: patch upstream
User: [email protected]
Usertags: fileordering
X-Debbugs-Cc: [email protected]

Hi!

While working on the "reproducible builds" effort [1], we have noticed
that garmin-plugin could not be built reproducibly.
During build it links objects in non-deterministic order.

The attached patch fixes this by sorting the list of source files.

Regards,
 Reiner

[1]: https://wiki.debian.org/ReproducibleBuilds
diff --git a/debian/patches/reproducible-build.patch b/debian/patches/reproducible-build.patch
new file mode 100644
index 0000000..e07de48
--- /dev/null
+++ b/debian/patches/reproducible-build.patch
@@ -0,0 +1,17 @@
+Author: Reiner Herrmann <[email protected]>
+Description: Sort source files so that objects are linked deterministically
+
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -26,9 +26,9 @@
+ LINK_lib = rm -f $@ && ar rcs $@ $^
+ COMPILE_cpp = $(GCC) $(CFLAGS) -o $@ -c $< $(MAKEDEP) $(INCLUDES)
+ 
+-CPP_FILES := $(wildcard *.cpp) \
++CPP_FILES := $(sort $(wildcard *.cpp) \
+         $(wildcard TcxBuilder/*.cpp) \
+-        $(wildcard fit/*.cpp)
++        $(wildcard fit/*.cpp))
+         
+ OBJ_FILES := $(CPP_FILES:.cpp=.o)  
+ DEP_FILES := $(CPP_FILES:.cpp=.d)  
diff --git a/debian/patches/series b/debian/patches/series
index a70fc17..1830500 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 libusb-1.0.patch
+reproducible-build.patch

Attachment: signature.asc
Description: PGP signature

Reply via email to