Source: armagetronad
Severity: normal
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

The current Reproducible Builds patch appears to be ineffective,
possibly due to checking for the presence of the debian/changelog when
it is not necessarily run from the top level source directory:

  
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/diffoscope-results/armagetronad.html

  /usr/games/armagetronad-dedicated.real

  0.2.9.1_alpha20210219
  vs.
  0.2.9.1_alpha20220325

Two patches are attached, one that could possibly be applied upstream,
and another that is a patch-on-patch applying the changes to
debian/patches.


Thanks for maintaining armagetronad!


live well,
  vagrant
From bac143a46de8763ec8a5ef05a3ec37e8f3ef5255 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Sat, 20 Feb 2021 02:54:04 +0000
Subject: [PATCH 1/2] batch/make/version: Use SOURCE_DATE_EPOCH to set date.

The minor_version may have a date string appended.

https://reproducible-builds.org/docs/source-date-epoch/
---
 batch/make/version | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/batch/make/version b/batch/make/version
index adc1c4a..3910d1c 100755
--- a/batch/make/version
+++ b/batch/make/version
@@ -15,7 +15,10 @@ fi
 # set version parts to defaults for CVS snapshot
 major_version=`cat ${srcdir}/major_version`
 minor_version_proto=`cat ${srcdir}/minor_version`
-DATE=`date +%Y%m%d`
+# Set DATE from SOURCE_DATE_EPOCH to enable reproducible builds:
+# https://reproducible-builds.org/docs/source-date-epoch/
+DATE_FMT='+%Y%m%d'
+DATE=$(date -u -d "@${SOURCE_DATE_EPOCH}" "${DATE_FMT}"  2>/dev/null || date -u -r "${SOURCE_DATE_EPOCH}" "${DATE_FMT}" 2>/dev/null || date -u "${DATE_FMT}")
 
 #echo $major_version
 #echo $minor_version
-- 
2.30.1

From e7c32fed8c8efec8e61d47224f82cee834222786 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Sat, 20 Feb 2021 02:59:26 +0000
Subject: [PATCH 2/2] Update reproducible build patch.

---
 debian/patches/reproducible_build.patch | 42 ++++++++++++++++---------
 1 file changed, 27 insertions(+), 15 deletions(-)

diff --git a/debian/patches/reproducible_build.patch b/debian/patches/reproducible_build.patch
index c140622..784e4f9 100644
--- a/debian/patches/reproducible_build.patch
+++ b/debian/patches/reproducible_build.patch
@@ -1,19 +1,31 @@
-Description: Make the build reproducible
-Author: Chris Lamb <la...@debian.org>
-Last-Update: 2020-11-16
+From bac143a46de8763ec8a5ef05a3ec37e8f3ef5255 Mon Sep 17 00:00:00 2001
+From: Vagrant Cascadian <vagr...@reproducible-builds.org>
+Date: Sat, 20 Feb 2021 02:54:04 +0000
+Subject: [PATCH] batch/make/version: Use SOURCE_DATE_EPOCH to set date.
 
---- armagetronad-0.2.9.0.1.orig/batch/make/version
-+++ armagetronad-0.2.9.0.1/batch/make/version
-@@ -12,6 +12,12 @@ if test "${CI_COMMIT_REF_PROTECTED}" = "
-     exit 0
- fi
- 
-+# if we're building from a Debian package, that is our version
-+if test -f debian/changelog; then
-+    dpkg-parsechangelog -SVersion
-+    exit 0
-+fi
-+
+The minor_version may have a date string appended.
+
+https://reproducible-builds.org/docs/source-date-epoch/
+---
+ batch/make/version | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/batch/make/version b/batch/make/version
+index adc1c4a..3910d1c 100755
+--- a/batch/make/version
++++ b/batch/make/version
+@@ -15,7 +15,10 @@ fi
  # set version parts to defaults for CVS snapshot
  major_version=`cat ${srcdir}/major_version`
  minor_version_proto=`cat ${srcdir}/minor_version`
+-DATE=`date +%Y%m%d`
++# Set DATE from SOURCE_DATE_EPOCH to enable reproducible builds:
++# https://reproducible-builds.org/docs/source-date-epoch/
++DATE_FMT='+%Y%m%d'
++DATE=$(date -u -d "@${SOURCE_DATE_EPOCH}" "${DATE_FMT}"  2>/dev/null || date -u -r "${SOURCE_DATE_EPOCH}" "${DATE_FMT}" 2>/dev/null || date -u "${DATE_FMT}")
+ 
+ #echo $major_version
+ #echo $minor_version
+-- 
+2.30.1
+
-- 
2.30.1

Attachment: signature.asc
Description: PGP signature

Reply via email to