Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
bootstrap-conda: Fix typo, generate->generating to match messages fro…
Browse files Browse the repository at this point in the history
…m bootstrap
  • Loading branch information
Matthias Koeppe committed May 14, 2022
2 parents 0df31a9 + 7759f3c commit 58ab878
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 43 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ bootstrap-clean:
rm -rf config configure build/make/Makefile-auto.in
rm -f src/doc/en/installation/*.txt
rm -rf src/doc/en/reference/spkg/*.rst
rm -f src/doc/en/reference/repl/*.txt
rm -f environment.yml
rm -f src/environment.yml
rm -f src/environment-dev.yml
Expand Down
15 changes: 7 additions & 8 deletions bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ bootstrap () {
rm -f m4/sage_spkg_configures.m4
spkg_configures=""
# initialize SAGE_ENABLE... options for standard packages
for pkgname in $(./sage --package list :standard: | sort); do
for pkgname in $(sage-package list :standard: | sort); do
spkg_configures="$spkg_configures
AS_VAR_SET_IF([SAGE_ENABLE_$pkgname], [], [AS_VAR_SET([SAGE_ENABLE_$pkgname], [yes])])"
done
# --enable-SPKG options
for pkgname in $(./sage --package list :optional: :experimental: | sort); do
for pkgname in $(sage-package list :optional: :experimental: | sort); do
# Trac #29629: Temporary solution for Sage 9.1: Do not provide
# --enable-SPKG options for installing pip packages
if [ ! -f build/pkgs/$pkgname/requirements.txt ]; then
Expand All @@ -109,12 +109,12 @@ SAGE_SPKG_ENABLE([$pkgname], [$pkgtype], [$(grep -v ^= build/pkgs/$pkgname/SPKG.
esac
fi
done
for pkgname in $(./sage --package list --has-file spkg-configure.m4 | sort); do
for pkgname in $(sage-package list --has-file spkg-configure.m4 | sort); do
echo "m4_sinclude([build/pkgs/$pkgname/spkg-configure.m4])"
spkg_configures="$spkg_configures
SAGE_SPKG_CONFIGURE_$(echo ${pkgname} | tr '[a-z]' '[A-Z]')"
done >> m4/sage_spkg_configures.m4
for pkgname in $(./sage --package list | sort); do
for pkgname in $(sage-package list | sort); do
DIR=build/pkgs/$pkgname
pkgtype="$(cat $DIR/type)"
if test -f "$DIR/requirements.txt"; then
Expand Down Expand Up @@ -143,7 +143,7 @@ SAGE_SPKG_FINALIZE([$pkgname], [$pkgtype], [$SPKG_SOURCE], [$SPKG_TREE_VAR])"
done
echo "$spkg_configures" >> m4/sage_spkg_configures.m4

for pkgname in $(./sage --package list --has-file bootstrap); do
for pkgname in $(sage-package list --has-file bootstrap); do
(cd build/pkgs/$pkgname && ./bootstrap) || exit 1
done

Expand Down Expand Up @@ -247,7 +247,6 @@ save () {
build/make/Makefile-auto.in \
src/doc/en/installation/*.txt \
src/doc/en/reference/spkg/*.rst \
src/doc/en/reference/repl/*.txt \
environment.yml \
src/environment.yml \
environment-optional.yml \
Expand All @@ -262,10 +261,10 @@ save () {

# Compute checksum
if [ "${BOOTSTRAP_QUIET}" = "no" ]; then
./sage --package fix-checksum configure
sage-package fix-checksum configure
else
# Hide the "Updating checksum..." message
./sage --package fix-checksum configure > /dev/null
sage-package fix-checksum configure > /dev/null
fi
}

Expand Down
6 changes: 4 additions & 2 deletions bootstrap-conda
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# Generate auto-generated conda environment files
#########################################################################

export PATH="$(pwd)/build/bin:$PATH"

STRIP_COMMENTS="sed s/#.*//;"

