Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sageWithDoc: fix documentation index #189776

Merged
merged 1 commit into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the above try/except is just for future-proofing. All os.chmod calls introduced by my patch succeed as of Sage 9.6.

+ 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():
"""
4 changes: 4 additions & 0 deletions pkgs/applications/science/math/sage/sage-src.nix
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ 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
Expand Down