|
5 | 5 | #
|
6 | 6 | # Assumes SAGE_ROOT is set
|
7 | 7 | PKG_BASE=$1
|
| 8 | +if [ -n "$OUTPUT_DIR" ]; then |
| 9 | + exec > "$OUTPUT_DIR"/$PKG_BASE.rst |
| 10 | +fi |
| 11 | +if [ -n "$OUTPUT_RST" ]; then |
| 12 | + echo ".. _spkg_$PKG_BASE:" |
| 13 | + echo |
| 14 | + ref () { echo ":ref:\`$1\`"; } |
| 15 | + issue () { echo ":issue:\`$1\`"; } |
| 16 | + code () { echo "\`\`$*\`\`"; } |
| 17 | +else |
| 18 | + ref () { echo "$1"; } |
| 19 | + issue () { echo "https://github.com/sagemath/sage/issues/$1"; } |
| 20 | + code () { echo "$1"; } |
| 21 | +fi |
8 | 22 | PKG_SCRIPTS="$SAGE_ROOT/build/pkgs/$PKG_BASE"
|
9 | 23 | for ext in rst txt; do
|
10 | 24 | SPKG_FILE="$PKG_SCRIPTS/SPKG.$ext"
|
11 | 25 | if [ -f "$SPKG_FILE" ]; then
|
12 |
| - sed "1,3s/^ *Sage: Open Source Mathematics Software:/$PKG_BASE:/" "$SPKG_FILE" |
| 26 | + # for sphinx 4.4 we need to replace all direct links by some "extlink" (issue 33272) |
| 27 | + sed -e "1,3s/^ *Sage: Open Source Mathematics Software:/$PKG_BASE:/" -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" "$SPKG_FILE" |
13 | 28 | break
|
14 | 29 | fi
|
15 | 30 | done
|
@@ -39,9 +54,9 @@ for dep_file in dependencies dependencies_order_only; do
|
39 | 54 | # Dependencies like $(BLAS)
|
40 | 55 | \$\(*) echo "- $dep";;
|
41 | 56 | # Looks like a package
|
42 |
| - *) if [ -n "$OUTPUT_RST" -a -r "$SAGE_ROOT/build/pkgs/$dep/SPKG.rst" ]; then |
| 57 | + *) if [ -r "$SAGE_ROOT/build/pkgs/$dep/SPKG.rst" ]; then |
43 | 58 | # This RST label is set in src/doc/bootstrap
|
44 |
| - echo "- :ref:\`spkg_$dep\`" |
| 59 | + echo "- $(ref spkg_$dep)" |
45 | 60 | else
|
46 | 61 | echo "- $dep"
|
47 | 62 | fi;;
|
@@ -114,15 +129,15 @@ else
|
114 | 129 | if [ -f "${SPKG_CONFIGURE}" ]; then
|
115 | 130 | if grep -q SAGE_PYTHON_PACKAGE_CHECK "${SPKG_CONFIGURE}"; then
|
116 | 131 | echo "If the system package is installed and if the (experimental) option"
|
117 |
| - echo "--enable-system-site-packages is passed to ./configure, then ./configure" |
| 132 | + echo "$(code --enable-system-site-packages) is passed to $(code ./configure), then $(code ./configure)" |
118 | 133 | echo "will check if the system package can be used."
|
119 | 134 | else
|
120 |
| - echo "If the system package is installed, ./configure will check if it can be used." |
| 135 | + echo "If the system package is installed, $(code ./configure) will check if it can be used." |
121 | 136 | fi
|
122 | 137 | else
|
123 | 138 | echo "However, these system packages will not be used for building Sage"
|
124 |
| - echo "because spkg-configure.m4 has not been written for this package;" |
125 |
| - echo "see https://github.com/sagemath/sage/issues/27330" |
| 139 | + echo "because $(code spkg-configure.m4) has not been written for this package;" |
| 140 | + echo "see $(issue 27330)" |
126 | 141 | fi
|
127 | 142 | fi
|
128 | 143 | echo
|
0 commit comments