From 5142233120fcceeacef67d97144a4512ba5e5c92 Mon Sep 17 00:00:00 2001 From: termux-pacman-bot Date: Wed, 21 Sep 2022 08:51:41 +0000 Subject: [PATCH] python-numpy: link against libopenblas --- packages/python-numpy/build.sh | 6 ++++-- packages/python-numpy/site-openblas.patch | 12 ++++++++++++ packages/python-numpy/test.patch | 11 +++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 packages/python-numpy/site-openblas.patch create mode 100644 packages/python-numpy/test.patch diff --git a/packages/python-numpy/build.sh b/packages/python-numpy/build.sh index 55d5c73c1e..67eb408276 100644 --- a/packages/python-numpy/build.sh +++ b/packages/python-numpy/build.sh @@ -3,9 +3,9 @@ TERMUX_PKG_DESCRIPTION="The fundamental package for scientific computing with Py TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION="1.23.3" -TERMUX_PKG_REVISION=1 +TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://github.com/numpy/numpy.git -TERMUX_PKG_DEPENDS="libc++, python" +TERMUX_PKG_DEPENDS="libc++, libopenblas, python" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_AUTO_UPDATE=true @@ -84,6 +84,8 @@ termux_step_create_debscripts() { cat <<- EOF > ./prerm #!$TERMUX_PREFIX/bin/sh + echo "Removing numpy..." + find $TERMUX_PREFIX/lib/python${_PYTHON_VERSION}/site-packages/$_NUMPY_EGGDIR | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf sed -i "/\.\/${_NUMPY_EGGDIR//./\\.}/d" $TERMUX_PREFIX/lib/python${_PYTHON_VERSION}/site-packages/easy-install.pth EOF } diff --git a/packages/python-numpy/site-openblas.patch b/packages/python-numpy/site-openblas.patch new file mode 100644 index 0000000000..35e0aa1299 --- /dev/null +++ b/packages/python-numpy/site-openblas.patch @@ -0,0 +1,12 @@ +--- a/site.cfg ++++ b/site.cfg +@@ -0,0 +1,9 @@ ++[DEFAULT] ++library_dirs = @TERMUX_PREFIX@/lib ++include_dirs = @TERMUX_PREFIX@/include ++ ++[openblas] ++libraries = openblas ++library_dirs = @TERMUX_PREFIX@/lib ++include_dirs = @TERMUX_PREFIX@/include ++runtime_library_dirs = @TERMUX_PREFIX@/lib diff --git a/packages/python-numpy/test.patch b/packages/python-numpy/test.patch new file mode 100644 index 0000000000..7b069ec6ab --- /dev/null +++ b/packages/python-numpy/test.patch @@ -0,0 +1,11 @@ +--- a/numpy/core/tests/test_mem_policy.py ++++ b/numpy/core/tests/test_mem_policy.py +@@ -18,6 +18,8 @@ + """ + if sys.platform.startswith('cygwin'): + pytest.skip('link fails on cygwin') ++ if os.path.exists("/system/bin/app_process"): ++ pytest.skip('link fails on Android') + functions = [ + ("get_default_policy", "METH_NOARGS", """ + Py_INCREF(PyDataMem_DefaultHandler);