aboutsummaryrefslogtreecommitdiff
path: root/development/python3-numpy
diff options
context:
space:
mode:
authorChristoph Willing <chris.willing@linux.com>2024-08-19 16:14:26 +1000
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2024-08-19 14:48:24 +0700
commit7b6e771109e079852561fd22baaf5e98b218dcff (patch)
tree9b270843fc2d4f48b8e71bce90e9000d08360359 /development/python3-numpy
parentff98654191e6c53d73695b6ced036af44ddb37b8 (diff)
development/python3-numpy: Enable choice of python3 version
Signed-off-by: Christoph Willing <chris.willing@linux.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development/python3-numpy')
-rw-r--r--development/python3-numpy/README5
-rw-r--r--development/python3-numpy/python3-numpy.SlackBuild19
2 files changed, 18 insertions, 6 deletions
diff --git a/development/python3-numpy/README b/development/python3-numpy/README
index 6268d4ec9a0c6..f61f1753d24f9 100644
--- a/development/python3-numpy/README
+++ b/development/python3-numpy/README
@@ -34,3 +34,8 @@ IMPORTANT: The version installed by this SlackBuild does NOT include the
is available for python2 only and does not conflict with this
installation of numpy.
+If a particular python3 version is to be used, it may be set using the
+PYVER environment variable e.g.
+ PYVER=3.11 bash python3-numpy.SlackBuild
+Otherwise it will use the version linked to by the system python3.
+
diff --git a/development/python3-numpy/python3-numpy.SlackBuild b/development/python3-numpy/python3-numpy.SlackBuild
index e3a11ce05af52..3a1c1389f29a2 100644
--- a/development/python3-numpy/python3-numpy.SlackBuild
+++ b/development/python3-numpy/python3-numpy.SlackBuild
@@ -30,7 +30,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=python3-numpy
SRCNAM=numpy
VERSION=${VERSION:-1.26.3}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -56,6 +56,13 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
+PYVER=${PYVER:-$(python3 -c 'import sys; print("%d.%d" % sys.version_info[:2])')}
+which python$PYVER 2>/dev/null 1>/dev/null
+[ "$?" = "0" ] || {
+ echo "Can't find python$PYVER. Exiting now ..."
+ exit 1
+}
+
set -e
rm -rf $PKG
@@ -114,20 +121,20 @@ case "$DEBUG" in
esac
if [ ! "$DEBUG" ]; then
- NPY_RELAXED_STRIDES_CHECKING=${NPY_RSC:-1} python3 -m build --wheel --no-isolation -Csetup-args="-Dallow-noblas=true"
- python3 -m installer -d "$PKG" dist/*.whl
+ NPY_RELAXED_STRIDES_CHECKING=${NPY_RSC:-1} python$PYVER -m build --wheel --no-isolation -Csetup-args="-Dallow-noblas=true"
+ python$PYVER -m installer -d "$PKG" dist/*.whl
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
else
- #NPY_RELAXED_STRIDES_CHECKING=${NPY_RSC:-1} python3 setup.py build --debug
- #python3 setup.py install --root $PKG
+ #NPY_RELAXED_STRIDES_CHECKING=${NPY_RSC:-1} python$PYVER setup.py build --debug
+ #python$PYVER setup.py install --root $PKG
echo "debug here"
fi
mkdir -p $PKG/usr/include
cd $PKG/usr/include
- ln -s $(ls -d /usr/lib${LIBDIRSUFFIX}/python3.*/site-packages)/numpy/core/include/numpy
+ ln -s $(ls -d /usr/lib${LIBDIRSUFFIX}/python$PYVER/site-packages)/numpy/core/include/numpy
cd -
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION