python-numpy-mkl: incorporate latest PKGBUILD changes from AUR

This commit is contained in:
Bipin Kumar 2023-10-10 12:01:29 +05:30 committed by GitHub
parent 2990f3ac8f
commit a4835af959
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,40 +8,41 @@
pkgname=python-numpy-mkl
pkgver=1.26.0
pkgrel=1
pkgrel=2
pkgdesc="Scientific tools for Python, compiled with Intel MKL"
arch=('x86_64' 'i686')
license=('custom')
url="http://numpy.scipy.org/"
provides=("python-numpy=$pkgver")
conflicts=('python-numpy')
depends=('python' 'intel-oneapi-mkl')
depends=('python' 'intel-oneapi-mkl' 'python-yaml' 'glibc' 'gcc-libs')
optdepends=('python-nose: testsuite')
makedepends=('git' 'cython' 'gcc-fortran' 'procps-ng' 'python-nose' 'python-setuptools' 'python-build' 'python-installer' 'python-wheel')
makedepends=('git' 'cython' 'gcc-fortran' 'procps-ng' 'python-nose' 'python-setuptools' 'python-build' 'python-installer' 'python-wheel' 'meson-python')
checkdepends=('python-pytest' 'python-hypothesis')
options=('staticlibs')
source=("https://github.com/numpy/numpy/releases/download/v$pkgver/numpy-$pkgver.tar.gz")
sha256sums=('f93fc78fe8bf15afe2b8d6b6499f1c73953169fad1e9a8dd086cdff3190e7fdf')
build() {
export MKL_DEBUG_CPU_TYPE=5
source /opt/intel/oneapi/setvars.sh
cd numpy-$pkgver
python setup.py build
python -m build --wheel --no-isolation \
-Csetup-args="-Dblas=mkl-dynamic-lp64-seq" \
-Csetup-args="-Dlapack=mkl-dynamic-lp64-seq"
}
check() {
# TODO: Fix fortran tests here (it works fine after installation)
cd numpy-$pkgver
python setup.py install --root="$PWD/tmp_install" --optimize=1
cd "$PWD/tmp_install"
PATH="$PWD/usr/bin:$PATH" PYTHONPATH="$PWD/usr/lib/python3.11/site-packages:$PYTHONPATH" python -c 'import numpy; numpy.test()'
}
local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
cd numpy-$pkgver
python -m installer --destdir="$PWD/tmp_install" dist/*.whl
cd "$PWD/tmp_install"
PATH="$PWD/usr/bin:$PATH" PYTHONPATH="$PWD/$site_packages:$PYTHONPATH" python -c 'import numpy; numpy.test()'
}
package() {
cd numpy-$pkgver
python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1
python -m installer --destdir="$pkgdir" dist/*.whl
install -m755 -d "${pkgdir}/usr/share/licenses/python-numpy"
install -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/python-numpy/"
install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"