## Package: sagemath / 8.6-6

Package Version Patches format
sagemath 8.6-6 3.0 (quilt)

### Patch series

view the series file
Patch File delta Description
u0 version numpy 1.16 inline fortran.patch #27061 | (download)

sage/src/sage/misc/inline_fortran.py | 53 30 + 23 - 0 !
1 file changed, 30 insertions(+), 23 deletions(-)

 fix sage.misc.inline_fortran to work with numpy 1.16

Numpy 1.16 introduced a slight backwards incompatibility such that the
way we were calling f2py.compile() would no longer work for capturing a
log of the f2py output.

It turns out f2py.compile() doesn't do anything very interesting anyways
and has many redundancies with what we do here: It's easy to call f2py
in a subprocess ourselves with the correct arguments and handle the
output.


u0 version ecl 16.1.3.patch #22191 | (download)

sage/src/sage/libs/ecl.pyx | 18 16 + 2 - 0 !
sage/src/sage/libs/eclsig.h | 42 42 + 0 - 0 !
2 files changed, 58 insertions(+), 2 deletions(-)

 set ecl to not trap floating point exceptions, so that sigfpe will
not occur


u0 version sphinx 1.8 dependency.patch #26949 | (download)

sage/src/sage_setup/docbuild/ext/sage_autodoc.py | 829 284 + 545 - 0 !
1 file changed, 284 insertions(+), 545 deletions(-)

 make sage autodoc work for both py2 and py3


u0 version sphinx 1.8.patch #26451 | (download)

sage/src/doc/common/conf.py | 2 1 + 1 - 0 !
sage/src/sage/misc/sphinxify.py | 18 11 + 7 - 0 !
sage/src/sage_setup/docbuild/__init__.py | 2 1 + 1 - 0 !
sage/src/sage_setup/docbuild/ext/inventory_builder.py | 13 13 + 0 - 0 !
sage/src/sage_setup/docbuild/ext/multidocs.py | 47 25 + 22 - 0 !
sage/src/sage_setup/docbuild/ext/sage_autodoc.py | 3 2 + 1 - 0 !
sage/src/sage_setup/docbuild/sphinxbuild.py | 5 3 + 2 - 0 !
7 files changed, 56 insertions(+), 34 deletions(-)

 call sphinx() 1.8 constructor

i.e., do not make srcdir and outdir the same as Sphinx does not allow that
anymore.


u1 sphinx 1.8 doctest transform.patch | (download)

sage/src/doc/common/conf.py | 2 1 + 1 - 0 !
sage/src/sage_setup/docbuild/ext/trim_doctest_flags.py | 67 67 + 0 - 0 !
2 files changed, 68 insertions(+), 1 deletion(-)

 add sphinx extension to modify lines in codeblocks starting with 'sage:'
In particular this removes <BLANKLINE> from doctest codeblocks in the documentation.


sage/src/sage/env.py | 6 6 + 0 - 0 !
sage/src/sage/libs/linbox/fflas.pxd | 1 1 + 0 - 0 !
sage/src/sage/libs/linbox/linbox.pxd | 1 1 + 0 - 0 !
sage/src/sage/libs/linbox/linbox_flint_interface.pxd | 1 1 + 0 - 0 !
4 files changed, 9 insertions(+)

 also use ldflags from pkg-config that are not -l or -l
The concrete failure is that the flag -fopenmp is missing for linbox and fflas-ffpack.
In principle these flags should be respected for all extensions that use
pkg-config, also in module_list.py.


sage/src/sage/repl/ipython_kernel/install.py | 10 9 + 1 - 0 !
1 file changed, 9 insertions(+), 1 deletion(-)

 fix atrocious logic in symlink()
If the desired result is already in effect, do nothing. Otherwise, proceed
with the previous behaviour, but handle permissions errors correctly.
We don't actually need any part of this file in Debian, but fixing this (so
that post-install tests don't fail) was easier than trying to figure out if
removing the file would have other consequences elsewhere.

u1 looser doctest basename.patch #22445 | (download)

sage/src/sage/doctest/sources.py | 4 2 + 2 - 0 !
1 file changed, 2 insertions(+), 2 deletions(-)

 make sage.doctest.sources.get_basename work in more situations
