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

Commit

Permalink
Update additional Python packages with DESTDIR support.
Browse files Browse the repository at this point in the history
These packages don't have much mutually in common other than being Python
packages whose spkg-install does more than just sdh_pip_install.  Their
conversion to use DESTDIR is still fairly straightforward though.

Also reduced some duplication in the setuptools and pip installs.
  • Loading branch information
embray committed Mar 29, 2018
1 parent e5c848a commit daaab8f
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 83 deletions.
2 changes: 1 addition & 1 deletion build/pkgs/cysignals/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.9
1.6.9.p0
17 changes: 1 addition & 16 deletions build/pkgs/cysignals/spkg-install
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
if [ -z "$SAGE_LOCAL" ]; then
echo >&2 "SAGE_LOCAL undefined ... exiting"
echo >&2 "Maybe run 'sage --sh'?"
exit 1
fi

cd src

if [ "$SAGE_DEBUG" = yes ]; then
CYSIGNALS_CONFIGURE="--enable-debug $CYSIGNALS_CONFIGURE"
fi

./configure $CYSIGNALS_CONFIGURE
if [ $? -ne 0 ]; then
echo "Error configuring cysignals ... exiting"
exit 1
fi

sdh_configure $CYSIGNALS_CONFIGURE
sdh_pip_install .
if [ $? -ne 0 ]; then
echo "Error installing cysignals ... exiting"
exit 1
fi
2 changes: 1 addition & 1 deletion build/pkgs/numpy/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.13.3.p0
1.13.3.p1
29 changes: 7 additions & 22 deletions build/pkgs/numpy/spkg-install
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
if [ -z "$SAGE_LOCAL" ]; then
echo "SAGE_LOCAL undefined ... exiting"
echo "Maybe run 'sage -sh'?"
exit 1
fi

# Setting CFLAGS to have the option -m64 does not work for Numpy when
# making 64-bit builds on at least OS X and Solaris. Instead set CC
# to include the -m64

if [ -z "$CFLAG64" ] ; then
CFLAG64=-m64
fi

if [ "x$SAGE64" = xyes ] ; then
CC="$CC $CFLAG64"
export CC
fi

# Make sure we do not include conflicting complex.h from cephes Sage package
CFLAGS="$CFLAGS -D__CEPHES_COMPLEX_H"
export CFLAGS
Expand Down Expand Up @@ -50,13 +31,17 @@ sage-python23 setup.py \
--no-user-cfg \
install \
--single-version-externally-managed \
--record /dev/null \
${NUMPY_FCONFIG}
--root "$SAGE_DESTDIR" \
${NUMPY_FCONFIG} || sdh_die "Error building / installing numpy"

# Touch all includes such that dependency checking works properly:
# the timestamp of the includes should be *now*, not the time when
# the numpy package was created.
sage-python23 <<EOF
# Note: Setting PYTHONPATH here is something of a hack to support
# installation into $SAGE_DESTDIR. This might be better handled
# as a post-install step
SITE_PACKAGES="$(sage-python23 -c 'import site; print(site.getsitepackages()[0])')"
PYTHONPATH="$SAGE_DESTDIR$SITE_PACKAGES" sage-python23 <<EOF
import os
os.chdir(os.environ["SAGE_ROOT"]) # Import numpy from safe location
import numpy
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/pillow/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.3.0
4.3.0.p0
12 changes: 1 addition & 11 deletions build/pkgs/pillow/spkg-install
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
if [ -z "$SAGE_LOCAL" ]; then
echo "SAGE_LOCAL undefined - exiting ..."
echo "Maybe run 'sage -sh'?"
exit 1
fi

cd src

# Delete old version
Expand All @@ -19,8 +13,4 @@ sage-python23 setup.py \
--disable-jpeg \
install \
--single-version-externally-managed \
--record /dev/null
if [ $? -ne 0 ]; then
echo "Error building / installing Pillow"
exit 1
fi
--root "$SAGE_DESTDIR" || sdh_die "Error building/installing Pillow"
2 changes: 1 addition & 1 deletion build/pkgs/pip/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.0.1
9.0.1.p0
17 changes: 5 additions & 12 deletions build/pkgs/pip/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,8 @@ cd src
# importing itself, will think itself is already installed
#
# Install pip3 first so pip2 overwrites local/bin/pip

python3 -m pip install --verbose --no-index --ignore-installed --isolated .
if [ $? -ne 0 ]; then
echo "Error building / installing pip3"
exit 1
fi

python2 -m pip install --verbose --no-index --ignore-installed --isolated .
if [ $? -ne 0 ]; then
echo "Error building / installing pip2"
exit 1
fi
for vers in 3 2; do
python${vers} -m pip install --verbose --no-index --ignore-installed \
--isolated --root="$SAGE_DESTDIR" . || \
sdh_die "Error building / installing pip${vers}"
done
2 changes: 1 addition & 1 deletion build/pkgs/setuptools/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
38.2.4
38.2.4.p0
22 changes: 5 additions & 17 deletions build/pkgs/setuptools/spkg-install
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
if [ "$SAGE_LOCAL" = "" ]; then
echo "SAGE_LOCAL undefined ... exiting";
echo "Maybe run 'sage -sh'?"
exit 1
fi

# distribute doesn't allow itself to be replaced by setuptools
# so we manually have to delete it
# (pip actually can uninstall setuptools but we may not have pip
Expand All @@ -16,14 +10,8 @@ export PYTHON_EGG_CACHE="$DOT_SAGE/.python-eggs"
cd src

# Prevent setuptools from installing itself with easy_install
python2 setup.py --no-user-cfg install --single-version-externally-managed --record=/dev/null
if [ $? -ne 0 ]; then
echo "Error Python 2 building / installing setuptools"
exit 1
fi

python3 setup.py --no-user-cfg install --single-version-externally-managed --record=/dev/null
if [ $? -ne 0 ]; then
echo "Error Python 3 building / installing setuptools"
exit 1
fi
for vers in 2 3; do
python${vers} setup.py --no-user-cfg install \
--single-version-externally-managed --root="$SAGE_DESTDIR" || \
sdh_die "Error building / installing setuptools for Python ${vers}"
done

0 comments on commit daaab8f

Please sign in to comment.