From e812a3aea30e6bbd2b1d318c5fe23829f5f2eeb8 Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Fri, 11 Aug 2023 13:20:57 -0400 Subject: [PATCH] add upstream sphinx fix --- ...add_html_cache_busting-on-sphinx-7.1.patch | 29 +++++++++++++++++++ python-matplotlib.spec | 4 +++ 2 files changed, 33 insertions(+) create mode 100644 0005-Disable-add_html_cache_busting-on-sphinx-7.1.patch diff --git a/0005-Disable-add_html_cache_busting-on-sphinx-7.1.patch b/0005-Disable-add_html_cache_busting-on-sphinx-7.1.patch new file mode 100644 index 0000000..15f6913 --- /dev/null +++ b/0005-Disable-add_html_cache_busting-on-sphinx-7.1.patch @@ -0,0 +1,29 @@ +diff -up matplotlib-3.7.2/doc/conf.py.orig matplotlib-3.7.2/doc/conf.py +--- matplotlib-3.7.2/doc/conf.py.orig 2023-08-11 13:11:52.705650329 -0400 ++++ matplotlib-3.7.2/doc/conf.py 2023-08-11 13:13:04.662668088 -0400 +@@ -20,6 +20,8 @@ import sys + from urllib.parse import urlsplit, urlunsplit + import warnings + ++import sphinx ++ + import matplotlib + + from datetime import timezone +@@ -347,6 +349,9 @@ def add_html_cache_busting(app, pagename + This adds the Matplotlib version as a query to the link reference in the + HTML, if the path is not absolute (i.e., it comes from the `_static` + directory) and doesn't already have a query. ++ ++ .. note:: Sphinx 7.1 provides asset checksums; so this hook only runs on ++ Sphinx 7.0 and earlier. + """ + from sphinx.builders.html import Stylesheet, JavaScript + +@@ -723,4 +728,5 @@ def setup(app): + else: + bld_type = 'rel' + app.add_config_value('releaselevel', bld_type, 'env') +- app.connect('html-page-context', add_html_cache_busting, priority=1000) ++ if sphinx.version_info[:2] < (7, 1): ++ app.connect('html-page-context', add_html_cache_busting, priority=1000) diff --git a/python-matplotlib.spec b/python-matplotlib.spec index 1278668..bcfdd9e 100644 --- a/python-matplotlib.spec +++ b/python-matplotlib.spec @@ -60,6 +60,10 @@ Patch1003: 0003-Set-FreeType-version-to-%{ftver}-and-update-tolerances.patc # https://github.com/matplotlib/matplotlib/pull/21190#issuecomment-1223271888 Patch0001: 0004-Use-old-stride_windows-implementation-on-32-bit-x86.patch +# Fix issue with Sphinx 7.1+ +# https://github.com/matplotlib/matplotlib/commit/a01fbaeba4bdefc2ff6782bac73a9a03b8a9bce7 +Patch0002: 0005-Disable-add_html_cache_busting-on-sphinx-7.1.patch + BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: glibc-langpack-en