## Package: sagemath / 8.9~beta9-1

Package Version Patches format
sagemath 8.9~beta9-1 3.0 (quilt)

### Patch series

view the series file
Patch File delta Description

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



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.


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-env | 2 1 + 1 - 0 !
sage/src/sage/doctest/control.py | 6 3 + 3 - 0 !
sage/src/sage/env.py | 1 1 + 0 - 0 !
sage/src/sage/interfaces/maxima.py | 4 2 + 2 - 0 !
5 files changed, 13 insertions(+), 12 deletions(-)

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


sage/src/sage/repl/ipython_kernel/widgets.py | 32 31 + 1 - 0 !
1 file changed, 31 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 !
1 file changed, 1 insertion(+), 1 deletion(-)

 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/interfaces/r.py | 20 10 + 10 - 0 !
1 file changed, 10 insertions(+), 10 deletions(-)

 adjustments for rpy 3
ri2py was renamed to rpy2py. Upstream still uses rpy 2.8.2.


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


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/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/sage/env.py | 2 1 + 1 - 0 !
sage/src/setup.py | 4 3 + 1 - 0 !
2 files changed, 4 insertions(+), 2 deletions(-)

 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 | 6 3 + 3 - 0 !
5 files changed, 8 insertions(+), 8 deletions(-)

 change to work with debian's maxima-sage packages


sage/src/sage/docs/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 !
3 files changed, 3 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.


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/repl/ipython_kernel/install.py | 2 1 + 1 - 0 !
3 files changed, 4 insertions(+), 4 deletions(-)

 hard-code paths to external system run-time dependencies


sage/src/sage/repl/rich_output/backend_ipython.py | 9 2 + 7 - 0 !
1 file changed, 2 insertions(+), 7 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/env.py | 2 1 + 1 - 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 | 7 3 + 4 - 0 !
sage/src/setup.py | 6 3 + 3 - 0 !
9 files changed, 14 insertions(+), 15 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 | 397 3 + 394 - 0 !
sage/src/sage/tests/cmdline.py | 47 0 + 47 - 0 !
2 files changed, 3 insertions(+), 441 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 | 15 9 + 6 - 0 !
sage/src/bin/sage-env | 27 8 + 19 - 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 | 35 13 + 22 - 0 !
sage/src/sage_setup/docbuild/__init__.py | 2 1 + 1 - 0 !
9 files changed, 36 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/src/bin/math-readline | 2 1 + 1 - 0 !
sage/src/bin/sage-cleaner | 2 1 + 1 - 0 !
sage/src/bin/sage-coverage | 2 1 + 1 - 0 !
sage/src/bin/sage-coverageall | 2 1 + 1 - 0 !
sage/src/bin/sage-location | 2 1 + 1 - 0 !
sage/src/bin/sage-num-threads.py | 2 1 + 1 - 0 !
sage/src/bin/sage-pkg | 2 1 + 1 - 0 !
sage/src/bin/sage-pypkg-location | 2 1 + 1 - 0 !
sage/src/bin/sage-run | 2 1 + 1 - 0 !
sage/src/bin/sage-sws2rst | 2 1 + 1 - 0 !
sage/src/bin/sage-unzip | 2 1 + 1 - 0 !
11 files changed, 11 insertions(+), 11 deletions(-)

 use python3 in shebangs
In Debian python is python2.


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(-)

---

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 | 16 0 + 16 - 0 !
2 files changed, 13 insertions(+), 28 deletions(-)

---

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 | 26 2 + 24 - 0 !
sage/src/sage_setup/docbuild/sphinxbuild.py | 5 5 + 0 - 0 !
2 files changed, 7 insertions(+), 24 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


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.


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

 ignore warnings of glpk 4.65 when parsing doctests
GLPK 4.65 prints warnings which lead to failing doctests.
Upstream does not use GLPK 4.65 yet. Ignore the warnings until a
solution is found.


sage/src/doc/en/constructions/algebraic_geometry.rst | 6 3 + 3 - 0 !
sage/src/doc/en/developer/coding_in_other.rst | 7 0 + 7 - 0 !
sage/src/sage/interfaces/tests.py | 2 1 + 1 - 0 !
3 files changed, 4 insertions(+), 11 deletions(-)

 temporary fixes to some more test cases
Every override in this file should be accompanied by an explanation on why
it's only going to be temporary and when it can be expected to be removed.


sage/src/bin/sage | 6 6 + 0 - 0 !
1 file changed, 6 insertions(+)

---

sage/src/sage/cpython/debug.pyx | 2 1 + 1 - 0 !
sage/src/sage/interacts/test_jupyter.rst | 165 82 + 83 - 0 !
sage/src/sage/repl/ipython_kernel/interact.py | 36 18 + 18 - 0 !
sage/src/sage/repl/ipython_kernel/widgets.py | 20 10 + 10 - 0 !
sage/src/sage/repl/ipython_kernel/widgets_sagenb.py | 72 36 + 36 - 0 !
5 files changed, 147 insertions(+), 148 deletions(-)

 upgrade to ipywidgets 7


 adjust tests for ipywidgets 6