Source: pchar
Version: 1.5-2
Severity: wishlist
Tags: patch upstream
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps hostname
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Hi!

While working on the "reproducible builds" effort [1], we have noticed
that pchar could not be built reproducibly.
It embeds the build date/time and hostname into the binary.

The attached patch strips this to enable reproducible building.

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..13375f6
--- /dev/null
+++ b/debian/patches/reproducible-build.patch
@@ -0,0 +1,32 @@
+Author: Reiner Herrmann <rei...@reiner-h.de>
+Description: Strip build date and hostname to enable reproducible building
+
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -183,11 +183,9 @@
+ 	@echo '"WARRANTY OF ANY KIND, EXPRESS OR IMPLIED."' >> $@
+ 	@${ECHOQNL} >> $@
+ 	@echo ';' >> $@
+-	@echo "static char build[] = \"Built for $(host) by `hostname` on `date`\";" >> $@
+ 	@echo "static char dflags[] = \"$(DFLAGS)\";" >> $@
+ 	@echo "char *Version = version;" >> $@
+ 	@echo "char *Copyright = copyright;" >> $@
+-	@echo "char *Build = build;" >> $@
+ 	@echo "char *DFlags = dflags;" >> $@
+ 
+ FORCE:
+--- a/main.cc
++++ b/main.cc
+@@ -127,11 +127,10 @@
+ //
+ void VersionInfo()
+ {
+-    extern char *Version, *Copyright, *Build, *DFlags;
++    extern char *Version, *Copyright, *DFlags;
+ 
+     fprintf(stderr, "%s\n", Version);
+     fprintf(stderr, "%s\n", Copyright);
+-    fprintf(stderr, "%s\n", Build);
+     fprintf(stderr, "Compilation flags: %s\n", DFlags);
+ 
+ }
diff --git a/debian/patches/series b/debian/patches/series
index 71f1aa3..6cc8403 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
+reproducible-build.patch
 cxx-typo-getifinfo.patch
 cxx-const-charp-warning.patch
 destdir-install.patch

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to