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

pkgs/sagemath-doc-{html,pdf} #36730

Draft
wants to merge 51 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
0965056
pkgs/sagemath-doc-html: New; build/pkgs/sagemath_doc_html/bootstrap: …
mkoeppe Jul 27, 2024
baa363c
pkgs/sagemath-doc-html: Use meson-python
mkoeppe Oct 22, 2024
1837273
Install via wheel
mkoeppe Nov 17, 2023
000a31e
build/pkgs/sagemath_doc_html/spkg-install: Respect SAGE_WHEELS
mkoeppe Nov 18, 2023
762e0ed
build/make/Makefile.in (WHEEL_PACKAGES): Add sagemath_doc_{html,pdf}
mkoeppe Nov 18, 2023
434498b
pkgs/sagemath-doc-html: Add meson_dist_script.sh
mkoeppe Nov 18, 2023
8338c9a
build/pkgs/sagemath_doc_html: Update dependencies, build wheel directly
mkoeppe Oct 22, 2024
da119c7
pkgs/sagemath-doc-pdf: New
mkoeppe Mar 23, 2024
93ef0d0
pkgs/sagemath-doc-*/pyproject.toml.m4: Fix license, other metadata
mkoeppe Nov 18, 2023
84a4683
build/pkgs/sagemath_doc_pdf/bootstrap: Add missing file
mkoeppe Nov 18, 2023
51a64d5
build/pkgs/sagemath_doc_*: Parallelize make when parallelized
mkoeppe Nov 18, 2023
4d94250
pkgs/sagemath-doc-pdf/README.rst: Update
mkoeppe Nov 18, 2023
72c46c0
.gitignore: Update
mkoeppe Nov 18, 2023
60eada8
build/pkgs/sagemath_doc_*: Add package-version.txt (as symlink)
mkoeppe Nov 19, 2023
1a2ef50
pkgs/sagemath-doc-*/meson.build: Read version from VERSION.txt
mkoeppe Nov 19, 2023
a8ffdbc
pkgs/sagemath-doc-*/pyproject.toml.m4: Get version from meson-python
mkoeppe Nov 19, 2023
41524ee
pkgs/sagemath-doc-*/meson.build: Suggested simplications and comments
mkoeppe Nov 20, 2023
9320fc8
pkgs/sagemath-doc-pdf/meson.build: Fix syntax
mkoeppe Nov 22, 2023
efd445c
src/doc/make.sh: Do not assume $MAKE is set
mkoeppe Nov 23, 2023
2fce181
pkgs/sagemath-doc-html/meson_dist_script.sh: Do not ship the m4 file
mkoeppe Nov 23, 2023
ac57bf8
pkgs/sagemath-doc-*/meson.build: Set SAGE_DOC_SRC
mkoeppe Nov 28, 2023
031c556
pkgs/sagemath-doc-html/meson_dist_script.sh: Fix the sdist
mkoeppe Nov 28, 2023
c63d630
pkgs/sagemath-doc-*: Make a writable copy of the source
mkoeppe Nov 29, 2023
66516ee
pkgs/sagemath-doc-pdf/meson.build: Copy fix from -html
mkoeppe Nov 29, 2023
bb745d9
src/doc/Makefile: Remove test for SAGE_ROOT as suggested
mkoeppe Nov 29, 2023
2ef7dbc
src/sage_docbuild/builders.py: Do not depend on MAKE environment vari…
mkoeppe Nov 29, 2023
04237c1
pkgs/sagemath-doc-html: Move helper scripts here from src/doc
mkoeppe Dec 1, 2023
2919c7b
pkgs/sagemath-doc-*/meson.build: Use console: true
mkoeppe Dec 3, 2023
5feb7de
pkgs/sagemath-doc-html/copy_doc_src.py: Do not fail if destination ex…
mkoeppe Dec 3, 2023
0daa689
build/pkgs/sagemath_doc_{html,pdf}/spkg-install.in: Rename from spkg-…
mkoeppe Mar 23, 2024
f49053f
build/pkgs/sagemath_doc_{html,pdf}: Use sdh_build_wheel instead of us…
mkoeppe Oct 22, 2024
74e6727
build/pkgs/sagemath_doc_{html,pdf}/spkg-legacy-uninstall: New
mkoeppe Mar 23, 2024
de4c691
build/pkgs/sagemath_doc_{html,pdf}/spkg-install.in: In editable mode,…
mkoeppe Jun 11, 2024
69de3f3
build/pkgs/sagemath_doc_pdf/dependencies: Remove outdated comments
mkoeppe Mar 24, 2024
ae5d9ca
pkgs/sagemath-doc-{html,pdf}/VERSION.txt: Update
mkoeppe Mar 24, 2024
183dfa5
pkgs/sagemath-doc-{html,pdf}/README.rst: Update copyright year
mkoeppe Mar 24, 2024
b500385
build/pkgs/sagemath_doc_{html,pdf}/spkg-install.in: In editable mode,…
mkoeppe Mar 24, 2024
55b0c83
doc-build.yml: Build live doc and wheels on release tags
mkoeppe Jul 27, 2024
9b21f85
.github/workflows/doc-build*.yml: Do not run on pushes to branches
mkoeppe Mar 24, 2024
6954840
build/pkgs/sagemath_doc_{html,pdf}/spkg-install.in: Use --no-build-is…
mkoeppe Mar 24, 2024
06096c4
build/make/Makefile.in (script package -sdist): Add meson_python as dep
mkoeppe Mar 24, 2024
e7a9bc7
.github/workflows/doc-build.yml: Fix wheel location
mkoeppe Mar 24, 2024
5336495
.github/workflows/doc-build.yml: Simplify, upgrade actions
mkoeppe Jun 11, 2024
278eecf
build/pkgs/sagemath_doc_*: Rename install-requires.txt to version_req…
mkoeppe May 10, 2024
dafc6dd
build/pkgs/sagemath_doc_html/spkg-install.in: Restrict find to 'cp*'
mkoeppe May 10, 2024
d60e0d6
.github/workflows/doc-build.yml: Fix workdir for livedoc build
mkoeppe May 10, 2024
7a2221d
.github/workflows/doc-build.yml: Fix 'copy docs', 'copy livedoc'
mkoeppe Jul 27, 2024
0678f63
build/pkgs/sagemath_doc_pdf/spkg-install.in: Restrict find to 'cp*'
mkoeppe May 11, 2024
7cb87d1
.github/workflows/doc-build.yml: Update livedoc to container build
mkoeppe Jul 27, 2024
58deba5
build/pkgs/sagemath_doc_*: Install in a tree SAGE_VENV_DOCS
mkoeppe May 30, 2024
58e30fe
build/pkgs/sagemath_doc_*: Install links into SAGE_DOCS in postinst
mkoeppe May 30, 2024
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
1 change: 0 additions & 1 deletion .ci/write-dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ FROM with-system-packages AS bootstrapped
RUN rm -rf /new /sage/.git
$ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap bootstrap-conda configure.ac sage .homebrew-build-env tox.ini Pipfile.m4 .gitignore /new/
$ADD config/config.rpath /new/config/config.rpath
$ADD src/doc/bootstrap /new/src/doc/bootstrap
$ADD src/bin /new/src/bin
$ADD src/Pipfile.m4 src/pyproject.toml src/requirements.txt.m4 src/setup.cfg.m4 src/VERSION.txt /new/src/
$ADD m4 /new/m4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc-build-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build documentation (PDF)

