From 76e713ad90e0fce5f1856f182413147165f0d92e Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Wed, 6 Dec 2023 16:01:41 -0800 Subject: Commit Debian 3.0 (quilt) metadata [dgit (10.7+deb12u2) quilt-fixup] --- .../make-the-documentation-build-reproducibl.patch | 52 ++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 53 insertions(+) create mode 100644 debian/patches/make-the-documentation-build-reproducibl.patch create mode 100644 debian/patches/series 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 +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 -- cgit v1.2.3