On Sun, Jun 26, 2016 at 05:58:37PM +0200, Reiner Herrmann wrote:
> The attached patch makes it honour SOURCE_DATE_EPOCH, if it is
> available, to get a deterministic timestamp.

Sorry, the patch contained one line too much.
Updated patch attached.
diff --git a/debian/patches/reproducible_build.patch b/debian/patches/reproducible_build.patch
new file mode 100644
index 0000000..24cf4ff
--- /dev/null
+++ b/debian/patches/reproducible_build.patch
@@ -0,0 +1,23 @@
+Author: Reiner Herrmann <rei...@reiner-h.de>
+Description: Honour SOURCE_DATE_EPOCH for embedded timestamp, if it is set
+
+--- a/inc/Marpa/R2/Build_Me.pm
++++ b/inc/Marpa/R2/Build_Me.pm
+@@ -83,7 +83,7 @@
+ 
+ ##no critic(ValuesAndExpressions::RequireInterpolationOfMetachars)
+     $text .= q{use vars qw($TIMESTAMP)} . qq{;\n};
+-    $text .= q{$TIMESTAMP='} . localtime()->datetime . qq{';\n};
++    $text .= q{$TIMESTAMP='} . (gmtime($ENV{SOURCE_DATE_EPOCH}) || localtime())->datetime . qq{';\n};
+ ##use critic
+ 
+     for my $package (@use_packages) {
+@@ -104,7 +104,7 @@
+ 
+ ##no critic(ValuesAndExpressions::RequireInterpolationOfMetachars)
+     $text .= q{use vars qw($TIMESTAMP)} . qq{;\n};
+-    $text .= q{$TIMESTAMP='} . localtime()->datetime . qq{';\n};
++    $text .= q{$TIMESTAMP='} . (gmtime($ENV{SOURCE_DATE_EPOCH}) || localtime())->datetime . qq{';\n};
+ ##use critic
+ 
+     for my $package (@use_packages) {
diff --git a/debian/patches/series b/debian/patches/series
index f8d2256..b4a3780 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 1001_xs_boot_workaround.patch
 2001_libmarpa_external_linkage.patch
+reproducible_build.patch

Attachment: signature.asc
Description: Digital signature

Reply via email to