Source: datalad
Version: 0.16.1-1
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0] we noticed that
datalad could not be built reproducibly.

This is because the generated manpages include the current build date.
A patch is attached that uses SOURCE_DATE_EPOCH if it is available.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
--- a/debian/patches/reproducible-build.patch   1969-12-31 16:00:00.000000000 
-0800
--- b/debian/patches/reproducible-build.patch   2022-04-28 11:45:44.965548810 
-0700
@@ -0,0 +1,27 @@
+Description: Make the build reproducible
+Author: Chris Lamb <la...@debian.org>
+Last-Update: 2022-04-28
+
+--- datalad-0.16.1.orig/_datalad_build_support/formatters.py
++++ datalad-0.16.1/_datalad_build_support/formatters.py
+@@ -7,7 +7,9 @@
+ 
+ import argparse
+ import datetime
++import os
+ import re
++import time
+ from textwrap import wrap
+ 
+ 
+@@ -34,7 +36,9 @@ class ManPageFormatter(argparse.HelpForm
+ 
+         self._prog = prog
+         self._section = 1
+-        self._today = datetime.date.today().strftime('%Y\\-%m\\-%d')
++        self._today = datetime.datetime.utcfromtimestamp(
++            int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
++        ).strftime('%Y\\-%m\\-%d')
+         self._ext_sections = ext_sections
+         self._version = version
+ 
--- a/debian/patches/series     2022-04-28 11:05:26.121641535 -0700
--- b/debian/patches/series     2022-04-28 11:45:43.945545461 -0700
@@ -2,3 +2,4 @@
 deb_setup_no_msgpack_and_duecredit
 deb_no_utf8
 python3.patch
+reproducible-build.patch

Reply via email to