Skip to content

Commit a559748

Browse files
author
Matthias Koeppe
committed
pkgs/sagemath-doc-html: New; build/pkgs/sagemath_doc_html/bootstrap: Move here from src/doc
1 parent fa5c939 commit a559748

File tree

19 files changed

+343
-233
lines changed

19 files changed

+343
-233
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ build/bin/sage-build-env-config
221221
/pkgs/sagemath-sirocco/pyproject.toml
222222
/pkgs/sagemath-tdlib/pyproject.toml
223223
/pkgs/sagemath-categories/pyproject.toml
224+
/pkgs/sagemath-doc-*/pyproject.toml
224225
/pkgs/sagemath-environment/pyproject.toml
225226
/pkgs/sagemath-repl/pyproject.toml
226227
/pkgs/sagemath-objects/requirements.txt

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ ptestoptionallong-nodoc:
321321

322322
###############################################################################
323323

324-
configure: bootstrap src/doc/bootstrap configure.ac src/bin/sage-version.sh m4/*.m4 build/pkgs/*/spkg-configure.m4 build/pkgs/*/type build/pkgs/*/install-requires.txt build/pkgs/*/package-version.txt build/pkgs/*/distros/*.txt
324+
configure: bootstrap configure.ac src/bin/sage-version.sh m4/*.m4 build/pkgs/*/spkg-configure.m4 build/pkgs/*/type build/pkgs/*/install-requires.txt build/pkgs/*/package-version.txt build/pkgs/*/distros/*.txt
325325
./bootstrap -d
326326

327327
install: all

build/bin/sage-spkg-info

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ for dep_file in dependencies dependencies_order_only; do
4040
\$\(*) echo "- $dep";;
4141
# Looks like a package
4242
*) if [ -n "$OUTPUT_RST" -a -r "$SAGE_ROOT/build/pkgs/$dep/SPKG.rst" ]; then
43-
# This RST label is set in src/doc/bootstrap
43+
# This RST label is set in build/pkgs/sagemath_doc_html/bootstrap
4444
echo "- :ref:\`spkg_$dep\`"
4545
else
4646
echo "- $dep"

build/bin/write-dockerfile.sh

-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ RUN if [ -d /sage ]; then echo "### Incremental build from \$(cat /sage/VERSION.
220220
WORKDIR /sage
221221
$ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap bootstrap-conda configure.ac sage .homebrew-build-env tox.ini Pipfile.m4 ./
222222
$ADD config/config.rpath config/config.rpath
223-
$ADD src/doc/bootstrap src/doc/bootstrap
224223
$ADD src/bin src/bin
225224
$ADD src/Pipfile.m4 src/pyproject.toml.m4 src/requirements.txt.m4 src/setup.cfg.m4 src/VERSION.txt src/
226225
$ADD m4 ./m4

build/pkgs/sagemath_doc_html/bootstrap

-1
This file was deleted.
+221
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
#!/usr/bin/env bash
2+
3+
########################################################################
4+
# Regenerate auto-generated files, using information in SAGE_ROOT/build/
5+
#
6+
# This script is run by SAGE_ROOT/bootstrap as part of the bootstrapping phase
7+
# (before configure, before creating source distributions).
8+
#
9+
# The BOOTSTRAP_QUIET variable is set by the top-level
10+
# bootstrap script and controls how verbose we are.
11+
########################################################################
12+
13+
set -e
14+
15+
if [ -z "$SAGE_ROOT" ]; then
16+
echo Please run the top-level bootstrap script of the Sage distribution.
17+
exit 1
18+
fi
19+
20+
./bootstrap_m4
21+
22+
cd "$SAGE_ROOT"
23+
24+
STRIP_COMMENTS="sed s/#.*//;"
25+
OUTPUT_DIR="src/doc/en/installation"
26+
mkdir -p "$OUTPUT_DIR"
27+
28+
shopt -s extglob
29+
30+
RECOMMENDED_SPKG_PATTERN="@(_recommended$(for a in $(head -n 1 build/pkgs/_recommended/dependencies); do echo -n "|"$a; done))"
31+
DEVELOP_SPKG_PATTERN="@(_develop$(for a in $(head -n 1 build/pkgs/_develop/dependencies); do echo -n "|"$a; done))"
32+
33+
for SYSTEM in arch debian fedora cygwin homebrew opensuse; do
34+
SYSTEM_PACKAGES=
35+
OPTIONAL_SYSTEM_PACKAGES=
36+
SAGELIB_SYSTEM_PACKAGES=
37+
SAGELIB_OPTIONAL_SYSTEM_PACKAGES=
38+
RECOMMENDED_SYSTEM_PACKAGES=
39+
DEVELOP_SYSTEM_PACKAGES=
40+
for PKG_BASE in $(sage-package list --has-file distros/$SYSTEM.txt); do
41+
PKG_SCRIPTS=build/pkgs/$PKG_BASE
42+
SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/distros/$SYSTEM.txt
43+
PKG_TYPE=$(cat $PKG_SCRIPTS/type)
44+
PKG_SYSTEM_PACKAGES=$(echo $(${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE))
45+
if [ -n "PKG_SYSTEM_PACKAGES" ]; then
46+
if [ -f $PKG_SCRIPTS/spkg-configure.m4 ]; then
47+
case "$PKG_BASE:$PKG_TYPE" in
48+
*:standard)
49+
SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
50+
;;
51+
$DEVELOP_SPKG_PATTERN:*)
52+
DEVELOP_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
53+
;;
54+
$RECOMMENDED_SPKG_PATTERN:*)
55+
RECOMMENDED_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
56+
;;
57+
*)
58+
OPTIONAL_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
59+
;;
60+
esac
61+
else
62+
case "$PKG_BASE:$PKG_TYPE" in
63+
$DEVELOP_SPKG_PATTERN:*)
64+
DEVELOP_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
65+
;;
66+
*:standard)
67+
SAGELIB_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
68+
;;
69+
*)
70+
SAGELIB_OPTIONAL_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
71+
;;
72+
esac
73+
fi
74+
fi
75+
done
76+
77+
if [ "${BOOTSTRAP_QUIET}" = "no" ]; then
78+
echo >&2 $0:$LINENO: installing "$OUTPUT_DIR"/$SYSTEM"*.txt"
79+
fi
80+
echo "$(sage-print-system-package-command $SYSTEM --prompt --sudo install $(echo $(echo $SYSTEM_PACKAGES | xargs -n 1 echo | sort | uniq)))" > "$OUTPUT_DIR"/$SYSTEM.txt
81+
echo "$(sage-print-system-package-command $SYSTEM --prompt --sudo install $(echo $(echo $OPTIONAL_SYSTEM_PACKAGES | xargs -n 1 echo | sort | uniq)))" > "$OUTPUT_DIR"/$SYSTEM-optional.txt
82+
echo "$(sage-print-system-package-command $SYSTEM --prompt --sudo install $(echo $(echo $RECOMMENDED_SYSTEM_PACKAGES | xargs -n 1 echo | sort | uniq)))" > "$OUTPUT_DIR"/$SYSTEM-recommended.txt
83+
echo "$(sage-print-system-package-command $SYSTEM --prompt --sudo install $(echo $(echo $DEVELOP_SYSTEM_PACKAGES | xargs -n 1 echo | sort | uniq)))" > "$OUTPUT_DIR"/$SYSTEM-develop.txt
84+
done
85+
86+
OUTPUT_DIR="src/doc/en/reference/spkg"
87+
mkdir -p "$OUTPUT_DIR"
88+
if [ "${BOOTSTRAP_QUIET}" = "no" ]; then
89+
echo >&2 $0:$LINENO: installing "$OUTPUT_DIR"/"*.rst"
90+
fi
91+
OUTPUT_INDEX="$OUTPUT_DIR"/index.rst
92+
cat > "$OUTPUT_INDEX" <<EOF
93+
94+
Packages and Features
95+
=====================
96+
97+
Standard Packages
98+
-----------------
99+
100+
The Sage distribution includes most programs and libraries on which
101+
Sage depends. It installs them automatically if it does not find
102+
equivalent system packages.
103+
104+
EOF
105+
for PKG_BASE in $(sage-package list --has-file SPKG.rst :standard: | grep -v '^sagemath_'); do
106+
echo "* :ref:\`spkg_$PKG_BASE\`"
107+
done >> "$OUTPUT_INDEX"
108+
cat >> "$OUTPUT_INDEX" <<EOF
109+
110+
Optional Packages
111+
-----------------
112+
113+
For additional functionality, you can install some of the following
114+
optional packages.
115+
116+
EOF
117+
for PKG_BASE in $(sage-package list --has-file SPKG.rst :optional: | grep -v '^sagemath_'); do
118+
echo "* :ref:\`spkg_$PKG_BASE\`"
119+
done >> "$OUTPUT_INDEX"
120+
cat >> "$OUTPUT_INDEX" <<EOF
121+
122+
Features
123+
--------
124+
125+
.. toctree::
126+
:maxdepth: 1
127+
128+
sage/features
129+
sage/features/join_feature
130+
sage/features/all
131+
sage/features/sagemath
132+
sage/features/pkg_systems
133+
sage/features/bliss
134+
sage/features/csdp
135+
sage/features/databases
136+
sage/features/dvipng
137+
sage/features/ffmpeg
138+
sage/features/four_ti_2
139+
sage/features/gap
140+
sage/features/graph_generators
141+
sage/features/graphviz
142+
sage/features/imagemagick
143+
sage/features/interfaces
144+
sage/features/internet
145+
sage/features/kenzo
146+
sage/features/latex
147+
sage/features/latte
148+
sage/features/lrs
149+
sage/features/mcqd
150+
sage/features/meataxe
151+
sage/features/mip_backends
152+
sage/features/normaliz
153+
sage/features/pandoc
154+
sage/features/pdf2svg
155+
sage/features/polymake
156+
sage/features/rubiks
157+
sage/features/tdlib
158+
EOF
159+
cat >> "$OUTPUT_INDEX" <<EOF
160+
161+
Distribution Packages of the Sage Library
162+
-----------------------------------------
163+
164+
EOF
165+
for PKG_BASE in $(sage-package list --has-file SPKG.rst | grep '^sagemath_'); do
166+
echo "* :ref:\`spkg_$PKG_BASE\`"
167+
done >> "$OUTPUT_INDEX"
168+
cat >> "$OUTPUT_INDEX" <<EOF
169+
170+
Experimental Packages
171+
---------------------
172+
173+
Some packages that provide additional functionality are marked as
174+
"experimental". Developers are needed in order to improve the
175+
integration of these packages into the Sage distribution.
176+
177+
EOF
178+
for PKG_BASE in $(sage-package list --has-file SPKG.rst :experimental: | grep -v '^sagemath_'); do
179+
echo "* :ref:\`spkg_$PKG_BASE\`"
180+
done >> "$OUTPUT_INDEX"
181+
182+
cat >> "$OUTPUT_INDEX" <<EOF
183+
184+
All External Packages
185+
---------------------
186+
187+
.. toctree::
188+
:maxdepth: 1
189+
190+
index_alph
191+
192+
EOF
193+
194+
OUTPUT_INDEX="$OUTPUT_DIR"/index_alph.rst
195+
cat >> "$OUTPUT_INDEX" <<EOF
196+
197+
Details of external packages
198+
============================
199+
200+
Packages are in alphabetical order.
201+
202+
.. default-role:: code
203+
204+
.. toctree::
205+
:maxdepth: 1
206+
207+
EOF
208+
for PKG_BASE in $(sage-package list --has-file SPKG.rst); do
209+
PKG_SCRIPTS=build/pkgs/$PKG_BASE
210+
# Instead of just copying, we may want to call
211+
# a version of sage-spkg-info to format extra information.
212+
# for sphinx 4.4 we need to replace all direct links by some "extlink" (issue 33272)
213+
214+
(echo ".. _spkg_$PKG_BASE:" && echo && OUTPUT_RST=1 sage-spkg-info $PKG_BASE) | sed -e "s|https://github.com/sagemath/sage/issues/\([0-9]*\)|:issue:\`\1\`|g" -e "s|https://arxiv.org/abs/cs/\([0-9]*\)|:arxiv:\`cs/\1\`|g" > "$OUTPUT_DIR"/$PKG_BASE.rst
215+
echo >> "$OUTPUT_INDEX" " $PKG_BASE"
216+
done
217+
cat >> "$OUTPUT_INDEX" <<EOF
218+
219+
.. default-role::
220+
221+
EOF
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../sagelib/bootstrap
+20-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1-
#! /usr/bin/env bash
2-
cd $SAGE_ROOT/src/doc
3-
$MAKE doc-html
1+
#!/usr/bin/env bash
2+
# From sage-spkg.
3+
# For type=script packages, the build rule in build/make/Makefile sources
4+
# sage-env but not sage-dist-helpers.
5+
lib="$SAGE_ROOT/build/bin/sage-dist-helpers"
6+
source "$lib"
7+
if [ $? -ne 0 ]; then
8+
echo >&2 "Error: failed to source $lib"
9+
echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?"
10+
exit 1
11+
fi
12+
cd src
13+
if [ "$SAGE_EDITABLE" = yes ]; then
14+
sdh_pip_editable_install .
15+
if [ "$SAGE_WHEELS" = yes ]; then
16+
sdh_setup_bdist_wheel && sdh_store_wheel .
17+
fi
18+
else
19+
sdh_pip_install .
20+
fi

