# Description: Array processing for numbers, strings, records, and objects with Python
# URL: https://numpy.org
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: lapack meson-python python3-cython

name=python3-numpy
version=2.2.6
release=1
source=(https://github.com/numpy/numpy/releases/download/v$version/numpy-$version.tar.gz)

build() {
  cd numpy-$version

  sed -e "/meson-python/s/,<0.16.0//" -i pyproject.toml

  CFLAGS+=" -ffat-lto-objects" \
  CXXFLAGS+=" -ffat-lto-objects" \
  /usr/bin/python3 -m build --wheel --no-isolation \
    -Csetup-args="-Dblas=blas" \
    -Csetup-args="-Dlapack=lapack"

  /usr/bin/python3 -m installer --destdir=$PKG dist/*.whl
  find $PKG \( \
    -iname "LICENSE.txt" -o \
    -iname "*README*" \
    \) -delete
  chmod -R g-w $PKG
}