shopt -s extglob
Expand All @@ -16,7 +18,7 @@ OPTIONAL_SYSTEM_PACKAGES=
SAGELIB_SYSTEM_PACKAGES=
SAGELIB_OPTIONAL_SYSTEM_PACKAGES=
DEVELOP_SYSTEM_PACKAGES=
for PKG_BASE in $(./sage --package list --has-file distros/conda.txt); do
for PKG_BASE in $(sage-package list --has-file distros/conda.txt); do
PKG_SCRIPTS=build/pkgs/$PKG_BASE
SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/distros/conda.txt
PKG_TYPE=$(cat $PKG_SCRIPTS/type)
Expand Down Expand Up @@ -46,7 +48,7 @@ for PKG_BASE in $(./sage --package list --has-file distros/conda.txt); do
fi
fi
done
echo >&2 $0:$LINENO: generate conda enviroment files
echo >&2 $0:$LINENO: generating conda environment files
(
echo "name: sage-build"
echo "channels:"
Expand Down
44 changes: 26 additions & 18 deletions src/doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
# 'make doc-html' (synonym for 'make' and 'make all') builds the html documentation.
# 'make doc-pdf' builds the PDF documentation.
#
# SAGE_ROOT must be defined for these to work, so these commands
# should be called by build/make/Makefile.
# The "sage" script must be in PATH, and the Sage library and the package sage_docbuild
# must be installed for these to work.
# These commands are intended to be called by build/make/Makefile via
# build/pkgs/sagemath_doc_{html,pdf}/spkg-install.
#
# 'make clean' removes build artifacts; SAGE_ROOT need not be defined for this to work.
# 'make clean' removes build artifacts; the "sage" script is not needed for this to work.

all: doc-html

Expand All @@ -15,22 +17,27 @@ clean:
rm -rf en/reference/sage
rm -f common/*.pyc

# Sources generated at build time. (For sources generated at bootstrap time, see bootstrap.)
doc-src:
mkdir -p en/reference/repl
sage -advanced > en/reference/repl/options.txt

# Matches doc-inventory--reference-manifolds etc.
doc-inventory--%:
cd $(SAGE_ROOT) && ./sage --docbuild --no-pdf-links $(subst -,/,$(subst doc-inventory--,,$@)) inventory $(SAGE_DOCBUILD_OPTS)
sage --docbuild --no-pdf-links $(subst -,/,$(subst doc-inventory--,,$@)) inventory $(SAGE_DOCBUILD_OPTS)

# Matches doc-html--developer, doc-html--reference-manifolds etc.
doc-html--%:
cd $(SAGE_ROOT) && ./sage --docbuild --no-pdf-links $(subst -,/,$(subst doc-html--,,$@)) html $(SAGE_DOCBUILD_OPTS)
sage --docbuild --no-pdf-links $(subst -,/,$(subst doc-html--,,$@)) html $(SAGE_DOCBUILD_OPTS)

# reference manual, inventory
ifndef SAGE_ROOT
doc-inventory-reference:
$(error SAGE_ROOT undefined. This Makefile needs to be invoked by build/make/install)
else
doc-inventory-reference:
$(eval DOCS = $(shell cd $(SAGE_ROOT) && ./sage --docbuild --all-documents reference))
@if [ -z "$(DOCS)" ]; then echo "Error: './sage --docbuild --all-documents' failed"; exit 1; fi
doc-inventory-reference: doc-src
$(eval DOCS = $(shell sage --docbuild --all-documents reference))
@if [ -z "$(DOCS)" ]; then echo "Error: 'sage --docbuild --all-documents' failed"; exit 1; fi
$(eval BIBLIO = $(firstword $(DOCS)))
$(eval OTHER_DOCS = $(wordlist 2, 100, $(DOCS)))
$(MAKE) doc-inventory--$(subst /,-,$(BIBLIO))
Expand All @@ -40,8 +47,8 @@ endif

# reference manual, html
doc-html-reference: doc-inventory-reference
$(eval DOCS = $(shell cd $(SAGE_ROOT) && ./sage --docbuild --all-documents reference))
@if [ -z "$(DOCS)" ]; then echo "Error: './sage --docbuild --all-documents' failed"; exit 1; fi
$(eval DOCS = $(shell sage --docbuild --all-documents reference))
@if [ -z "$(DOCS)" ]; then echo "Error: 'sage --docbuild --all-documents' failed"; exit 1; fi
$(eval BIBLIO = $(firstword $(DOCS)))
$(eval OTHER_DOCS = $(wordlist 2, 100, $(DOCS)))
$(MAKE) SAGE_DOCBUILD_OPTS="$(SAGE_DOCBUILD_OPTS) --no-prune-empty-dirs" doc-html--$(subst /,-,$(BIBLIO))
Expand All @@ -50,20 +57,20 @@ doc-html-reference: doc-inventory-reference

# other documentation, html
doc-html-other: doc-html-reference
$(eval DOCS = $(shell cd $(SAGE_ROOT) && ./sage --docbuild --all-documents all))
@if [ -z "$(DOCS)" ]; then echo "Error: './sage --docbuild --all-documents' failed"; exit 1; fi
$(eval DOCS = $(shell sage --docbuild --all-documents all))
@if [ -z "$(DOCS)" ]; then echo "Error: 'sage --docbuild --all-documents' failed"; exit 1; fi
$(MAKE) SAGE_DOCBUILD_OPTS="$(SAGE_DOCBUILD_OPTS) --no-prune-empty-dirs" $(foreach doc, $(wordlist 2, 100, $(DOCS)), doc-html--$(subst /,-,$(doc)))

doc-html: doc-html-reference doc-html-other

# Matches doc-pdf--developer, doc-pdf--reference-manifolds etc.
doc-pdf--%:
cd $(SAGE_ROOT) && ./sage --docbuild $(subst -,/,$(subst doc-pdf--,,$@)) pdf $(SAGE_DOCBUILD_OPTS)
sage --docbuild $(subst -,/,$(subst doc-pdf--,,$@)) pdf $(SAGE_DOCBUILD_OPTS)

# reference manual, pdf
doc-pdf-reference: doc-inventory-reference
$(eval DOCS = $(shell cd $(SAGE_ROOT) && ./sage --docbuild --all-documents reference))
@if [ -z "$(DOCS)" ]; then echo "Error: './sage --docbuild --all-documents' failed"; exit 1; fi
$(eval DOCS = $(shell sage --docbuild --all-documents reference))
@if [ -z "$(DOCS)" ]; then echo "Error: 'sage --docbuild --all-documents' failed"; exit 1; fi
$(eval BIBLIO = $(firstword $(DOCS)))
$(eval OTHER_DOCS = $(wordlist 2, 100, $(DOCS)))
$(MAKE) SAGE_DOCBUILD_OPTS="$(SAGE_DOCBUILD_OPTS) --no-prune-empty-dirs" doc-pdf--$(subst /,-,$(BIBLIO))
Expand All @@ -72,17 +79,18 @@ doc-pdf-reference: doc-inventory-reference

# other documentation, pdf
doc-pdf-other: doc-html-reference
$(eval DOCS = $(shell cd $(SAGE_ROOT) && ./sage --docbuild --all-documents all))
@if [ -z "$(DOCS)" ]; then echo "Error: './sage --docbuild --all-documents' failed"; exit 1; fi
$(eval DOCS = $(shell sage --docbuild --all-documents all))
@if [ -z "$(DOCS)" ]; then echo "Error: 'sage --docbuild --all-documents' failed"; exit 1; fi
$(MAKE) SAGE_DOCBUILD_OPTS="$(SAGE_DOCBUILD_OPTS) --no-prune-empty-dirs" $(foreach doc, $(wordlist 2, 100, $(DOCS)), doc-pdf--$(subst /,-,$(doc)))

# website with pdf links
doc-pdf-website:
cd $(SAGE_ROOT) && ./sage --docbuild website html $(SAGE_DOCBUILD_OPTS)
sage --docbuild website html $(SAGE_DOCBUILD_OPTS)

doc-pdf: doc-pdf-reference doc-pdf-other doc-pdf-website

.PHONY: all clean \
doc-src \
doc-html doc-pdf \
doc-inventory-reference doc-html-reference doc-pdf-reference \
doc-html-other doc-pdf-other
19 changes: 5 additions & 14 deletions src/doc/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ for SYSTEM in arch debian fedora cygwin homebrew; do
SAGELIB_SYSTEM_PACKAGES=
SAGELIB_OPTIONAL_SYSTEM_PACKAGES=
RECOMMENDED_SYSTEM_PACKAGES=
for PKG_BASE in $(./sage --package list --has-file distros/$SYSTEM.txt); do
for PKG_BASE in $(sage-package list --has-file distros/$SYSTEM.txt); do
PKG_SCRIPTS=build/pkgs/$PKG_BASE
SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/distros/$SYSTEM.txt
PKG_TYPE=$(cat $PKG_SCRIPTS/type)
Expand Down Expand Up @@ -91,7 +91,7 @@ Sage depends. It installs them automatically if it does not find
equivalent system packages.
EOF
for PKG_BASE in $(./sage --package list --has-file SPKG.rst :standard: | sort); do
for PKG_BASE in $(sage-package list --has-file SPKG.rst :standard: | sort); do
echo "* :ref:\`spkg_$PKG_BASE\`"
done >> "$OUTPUT_INDEX"
cat >> "$OUTPUT_INDEX" <<EOF
Expand All @@ -103,7 +103,7 @@ For additional functionality, you can install some of the following
optional packages.
EOF
for PKG_BASE in $(./sage --package list --has-file SPKG.rst :optional: | sort); do
for PKG_BASE in $(sage-package list --has-file SPKG.rst :optional: | sort); do
echo "* :ref:\`spkg_$PKG_BASE\`"
done >> "$OUTPUT_INDEX"
cat >> "$OUTPUT_INDEX" <<EOF
Expand All @@ -116,7 +116,7 @@ Some packages that provide additional functionality are marked as
integration of these packages into the Sage distribution.
EOF
for PKG_BASE in $(./sage --package list --has-file SPKG.rst :experimental: | sort); do
for PKG_BASE in $(sage-package list --has-file SPKG.rst :experimental: | sort); do
echo "* :ref:\`spkg_$PKG_BASE\`"
done >> "$OUTPUT_INDEX"
cat >> "$OUTPUT_INDEX" <<EOF
Expand All @@ -142,7 +142,7 @@ Packages are in alphabetical order.
:maxdepth: 1
EOF
for PKG_BASE in $(./sage --package list --has-file SPKG.rst | sort); do
for PKG_BASE in $(sage-package list --has-file SPKG.rst | sort); do
PKG_SCRIPTS=build/pkgs/$PKG_BASE
# Instead of just copying, we may want to call
# a version of sage-spkg-info to format extra information.
Expand All @@ -151,12 +151,3 @@ for PKG_BASE in $(./sage --package list --has-file SPKG.rst | sort); do
(echo ".. _spkg_$PKG_BASE:" && echo && OUTPUT_RST=1 sage-spkg-info $PKG_BASE) | sed -e "s|https://trac.sagemath.org/ticket/\([0-9]*\)|:trac:\`\1\`|g" -e "s|https://arxiv.org/abs/cs/\([0-9]*\)|:arxiv:\`cs/\1\`|g" > "$OUTPUT_DIR"/$PKG_BASE.rst
echo >> "$OUTPUT_INDEX" " $PKG_BASE"
done

# #30064: Create the directory first
OUTPUT_DIR="src/doc/en/reference/repl"
mkdir -p "$OUTPUT_DIR"
OUTPUT="$OUTPUT_DIR/options.txt"
if [ "${BOOTSTRAP_QUIET}" = "no" ]; then
echo >&2 $0:$LINENO: installing "$OUTPUT"
fi
./sage -advanced > "$OUTPUT"

0 comments on commit 58ab878

Please sign in to comment.