[SCM] pd-hid/master: Made build reproducible

umlaeute at users.alioth.debian.org umlaeute at users.alioth.debian.org
Fri Jun 10 20:37:17 UTC 2016


The following commit has been merged in the master branch:
commit a32bef6430048f104f9440735035b2f2c18ee528
Author: IOhannes m zmölnig <zmoelnig at umlautQ.umlaeute.mur.at>
Date:   Fri Jun 10 22:34:06 2016 +0200

    Made build reproducible
    
    by replacing __DATE__/__TIME__ with values from d/changelog

diff --git a/debian/patches/reproducible.patch b/debian/patches/reproducible.patch
new file mode 100644
index 0000000..aae4365
--- /dev/null
+++ b/debian/patches/reproducible.patch
@@ -0,0 +1,19 @@
+Description: replace __DATE__/__TIME__ with fixed values to make build reproducible
+Author: IOhannes m zmölnig
+Last-Update: 2016-06-10
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- pd-hid.orig/hid.c
++++ pd-hid/hid.c
+@@ -445,7 +445,10 @@
+   {
+ 	  post("[hid] %d.%d, written by Hans-Christoph Steiner <hans at eds.org>",
+ 			 HID_MAJOR_VERSION, HID_MINOR_VERSION);  
+-	  post("\tcompiled on "__DATE__" at "__TIME__ " ");
++#ifndef PD_TIMESTAMP_STRING
++# define PD_TIMESTAMP_STRING "compiled on "__DATE__" at "__TIME__
++#endif
++	  post("\t"PD_TIMESTAMP_STRING);
+   }
+ 
+ #if !defined(__linux__) && !defined(__APPLE__)
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..038ee28
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+reproducible.patch
diff --git a/debian/rules b/debian/rules
index 0df191c..dc00d38 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,9 +4,18 @@ LIBRARY_NAME = hid
 PACKAGE = pd-$(LIBRARY_NAME)
 pkglibdir = /usr/lib/pd/extra
 
+PD_DATE:=$(shell LANG=C LC_ALL=C date -u -d "$$(dpkg-parsechangelog -SDate)" +"%Y/%m/%d")
+PD_TIME:=$(shell LANG=C LC_ALL=C date -u -d "$$(dpkg-parsechangelog -SDate)" +"%H:%M:%S UTC")
+VERSION_CPPFLAGS = -DPD_TIMESTAMP_STRING='\"compiled on $(PD_DATE) at $(PD_TIME)\"' -DPD_DATE='\"$(PD_DATE)\"' -DPD_TIME='\"$(PD_TIME)\"'
+
 %:
 	dh $@ --buildsystem=makefile
 
+override_dh_auto_build:
+	dh_auto_build -- \
+                CFLAGS="-DPD -fPIC $(CFLAGS) $(CPPFLAGS) $(VERSION_CPPFLAGS) -I/usr/include/pd" \
+                LDFLAGS="-Wl,--export-dynamic  -shared -fPIC $(LDFLAGS)"
+
 override_dh_auto_install:
 	dh_auto_install -- prefix=/usr pkglibdir=$(pkglibdir)
 # replace license file with link to the Debian license file

-- 
pd-hid packaging



More information about the pkg-multimedia-commits mailing list