This lets you specify SAGE_SRC like /path/to/test/dir/../../src/dir, which
avoids post-install test failures in sage/doctest/test.py


sage/src/bin/sage | 12 6 + 6 - 0 !
sage/src/bin/sage-cachegrind | 2 1 + 1 - 0 !
sage/src/bin/sage-callgrind | 2 1 + 1 - 0 !
sage/src/bin/sage-env | 2 1 + 1 - 0 !
sage/src/bin/sage-massif | 2 1 + 1 - 0 !
sage/src/bin/sage-omega | 2 1 + 1 - 0 !
sage/src/bin/sage-valgrind | 2 1 + 1 - 0 !
sage/src/sage/doctest/control.py | 12 6 + 6 - 0 !
sage/src/sage/env.py | 1 1 + 0 - 0 !
sage/src/sage/interfaces/maxima.py | 4 2 + 2 - 0 !
10 files changed, 21 insertions(+), 20 deletions(-)

 define and use sage_scripts_dir in more places
So distros can install them somewhere other than /usr/bin

u1 ipywidgets repr.patch #https://github.com/jupyter widgets/ipywidgets/pull/1031 | (download)

sage/src/sage/repl/ipython_kernel/widgets.py | 31 30 + 1 - 0 !
1 file changed, 30 insertions(+), 1 deletion(-)

 money-patch ipywidgets in the way that sage upstream expects
Sage upstream patches ipywidgets, but this is still being discussed
upstream (see Bug below). In the meantime, we can have Sage monkey-patch
ipywidgets at runtime, to prevent other users of ipywidgets being affected.

u1 workaround sympow malloc perturb.patch #https://salsa.debian.org/science team/sympow/merge_requests/1, reported to upstream by private email | (download)

sage/src/sage/lfunctions/sympow.py | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 work around sympow segfault due to malloc_perturb_

u1 fix trivial test cases.patch #25094, #25096, #25102, the interpreter bits do not seem necessary anymore | (download)

sage/src/sage/interfaces/tachyon.py | 2 1 + 1 - 0 !
sage/src/sage/tests/books/judson-abstract-algebra/sylow-sage.py | 2 1 + 1 - 0 !
2 files changed, 2 insertions(+), 2 deletions(-)

 fix trivial test cases to work
Includes cases of:
- add more "..." wildcard patterns to the test
- changing the value to an exactly-equivalent value.
These should probably be forwarded upstream.
.
Also includes cases of:
- update an expected error message to some conceptually identical message


sage/src/sage/lfunctions/sympow.py | 3 2 + 1 - 0 !
1 file changed, 2 insertions(+), 1 deletion(-)

 set sympow_cachedir to be inside dot_sage
Otherwise tests fail in sbuild because sympow can't create HOME/.sympow

u2 allow override sage local.patch | (download)

sage/build/make/install | 4 2 + 2 - 0 !
sage/configure.ac | 2 1 + 1 - 0 !
sage/sage | 2 2 + 0 - 0 !
sage/src/bin/sage-env | 2 1 + 1 - 0 !
sage/src/sage/env.py | 2 1 + 1 - 0 !
5 files changed, 7 insertions(+), 5 deletions(-)

 allow sage_local to be overridden from outside the makefiles
This makes it easier for package managers to create binary distributions.
However, keep SAGE_SPKG_INST relative to SAGE_ROOT rather than SAGE_LOCAL
since that would be a more intrusive change.


sage/src/sage/libs/gap/util.pyx | 14 14 + 0 - 0 !
1 file changed, 14 insertions(+)

 force all symbols in libgap.so to be loaded
This fixes a bug that occurs when trying to load compiled GAP packages using
libgap as opposed to the gap executable.  The problem is caused by the fact
that compiled GAP packages are not currently linked with -lgap; rather they
assume they will be loaded by running the gap executable, which has all of the
GAP library compiled into it and thus is able to resolve all the symbols it
uses at runtime.  However, when using libgap, symbols are resolved lazily by
default (this is in turn due to the dlopen flags that Python uses when
importing a module), and when libgap in turn tries to dlopen() a compiled
GAP module such as io.so, since io.so does not have a DT_NEEDED entry for
libgap it fails to find some of the symbols it needs that haven't been
resolved yet.