build/pkgs/sagemath_doc_html/spkg-src

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Script to prepare an sdist tarball for sagemath_doc_html
4+
# This script is not used during build.
5+
#
6+
# HOW TO MAKE THE TARBALL:
7+
# ./sage --sh build/pkgs/sagemath_doc_html/spkg-src
8+
9+
if [ -z "$SAGE_ROOT" ] ; then
10+
echo >&2 "Error - SAGE_ROOT undefined ... exiting"
11+
echo >&2 "Maybe run 'sage -sh'?"
12+
exit 1
13+
fi
14+
15+
# Exit on failure
16+
set -e
17+
18+
cd build/pkgs/sagemath_doc_html
19+
20+
cd src
21+
# Get rid of old *.egg-info/SOURCES.txt
22+
rm -Rf *.egg-info
23+
24+
python3 -m build --sdist --no-isolation --skip-dependency-check --outdir "$SAGE_DISTFILES"

build/pkgs/sagemath_doc_html/src

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../src/doc
1+
../../../pkgs/sagemath-doc-html

pkgs/sage-conf_conda/MANIFEST.in

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ include sage_root/src/bin/sage-env-config.in
4141
include sage_root/src/bin/sage-src-env-config.in
4242
include sage_root/src/bin/sage-venv-config
4343
include sage_root/src/bin/sage-version.sh
44-
include sage_root/src/doc/bootstrap # FIXME: should move to builds/pkgs/sagemath_doc_html/
4544

