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

Commit b0f5cd2

Browse files
author
Matthias Koeppe
committed
bootstrap: Generate build/pkgs/sagelib/src/setup.cfg with m4
1 parent 6bff345 commit b0f5cd2

File tree

4 files changed

+66
-10
lines changed

4 files changed

+66
-10
lines changed

bootstrap

+4-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ SAGE_SPKG_ENABLE([$pkgname], [$pkgtype])"
9696
esac
9797
for infile in "$pkgdir"/src/*.m4; do
9898
if [ -f "$infile" ]; then
99-
outfile="$pkgdir/$(basename $infile .m4)"
100-
echo "$0: installing $outfile"
99+
outfile="$pkgdir/src/$(basename $infile .m4)"
100+
if [ "${BOOTSTRAP_QUIET}" = "no" ]; then
101+
echo "$0: installing $outfile"
102+
fi
101103
m4 "$infile" > "$outfile"
102104
fi
103105
done

build/bin/sage-get-system-packages

+20-6
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,32 @@ if [ -z "$SAGE_ROOT" ]; then
1111
SAGE_ROOT=`pwd`
1212
fi
1313
case "$SYSTEM" in
14+
install-requires)
15+
SYSTEM_PACKAGES_FILE_NAMES="install-requires.txt"
16+
STRIP_COMMENTS="sed s/#.*//;/^[[:space:]]*$/d;"
17+
COLLECT=
18+
;;
1419
pip)
15-
SYSTEM_PACKAGES_FILE_NAME="requirements.txt"
20+
SYSTEM_PACKAGES_FILE_NAMES="requirements.txt install-requires.txt"
1621
STRIP_COMMENTS='sed s/#.*//;s/[[:space:]]//g;'
22+
COLLECT=echo
1723
;;
1824
*)
19-
SYSTEM_PACKAGES_FILE_NAME="distros/$SYSTEM.txt"
25+
SYSTEM_PACKAGES_FILE_NAMES="distros/$SYSTEM.txt"
2026
STRIP_COMMENTS="sed s/#.*//;"
27+
COLLECT=echo
2128
;;
2229
esac
2330
for PKG_BASE in $SPKGS; do
24-
SYSTEM_PACKAGES_FILE="$SAGE_ROOT"/build/pkgs/$PKG_BASE/$SYSTEM_PACKAGES_FILE_NAME
25-
if [ -f $SYSTEM_PACKAGES_FILE ]; then
26-
echo $(${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE)
27-
fi
31+
for NAME in $SYSTEM_PACKAGES_FILE_NAMES; do
32+
SYSTEM_PACKAGES_FILE="$SAGE_ROOT"/build/pkgs/$PKG_BASE/$NAME
33+
if [ -f $SYSTEM_PACKAGES_FILE ]; then
34+
if [ -z "$COLLECT" ]; then
35+
${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE
36+
else
37+
$COLLECT $(${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE)
38+
fi
39+
break
40+
fi
41+
done
2842
done

build/pkgs/sagelib/src/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/setup.cfg

build/pkgs/sagelib/src/setup.cfg.m4

+41-2
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,44 @@ classifiers =
2727

2828
[options]
2929
install_requires =
30-
# From build/pkgs/sagelib/dependencies
31-
include(`build/pkgs/six/install-requires.txt')
30+
esyscmd(`sage-get-system-packages install-requires \
31+
six \
32+
| sed "2,\$s/^/ /;"')dnl
33+
dnl From build/pkgs/sagelib/dependencies
34+
esyscmd(`sage-get-system-packages install-requires \
35+
cypari \
36+
cysignals \
37+
cython \
38+
gmpy2 \
39+
jinja2 \
40+
jupyter_core \
41+
numpy \
42+
pkgconfig \
43+
pplpy \
44+
| sed "2,\$s/^/ /;"')dnl
45+
dnl From Makefile.in: SAGERUNTIME
46+
esyscmd(`sage-get-system-packages install-requires \
47+
ipython \
48+
pexpect \
49+
psutil \
50+
| sed "2,\$s/^/ /;"')dnl
51+
dnl From Makefile.in: DOC_DEPENDENCIES
52+
esyscmd(`sage-get-system-packages install-requires \
53+
sphinx \
54+
networkx \
55+
scipy \
56+
sympy \
57+
matplotlib \
58+
pillow \
59+
mpmath \
60+
ipykernel \
61+
jupyter_client \
62+
ipywidgets \
63+
| sed "2,\$s/^/ /;"')dnl
64+
dnl Other Python packages that are standard spkg, used in doctests
65+
esyscmd(`sage-get-system-packages install-requires \
66+
cvxopt \
67+
rpy2 \
68+
| sed "2,\$s/^/ /;"')dnl
69+
dnl fpylll # does not install because it does not declare its build dependencies correctly. Reported upstream: https://github.com/fplll/fpylll/issues/185
70+
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 commit comments

Comments
 (0)