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

umlaeute at users.alioth.debian.org umlaeute at users.alioth.debian.org
Fri Jun 10 20:11:06 UTC 2016


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

    Made build reproducible

diff --git a/debian/patches/reproducible_builddate.patch b/debian/patches/reproducible_builddate.patch
new file mode 100644
index 0000000..cfd2e11
--- /dev/null
+++ b/debian/patches/reproducible_builddate.patch
@@ -0,0 +1,109 @@
+Description: allow to replace __DATE__/__TIME__ by reproducible balues
+Author: IOhannes m zmölnig
+Last-Update: 2016-06-10
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- pd-hcs.orig/ce_path.c
++++ pd-hcs/ce_path.c
+@@ -105,7 +105,10 @@
+                     gensym("rewind"), 0);
+ 
+     post("[ce_path] %s", 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);
+     post("\tcompiled against Pd version %d.%d.%d", PD_MAJOR_VERSION, 
+          PD_MINOR_VERSION, PD_BUGFIX_VERSION);
+ }
+--- pd-hcs.orig/classpath.c
++++ pd-hcs/classpath.c
+@@ -107,7 +107,10 @@
+ 	{
+ 		post("[classpath] %s",version);  
+ 		post("\twritten by Hans-Christoph Steiner <hans at at.or.at>");
+-		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);
+ 		post("\tcompiled against Pd version %d.%d.%d", PD_MAJOR_VERSION, 
+ 			 PD_MINOR_VERSION, PD_BUGFIX_VERSION);
+ 	}
+--- pd-hcs.orig/group.c
++++ pd-hcs/group.c
+@@ -217,7 +217,10 @@
+ 	{
+ 		post("[group] %s",version);  
+ 		post("\twritten by Hans-Christoph Steiner <hans at at.or.at>");
+-		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);
+ 	}
+ 	group_instance_count++;
+ 
+--- pd-hcs.orig/helppath.c
++++ pd-hcs/helppath.c
+@@ -129,7 +129,10 @@
+ 					A_DEFSYMBOL, 0);
+ 
+     post("[helppath] %s", 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);
+     post("\tcompiled against Pd version %d.%d.%d", PD_MAJOR_VERSION, 
+          PD_MINOR_VERSION, PD_BUGFIX_VERSION);
+ }
+--- pd-hcs.orig/passwd.c
++++ pd-hcs/passwd.c
+@@ -166,7 +166,10 @@
+ 	{
+ 		post("[passwd] %s",version);  
+ 		post("\twritten by Hans-Christoph Steiner <hans at at.or.at>");
+-		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);
+ 	}
+ 	passwd_instance_count++;
+ 
+--- pd-hcs.orig/stat.c
++++ pd-hcs/stat.c
+@@ -268,7 +268,10 @@
+ 	{
+ 		post("[stat] %s",version);  
+ 		post("\twritten by Hans-Christoph Steiner <hans at at.or.at>");
+-		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);
+ 	}
+ 	stat_instance_count++;
+ 
+--- pd-hcs.orig/version.c
++++ pd-hcs/version.c
+@@ -55,8 +55,15 @@
+ 	SETFLOAT(version_data + 1, (t_float) minor);
+ 	SETFLOAT(version_data + 2, (t_float) bugfix);
+ 	SETSYMBOL(version_data + 3, gensym(PD_TEST_VERSION));
+-	SETSYMBOL(version_data + 4, gensym(__DATE__));
+-	SETSYMBOL(version_data + 5, gensym(__TIME__));
++#ifndef PD_DATE
++# define PD_DATE __DATE__
++#endif
++#ifndef PD_TIME
++# define PD_TIME __TIME__
++#endif
++		post("\t"PD_TIMESTAMP_STRING);
++	SETSYMBOL(version_data + 4, gensym(PD_DATE));
++	SETSYMBOL(version_data + 5, gensym(PD_TIME));
+ 	
+ 	outlet_list(x->x_obj.ob_outlet, &s_list, 6, version_data);
+ }
diff --git a/debian/patches/series b/debian/patches/series
index e69de29..d58e59a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -0,0 +1 @@
+reproducible_builddate.patch
diff --git a/debian/rules b/debian/rules
index 0306720..55f795f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,12 +4,17 @@ LIBRARY_NAME = hcs
 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) -I/usr/include/pd" \
+                CFLAGS="-DPD -fPIC $(CFLAGS) $(CPPFLAGS) $(VERSION_CPPFLAGS) -I/usr/include/pd" \
                 LDFLAGS="-Wl,--export-dynamic  -shared -fPIC $(LDFLAGS)"
 
 

-- 
pd-hcs packaging



More information about the pkg-multimedia-commits mailing list