Bug#1067098: mpl-sphinx-theme: please make the build reproducible
Chris Lamb
lamby at debian.org
Mon Mar 18 13:02:20 GMT 2024
Source: mpl-sphinx-theme
Version: 3.5.0-2
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org
Hi,
Whilst working on the Reproducible Builds effort [0], we noticed that
mpl-sphinx-theme could not be built reproducibly.
This is because it embedded the build date in the documentation:
│ │ │ ├── ./usr/share/doc/python-mpl-sphinx-theme-doc/html/genindex.html
│ │ │ │ @@ -184,15 +184,15 @@
│ │ │ │
│ │ │ │ <script src="_static/js/index.be7d3bbb2ef33a8344ce.js"></script>
│ │ │ │ <footer class="footer mt-5 mt-md-0">
│ │ │ │ <div class="container">
│ │ │ │
│ │ │ │ <div class="footer-item">
│ │ │ │ <p class="copyright">
│ │ │ │ - © Copyright 2024 - 2024 The Matplotlib development team.<br>
│ │ │ │ + © Copyright 2024 - 2025 The Matplotlib development team.<br>
│ │ │ │ </p>
(Etc.)
Patch attached.
[0] https://reproducible-builds.org/
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` lamby at debian.org / chris-lamb.co.uk
`-
-------------- next part --------------
--- a/debian/patches/reproducible-build.patch 1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/reproducible-build.patch 2024-03-18 12:59:19.650123651 +0000
@@ -0,0 +1,28 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2024-03-18
+
+--- mpl-sphinx-theme-3.5.0.orig/docs/conf.py
++++ mpl-sphinx-theme-3.5.0/docs/conf.py
+@@ -1,5 +1,12 @@
++import os
++import time
+ import datetime
+
++build_date = datetime.datetime.fromtimestamp(
++ int(os.environ.get('SOURCE_DATE_EPOCH', time.time())),
++ tz=datetime.timezone.utc,
++)
++
+ # Configuration file for the Sphinx documentation builder for
+ # matplotlib projects.
+
+@@ -10,7 +17,7 @@ is_release_build = tags.has('release')
+
+ project = "Matplotlib Sphinx Theme"
+ copyright = (
+- f"2012 - {datetime.datetime.now().year} The Matplotlib development team"
++ f"2012 - {build_date.year} The Matplotlib development team"
+ )
+ author = "Matplotlib Developers"
+
--- a/debian/patches/series 1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/series 2024-03-18 12:59:16.218124536 +0000
@@ -0,0 +1 @@
+reproducible-build.patch
More information about the Reproducible-bugs
mailing list