diff options
| author | rawnix ports <ports@rawnix.org> | 2026-09-26 18:19:05 +0000 |
|---|---|---|
| committer | rawnix ports <ports@rawnix.org> | 2026-09-26 18:19:05 +0000 |
| commit | c82e88dd00d1b0b7fcfb4e5628d99611388cef6f (patch) | |
| tree | 56d864b5a5c6c145edd96178ae219a8f90e191a6 /python/py-numpy/MAKEPKG | |
| download | ports-c82e88dd00d1b0b7fcfb4e5628d99611388cef6f.tar.gz | |
sync 2026-09-26 18:19 UTC
1672 files changed, 151396 insertions(+)
Diffstat (limited to 'python/py-numpy/MAKEPKG')
| -rw-r--r-- | python/py-numpy/MAKEPKG | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/python/py-numpy/MAKEPKG b/python/py-numpy/MAKEPKG new file mode 100644 index 0000000..bf53965 --- /dev/null +++ b/python/py-numpy/MAKEPKG @@ -0,0 +1,61 @@ +#!/bin/mkpkg +# description: Fundamental package for array computing in Python +# url: https://numpy.org/ + +name=py-numpy +_name=numpy +version=2.5.3 +release=2 +depends=(python3 openblas) +makedeps=(py-build py-installer py-meson_python py-cython meson samurai pkgconf patchelf) +source=(https://files.pythonhosted.org/packages/source/n/numpy/$_name-$version.tar.gz) + +sha256sums=( + "df2d5874ff183595a4ba404edd04f6bd9b5505c1d7708573f6a6c17489a67563" +) + +build() { + cd $_name-$version + + # Build wheel with explicit BLAS/LAPACK pinning to openblas. + # --no-isolation: use system-installed py-meson_python, py-cython, etc. + /usr/bin/python3 -m build \ + --wheel \ + --no-isolation \ + -Csetup-args=-Dblas=openblas \ + -Csetup-args=-Dlapack=openblas + + _pyver=$(/usr/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') + _sitedir="$PKG/usr/lib/python${_pyver}/site-packages" + + install -dm755 "$_sitedir" + # py-installer: creates /usr/bin/numpy-config from the wheel's entry + # points. No bytecode shipped: __pycache__ is created at runtime. + /usr/bin/python3 -m installer --no-compile-bytecode --destdir "$PKG" --prefix /usr dist/*.whl + + # Strip dev/test bloat + find "$_sitedir" -type d -name tests -prune -exec rm -rf {} + + find "$_sitedir" -name "*.pyx" -delete + + # Strip pytest config (not imported at runtime, only when running tests) + rm -f "$_sitedir/numpy/conftest.py" + + # Strip example code (rng usage examples - not runtime) + rm -rf "$_sitedir/numpy/random/_examples" + + # Strip pyinstaller hooks (not used on krypt/sh) + rm -rf "$_sitedir/numpy/_pyinstaller" + + # Strip f2py: Fortran wrapper generator, useless without a Fortran + # compiler (rawnix is clang-only). numpy imports it lazily, so + # `import numpy` is unaffected. numpy-config is kept (meson ports use it). + rm -f "$PKG/usr/bin/f2py" + rm -rf "$_sitedir/numpy/f2py" +} + +signify() { + untrusted comment: public key + RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3 +} + +# vim: filetype=sh |
