On 2022-02-15, Chris Lamb wrote:
> This is because the documentation embedded the current build year. A
> patch is attached that optionally uses SOURCE_DATE_EPOCH [1] as the
> source of this value instead.

I have uploaded an NMU to DELAYED/10 using dgit, applying the fix that
was merged upstream, with the following changes:

diff -Nru mpl-sphinx-theme-3.5.0/debian/changelog 
mpl-sphinx-theme-3.5.0/debian/changelog
--- mpl-sphinx-theme-3.5.0/debian/changelog     2022-06-21 20:36:30.000000000 
-0700
+++ mpl-sphinx-theme-3.5.0/debian/changelog     2023-12-06 15:59:56.000000000 
-0800
@@ -1,3 +1,12 @@
+mpl-sphinx-theme (3.5.0-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+
+  [ Chris Lamb ]
+  * Make the documentation build reproducibly (Closes: #1005826)
+
+ -- Vagrant Cascadian <vagr...@reproducible-builds.org>  Wed, 06 Dec 2023 
15:59:56 -0800
+
 mpl-sphinx-theme (3.5.0-1) unstable; urgency=medium
 
   * New upstream release
diff -Nru 
mpl-sphinx-theme-3.5.0/debian/patches/make-the-documentation-build-reproducibl.patch
 
mpl-sphinx-theme-3.5.0/debian/patches/make-the-documentation-build-reproducibl.patch
--- 
mpl-sphinx-theme-3.5.0/debian/patches/make-the-documentation-build-reproducibl.patch
        1969-12-31 16:00:00.000000000 -0800
+++ 
mpl-sphinx-theme-3.5.0/debian/patches/make-the-documentation-build-reproducibl.patch
        2023-12-06 15:59:56.000000000 -0800
@@ -0,0 +1,52 @@
+From: Chris Lamb <la...@debian.org>
+Date: Tue, 15 Feb 2022 13:49:50 -0800
+X-Dgit-Generated: 3.5.0-1.1 671e8647bfcbc3f8fccec0ef82441394d23240d6
+Subject: Make the documentation build reproducibly (Closes: #1005826)
+
+Whilst working on the Reproducible Builds effort [0], I noticed that
+mpl-sphinx-theme could not be built reproducibly.
+
+This is because the documentation embedded the current build year. This patch
+changes the behaviour of the Sphinx documentation so that it can that
+optionally use SOURCE_DATE_EPOCH [1] as the source of this value instead.
+
+I originally filed this in Debian as bug #1005826 [2].
+
+ [0] https://reproducible-builds.org/
+ [1] https://reproducible-builds.org/specs/source-date-epoch/
+ [2] https://bugs.debian.org/1005826
+
+Bug-Upstream: https://github.com/matplotlib/mpl-sphinx-theme/pull/25
+Origin: 
https://github.com/matplotlib/mpl-sphinx-theme/commit/5467339267c874338c41364965a99b2dadb8d7cd
+
+---
+
+diff --git a/docs/conf.py b/docs/conf.py
+index d77eefc..9dbf3dd 100644
+--- a/docs/conf.py
++++ b/docs/conf.py
+@@ -1,3 +1,5 @@
++import os
++import time
+ import datetime
+ 
+ # Configuration file for the Sphinx documentation builder for
+@@ -6,11 +8,17 @@ import datetime
+ # Release mode enables optimizations and other related options.
+ is_release_build = tags.has('release')  # noqa
+ 
++# Parse year using SOURCE_DATE_EPOCH, falling back to current time.
++# https://reproducible-builds.org/specs/source-date-epoch/
++build_date = datetime.datetime.utcfromtimestamp(
++    int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
++)
++
+ # -- Project information -----------------------------------------------------
+ 
+ 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"
+ 
diff -Nru mpl-sphinx-theme-3.5.0/debian/patches/series 
mpl-sphinx-theme-3.5.0/debian/patches/series
--- mpl-sphinx-theme-3.5.0/debian/patches/series        1969-12-31 
16:00:00.000000000 -0800
+++ mpl-sphinx-theme-3.5.0/debian/patches/series        2023-12-06 
15:59:56.000000000 -0800
@@ -0,0 +1 @@
+make-the-documentation-build-reproducibl.patch


live well,
  vagrant

Attachment: signature.asc
Description: PGP signature

Reply via email to