[sagemath] 01/02: Add patches for sphinx 1.5.
Tobias Hansen
thansen at moszumanska.debian.org
Fri Jul 21 19:21:11 UTC 2017
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch 7.6-bugfix
in repository sagemath.
commit 8f96ba4385b186091e1f45cd0d17eddf9f14e244
Author: Tobias Hansen <thansen at debian.org>
Date: Fri Jul 21 20:07:44 2017 +0100
Add patches for sphinx 1.5.
---
debian/changelog | 8 ++
debian/patches/series | 2 +
debian/patches/u0-sphinx-1.5.patch | 151 ++++++++++++++++++++++++++
debian/patches/u1-more-sphinx-1.5-fixes.patch | 19 ++++
4 files changed, 180 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 75bb3ae..e823dde 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+sagemath (7.6-3) unstable; urgency=medium
+
+ * New patches:
+ - u0-sphinx-1.5.patch, upstream fixes for sphinx 1.5.
+ - u1-more-sphinx-1.5-fixes.patch from Dmitry Shachnev. (Closes: #866166)
+
+ -- Tobias Hansen <thansen at debian.org> Fri, 21 Jul 2017 20:04:54 +0100
+
sagemath (7.6-2) unstable; urgency=medium
* Upload to unstable.
diff --git a/debian/patches/series b/debian/patches/series
index 342c92b..9802d4a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,6 +4,7 @@ u0-version-r-3.3.3.patch #20523
u0-version-singular-4.1.0p2.patch #22425
u0-version-singular-4.1.0p3.patch #22868
u0-fix-proper-scipy-rtol.patch #22439
+u0-sphinx-1.5.patch #22252
# Patches that have open upstream tickets
u1-version-planarity-3.patch #21774
@@ -15,6 +16,7 @@ u1-pip-nowarn.patch #21835
u1-fix-atrocious-symlink-logic.patch #22444
u1-looser-doctest-basename.patch #22445
u1-scripts-dir.patch #22731
+u1-more-sphinx-1.5-fixes.patch #23364
# Patches that should be upstreamed (may need some work first)
u2-version-cddlib-094h.patch
diff --git a/debian/patches/u0-sphinx-1.5.patch b/debian/patches/u0-sphinx-1.5.patch
new file mode 100644
index 0000000..e498000
--- /dev/null
+++ b/debian/patches/u0-sphinx-1.5.patch
@@ -0,0 +1,151 @@
+From 78e671810360d3e02ec1e0fa6643a0e63f727f39 Mon Sep 17 00:00:00 2001
+From: Jeroen Demeyer <jdemeyer at cage.ugent.be>
+Date: Wed, 25 Jan 2017 16:42:34 +0100
+Subject: Docbuild fixes for Sphinx 1.5.x
+
+---
+ src/sage/homology/simplicial_complex.py | 6 +++---
+ src/sage_setup/docbuild/__init__.py | 28 ----------------------------
+ src/sage_setup/docbuild/ext/multidocs.py | 18 ++++++++++--------
+ 3 files changed, 13 insertions(+), 39 deletions(-)
+
+diff --git a/sage/src/sage/homology/simplicial_complex.py b/sage/src/sage/homology/simplicial_complex.py
+index c110648..462d0bf 100644
+--- a/sage/src/sage/homology/simplicial_complex.py
++++ b/sage/src/sage/homology/simplicial_complex.py
+@@ -195,8 +195,8 @@ def lattice_paths(t1, t2, length=None):
+ :param length: if not ``None``, then an integer, the length of the desired
+ path.
+ :type length: integer or ``None``; optional, default ``None``
+- :type t1: tuple, list, other iterable
+- :type t2: tuple, list, other iterable
++ :type t1: list, other iterable
++ :type t2: list, other iterable
+ :return: list of lists of vertices making up the paths as described above
+ :rtype: list of lists
+
+@@ -333,7 +333,7 @@ class Simplex(SageObject):
+ tuple of the vertices.
+
+ :param X: set of vertices
+- :type X: integer or list, tuple, or other iterable
++ :type X: integer, list, other iterable
+ :return: simplex with those vertices
+
+ ``X`` may be a non-negative integer `n`, in which case the
+diff --git a/sage/src/sage_setup/docbuild/__init__.py b/sage/src/sage_setup/docbuild/__init__.py
+index c155b4e..b93e743 100644
+--- a/sage/src/sage_setup/docbuild/__init__.py
++++ b/sage/src/sage_setup/docbuild/__init__.py
+@@ -1578,32 +1578,6 @@ class IntersphinxCache:
+ return i
+
+
+-def patch_domain_init():
+- """
+- Applies a monkey-patch to the __init__ method of the Domain class in
+- Sphinx, in order to work around a bug.
+-
+- See https://trac.sagemath.org/ticket/21044 as well as
+- https://github.com/sphinx-doc/sphinx/pull/2816 for details about that
+- bug.
+- """
+-
+- from sphinx.domains import Domain
+- import copy
+-
+- orig_init = Domain.__init__
+-
+- def __init__(self, *args, **kwargs):
+- orig_init(self, *args, **kwargs)
+-
+- # Replace the original initial_data class attribute with a new
+- # deep-copy of itself, since the bug will cause the original
+- # initial_data to be modified in-place
+- self.__class__.initial_data = copy.deepcopy(self.initial_data)
+-
+- Domain.__init__ = __init__
+-
+-
+ def main():
+ # Parse the command-line.
+ parser = setup_parser()
+@@ -1653,8 +1627,6 @@ def main():
+
+ ABORT_ON_ERROR = not options.keep_going
+
+- patch_domain_init()
+-
+ # Delete empty directories. This is needed in particular for empty
+ # directories due to "git checkout" which never deletes empty
+ # directories it leaves behind. See Trac #20010.
+diff --git a/sage/src/sage_setup/docbuild/ext/multidocs.py b/sage/src/sage_setup/docbuild/ext/multidocs.py
+index 63dbb71..47b2321 100644
+--- a/sage/src/sage_setup/docbuild/ext/multidocs.py
++++ b/sage/src/sage_setup/docbuild/ext/multidocs.py
+@@ -3,8 +3,6 @@
+ multi documentation in Sphinx
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+- This is a slightly hacked-up version of the Sphinx-multidoc plugin
+-
+ The goal of this extension is to manage a multi documentation in Sphinx.
+ To be able to compile Sage's huge documentation in parallel, the
+ documentation is cut into a bunch of independent documentations called
+@@ -57,7 +55,7 @@ def merge_environment(app, env):
+ app.info(" %s todos, %s index, %s citations"%(
+ len(docenv.todo_all_todos),
+ len(docenv.indexentries),
+- len(docenv.citations)
++ len(docenv.domaindata["std"]["citations"])
+ ), nonl=1)
+
+ # merge titles
+@@ -88,10 +86,10 @@ def merge_environment(app, env):
+ env.metadata[ind] = md
+ # merge the citations
+ newcite = {}
+- for ind, (path, tag) in six.iteritems(docenv.citations):
++ for ind, (path, tag) in six.iteritems(docenv.domaindata["std"]["citations"]):
+ # TODO: Warn on conflicts
+ newcite[ind] = (fixpath(path), tag)
+- env.citations.update(newcite)
++ env.domaindata["std"]["citations"].update(newcite)
+ # merge the py:module indexes
+ newmodules = {}
+ for ind,(modpath,v1,v2,v3) in (
+@@ -102,9 +100,9 @@ def merge_environment(app, env):
+ app.info('... done (%s todos, %s index, %s citations, %s modules)'%(
+ len(env.todo_all_todos),
+ len(env.indexentries),
+- len(env.citations),
++ len(env.domaindata["std"]["citations"]),
+ len(env.domaindata['py']['modules'])))
+- write_citations(app, env.citations)
++ write_citations(app, env.domaindata["std"]["citations"])
+
+ def get_env(app, curdoc):
+ """
+@@ -146,6 +144,10 @@ def merge_js_index(app):
+ titles = app.builder.indexer._titles
+ for (res, title) in six.iteritems(index._titles):
+ titles[fixpath(res)] = title
++ # merge the filenames
++ filenames = app.builder.indexer._filenames
++ for (res, filename) in six.iteritems(index._filenames):
++ filenames[fixpath(res)] = filename
+ # TODO: merge indexer._objtypes, indexer._objnames as well
+
+ # Setup source symbolic links
+@@ -244,7 +246,7 @@ def fetch_citation(app, env):
+ with open(filename, 'rb') as f:
+ cache = cPickle.load(f)
+ app.builder.info("done (%s citations)."%len(cache))
+- cite = env.citations
++ cite = env.domaindata["std"]["citations"]
+ for ind, (path, tag) in six.iteritems(cache):
+ if ind not in cite: # don't override local citation
+ cite[ind]=(os.path.join("..", path), tag)
+--
+cgit v1.0-1-gd88e
+
diff --git a/debian/patches/u1-more-sphinx-1.5-fixes.patch b/debian/patches/u1-more-sphinx-1.5-fixes.patch
new file mode 100644
index 0000000..ddaaee8
--- /dev/null
+++ b/debian/patches/u1-more-sphinx-1.5-fixes.patch
@@ -0,0 +1,19 @@
+Description: Update to Sphinx 1.5 searchindex.js
+ Filename paths also need to be updated, otherwise search snippets won't be
+ able to find the source file and "404" will be displayed instead. (The link
+ to the html file still works.)
+Author: Dmitry Shachnev <mitya57 at debian.org>
+Bug: https://trac.sagemath.org/ticket/23364
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/sage/src/sage_setup/docbuild/ext/multidocs.py
++++ b/sage/src/sage_setup/docbuild/ext/multidocs.py
+@@ -147,7 +147,7 @@
+ # merge the filenames
+ filenames = app.builder.indexer._filenames
+ for (res, filename) in six.iteritems(index._filenames):
+- filenames[fixpath(res)] = filename
++ filenames[fixpath(res)] = fixpath(filename)
+ # TODO: merge indexer._objtypes, indexer._objnames as well
+
+ # Setup source symbolic links
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagemath.git
More information about the debian-science-commits
mailing list