4645
global-exclude .tox
4746
global-exclude *~*

pkgs/sage-conf_pypi/sage_root/src/doc/bootstrap

-3
This file was deleted.

pkgs/sagemath-doc-html/MANIFEST.in

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
graft doc
2+
# Exclude what is removed by 'make clean' in doc/Makefile
3+
prune doc/en/reference/sage
4+
prune doc/en/reference/*/sage

pkgs/sagemath-doc-html/README.rst

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
======================================================================
2+
Sage: Open Source Mathematics Software: Documentation in HTML format
3+
======================================================================
4+
5+
About SageMath
6+
--------------
7+
8+
"Creating a Viable Open Source Alternative to
9+
Magma, Maple, Mathematica, and MATLAB"
10+
11+
Copyright (C) 2005-2023 The Sage Development Team
12+
13+
https://www.sagemath.org
14+
15+
SageMath fully supports all major Linux distributions, recent versions of
16+
macOS, and Windows (using Cygwin or Windows Subsystem for Linux).
17+
18+
The traditional and recommended way to install SageMath is from source via
19+
Sage-the-distribution (https://www.sagemath.org/download-source.html).
20+
Sage-the-distribution first builds a large number of open source packages from
21+
source (unless it finds suitable versions installed in the system) and then
22+
installs the Sage Library (sagelib, implemented in Python and Cython).
23+
24+
25+
About this pip-installable source distribution
26+
----------------------------------------------
27+
28+
When installed from source, the distribution `sagemath-doc-html` uses Sphinx
29+
to build the SageMath documentation in HTML format.

pkgs/sagemath-doc-html/VERSION.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
10.2.rc3

pkgs/sagemath-doc-html/doc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../src/doc
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
include(`sage_spkg_versions_toml.m4')dnl' -*- conf-toml -*-
2+
[build-system]
3+
# Minimum requirements for the build system to execute.
4+
requires = [
5+
SPKG_INSTALL_REQUIRES_setuptools_wheel
6+
SPKG_INSTALL_REQUIRES_sage_docbuild
7+
SPKG_INSTALL_REQUIRES_sphinx
8+
SPKG_INSTALL_REQUIRES_sphinx_copybutton
9+
SPKG_INSTALL_REQUIRES_furo
10+
SPKG_INSTALL_REQUIRES_jupyter_sphinx
11+
SPKG_INSTALL_REQUIRES_sagelib
12+
]
13+
build-backend = "setuptools.build_meta"
14+
15+
[project]
16+
name = "sagemath-doc-html"
17+
description = "Sage: Open Source Mathematics Software: Documentation in HTML format"
18+
dependencies = []
19+
dynamic = ["version"]
20+
include(`pyproject_toml_metadata.m4')dnl'
21+
22+
[project.readme]
23+
file = "README.rst"
24+
content-type = "text/x-rst"
25+
26+
[tool.setuptools]
27+
include-package-data = false
28+
29+
[tool.setuptools.dynamic]
30+
version = {file = ["VERSION.txt"]}

0 commit comments

Comments
 (0)