Source: libpgm
Version: 5.1.118-1~dfsg-2
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps

Hi!

While working on the “reproducible builds” effort [1], we have noticed
that libpgm could not be built reproducibly.

The attached patch adds support for SOURCE_DATE_EPOCH to set the
build timestamp. Once applied, libpgm can be built reproducibly in
our current experimental framework.

 [1]: https://wiki.debian.org/ReproducibleBuilds

-- 
Lunar                                .''`. 
lu...@debian.org                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   
diff -Nru libpgm-5.1.118-1~dfsg/debian/changelog libpgm-5.1.118-1~dfsg/debian/changelog
--- libpgm-5.1.118-1~dfsg/debian/changelog	2015-01-17 20:03:11.000000000 +0100
+++ libpgm-5.1.118-1~dfsg/debian/changelog	2016-02-15 19:22:58.000000000 +0100
@@ -1,3 +1,9 @@
diff -Nru libpgm-5.1.118-1~dfsg/debian/patches/series libpgm-5.1.118-1~dfsg/debian/patches/series
--- libpgm-5.1.118-1~dfsg/debian/patches/series	2014-10-20 22:03:15.000000000 +0200
+++ libpgm-5.1.118-1~dfsg/debian/patches/series	2016-02-15 19:25:11.000000000 +0100
@@ -1 +1,2 @@
 hurd-ftbfs-fix.patch
+support_source_date_epoch.patch
diff -Nru libpgm-5.1.118-1~dfsg/debian/patches/support_source_date_epoch.patch libpgm-5.1.118-1~dfsg/debian/patches/support_source_date_epoch.patch
--- libpgm-5.1.118-1~dfsg/debian/patches/support_source_date_epoch.patch	1970-01-01 01:00:00.000000000 +0100
+++ libpgm-5.1.118-1~dfsg/debian/patches/support_source_date_epoch.patch	2016-02-15 19:38:54.000000000 +0100
@@ -0,0 +1,20 @@
+Description: add support for SOURCE_DATE_EPOCH
+ Allow to override the recorded build time by setting SOURCE_DATE_EPOCH
+ in the environment. More details can be found on:
+ https://reproducible-builds.org/specs/source-date-epoch/
+Author: Jérémy Bobbio <lu...@debian.org>
+
+--- libpgm-5.1.118-1~dfsg.orig/openpgm/pgm/version_generator.py
++++ libpgm-5.1.118-1~dfsg/openpgm/pgm/version_generator.py
+@@ -4,8 +4,9 @@ import os
+ import platform
+ import time
+ 
+-build_date = time.strftime ("%Y-%m-%d")
+-build_time = time.strftime ("%H:%M:%S")
++timestamp = time.gmtime (int (os.getenv ('SOURCE_DATE_EPOCH', time.time ())))
++build_date = time.strftime ("%Y-%m-%d", timestamp)
++build_time = time.strftime ("%H:%M:%S", timestamp)
+ build_rev = filter (str.isdigit, "$Revision: 1369 $")
+ 
+ print """

Attachment: signature.asc
Description: Digital signature

Reply via email to