Source: libgcrypt20
Version: 1.6.4-4
Severity: wishlist
Tag: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-bui...@lists.alioth.debian.org

Hi!

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

The attached patch adds support for SOURCE_DATE_EPOCH to set the value
of BUILD_TIMESTAMP defined in the configure script. Once applied,
libgcrypt20 is nearly reproducible in our current experimental
framework—their might be remaining timestamps in the PDF documentation.

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

-- 
Lunar                                .''`. 
lu...@debian.org                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   
diff --git a/debian/control b/debian/control
index ff31343..e3a19c4 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Uploaders: Andreas Metzler <ametz...@debian.org>,
  Eric Dorland <e...@debian.org>, James Westby <jw+deb...@jameswestby.net>,
  Simon Josefsson <si...@josefsson.org>
 Build-Depends: debhelper (>= 9.20150628),
- libgpg-error-dev (>= 1.11), autotools-dev
+ libgpg-error-dev (>= 1.11), autotools-dev, dh-autoreconf
 Build-Depends-Indep: texlive-latex-base, texlive-generic-recommended,
  texinfo (>= 4.6-0)
 Standards-Version: 3.9.6
diff --git a/debian/patches/30_support_source_date_epoch.diff b/debian/patches/30_support_source_date_epoch.diff
new file mode 100644
index 0000000..8e43921
--- /dev/null
+++ b/debian/patches/30_support_source_date_epoch.diff
@@ -0,0 +1,18 @@
+Description: support setting BUILD_TIMESTAMP using SOURCE_DATE_EPOCH
+ Enable reproducible builds by supporting setting the value of BUILD_TIMESTAMP
+ through the SOURCE_DATE_EPOCH environment variable. More information at:
+ https://reproducible-builds.org/specs/source-date-epoch/
+Author: Jérémy Bobbio <lu...@debian.org>
+Last-Update: 2016-01-23
+
+--- libgcrypt20-1.6.4.orig/configure.ac
++++ libgcrypt20-1.6.4/configure.ac
+@@ -1993,7 +1993,7 @@ changequote([,])dnl
+ BUILD_FILEVERSION="${BUILD_FILEVERSION}mym4_revision_dec"
+ AC_SUBST(BUILD_FILEVERSION)
+ 
+-BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`
++BUILD_TIMESTAMP=`date -d"@$SOURCE_DATE_EPOCH" -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`
+ AC_SUBST(BUILD_TIMESTAMP)
+ AC_DEFINE_UNQUOTED(BUILD_TIMESTAMP, "$BUILD_TIMESTAMP",
+                    [The time this package was configured for a build])
diff --git a/debian/patches/series b/debian/patches/series
index d5154e9..2f0a91b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 12_lessdeps_libgcrypt-config.diff
 15_multiarchpath_in_-L.diff
 20_fedora_libgcrypt-1.6.3-aliasing.patch
+30_support_source_date_epoch.diff
diff --git a/debian/rules b/debian/rules
index 27614f9..1b137a5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -48,4 +48,4 @@ override_dh_gencontrol:
 	dh_gencontrol --remaining-packages
 
 %:
-	dh $@ --parallel --with autotools_dev
+	dh $@ --parallel --with autoreconf --with autotools_dev

Attachment: signature.asc
Description: Digital signature

Reply via email to