Bug#1039932: python-bitstring: please make the build reproducible

2023-06-29 Thread Chris Lamb
forwarded 1039932 https://github.com/scott-griffiths/bitstring/pull/269
thanks

I've forwarded this upstream here:

  https://github.com/scott-griffiths/bitstring/pull/269


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-



Bug#1039932: python-bitstring: please make the build reproducible

2023-06-29 Thread Chris Lamb
Source: python-bitstring
Version: 4.0.2-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-bitstring could not be built reproducibly.

This was because the documentation used the build year in the
documentation:

│ │ │ ├── ./usr/share/doc/python-bitstring-doc/html/bitarray.html
│ │ │ │ @@ -973,11 +973,11 @@
│ │ │ │   >previous |
│ │ │ │  bitstring 
4.0 documentation 
│ │ │ │Reference 
│ │ │ │  BitArray 
Class 
│ │ │ │
│ │ │ │  
│ │ │ │  
│ │ │ │ - Copyright 2023 - 2023, Scott Griffiths.
│ │ │ │ + Copyright 2023 - 2024, Scott Griffiths.
│ │ │ │  
│ │ │ │
│ │ │ │  

Patch attached that bases this value on SOURCE_DATE_EPOCH if
available.

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


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-
--- a/debian/patches/0002-reproducible-build.patch  1970-01-01 
01:00:00.0 +0100
--- b/debian/patches/0002-reproducible-build.patch  2023-06-29 
17:25:47.227191969 +0100
@@ -0,0 +1,22 @@
+Description: Make the build reproducible
+Author: Chris Lamb 
+Last-Update: 2023-06-29
+
+--- python-bitstring-4.0.2.orig/doc/conf.py
 python-bitstring-4.0.2/doc/conf.py
+@@ -1,8 +1,14 @@
+ # Configuration file for the Sphinx documentation builder.
+ #
++import os
++import time
+ import datetime
+ 
+-year = datetime.datetime.now().year
++import datetime
++
++year = datetime.datetime.utcfromtimestamp(
++int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
++).year
+ 
+ project = 'bitstring'
+ copyright = f'2006 - {year}, Scott Griffiths'
--- a/debian/patches/series 2023-06-29 17:24:24.615705188 +0100
--- b/debian/patches/series 2023-06-29 17:25:46.187198262 +0100
@@ -1 +1,2 @@
 0001-delete-mybinder.org-remote-refs-privacy-breach-logo.patch
+0002-reproducible-build.patch