This fixes the issue in Sage's libgap interface by immediately, before
initializing GAP, re-dlopen()-ing libgap.so with the RTLD_GLOBAL | RTLD_NOW
flagset, forcing all symbols in the library to be resolved.


sage/src/module_list.py | 4 2 + 2 - 0 !
sage/src/sage/libs/arb/acb.pxd | 2 1 + 1 - 0 !
sage/src/sage/libs/arb/acb_calc.pxd | 2 1 + 1 - 0 !
sage/src/sage/libs/arb/acb_elliptic.pxd | 2 1 + 1 - 0 !
sage/src/sage/libs/arb/acb_hypgeom.pxd | 2 1 + 1 - 0 !
sage/src/sage/libs/arb/acb_modular.pxd | 2 1 + 1 - 0 !
sage/src/sage/libs/arb/acb_poly.pxd | 2 1 + 1 - 0 !
sage/src/sage/libs/arb/arb.pxd | 2 1 + 1 - 0 !
sage/src/sage/libs/arb/arf.pxd | 2 1 + 1 - 0 !
sage/src/sage/libs/arb/bernoulli.pxd | 2 1 + 1 - 0 !
sage/src/sage/libs/arb/mag.pxd | 2 1 + 1 - 0 !
11 files changed, 12 insertions(+), 12 deletions(-)

 link with -lflint-arb instead of -larb
The name of the arb library is libflint-arb in Debian.


sage/src/module_list.py | 7 3 + 4 - 0 !
sage/src/sage/misc/cython.py | 7 3 + 4 - 0 !
2 files changed, 6 insertions(+), 8 deletions(-)

 hard-code gsl cblas paths and keep gslcblas in gsl_libs
Debian does not provide a pkg-config file for libgslcblas,
so just hard-code the paths here for Sage
.
Also, when gslcblas is removed from gsl_libs we currently get this error
at the beginning of the doc build:
ImportError: /usr/lib/x86_64-linux-gnu/libgsl.so.19: undefined symbol: cblas_ctrmv
Does libgsl need to be linked against gslcblas?


sage/src/setup.py | 4 3 + 1 - 0 !
1 file changed, 3 insertions(+), 1 deletion(-)

 add gap library directory
Search libraries in gap's subdirectory where libgap is located.


sage/src/bin/sage | 2 1 + 1 - 0 !
sage/src/doc/en/constructions/plotting.rst | 2 1 + 1 - 0 !
sage/src/sage/interfaces/expect.py | 2 1 + 1 - 0 !
sage/src/sage/interfaces/maxima.py | 4 2 + 2 - 0 !
sage/src/sage/interfaces/maxima_abstract.py | 11 4 + 7 - 0 !
5 files changed, 9 insertions(+), 12 deletions(-)

 change to work with debian's maxima-sage packages


sage/src/doc/common/conf.py | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 change mathjax_path
_static/mathjax are symlinks to /usr/share/javascript/mathjax created in debian/rules.


sage/src/sage/graphs/digraph_generators.py | 2 1 + 1 - 0 !
sage/src/sage/graphs/graph_generators.py | 4 2 + 2 - 0 !
sage/src/sage/graphs/hypergraph_generators.py | 2 1 + 1 - 0 !
3 files changed, 4 insertions(+), 4 deletions(-)

---

sage/src/sage/interfaces/rubik.py | 6 3 + 3 - 0 !
1 file changed, 3 insertions(+), 3 deletions(-)

 find rubiks binaries


sage/src/sage/env.py | 2 1 + 1 - 0 !
sage/src/sage/interfaces/singular.py | 2 1 + 1 - 0 !
sage/src/sage/misc/compat.py | 2 1 + 1 - 0 !
sage/src/sage/misc/cython.py | 5 5 + 0 - 0 !
4 files changed, 8 insertions(+), 3 deletions(-)

 additional changes to work with the debian package of singular
