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

Commit

Permalink
bootstrap: Generate build/pkgs/sagelib/src/setup.cfg with m4
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Nov 15, 2020
1 parent 6bff345 commit b0f5cd2
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 10 deletions.
6 changes: 4 additions & 2 deletions bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@ SAGE_SPKG_ENABLE([$pkgname], [$pkgtype])"
esac
for infile in "$pkgdir"/src/*.m4; do
if [ -f "$infile" ]; then
outfile="$pkgdir/$(basename $infile .m4)"
echo "$0: installing $outfile"
outfile="$pkgdir/src/$(basename $infile .m4)"
if [ "${BOOTSTRAP_QUIET}" = "no" ]; then
echo "$0: installing $outfile"
fi
m4 "$infile" > "$outfile"
fi
done
Expand Down
26 changes: 20 additions & 6 deletions build/bin/sage-get-system-packages
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,32 @@ if [ -z "$SAGE_ROOT" ]; then
SAGE_ROOT=`pwd`
fi
case "$SYSTEM" in
install-requires)
SYSTEM_PACKAGES_FILE_NAMES="install-requires.txt"
STRIP_COMMENTS="sed s/#.*//;/^[[:space:]]*$/d;"
COLLECT=
;;
pip)
SYSTEM_PACKAGES_FILE_NAME="requirements.txt"
SYSTEM_PACKAGES_FILE_NAMES="requirements.txt install-requires.txt"
STRIP_COMMENTS='sed s/#.*//;s/[[:space:]]//g;'
COLLECT=echo
;;
*)
SYSTEM_PACKAGES_FILE_NAME="distros/$SYSTEM.txt"
SYSTEM_PACKAGES_FILE_NAMES="distros/$SYSTEM.txt"
STRIP_COMMENTS="sed s/#.*//;"
COLLECT=echo
;;
esac
for PKG_BASE in $SPKGS; do
SYSTEM_PACKAGES_FILE="$SAGE_ROOT"/build/pkgs/$PKG_BASE/$SYSTEM_PACKAGES_FILE_NAME
if [ -f $SYSTEM_PACKAGES_FILE ]; then
echo $(${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE)
fi
for NAME in $SYSTEM_PACKAGES_FILE_NAMES; do
SYSTEM_PACKAGES_FILE="$SAGE_ROOT"/build/pkgs/$PKG_BASE/$NAME
if [ -f $SYSTEM_PACKAGES_FILE ]; then
if [ -z "$COLLECT" ]; then
${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE
else
$COLLECT $(${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE)
fi
break
fi
done
done
1 change: 1 addition & 0 deletions build/pkgs/sagelib/src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/setup.cfg
43 changes: 41 additions & 2 deletions build/pkgs/sagelib/src/setup.cfg.m4
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,44 @@ classifiers =

[options]
install_requires =
# From build/pkgs/sagelib/dependencies
include(`build/pkgs/six/install-requires.txt')
esyscmd(`sage-get-system-packages install-requires \
six \
| sed "2,\$s/^/ /;"')dnl
dnl From build/pkgs/sagelib/dependencies
esyscmd(`sage-get-system-packages install-requires \
cypari \
cysignals \
cython \
gmpy2 \
jinja2 \
jupyter_core \
numpy \
pkgconfig \
pplpy \
| sed "2,\$s/^/ /;"')dnl
dnl From Makefile.in: SAGERUNTIME
esyscmd(`sage-get-system-packages install-requires \
ipython \
pexpect \
psutil \
| sed "2,\$s/^/ /;"')dnl
dnl From Makefile.in: DOC_DEPENDENCIES
esyscmd(`sage-get-system-packages install-requires \
sphinx \
networkx \
scipy \
sympy \
matplotlib \
pillow \
mpmath \
ipykernel \
jupyter_client \
ipywidgets \
| sed "2,\$s/^/ /;"')dnl
dnl Other Python packages that are standard spkg, used in doctests
esyscmd(`sage-get-system-packages install-requires \
cvxopt \
rpy2 \
| sed "2,\$s/^/ /;"')dnl
dnl fpylll # does not install because it does not declare its build dependencies correctly. Reported upstream: https://github.com/fplll/fpylll/issues/185
dnl pycryptosat # Sage distribution installs it as part of cryptominisat. According to its README on https://pypi.org/project/pycryptosat/: "The pycryptosat python package compiles while compiling CryptoMiniSat. It cannot be compiled on its own, it must be compiled at the same time as CryptoMiniSat."

0 comments on commit b0f5cd2

Please sign in to comment.