Skip to content

Commit

Permalink
build/bin/sage-spkg-info: Fix and improve RST markup
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Dec 18, 2023
1 parent 93a900c commit 84c3e36
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions build/bin/sage-spkg-info
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,17 @@
PKG_BASE=$1
if [ -n "$OUTPUT_DIR" ]; then
exec > "$OUTPUT_DIR"/$PKG_BASE.rst
fi
if [ -n "$OUTPUT_RST" ]; then
echo ".. _spkg_$PKG_BASE:"
echo
ref () { echo ":ref:\`$1\`"; }
issue () { echo ":issue:\`$1\`"; }
code () { echo "\`\`$*\`\`"; }
else
ref () { echo "$1"; }
issue () { echo "https://github.com/sagemath/sage/issues/$1"; }
code () { echo "$1"; }
fi
PKG_SCRIPTS="$SAGE_ROOT/build/pkgs/$PKG_BASE"
for ext in rst txt; do
Expand Down Expand Up @@ -45,9 +54,9 @@ for dep_file in dependencies dependencies_order_only; do
# Dependencies like $(BLAS)
\$\(*) echo "- $dep";;
# Looks like a package
*) if [ -n "$OUTPUT_RST" -a -r "$SAGE_ROOT/build/pkgs/$dep/SPKG.rst" ]; then
*) if [ -r "$SAGE_ROOT/build/pkgs/$dep/SPKG.rst" ]; then
# This RST label is set in src/doc/bootstrap
echo "- :ref:\`spkg_$dep\`"
echo "- $(ref spkg_$dep)"
else
echo "- $dep"
fi;;
Expand Down Expand Up @@ -120,15 +129,15 @@ else
if [ -f "${SPKG_CONFIGURE}" ]; then
if grep -q SAGE_PYTHON_PACKAGE_CHECK "${SPKG_CONFIGURE}"; then
echo "If the system package is installed and if the (experimental) option"
echo "--enable-system-site-packages is passed to ./configure, then ./configure"
echo "$(code --enable-system-site-packages) is passed to $(code ./configure), then $(code ./configure)"
echo "will check if the system package can be used."
else
echo "If the system package is installed, ./configure will check if it can be used."
echo "If the system package is installed, $(code ./configure) will check if it can be used."
fi
else
echo "However, these system packages will not be used for building Sage"
echo "because spkg-configure.m4 has not been written for this package;"
echo "see https://github.com/sagemath/sage/issues/27330"
echo "because $(code spkg-configure.m4) has not been written for this package;"
echo "see $(issue 27330)"
fi
fi
echo

0 comments on commit 84c3e36

Please sign in to comment.