# 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 python3-build python3-cython python3-installer python3-wheel

name=python3-numpy
version=1.25.2
release=1
source=(https://github.com/${name#*-}/${name#*-}/releases/download/v$version/${name#*-}-$version.tar.gz)

build() {
  export CFLAGS+=' -fno-strict-aliasing'
  export ATLAS=None
  export LDFLAGS="$LDFLAGS -shared"

  ## broken port, this requires an older setuptools
  cd ${name#*-}-$version
  /usr/bin/python3 -m build --wheel --skip-dependency-check --no-isolation
  /usr/bin/python3 -m installer --compile-bytecode 0 --destdir=$PKG dist/*.whl

  local pyv="$(python3 -c "import sys; print (sys.version_info[0], sys.version_info[1])" | sed -e 's/\ /./g')"
  rm $PKG/usr/lib/python$pyv/site-packages/numpy/LICENSE.txt
  find $PKG \( \
    -iname "LICENSE.txt" -o \
    -iname "*README*" \
    \) -delete
  chmod -R g-w $PKG
}