We search for a specific SOVERSION of libsingular-Singular, to allow us to
runtime-Depend on libsingular4 and not libsingular4-dev.

d0 threejs default in notebooks.patch | (download)

sage/src/sage/plot/plot3d/base.pyx | 4 2 + 2 - 0 !
sage/src/sage/repl/rich_output/backend_ipython.py | 2 1 + 1 - 0 !
sage/src/sage/repl/rich_output/backend_sagenb.py | 2 1 + 1 - 0 !
3 files changed, 4 insertions(+), 4 deletions(-)

 use threejs as default 3d viewer in jupyter and sagenb notebooks
In Debian we have jmol, which can be used from the sage command line,
but not jsmol, which is necessary to use jmol in the notebooks. This patch
makes sure that jmol is the default 3D viewer on the command line and threejs
is the default in the notebooks.


sage/src/sage/repl/display/jsmol_iframe.py | 13 13 + 0 - 0 !
sage/src/sage/repl/ipython_kernel/install.py | 1 0 + 1 - 0 !
2 files changed, 13 insertions(+), 1 deletion(-)

 disable installation of jsmol nbextension


sage/build/bin/sage-python23 | 4 2 + 2 - 0 !
sage/src/sage/libs/lcalc/lcalc_sage.h | 2 1 + 1 - 0 !
sage/src/sage/misc/cython.py | 2 1 + 1 - 0 !
sage/src/sage/repl/ipython_kernel/install.py | 2 1 + 1 - 0 !
4 files changed, 5 insertions(+), 5 deletions(-)

 hard-code paths to external system run-time dependencies


sage/src/sage/repl/rich_output/backend_ipython.py | 26 7 + 19 - 0 !
sage/src/sage/repl/rich_output/backend_sagenb.py | 6 4 + 2 - 0 !
2 files changed, 11 insertions(+), 21 deletions(-)

---
d1 install paths.patch # many things in here could be split into an upstreamable patch | (download)

sage/configure.ac | 3 1 + 2 - 0 !
sage/sage | 1 1 + 0 - 0 !
sage/src/Makefile.in | 2 1 + 1 - 0 !
sage/src/module_list.py | 2 1 + 1 - 0 !
sage/src/sage/doctest/sources.py | 4 2 + 2 - 0 !
sage/src/sage/env.py | 8 4 + 4 - 0 !
sage/src/sage/interacts/debugger.py | 4 2 + 2 - 0 !
sage/src/sage_setup/clean.py | 2 1 + 1 - 0 !
sage/src/sage_setup/find.py | 9 4 + 5 - 0 !
sage/src/setup.py | 6 3 + 3 - 0 !
10 files changed, 20 insertions(+), 21 deletions(-)

 install to debian paths
TODO: upstream hard-codes "site-packages" in a bunch of places; these should
be fixed to use SAGE_LIB instead and forwarded upstream. Then this patch could
be a lot smaller.


sage/src/bin/sage | 389 3 + 386 - 0 !
sage/src/sage/tests/cmdline.py | 103 0 + 103 - 0 !
2 files changed, 3 insertions(+), 489 deletions(-)

 patch the sage startup script
This patch removes options that do not work for us
and removes a check for if we are in a sage source directory.
It has only minor modifications from the sage-on-gentoo version.


sage/build/make/deps | 2 1 + 1 - 0 !
sage/build/make/install | 2 1 + 1 - 0 !
sage/src/bin/sage | 34 21 + 13 - 0 !
sage/src/bin/sage-env | 32 10 + 22 - 0 !
sage/src/doc/en/developer/sage_manuals.rst | 2 1 + 1 - 0 !
sage/src/doc/en/faq/faq-general.rst | 2 1 + 1 - 0 !
sage/src/doc/en/installation/source.rst | 2 1 + 1 - 0 !
sage/src/sage/env.py | 25 13 + 12 - 0 !
sage/src/sage_setup/docbuild/__init__.py | 2 1 + 1 - 0 !
9 files changed, 50 insertions(+), 53 deletions(-)

 patch sage-env and env.py
Note that the patched sage-env is only used during the package build and not installed.
.
The LD_LIBRARY_PATH can probably be forwarded upstream, either way is fine.