on:
pull_request:
push:
merge_group:
workflow_dispatch:
# Allow to run manually
inputs:
Expand Down
30 changes: 27 additions & 3 deletions .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ env:
FROM_DOCKER_TARGET: "with-targets"
FROM_DOCKER_TAG: ${{ github.event.inputs.docker_tag || 'dev'}}
EXTRA_CONFIGURE_ARGS: --enable-fat-binary
# For deployment of the sagemath_doc_... wheels to PyPI
CAN_DEPLOY: ${{ secrets.SAGEMATH_PYPI_API_TOKEN != '' }}

jobs:
build-doc:
Expand Down Expand Up @@ -164,6 +166,10 @@ jobs:
git add -A && git commit --quiet -m 'old')
fi

#
# On PRs and pushes to branches
#

- name: Build doc
id: docbuild
if: (success() || failure()) && steps.worktree.outcome == 'success' && !startsWith(github.ref, 'refs/tags/')
Expand Down Expand Up @@ -221,7 +227,7 @@ jobs:

- name: Upload doc
id: upload
if: (success() || failure()) && steps.copy.outcome == 'success'
if: (success() || failure()) && steps.copy.outcome == 'success' && !startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
name: doc
Expand All @@ -243,8 +249,8 @@ jobs:
export SAGE_USE_CDNS=yes
export SAGE_LIVE_DOC=yes
export SAGE_JUPYTER_SERVER=binder:sagemath/sage-binder-env/dev
make doc-clean doc-uninstall
./config.status && make sagemath_doc_html-no-deps sagemath_doc_pdf-no-deps
./config.status && make SAGE_WHEELS=yes SAGE_EDITABLE=no sagemath_doc_html-no-deps sagemath_doc_pdf-no-deps
(cd venv/var/lib/sage/ && zip /sage/sagemath_doc_wheels.zip wheels/sagemath_doc*.whl)
shell: sh .ci/docker-exec-script.sh BUILD /sage {0}

