Package: xpdf Version: 3.04-1 Severity: wishlist Tags: patch User: reproducible-bui...@lists.alioth.debian.org Usertags: fileordering
Hi, While working on the "reproducible builds" effort [1], we have noticed that xpdf could not be built reproducibly. The linking step in the 'override_dh_auto_build' rules target uses a file ordering based on wildcards alone, which results in different binaries for different file orderings. The attached patch fixes this by making sure objects are linked in sorted order. Once applied, xpdf can be built reproducibly in our current experimental framework. Best regards, Sascha [1]: https://wiki.debian.org/ReproducibleBuilds
diff -Nru xpdf-3.04/debian/rules xpdf-3.04/debian/rules --- xpdf-3.04/debian/rules 2016-02-07 17:59:57.000000000 +0000 +++ xpdf-3.04/debian/rules 2016-03-27 11:21:10.000000000 +0000 @@ -14,8 +14,8 @@ files+=xpdf/XPDFApp xpdf/XPDFCore xpdf/XPDFTree xpdf/XPDFViewer xpdf/xpdf headers=xpdf/config.h xpdf/XPDFTreeP.h xpdf/about-text.h xpdf/*.xbm xpdf/xpdfIcon.xpm -sources=$(shell for file in $(files); do echo $$file.*; done) -objects=$(shell for file in $(files); do echo build/$$(basename $$file).o; done) +sources=$(sort $(shell for file in $(files); do echo $$file.*; done)) +objects=$(sort $(shell for file in $(files); do echo build/$$(basename $$file).o; done)) override_dh_clean: dh_clean @@ -30,7 +30,7 @@ mv build/parseargs.c build/parseargs.cc override_dh_auto_build: $(objects) - $(CXX) $(LDFLAGS) -o build/xpdf.real build/*.o $(LIBS) + $(CXX) $(LDFLAGS) -o build/xpdf.real $^ $(LIBS) %: dh ${@}