summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVagrant Cascadian <vagrant@reproducible-builds.org>2023-12-06 16:01:41 -0800
committerVagrant Cascadian <vagrant@reproducible-builds.org>2023-12-06 16:01:41 -0800
commit76e713ad90e0fce5f1856f182413147165f0d92e (patch)
tree13ca8f1ccc71e7a7e798920e0881067b36b76063
parentfd0cbbd24f534d6a35cab0ee7261b285fb3d8cfb (diff)
Commit Debian 3.0 (quilt) metadataHEADdebian/3.5.0-1.1archive/debian/3.5.0-1.1master
[dgit (10.7+deb12u2) quilt-fixup]
-rw-r--r--debian/patches/make-the-documentation-build-reproducibl.patch52
-rw-r--r--debian/patches/series1
2 files changed, 53 insertions, 0 deletions
diff --git a/debian/patches/make-the-documentation-build-reproducibl.patch b/debian/patches/make-the-documentation-build-reproducibl.patch
new file mode 100644
index 0000000..f5f4357
--- /dev/null
+++ b/debian/patches/make-the-documentation-build-reproducibl.patch
@@ -0,0 +1,52 @@
+From: Chris Lamb <lamby@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 --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..b1d0f1e
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+make-the-documentation-build-reproducibl.patch