Source: python-sybil
Version: 1.2.0-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
python-sybil could not be built reproducibly.

This is because it used the current build year in the documentation.
Patch attached that uses SOURCE_DATE_EPOCH [1] instead.

 [0] https://reproducible-builds.org/
 [1] https://reproducible-builds.org/specs/source-date-epoch/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
--- a/debian/patches/0002-Reproducible-build.patch      1970-01-01 
01:00:00.000000000 +0100
--- b/debian/patches/0002-Reproducible-build.patch      2019-11-15 
10:31:54.016310434 +0000
@@ -0,0 +1,23 @@
+Description: Make the build reproducible
+Author: Chris Lamb <la...@debian.org>
+Last-Update: 2019-11-15
+
+--- python-sybil-1.2.0.orig/docs/conf.py
++++ python-sybil-1.2.0/docs/conf.py
+@@ -1,5 +1,5 @@
+ # -*- coding: utf-8 -*-
+-import os, pkg_resources, datetime, sys
++import os, pkg_resources, datetime, sys, time
+ 
+ on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
+ 
+@@ -28,7 +28,8 @@ extensions = [
+ source_suffix = '.rst'
+ master_doc = 'index'
+ project = 'sybil'
+-copyright = '2017 - %s Chris Withers' % datetime.datetime.now().year
++build_date = 
datetime.datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', 
time.time())))
++copyright = '2017 - %s Chris Withers' % build_date.year
+ version = release = pkg_resources.get_distribution(project).version
+ exclude_patterns = [
+     'description.rst',
--- a/debian/patches/series     2019-11-15 10:29:22.334203532 +0000
--- b/debian/patches/series     2019-11-15 10:31:52.264279198 +0000
@@ -1 +1,2 @@
 0001-Use-local-intersphinx-files.patch
+0002-Reproducible-build.patch

Reply via email to