summaryrefslogtreecommitdiffstats
path: root/debian/patches
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--debian/patches/disable_js_version_check.diff21
-rw-r--r--debian/patches/highlight_search_terms.diff120
-rw-r--r--debian/patches/intersphinx_local.diff51
-rw-r--r--debian/patches/move_sphinxcontrib_to_extras_require.diff40
-rw-r--r--debian/patches/no_external_css.diff21
-rw-r--r--debian/patches/pygments_2.14.diff111
-rw-r--r--debian/patches/remove_contrib_references.diff98
-rw-r--r--debian/patches/series12
-rw-r--r--debian/patches/skip_tests_jsmath.diff36
-rw-r--r--debian/patches/skip_tests_network.diff63
-rw-r--r--debian/patches/skip_tests_serializinghtml.diff28
-rw-r--r--debian/patches/support_old_search_indexes.diff35
-rw-r--r--debian/patches/use_packaged_mathjax.diff20
13 files changed, 656 insertions, 0 deletions
diff --git a/debian/patches/disable_js_version_check.diff b/debian/patches/disable_js_version_check.diff
new file mode 100644
index 0000000..a59f03b
--- /dev/null
+++ b/debian/patches/disable_js_version_check.diff
@@ -0,0 +1,21 @@
+From: Dmitry Shachnev <mitya57@debian.org>
+Date: Thu, 8 Oct 2015 13:58:04 -0700
+Subject: disable a test that checks versions of JS libraries
+
+Forwarded: not-needed
+---
+ tests/test_theming.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tests/test_theming.py b/tests/test_theming.py
+index 21382d8..2a3b027 100644
+--- a/tests/test_theming.py
++++ b/tests/test_theming.py
+@@ -57,6 +57,7 @@ def test_theme_api(app, status, warning):
+ assert not os.path.exists(themedir)
+
+
++@pytest.mark.skip('In Debian we use packaged JS libraries')
+ @pytest.mark.sphinx(testroot='tocdepth') # a minimal root
+ def test_js_source(app, status, warning):
+ # Now sphinx provides non-minified JS files for jquery.js and underscore.js
diff --git a/debian/patches/highlight_search_terms.diff b/debian/patches/highlight_search_terms.diff
new file mode 100644
index 0000000..5aa9159
--- /dev/null
+++ b/debian/patches/highlight_search_terms.diff
@@ -0,0 +1,120 @@
+From: Dmitry Shachnev <mitya57@debian.org>
+Date: Sun, 23 Oct 2022 22:38:55 +0300
+Subject: Highlight all search terms on search results page
+
+SphinxHighlight.highlightSearchWords() is called on DOMContentLoaded
+event, and it will not highlight page fragments loaded asynchronously.
+
+So we should highlight all such fragments manually.
+
+Forwarded: https://github.com/sphinx-doc/sphinx/pull/10930
+---
+ sphinx/themes/basic/static/searchtools.js | 20 ++++++++++++++------
+ sphinx/themes/basic/static/sphinx_highlight.js | 20 ++++++++++++++------
+ 2 files changed, 28 insertions(+), 12 deletions(-)
+
+diff --git a/sphinx/themes/basic/static/searchtools.js b/sphinx/themes/basic/static/searchtools.js
+index 8279279..0b5537f 100644
+--- a/sphinx/themes/basic/static/searchtools.js
++++ b/sphinx/themes/basic/static/searchtools.js
+@@ -57,7 +57,7 @@ const _removeChildren = (element) => {
+ const _escapeRegExp = (string) =>
+ string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
+
+-const _displayItem = (item, searchTerms) => {
++const _displayItem = (item, searchTerms, highlightTerms) => {
+ const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
+ const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT;
+ const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
+@@ -86,9 +86,15 @@ const _displayItem = (item, searchTerms) => {
+ linkEl.href = linkUrl + anchor;
+ linkEl.dataset.score = score;
+ linkEl.innerHTML = title;
+- if (descr)
++ const rehighlightListItem = () => window.setTimeout(() => {
++ if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js
++ highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted"));
++ }, 10);
++ if (descr) {
+ listItem.appendChild(document.createElement("span")).innerHTML =
+ " (" + descr + ")";
++ rehighlightListItem();
++ }
+ else if (showSearchSummary)
+ fetch(requestUrl)
+ .then((responseData) => responseData.text())
+@@ -97,6 +103,7 @@ const _displayItem = (item, searchTerms) => {
+ listItem.appendChild(
+ Search.makeSearchSummary(data, searchTerms)
+ );
++ rehighlightListItem();
+ });
+ Search.output.appendChild(listItem);
+ };
+@@ -115,14 +122,15 @@ const _finishSearch = (resultCount) => {
+ const _displayNextItem = (
+ results,
+ resultCount,
+- searchTerms
++ searchTerms,
++ highlightTerms,
+ ) => {
+ // results left, load the summary and display it
+ // this is intended to be dynamic (don't sub resultsCount)
+ if (results.length) {
+- _displayItem(results.pop(), searchTerms);
++ _displayItem(results.pop(), searchTerms, highlightTerms);
+ setTimeout(
+- () => _displayNextItem(results, resultCount, searchTerms),
++ () => _displayNextItem(results, resultCount, searchTerms, highlightTerms),
+ 5
+ );
+ }
+@@ -360,7 +368,7 @@ const Search = {
+ // console.info("search results:", Search.lastresults);
+
+ // print the results
+- _displayNextItem(results, results.length, searchTerms);
++ _displayNextItem(results, results.length, searchTerms, highlightTerms);
+ },
+
+ /**
+diff --git a/sphinx/themes/basic/static/sphinx_highlight.js b/sphinx/themes/basic/static/sphinx_highlight.js
+index aae669d..5fbd3ce 100644
+--- a/sphinx/themes/basic/static/sphinx_highlight.js
++++ b/sphinx/themes/basic/static/sphinx_highlight.js
+@@ -29,14 +29,16 @@ const _highlight = (node, addItems, text, className) => {
+ }
+
+ span.appendChild(document.createTextNode(val.substr(pos, text.length)));
++ const rest = document.createTextNode(val.substr(pos + text.length));
+ parent.insertBefore(
+ span,
+- parent.insertBefore(
+- document.createTextNode(val.substr(pos + text.length)),
+- node.nextSibling
+- )
++ parent.insertBefore(rest, node.nextSibling)
+ );
+ node.nodeValue = val.substr(0, pos);
++ /* There may be more occurrences of search term in this node. So call this
++ * function recursively on the remaining fragment.
++ */
++ _highlight(rest, addItems, text, className);
+
+ if (isInSVG) {
+ const rect = document.createElementNS(
+@@ -140,5 +142,11 @@ const SphinxHighlight = {
+ },
+ };
+
+-_ready(SphinxHighlight.highlightSearchWords);
+-_ready(SphinxHighlight.initEscapeListener);
++_ready(() => {
++ /* Do not call highlightSearchWords() when we are on the search page.
++ * It will highlight words from the _previous_ search query.
++ */
++ if (typeof Search === "undefined")
++ SphinxHighlight.highlightSearchWords();
++ SphinxHighlight.initEscapeListener();
++});
diff --git a/debian/patches/intersphinx_local.diff b/debian/patches/intersphinx_local.diff
new file mode 100644
index 0000000..ba86960
--- /dev/null
+++ b/debian/patches/intersphinx_local.diff
@@ -0,0 +1,51 @@
+From: Dmitry Shachnev <mitya57@debian.org>
+Date: Tue, 2 Jun 2020 12:22:52 +0300
+Subject: Use local intersphinx inventory
+
+To prevent Sphinx from downloading https://docs.python.org/3/objects.inv
+during build.
+---
+ doc/conf.py | 5 ++---
+ doc/tutorial/deploying.rst | 9 ++++++---
+ 2 files changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/doc/conf.py b/doc/conf.py
+index d24ef11..74be5b5 100644
+--- a/doc/conf.py
++++ b/doc/conf.py
+@@ -118,9 +118,8 @@ texinfo_documents = [
+ ]
+
+ intersphinx_mapping = {
+- 'python': ('https://docs.python.org/3/', None),
+- 'requests': ('https://requests.readthedocs.io/en/latest/', None),
+- 'readthedocs': ('https://docs.readthedocs.io/en/stable', None),
++ 'python': ('/usr/share/doc/python3-doc/html', None),
++ 'requests': ('/usr/share/doc/python-requests-doc/html', None),
+ }
+
+ # Sphinx document translation with sphinx gettext feature uses these settings:
+diff --git a/doc/tutorial/deploying.rst b/doc/tutorial/deploying.rst
+index 76b68c3..619b502 100644
+--- a/doc/tutorial/deploying.rst
++++ b/doc/tutorial/deploying.rst
+@@ -160,13 +160,16 @@ Read the Docs
+ ~~~~~~~~~~~~~
+
+ `Read the Docs`_ offers integration with both GitHub and GitLab. The quickest
+-way of getting started is to follow :doc:`the RTD
+-tutorial <readthedocs:tutorial/index>`, which is loosely based on this one.
++way of getting started is to follow `the RTD tutorial`_, which is loosely
++based on this one.
+ You can publish your sources on GitHub as explained :ref:`in the previous
+ section <publishing-sources>`, then skip directly to
+-:ref:`readthedocs:tutorial/index:Sign up for Read the Docs`.
++`Sign up for Read the Docs`_.
+ If you choose GitLab instead, the process is similar.
+
++.. _the RTD tutorial: https://docs.readthedocs.io/en/stable/tutorial/index.html
++.. _Sign up for Read the Docs: https://docs.readthedocs.io/en/stable/tutorial/index.html#sign-up-for-read-the-docs
++
+ GitHub Pages
+ ~~~~~~~~~~~~
+
diff --git a/debian/patches/move_sphinxcontrib_to_extras_require.diff b/debian/patches/move_sphinxcontrib_to_extras_require.diff
new file mode 100644
index 0000000..574255a
--- /dev/null
+++ b/debian/patches/move_sphinxcontrib_to_extras_require.diff
@@ -0,0 +1,40 @@
+From: Dmitry Shachnev <mitya57@debian.org>
+Date: Fri, 7 Feb 2020 13:59:30 +0300
+Subject: Move sphinxcontrib modules to extras_require
+
+---
+ pyproject.toml | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/pyproject.toml b/pyproject.toml
+index 0e059b5..7532268 100644
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -57,12 +57,6 @@ classifiers = [
+ "Topic :: Utilities",
+ ]
+ dependencies = [
+- "sphinxcontrib-applehelp",
+- "sphinxcontrib-devhelp",
+- "sphinxcontrib-jsmath",
+- "sphinxcontrib-htmlhelp>=2.0.0",
+- "sphinxcontrib-serializinghtml>=1.1.5",
+- "sphinxcontrib-qthelp",
+ "Jinja2>=3.0",
+ "Pygments>=2.12",
+ "docutils>=0.14,<0.20",
+@@ -99,6 +93,14 @@ test = [
+ "typed_ast; python_version < '3.8'",
+ "cython",
+ ]
++sphinxcontrib = [
++ "sphinxcontrib-applehelp",
++ "sphinxcontrib-devhelp",
++ "sphinxcontrib-jsmath",
++ "sphinxcontrib-htmlhelp>=2.0.0",
++ "sphinxcontrib-serializinghtml>=1.1.5",
++ "sphinxcontrib-qthelp",
++]
+
+ [[project.authors]]
+ name = "Georg Brandl"
diff --git a/debian/patches/no_external_css.diff b/debian/patches/no_external_css.diff
new file mode 100644
index 0000000..697de83
--- /dev/null
+++ b/debian/patches/no_external_css.diff
@@ -0,0 +1,21 @@
+From: Chris Lamb <lamby@debian.org>
+Date: Sat, 14 Apr 2018 10:10:45 +0100
+Subject: Don't use Google Fonts to avoid privacy breach.
+
+---
+ sphinx/themes/pyramid/layout.html | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/sphinx/themes/pyramid/layout.html b/sphinx/themes/pyramid/layout.html
+index ffa9313..19f351d 100644
+--- a/sphinx/themes/pyramid/layout.html
++++ b/sphinx/themes/pyramid/layout.html
+@@ -1,8 +1,6 @@
+ {%- extends "basic/layout.html" %}
+
+ {%- block extrahead %}
+-<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Neuton&amp;subset=latin" type="text/css" media="screen" charset="utf-8" />
+-<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nobile:regular,italic,bold,bolditalic&amp;subset=latin" type="text/css" media="screen" charset="utf-8" />
+ <!--[if lte IE 6]>
+ <link rel="stylesheet" href="{{ pathto('_static/ie6.css', 1) }}" type="text/css" media="screen" charset="utf-8" />
+ <![endif]-->
diff --git a/debian/patches/pygments_2.14.diff b/debian/patches/pygments_2.14.diff
new file mode 100644
index 0000000..f08b49b
--- /dev/null
+++ b/debian/patches/pygments_2.14.diff
@@ -0,0 +1,111 @@
+From: Adam Turner <9087854+aa-turner@users.noreply.github.com>
+Date: Sun, 1 Jan 2023 19:17:03 +0000
+Subject: Fix tests for Pygments 2.14
+
+Pygments 2.14 was released on 01/01/2023 [0]
+
+[0]: https://pygments.org/docs/changelog/#version-2-14-0
+
+(cherry picked from commit 965768bfda2a00ba6466cdb12a7a46efdce47023)
+---
+ pyproject.toml | 2 +-
+ tests/test_ext_viewcode.py | 27 +++++++++++++++++++--------
+ tests/test_intl.py | 11 +++++++++--
+ 3 files changed, 29 insertions(+), 11 deletions(-)
+
+diff --git a/pyproject.toml b/pyproject.toml
+index 7532268..06e5e45 100644
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -58,7 +58,7 @@ classifiers = [
+ ]
+ dependencies = [
+ "Jinja2>=3.0",
+- "Pygments>=2.12",
++ "Pygments>=2.13",
+ "docutils>=0.14,<0.20",
+ "snowballstemmer>=2.0",
+ "babel>=2.9",
+diff --git a/tests/test_ext_viewcode.py b/tests/test_ext_viewcode.py
+index 7750b8d..6d443d1 100644
+--- a/tests/test_ext_viewcode.py
++++ b/tests/test_ext_viewcode.py
+@@ -2,6 +2,7 @@
+
+ import re
+
++import pygments
+ import pytest
+
+
+@@ -31,14 +32,24 @@ def test_viewcode(app, status, warning):
+
+ result = (app.outdir / '_modules/spam/mod1.html').read_text(encoding='utf8')
+ result = re.sub('<span class=".*?">', '<span>', result) # filter pygments classes
+- assert ('<div class="viewcode-block" id="Class1"><a class="viewcode-back" '
+- 'href="../../index.html#spam.Class1">[docs]</a>'
+- '<span>@decorator</span>\n'
+- '<span>class</span> <span>Class1</span>'
+- '<span>(</span><span>object</span><span>):</span>\n'
+- ' <span>&quot;&quot;&quot;</span>\n'
+- '<span> this is Class1</span>\n'
+- '<span> &quot;&quot;&quot;</span></div>\n') in result
++ if pygments.__version__ >= '2.14.0':
++ assert ('<div class="viewcode-block" id="Class1"><a class="viewcode-back" '
++ 'href="../../index.html#spam.Class1">[docs]</a>'
++ '<span>@decorator</span>\n'
++ '<span>class</span> <span>Class1</span>'
++ '<span>(</span><span>object</span><span>):</span>\n'
++ '<span> </span><span>&quot;&quot;&quot;</span>\n'
++ '<span> this is Class1</span>\n'
++ '<span> &quot;&quot;&quot;</span></div>\n') in result
++ else:
++ assert ('<div class="viewcode-block" id="Class1"><a class="viewcode-back" '
++ 'href="../../index.html#spam.Class1">[docs]</a>'
++ '<span>@decorator</span>\n'
++ '<span>class</span> <span>Class1</span>'
++ '<span>(</span><span>object</span><span>):</span>\n'
++ ' <span>&quot;&quot;&quot;</span>\n'
++ '<span> this is Class1</span>\n'
++ '<span> &quot;&quot;&quot;</span></div>\n') in result
+
+
+ @pytest.mark.sphinx('epub', testroot='ext-viewcode')
+diff --git a/tests/test_intl.py b/tests/test_intl.py
+index 796d95b..956352c 100644
+--- a/tests/test_intl.py
++++ b/tests/test_intl.py
+@@ -7,6 +7,7 @@ import os
+ import re
+
+ import docutils
++import pygments
+ import pytest
+ from babel.messages import mofile, pofile
+ from babel.messages.catalog import Catalog
+@@ -1105,8 +1106,11 @@ def test_additional_targets_should_not_be_translated(app):
+ expected_expr = ("""<span class="n">literal</span>"""
+ """<span class="o">-</span>"""
+ """<span class="n">block</span>\n"""
+- """<span class="k">in</span> """
++ """<span class="k">in</span>"""
++ """<span class="w"> </span>"""
+ """<span class="n">list</span>""")
++ if pygments.__version__ < '2.14.0':
++ expected_expr = expected_expr.replace("""<span class="w"> </span>""", ' ')
+ assert_count(expected_expr, result, 1)
+
+ # doctest block should not be translated but be highlighted
+@@ -1184,8 +1188,11 @@ def test_additional_targets_should_be_translated(app):
+ expected_expr = ("""<span class="no">LITERAL</span>"""
+ """<span class="o">-</span>"""
+ """<span class="no">BLOCK</span>\n"""
+- """<span class="no">IN</span> """
++ """<span class="no">IN</span>"""
++ """<span class="w"> </span>"""
+ """<span class="no">LIST</span>""")
++ if pygments.__version__ < '2.14.0':
++ expected_expr = expected_expr.replace("""<span class="w"> </span>""", ' ')
+ assert_count(expected_expr, result, 1)
+
+ # doctest block should not be translated but be highlighted
diff --git a/debian/patches/remove_contrib_references.diff b/debian/patches/remove_contrib_references.diff
new file mode 100644
index 0000000..f22bf0a
--- /dev/null
+++ b/debian/patches/remove_contrib_references.diff
@@ -0,0 +1,98 @@
+From: Dmitry Shachnev <mitya57@debian.org>
+Date: Wed, 25 Dec 2019 23:18:56 +0300
+Subject: Remove references to sphinxcontrib modules
+
+They are not packaged yet, and when they are, we would want to avoid
+dependency loops anyway.
+---
+ doc/usage/builders/index.rst | 24 ------------------------
+ sphinx/application.py | 6 ------
+ sphinx/builders/html/__init__.py | 2 --
+ 3 files changed, 32 deletions(-)
+
+diff --git a/doc/usage/builders/index.rst b/doc/usage/builders/index.rst
+index 4d53152..4f7bdb6 100644
+--- a/doc/usage/builders/index.rst
++++ b/doc/usage/builders/index.rst
+@@ -68,12 +68,6 @@ The builder's "name" must be given to the **-b** command-line option of
+ also generates HTML Help support files that allow the Microsoft HTML Help
+ Workshop to compile them into a CHM file.
+
+- .. autoattribute:: name
+-
+- .. autoattribute:: format
+-
+- .. autoattribute:: supported_image_types
+-
+ .. module:: sphinxcontrib.qthelp
+ .. class:: QtHelpBuilder
+
+@@ -85,12 +79,6 @@ The builder's "name" must be given to the **-b** command-line option of
+
+ Moved to sphinxcontrib.qthelp from sphinx.builders package.
+
+- .. autoattribute:: name
+-
+- .. autoattribute:: format
+-
+- .. autoattribute:: supported_image_types
+-
+ .. _Qt help: https://doc.qt.io/qt-4.8/qthelp-framework.html
+
+ .. module:: sphinxcontrib.applehelp
+@@ -111,12 +99,6 @@ The builder's "name" must be given to the **-b** command-line option of
+ output will not be valid until :program:`hiutil` has been run on all of the
+ ``.lproj`` folders within the bundle.
+
+- .. autoattribute:: name
+-
+- .. autoattribute:: format
+-
+- .. autoattribute:: supported_image_types
+-
+ .. versionadded:: 1.3
+
+ .. versionchanged:: 2.0
+@@ -130,12 +112,6 @@ The builder's "name" must be given to the **-b** command-line option of
+ also generates `GNOME Devhelp <https://wiki.gnome.org/Apps/Devhelp>`__
+ support file that allows the GNOME Devhelp reader to view them.
+
+- .. autoattribute:: name
+-
+- .. autoattribute:: format
+-
+- .. autoattribute:: supported_image_types
+-
+ .. versionchanged:: 2.0
+
+ Moved to sphinxcontrib.devhelp from sphinx.builders package.
+diff --git a/sphinx/application.py b/sphinx/application.py
+index 10c03a2..c83fcc2 100644
+--- a/sphinx/application.py
++++ b/sphinx/application.py
+@@ -99,12 +99,6 @@ builtin_extensions = (
+ 'sphinx.environment.collectors.metadata',
+ 'sphinx.environment.collectors.title',
+ 'sphinx.environment.collectors.toctree',
+- # 1st party extensions
+- 'sphinxcontrib.applehelp',
+- 'sphinxcontrib.devhelp',
+- 'sphinxcontrib.htmlhelp',
+- 'sphinxcontrib.serializinghtml',
+- 'sphinxcontrib.qthelp',
+ # Strictly, alabaster theme is not a builtin extension,
+ # but it is loaded automatically to use it as default theme.
+ 'alabaster',
+diff --git a/sphinx/builders/html/__init__.py b/sphinx/builders/html/__init__.py
+index 4fe40eb..861232e 100644
+--- a/sphinx/builders/html/__init__.py
++++ b/sphinx/builders/html/__init__.py
+@@ -1350,8 +1350,6 @@ def deprecate_html_4(_app: Sphinx, config: Config) -> None:
+
+
+ # for compatibility
+-import sphinxcontrib.serializinghtml # NOQA
+-
+ import sphinx.builders.dirhtml # NOQA
+ import sphinx.builders.singlehtml # NOQA
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..5bc8b97
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,12 @@
+disable_js_version_check.diff
+skip_tests_network.diff
+no_external_css.diff
+remove_contrib_references.diff
+skip_tests_jsmath.diff
+use_packaged_mathjax.diff
+skip_tests_serializinghtml.diff
+move_sphinxcontrib_to_extras_require.diff
+intersphinx_local.diff
+support_old_search_indexes.diff
+highlight_search_terms.diff
+pygments_2.14.diff
diff --git a/debian/patches/skip_tests_jsmath.diff b/debian/patches/skip_tests_jsmath.diff
new file mode 100644
index 0000000..faf04e4
--- /dev/null
+++ b/debian/patches/skip_tests_jsmath.diff
@@ -0,0 +1,36 @@
+From: Dmitry Shachnev <mitya57@debian.org>
+Date: Wed, 25 Dec 2019 23:37:50 +0300
+Subject: Skip tests that require sphinxcontrib.jsmath module
+
+---
+ tests/test_build_html.py | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/tests/test_build_html.py b/tests/test_build_html.py
+index 1796dc0..8a74a68 100644
+--- a/tests/test_build_html.py
++++ b/tests/test_build_html.py
+@@ -1528,6 +1528,7 @@ def test_html_math_renderer_is_imgmath(app, status, warning):
+ assert app.builder.math_renderer_name == 'imgmath'
+
+
++@pytest.mark.skip('Requires sphinxcontrib.jsmath module')
+ @pytest.mark.sphinx('html', testroot='basic',
+ confoverrides={'extensions': ['sphinxcontrib.jsmath',
+ 'sphinx.ext.imgmath']})
+@@ -1549,6 +1550,7 @@ def test_html_math_renderer_is_duplicated2(app, status, warning):
+ assert app.builder.math_renderer_name == 'imgmath' # The another one is chosen
+
+
++@pytest.mark.skip('Requires sphinxcontrib.jsmath module')
+ @pytest.mark.sphinx('html', testroot='basic',
+ confoverrides={'extensions': ['sphinxcontrib.jsmath',
+ 'sphinx.ext.imgmath'],
+@@ -1557,6 +1559,7 @@ def test_html_math_renderer_is_chosen(app, status, warning):
+ assert app.builder.math_renderer_name == 'imgmath'
+
+
++@pytest.mark.skip('Requires sphinxcontrib.jsmath module')
+ @pytest.mark.sphinx('html', testroot='basic',
+ confoverrides={'extensions': ['sphinxcontrib.jsmath',
+ 'sphinx.ext.mathjax'],
diff --git a/debian/patches/skip_tests_network.diff b/debian/patches/skip_tests_network.diff
new file mode 100644
index 0000000..f873091
--- /dev/null
+++ b/debian/patches/skip_tests_network.diff
@@ -0,0 +1,63 @@
+From: Dmitry Shachnev <mitya57@debian.org>
+Date: Tue, 20 Dec 2016 16:37:32 +0300
+Subject: Skip tests that require network access
+
+Forwarded: not-needed
+---
+ tests/test_build_latex.py | 1 +
+ tests/test_build_linkcheck.py | 3 +++
+ tests/test_setup_command.py | 1 +
+ 3 files changed, 5 insertions(+)
+
+diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py
+index 004fc02..374e5ee 100644
+--- a/tests/test_build_latex.py
++++ b/tests/test_build_latex.py
+@@ -1384,6 +1384,7 @@ def test_latex_raw_directive(app, status, warning):
+ assert 'LaTeX: abc def ghi' in result
+
+
++@pytest.mark.skip('Requires internet access')
+ @pytest.mark.sphinx('latex', testroot='images')
+ def test_latex_images(app, status, warning):
+ app.builder.build_all()
+diff --git a/tests/test_build_linkcheck.py b/tests/test_build_linkcheck.py
+index 631c7fa..5df6b87 100644
+--- a/tests/test_build_linkcheck.py
++++ b/tests/test_build_linkcheck.py
+@@ -23,6 +23,7 @@ from .utils import CERT_FILE, http_server, https_server
+ ts_re = re.compile(r".*\[(?P<ts>.*)\].*")
+
+
++@pytest.mark.skip('Requires internet access')
+ @pytest.mark.sphinx('linkcheck', testroot='linkcheck', freshenv=True)
+ def test_defaults(app):
+ app.build()
+@@ -44,6 +45,7 @@ def test_defaults(app):
+ assert len(content.splitlines()) == 7
+
+
++@pytest.mark.skip('Requires internet access')
+ @pytest.mark.sphinx('linkcheck', testroot='linkcheck', freshenv=True)
+ def test_defaults_json(app):
+ app.build()
+@@ -105,6 +107,7 @@ def test_defaults_json(app):
+ }
+
+
++@pytest.mark.skip('Requires internet access')
+ @pytest.mark.sphinx(
+ 'linkcheck', testroot='linkcheck', freshenv=True,
+ confoverrides={'linkcheck_anchors_ignore': ["^!", "^top$"],
+diff --git a/tests/test_setup_command.py b/tests/test_setup_command.py
+index ef36467..6b36ac9 100644
+--- a/tests/test_setup_command.py
++++ b/tests/test_setup_command.py
+@@ -99,6 +99,7 @@ def test_build_sphinx_with_nonascii_path(setup_command):
+ assert proc.returncode == 0
+
+
++@pytest.mark.skip('Requires internet access')
+ @pytest.mark.setup_command('-b', 'linkcheck')
+ def test_build_sphinx_return_nonzero_status(setup_command):
+ srcdir = (setup_command.pkgroot / 'doc')
diff --git a/debian/patches/skip_tests_serializinghtml.diff b/debian/patches/skip_tests_serializinghtml.diff
new file mode 100644
index 0000000..659a071
--- /dev/null
+++ b/debian/patches/skip_tests_serializinghtml.diff
@@ -0,0 +1,28 @@
+From: Dmitry Shachnev <mitya57@debian.org>
+Date: Thu, 6 Feb 2020 23:55:28 +0300
+Subject: Skip tests that require sphinxcontrib.serializinghtml module
+
+---
+ tests/test_api_translator.py | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tests/test_api_translator.py b/tests/test_api_translator.py
+index 25aee0c..033d5d4 100644
+--- a/tests/test_api_translator.py
++++ b/tests/test_api_translator.py
+@@ -40,6 +40,7 @@ def test_singlehtml_set_translator_for_singlehtml(app, status, warning):
+ assert translator_class.__name__ == 'ConfSingleHTMLTranslator'
+
+
++@pytest.mark.skip('Requires sphinxcontrib.serializinghtml module')
+ @pytest.mark.sphinx('pickle', testroot='api-set-translator')
+ def test_pickle_set_translator_for_pickle(app, status, warning):
+ translator_class = app.builder.get_translator_class()
+@@ -47,6 +48,7 @@ def test_pickle_set_translator_for_pickle(app, status, warning):
+ assert translator_class.__name__ == 'ConfPickleTranslator'
+
+
++@pytest.mark.skip('Requires sphinxcontrib.serializinghtml module')
+ @pytest.mark.sphinx('json', testroot='api-set-translator')
+ def test_json_set_translator_for_json(app, status, warning):
+ translator_class = app.builder.get_translator_class()
diff --git a/debian/patches/support_old_search_indexes.diff b/debian/patches/support_old_search_indexes.diff
new file mode 100644
index 0000000..ed8bd18
--- /dev/null
+++ b/debian/patches/support_old_search_indexes.diff
@@ -0,0 +1,35 @@
+From: Dmitry Shachnev <mitya57@debian.org>
+Date: Sat, 11 Dec 2021 19:19:27 +0300
+Subject: Make searchtools.js support old searchindex.js files
+
+Sphinx 4.3 has changed format of searchindex.js files, but in Debian
+there are lots of packages built with older Sphinx, and we want to
+keep them working for some time.
+
+Forwarded: not-needed
+---
+ sphinx/themes/basic/static/searchtools.js | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/sphinx/themes/basic/static/searchtools.js b/sphinx/themes/basic/static/searchtools.js
+index e89e34d..8279279 100644
+--- a/sphinx/themes/basic/static/searchtools.js
++++ b/sphinx/themes/basic/static/searchtools.js
+@@ -426,11 +426,14 @@ const Search = {
+ filenames[match[0]],
+ ]);
+ };
+- Object.keys(objects).forEach((prefix) =>
++ Object.keys(objects).forEach((prefix) => {
++ if (!(objects[prefix] instanceof Array)) {
++ objects[prefix] = Object.entries(objects[prefix]).map(([name, match]) => [...match, name]);
++ }
+ objects[prefix].forEach((array) =>
+ objectSearchCallback(prefix, array)
+- )
+- );
++ );
++ });
+ return results;
+ },
+
diff --git a/debian/patches/use_packaged_mathjax.diff b/debian/patches/use_packaged_mathjax.diff
new file mode 100644
index 0000000..f28f920
--- /dev/null
+++ b/debian/patches/use_packaged_mathjax.diff
@@ -0,0 +1,20 @@
+From: Dmitry Shachnev <mitya57@debian.org>
+Date: Tue, 4 Feb 2020 00:12:18 +0300
+Subject: Use packaged MathJax (for our own documentation)
+
+---
+ doc/conf.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/doc/conf.py b/doc/conf.py
+index ec845be..d24ef11 100644
+--- a/doc/conf.py
++++ b/doc/conf.py
+@@ -127,6 +127,7 @@ intersphinx_mapping = {
+ locale_dirs = ['locale/']
+ gettext_compact = False
+
++mathjax_path = 'file:///usr/share/javascript/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
+
+ # -- Extension interface -------------------------------------------------------
+