[sagemath] 01/01: Patch Sage's use of Sphinx, add maxima-ecl as a build-dep
Ximin Luo
infinity0 at debian.org
Fri Jul 8 10:13:47 UTC 2016
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository sagemath.
commit 866b5243239b53b1751a6e4e2f28351b77416ebb
Author: Ximin Luo <infinity0 at debian.org>
Date: Fri Jul 8 12:13:07 2016 +0200
Patch Sage's use of Sphinx, add maxima-ecl as a build-dep
---
debian/README.Debian | 3 +-
debian/control | 1 +
debian/patches/python_installs_in_userdir.patch | 31 ++++++++++++++
debian/patches/series | 1 +
debian/patches/sphinx-update.patch | 57 +++++++++++++++++++++++++
5 files changed, 92 insertions(+), 1 deletion(-)
diff --git a/debian/README.Debian b/debian/README.Debian
index a966468..fcb6b1e 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -18,7 +18,8 @@ also need sage to -lflint-arb instead of -larb (or perhaps Debian needs to
install it as libarb.so; check upstream to see what they prefer). as a temp
workaround you can `ln -s libflint-arb.so /usr/lib/libarb.so`.
-3. Post-compilation docbuild fails due to hardcoded paths. Need to patch this
+3. Post-compilation docbuild hangs after successfully building the
+doc/sage/inventory/en/reference/tensor component. Figure out why..
## TODO (required to get into Debian archives)
diff --git a/debian/control b/debian/control
index 0e252c1..555fe5b 100644
--- a/debian/control
+++ b/debian/control
@@ -75,6 +75,7 @@ Build-Depends:
libzn-poly-dev,
maxima (= 5.35.1-5sage2),
maxima-doc (= 5.35.1-5sage2),
+ maxima-ecl (= 5.35.1-5sage2),
maxima-share (= 5.35.1-5sage2),
nauty,
palp (>= 2.1-2),
diff --git a/debian/patches/python_installs_in_userdir.patch b/debian/patches/python_installs_in_userdir.patch
index 200c019..faba1d2 100644
--- a/debian/patches/python_installs_in_userdir.patch
+++ b/debian/patches/python_installs_in_userdir.patch
@@ -113,3 +113,34 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
# Resolve all symbolic links in a filename. This more or less behaves
+--- a/sage/src/bin/sage-env
++++ b/sage/src/bin/sage-env
+@@ -247,7 +247,7 @@
+ # Setting Sage-related location environment variables.
+ export SAGE_LOCAL="$SAGE_ROOT/local"
+ export SAGE_ETC="$SAGE_LOCAL/etc"
+-export SAGE_SHARE="/usr/share/sagemath"
++export SAGE_SHARE="$HOME/.local/share/sagemath"
+ export SAGE_EXTCODE="$SAGE_LOCAL/share/sage/ext"
+ export SAGE_SPKG_INST="$SAGE_LOCAL/var/lib/sage/installed"
+ export SAGE_LOGS="$SAGE_ROOT/logs/pkgs"
+--- a/sage/src/sage_setup/docbuild/__init__.py
++++ b/sage/src/sage_setup/docbuild/__init__.py
+@@ -22,7 +22,7 @@
+ import sage.all
+ from sage.misc.cachefunc import cached_method
+ from sage.misc.misc import sage_makedirs
+-from sage.env import SAGE_DOC_SRC, SAGE_DOC, SAGE_SRC
++from sage.env import SAGE_DOC_SRC, SAGE_DOC, SAGE_SRC, SAGE_SHARE
+
+ from .build_options import (LANGUAGES, SPHINXOPTS, PAPER, OMIT,
+ PAPEROPTS, ALLSPHINXOPTS, NUM_THREADS, WEBSITESPHINXOPTS,
+@@ -151,6 +151,8 @@
+ """
+ d = os.path.join(SAGE_DOC, type, self.lang, self.name)
+ sage_makedirs(d)
++ subprocess.check_call(['sh', '-c',
++ 'for i in /usr/share/sagemath/*; do ln -Tsf "$i" %s/"$(basename $i)"; done' % SAGE_SHARE])
+ return d
+
+ def _doctrees_dir(self):
diff --git a/debian/patches/series b/debian/patches/series
index 5ee7044..222a6af 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -14,3 +14,4 @@ use-gsl-cblas.patch
mpfi-fix-api.patch
cysignals-multiarch-path.patch
python_installs_in_userdir.patch
+sphinx-update.patch
diff --git a/debian/patches/sphinx-update.patch b/debian/patches/sphinx-update.patch
new file mode 100644
index 0000000..5b0684c
--- /dev/null
+++ b/debian/patches/sphinx-update.patch
@@ -0,0 +1,57 @@
+Description: Update Sage's use of Sphinx for the version in Debian
+ Sage uses 1.2.2, Debian has 1.4.4.
+ Also disable a convoluted "build log buffering" mechanism which was causing problems.
+Author: Ximin Luo <infinity0 at debian.org>
+Forwarded: not-needed
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/sage/src/sage_setup/docbuild/__init__.py
++++ b/sage/src/sage_setup/docbuild/__init__.py
+@@ -769,7 +769,7 @@
+
+ env_pickle = os.path.join(self._doctrees_dir(), 'environment.pickle')
+ try:
+- env = BuildEnvironment.frompickle(config, env_pickle)
++ env = BuildEnvironment.frompickle(SAGE_DOC_SRC, config, env_pickle)
+ logger.debug("Opened Sphinx environment: %s", env_pickle)
+ return env
+ except IOError as err:
+--- a/sage/src/sage_setup/docbuild/ext/sage_autodoc.py
++++ b/sage/src/sage_setup/docbuild/ext/sage_autodoc.py
+@@ -38,7 +38,7 @@
+ from sphinx.util.nodes import nested_parse_with_titles
+ from sphinx.util.compat import Directive
+ from sphinx.util.inspect import getargspec, isdescriptor, safe_getmembers, \
+- safe_getattr, safe_repr, is_builtin_class_method
++ safe_getattr, object_description as safe_repr, is_builtin_class_method
+ from sphinx.util.pycompat import base_exception, class_types
+ from sphinx.util.docstrings import prepare_docstring
+
+--- a/sage/src/doc/common/conf.py
++++ b/sage/src/doc/common/conf.py
+@@ -724,9 +724,9 @@
+ # link to the Python documentation several links where broken because there
+ # where class listed as functions. Expand the list 'base_class_as_func'
+ # above instead of marking the link as broken.
+-nitpick_ignore = (
++nitpick_ignore = [
+ ('py:class', 'twisted.web2.resource.Resource'),
+- ('py:class', 'twisted.web2.resource.PostableResource'))
++ ('py:class', 'twisted.web2.resource.PostableResource')]
+
+ def nitpick_patch_config(app):
+ """
+--- a/sage/src/sage_setup/docbuild/sphinxbuild.py
++++ b/sage/src/sage_setup/docbuild/sphinxbuild.py
+@@ -200,8 +200,9 @@
+ saved_stderr = sys.stderr
+
+ try:
+- sys.stdout = SageSphinxLogger(sys.stdout, os.path.basename(output_dir))
+- sys.stderr = SageSphinxLogger(sys.stderr, os.path.basename(output_dir))
++ # Sage is too smart for their own good, this poorly-implemented "file" replacement breaks stuff
++ #sys.stdout = SageSphinxLogger(sys.stdout, os.path.basename(output_dir))
++ #sys.stderr = SageSphinxLogger(sys.stderr, os.path.basename(output_dir))
+ sphinx.cmdline.main(sys.argv)
+ finally:
+ sys.stdout = saved_stdout
--
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