sage: matplotlib 3.6 upgrade fixes

This commit is contained in:
Mauricio Collares 2023-01-18 14:00:35 +01:00
parent 1a355ae751
commit 6692659ce6
2 changed files with 16 additions and 25 deletions

View File

@ -1,21 +0,0 @@
diff --git a/src/sage_docbuild/ext/multidocs.py b/src/sage_docbuild/ext/multidocs.py
index f91c7753ca..edeb81ff2e 100644
--- a/src/sage_docbuild/ext/multidocs.py
+++ b/src/sage_docbuild/ext/multidocs.py
@@ -284,6 +284,16 @@ def init_subdoc(app):
if not app.config.multidoc_first_pass:
app.connect('env-updated', fetch_citation)
+ def fix_matplotlib_css_permissions(app: Sphinx, env):
+ css_file = os.path.join(app.builder.outdir, '_static', 'plot_directive.css')
+ try:
+ os.chmod(css_file, 0o644)
+ except:
+ pass
+
+ # executed after matplotlib's _copy_css_file
+ app.connect('build-finished', fix_matplotlib_css_permissions, priority=600)
+
# Monkey patch copy_static_files to make a symlink to "../"
def link_static_files():
"""

View File

@ -80,10 +80,6 @@ stdenv.mkDerivation rec {
# Parallelize docubuild using subprocesses, fixing an isolation issue. See
# https://groups.google.com/forum/#!topic/sage-packaging/YGOm8tkADrE
./patches/sphinx-docbuild-subprocesses.patch
# Docbuilding copies files from the Nix store and expects them to be writable.
# Remove when https://github.com/matplotlib/matplotlib/pull/23805 lands.
./patches/sphinx-fix-matplotlib-css-perms.patch
];
# Since sage unfortunately does not release bugfix releases, packagers must
@ -163,6 +159,22 @@ stdenv.mkDerivation rec {
# conflicts. The patch below contains rebased versions.
./patches/pari-2.15.1-upgrade-rebased.patch
# https://trac.sagemath.org/ticket/34668
(fetchSageDiff {
name = "matplotlib-3.6-upgrade.patch";
base = "9.8.beta2";
rev = "5501e0de0dca1cff0355326dd42bd8c7e5749568";
sha256 = "sha256-ceJkVaecIsZewN8v/3gPQXFbFjv5Akz6zEFg/ToXdek=";
})
# https://trac.sagemath.org/ticket/34693
(fetchSageDiff {
name = "matplotlib-3.6-docbuilding.patch";
base = "9.8.beta4";
rev = "64589686c261d33e6b5aff2589bcae8af004bcc6";
sha256 = "sha256-j5AMY1TmhP+HBBBYaFZSkABJ5vtwe6iP2LRfGEgSm8Q=";
})
# Sage uses mixed integer programs (MIPs) to find edge disjoint
# spanning trees. For some reason, aarch64 glpk takes much longer
# than x86_64 glpk to solve such MIPs. Since the MIP formulation