- name: Copy live doc
Expand All @@ -257,6 +263,8 @@ jobs:
docker cp --follow-link BUILD:/sage/local/share/doc/sage/pdf livedoc
docker cp --follow-link BUILD:/sage/local/share/doc/sage/index.html livedoc
zip -r livedoc.zip livedoc
docker cp BUILD:/sage/sagemath_doc_wheels.zip .
unzip sagemath_doc_wheels.zip

- name: Upload live doc
if: (success() || failure()) && steps.copylivedoc.outcome == 'success'
Expand All @@ -265,3 +273,19 @@ jobs:
name: livedoc
path: livedoc.zip

- name: Upload sagemath-doc wheels
id: uploaddocwheels
if: (success() || failure()) && steps.buildlivedoc.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: sagemath_doc_wheels
path: sagemath_doc_wheels.zip

- uses: pypa/gh-action-pypi-publish@release/v1
if: (success() || failure()) && steps.buildlivedoc.outcome == 'success' && env.CAN_DEPLOY == 'true'
with:
user: __token__
password: ${{ secrets.SAGEMATH_PYPI_API_TOKEN }}
packages-dir: wheels/
skip-existing: true
verbose: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ build/pkgs/wheel/version_requirements.txt

# Generated files in the top-level source trees
/pkgs/*/build
/pkgs/*/.mesonpy-*
/pkgs/*/dist
/pkgs/*/MANIFEST
/pkgs/*/*.egg-info
Expand Down Expand Up @@ -235,6 +236,7 @@ build/pkgs/wheel/version_requirements.txt
/pkgs/sagemath-sirocco/pyproject.toml
/pkgs/sagemath-tdlib/pyproject.toml
/pkgs/sagemath-categories/pyproject.toml
/pkgs/sagemath-doc-*/pyproject.toml
/pkgs/sagemath-environment/pyproject.toml
/pkgs/sagemath-repl/pyproject.toml
/pkgs/sagemath-objects/requirements*.txt
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ SPKG_INFO_DEPENDENCIES = \
build/pkgs/*/version_requirements.txt build/pkgs/*/package-version.txt \
build/pkgs/*/distros/*.txt

configure: bootstrap src/doc/bootstrap $(CONFIGURE_DEPENDENCIES) $(SPKG_INFO_DEPENDENCIES)
configure: bootstrap $(CONFIGURE_DEPENDENCIES) $(SPKG_INFO_DEPENDENCIES)
./bootstrap -d

install: all
Expand Down
11 changes: 8 additions & 3 deletions build/make/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ SAGE_SPKG_OPTIONS = @SAGE_SPKG_OPTIONS@
# set to empty if --disable-doc is used
SAGE_DOCS = @SAGE_DOCS@
SAGE_DOCS_DISABLED_MESSAGE = This Sage build is configured with "configure --disable-doc", so building the documentation will not work.
SAGE_VENV_DOCS = @SAGE_VENV_DOCS@
SAGE_VENV_DOCS_DISABLED_MESSAGE = This Sage build is configured with "configure --disable-doc", so building the documentation will not work.

# Where the Sage distribution installs Python packages.
# This can be overridden by 'make SAGE_VENV=/some/venv'.
Expand Down Expand Up @@ -148,11 +150,14 @@ PYPI_WHEEL_PACKAGES = $(PYPI_NOARCH_WHEEL_PACKAGES) \
sagemath_sirocco \
sagemath_meataxe

# sage_docbuild is here, not in PYPI_WHEEL_PACKAGES, because it depends on sagelib
# sage_docbuild is here, not in PYPI_WHEEL_PACKAGES, because it depends on sagelib.
# This can be changed when we have separate 'dependencies_build' files.
WHEEL_PACKAGES = $(PYPI_WHEEL_PACKAGES) \
sage_conf \
sagelib \
sage_docbuild
sage_docbuild \
sagemath_doc_html \
sagemath_doc_pdf

# Packages for which build sdists for PyPI
PYPI_SDIST_PACKAGES = $(WHEEL_PACKAGES)
Expand Down Expand Up @@ -772,7 +777,7 @@ $(1)-uninstall: $(1)-$(4)-uninstall

$(1)-clean: $(1)-uninstall

$(1)-sdist: FORCE python_build sage_setup cython
$(1)-sdist: FORCE python_build sage_setup cython meson_python
$(AM_V_at) cd '$$(SAGE_ROOT)' && \
. '$$(SAGE_ROOT)/src/bin/sage-src-env-config' && \
. '$$(SAGE_ROOT)/src/bin/sage-env-config' && \
Expand Down
1 change: 0 additions & 1 deletion build/pkgs/sagemath_doc_html/bootstrap

This file was deleted.

184 changes: 184 additions & 0 deletions build/pkgs/sagemath_doc_html/bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
#!/usr/bin/env bash

########################################################################
# Regenerate auto-generated files, using information in SAGE_ROOT/build/
#
# This script is run by SAGE_ROOT/bootstrap as part of the bootstrapping phase
# (before configure, before creating source distributions).
#
# The BOOTSTRAP_QUIET variable is set by the top-level
# bootstrap script and controls how verbose we are.
########################################################################

set -e

if [ -z "$SAGE_ROOT" ]; then
echo Please run the top-level bootstrap script of the Sage distribution.
exit 1
fi

./bootstrap_m4

cd "$SAGE_ROOT"

OUTPUT_DIR="src/doc/en/installation"
mkdir -p "$OUTPUT_DIR"

shopt -s extglob

RECOMMENDED_SPKG_PATTERN="@(_recommended$(for a in $(head -n 1 build/pkgs/_recommended/dependencies); do echo -n "|"$a; done))"
DEVELOP_SPKG_PATTERN="@(_develop$(for a in $(head -n 1 build/pkgs/_develop/dependencies); do echo -n "|"$a; done))"

for SYSTEM in arch debian fedora homebrew opensuse void; do
SYSTEM_PACKAGES=
OPTIONAL_SYSTEM_PACKAGES=
SAGELIB_SYSTEM_PACKAGES=
SAGELIB_OPTIONAL_SYSTEM_PACKAGES=
RECOMMENDED_SYSTEM_PACKAGES=
DEVELOP_SYSTEM_PACKAGES=
for PKG_BASE in $(sage-package list --has-file distros/$SYSTEM.txt); do
PKG_SCRIPTS=build/pkgs/$PKG_BASE
PKG_TYPE=$(cat $PKG_SCRIPTS/type)
PKG_SYSTEM_PACKAGES=$(sage-get-system-packages $SYSTEM $PKG_BASE)
if [ -n "PKG_SYSTEM_PACKAGES" ]; then
if [ -f $PKG_SCRIPTS/spkg-configure.m4 ]; then
case "$PKG_BASE:$PKG_TYPE" in
*:standard)
SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
;;
$DEVELOP_SPKG_PATTERN:*)
DEVELOP_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
;;
$RECOMMENDED_SPKG_PATTERN:*)
RECOMMENDED_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
;;
*)
OPTIONAL_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
;;
esac
else
case "$PKG_BASE:$PKG_TYPE" in
$DEVELOP_SPKG_PATTERN:*)
DEVELOP_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
;;
*:standard)
SAGELIB_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
;;
*)
SAGELIB_OPTIONAL_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
;;
esac
fi
fi
done

if [ "${BOOTSTRAP_QUIET}" = "no" ]; then
echo >&2 $0:$LINENO: installing "$OUTPUT_DIR"/$SYSTEM"*.txt"
fi
echo "$(sage-print-system-package-command $SYSTEM --prompt --wrap --sudo install $(echo $(echo $SYSTEM_PACKAGES | xargs -n 1 echo | sort | uniq)))" > "$OUTPUT_DIR"/$SYSTEM.txt
echo "$(sage-print-system-package-command $SYSTEM --prompt --wrap --sudo install $(echo $(echo $OPTIONAL_SYSTEM_PACKAGES | xargs -n 1 echo | sort | uniq)))" > "$OUTPUT_DIR"/$SYSTEM-optional.txt
echo "$(sage-print-system-package-command $SYSTEM --prompt --wrap --sudo install $(echo $(echo $RECOMMENDED_SYSTEM_PACKAGES | xargs -n 1 echo | sort | uniq)))" > "$OUTPUT_DIR"/$SYSTEM-recommended.txt
echo "$(sage-print-system-package-command $SYSTEM --prompt --wrap --sudo install $(echo $(echo $DEVELOP_SYSTEM_PACKAGES | xargs -n 1 echo | sort | uniq)))" > "$OUTPUT_DIR"/$SYSTEM-develop.txt
done

OUTPUT_DIR="src/doc/en/reference/spkg"
mkdir -p "$OUTPUT_DIR"
if [ "${BOOTSTRAP_QUIET}" = "no" ]; then
echo >&2 $0:$LINENO: installing "$OUTPUT_DIR"/"*.rst"
fi
(cat <<EOF
Mathematics
~~~~~~~~~~~

EOF
for PKG_BASE in $(sage-package list --has-file SPKG.rst --has-file math :standard: | grep -v '^sagemath_'); do
echo "* :ref:\`spkg_$PKG_BASE\`"
done
cat <<EOF

Front-end, graphics, document preparation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

EOF
for PKG_BASE in $(sage-package list --has-file SPKG.rst --no-file math --has-file front-end :standard: | grep -v '^sagemath_'); do
echo "* :ref:\`spkg_$PKG_BASE\`"
done
cat <<EOF

Other dependencies
~~~~~~~~~~~~~~~~~~

EOF
for PKG_BASE in $(sage-package list --has-file SPKG.rst --no-file math --no-file front-end :standard: | grep -v '^sagemath_'); do
echo "* :ref:\`spkg_$PKG_BASE\`"
done) > "$OUTPUT_DIR"/index_standard.rst
(cat <<EOF
Mathematics
~~~~~~~~~~~

EOF
for PKG_BASE in $(sage-package list --has-file SPKG.rst --has-file math :optional: | grep -v '^sagemath_'); do
echo "* :ref:\`spkg_$PKG_BASE\`"
done
cat <<EOF

Front-end, graphics, document preparation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

EOF
for PKG_BASE in $(sage-package list --has-file SPKG.rst --no-file math --has-file front-end :optional: | grep -v '^sagemath_'); do
echo "* :ref:\`spkg_$PKG_BASE\`"
done
cat <<EOF

Other dependencies
~~~~~~~~~~~~~~~~~~

EOF
for PKG_BASE in $(sage-package list --has-file SPKG.rst --no-file math --no-file front-end :optional: | grep -v '^sagemath_'); do
echo "* :ref:\`spkg_$PKG_BASE\`"
done) > "$OUTPUT_DIR"/index_optional.rst
for PKG_BASE in $(sage-package list --has-file SPKG.rst | grep '^sagemath_'); do
echo "* :ref:\`spkg_$PKG_BASE\`"
done > "$OUTPUT_DIR"/index_sagemath.rst
(cat <<EOF
Mathematics
~~~~~~~~~~~

EOF
for PKG_BASE in $(sage-package list --has-file SPKG.rst --has-file math :experimental: | grep -v '^sagemath_'); do
echo "* :ref:\`spkg_$PKG_BASE\`"
done

cat <<EOF

Other dependencies
~~~~~~~~~~~~~~~~~~

EOF
for PKG_BASE in $(sage-package list --has-file SPKG.rst --no-file math :experimental: | grep -v '^sagemath_'); do
echo "* :ref:\`spkg_$PKG_BASE\`"
done) > "$OUTPUT_DIR"/index_experimental.rst
(cat <<EOF

Details of external packages
============================

Packages are in alphabetical order.

.. default-role:: code

.. toctree::
:maxdepth: 1

EOF
for PKG_BASE in $(sage-package list --has-file SPKG.rst); do
echo " $PKG_BASE"
done
cat <<EOF

.. default-role::

EOF
) > "$OUTPUT_DIR"/index_alph.rst
sage-package list --has-file SPKG.rst | OUTPUT_DIR=$OUTPUT_DIR OUTPUT_RST=1 xargs -P 99 -n 1 sage-spkg-info
1 change: 1 addition & 0 deletions build/pkgs/sagemath_doc_html/bootstrap_m4
2 changes: 1 addition & 1 deletion build/pkgs/sagemath_doc_html/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sagelib sphinx sphinx_copybutton sphinx_inline_tabs pplpy_doc | $(SAGERUNTIME) maxima networkx scipy sympy matplotlib pillow mathjax mpmath ipykernel jupyter_client conway_polynomials tachyon ipywidgets sage_docbuild elliptic_curves furo fpylll graphs
sagelib sphinx sphinx_copybutton sphinx_inline_tabs pplpy_doc | $(SAGERUNTIME) maxima networkx scipy sympy matplotlib pillow mathjax mpmath ipykernel jupyter_client conway_polynomials tachyon ipywidgets sage_docbuild elliptic_curves furo fpylll graphs meson_python

# Building the documentation has many dependencies, because all
# documented modules are imported and because we use matplotlib to
Expand Down
1 change: 1 addition & 0 deletions build/pkgs/sagemath_doc_html/package-version.txt
3 changes: 0 additions & 3 deletions build/pkgs/sagemath_doc_html/spkg-install

This file was deleted.

20 changes: 20 additions & 0 deletions build/pkgs/sagemath_doc_html/spkg-install.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
cd src

# Needed because we have trees.txt, which directs us to $SAGE_LOCAL/...
export PIP_FIND_LINKS=$SAGE_VENV/var/lib/sage/wheels

if [ "$SAGE_EDITABLE" = yes ]; then
# Editables 0.5 does not map non-package data files
# https://editables.readthedocs.io/en/latest/use-cases.html#mapping-non-python-directories-or-files
mkdir -p ${SAGE_DESTDIR}${SAGE_INST_LOCAL}/share/doc/sage
sdh_pip_editable_install .
# We expect a subdirectory like build/cp312.
# Use 'find -newer' to use the one just created/modified by the editable build.
find $(pwd -P)/build -maxdepth 1 -name "cp*" -newer ${SAGE_DESTDIR}${SAGE_INST_LOCAL} -exec \
ln -svf {}/html {}/index.html ${SAGE_DESTDIR}${SAGE_INST_LOCAL}/share/doc/sage/ \;
if [ "$SAGE_WHEELS" = yes ]; then
sdh_build_and_store_wheel --no-build-isolation .
fi
else
sdh_pip_install --no-build-isolation .
fi
4 changes: 4 additions & 0 deletions build/pkgs/sagemath_doc_html/spkg-legacy-uninstall
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#! /usr/bin/env bash
if [ -d "$SAGE_DOC" ]; then
rm -rf "$SAGE_DOC"/doctrees "$SAGE_DOC"/inventory "$SAGE_DOC"/html "$SAGE_DOC"/*.html
fi
7 changes: 7 additions & 0 deletions build/pkgs/sagemath_doc_html/spkg-postinst.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mkdir -p "${SAGE_DOC}"
cd "${SAGE_INST_LOCAL}/share/doc/sage"
for a in *; do
if [ -e "$a" -a ! -e "${SAGE_DOC}/$a" ]; then
ln -sf "${SAGE_INST_LOCAL}/share/doc/sage/$a" "${SAGE_DOC}/$a"
fi
done
Loading
Loading