sage/configure.ac | 1 0 + 1 - 0 !
1 file changed, 1 deletion(-)

 we are building with fakeroot which makes this check fail.
dpkg-buildpackage uses fakeroot debian/rules clean so this is needed


sage/src/sage/misc/sageinspect.py | 8 7 + 1 - 0 !
1 file changed, 7 insertions(+), 1 deletion(-)

 correctly handle debian's python multiarch extension module names
We need to strip that part in order to return the correct ".pyx" filename.
Otherwise a few post-install tests break.


sage/src/sage/misc/copying.py | 2 1 + 1 - 0 !
sage/src/sage/misc/sagedoc.py | 4 2 + 2 - 0 !
2 files changed, 3 insertions(+), 3 deletions(-)

---
d1 disable post install tests.patch | (download)

sage/src/sage/all.py | 8 0 + 8 - 0 !
sage/src/sage/misc/sage_ostools.pyx | 2 0 + 2 - 0 !
2 files changed, 10 deletions(-)

 disable some post-install tests
We don't need to test these pre-install either because they're already
implicitly tested by other parts of the build process.

df revert minor feature dependent on python patch.patch | (download)

sage/src/sage/rings/integer.pyx | 10 0 + 10 - 0 !
1 file changed, 10 deletions(-)

 revert sage commit 5dbc699911095dd03f0141a7c1b7ba1c7056ceef
This is dependent on a python patch that hasn't landed upstream or in Debian
yet. It adds a minor feature used nowhere except the doctests, so just revert
it because we know it will break.


sage/src/sage/doctest/control.py | 25 13 + 12 - 0 !
sage/src/sage/tests/cmdline.py | 33 17 + 16 - 0 !
2 files changed, 30 insertions(+), 28 deletions(-)

---
df sage gap reset doctest.patch | (download)

sage/src/sage/interfaces/gap.py | 1 1 + 0 - 0 !
1 file changed, 1 insertion(+)

 reset the sage-local gap workspace before the first test
Otherwise it causes test errors, if the workspace contains files from older
versions of gap.


sage/src/sage/libs/ecl.pyx | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

---

sage/src/sage_setup/docbuild/__init__.py | 27 2 + 25 - 0 !
sage/src/sage_setup/docbuild/sphinxbuild.py | 5 5 + 0 - 0 !
2 files changed, 7 insertions(+), 25 deletions(-)

 use subprocess to run parallel sphinx build
The upstream sphinx parallel build segfaults because we don't patch Python,
see our revert-lazy-import patches for details. (Those reverts are needed to
make the serial build not segfault, but the parallel build still segfaults.)
.
We used to disable parallel build completely, but it was too slow. This
alternative method of running the parallel build seems to work OK.
.
As of SageMath 8.0 the RAM usage seems to be more reasonable (~3-4GB for 4
threads), but please complain on the mailing list if this eats your machine.

dt version glpk 4.60 extra hacky fixes.patch | (download)

sage/src/sage/libs/glpk/error.pyx | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 work around sage/glpk differences to fix remaining glpk doctests
Sage upstream patch GLPK. Most of this was accepted by upstream, however they
rejected one minor part of it:
https://git.sagemath.org/sage.git/tree/build/pkgs/glpk/patches/error_recovery.patch?id=3e8450b13d5c5353cd45d5881acf59994cf28b6b
This is described in some more detail here:
https://trac.sagemath.org/ticket/20710#comment:18
It turns out this is quite important for Sage:
.
Since we don't patch GLPK the same way in Debian, this means that if GLPK in
Sage causes one error, and this is caught by Sage and recovered from, then
later (because upstream GLPK is not clear the "error" flag) Sage will append
all subsequent terminal output of GLPK into the error_message string but not
actually forward it to the user's terminal. This breaks some doctests.
.
The patch below disables the terminal supression, so that doctests work again.
In this sense, it is not *this patch* that is hacky; this patch can remain -
all it does is print some extra messages to the terminal. However, this
inherent incompatibility between what upstream GLPK does and what Sage
expects, may cause other problems for us later, so I am just documenting this
in detail for future maintainers.