# Maintainer: Alexey Pavlov # Contributor: Ray Donnelly # Contributor: Duong Pham _realname=numpy pkgbase=mingw-w64-python-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}") pkgver=2.3.5 pkgrel=1 pkgdesc="Fundamental package for array computing in Python. (mingw-w64)" arch=('any') mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') url="https://www.numpy.org/" msys2_repository_url="https://github.com/numpy/numpy" msys2_references=( "archlinux: python-numpy" "cpe: cpe:/a:numpy:numpy" "cygwin: python-numpy" "gentoo: dev-python/numpy" "purl: pkg:pypi/numpy" ) license=('spdx:BSD-3-Clause') makedepends=("${MINGW_PACKAGE_PREFIX}-python-build" "${MINGW_PACKAGE_PREFIX}-python-installer" "${MINGW_PACKAGE_PREFIX}-meson-python" "${MINGW_PACKAGE_PREFIX}-pkgconf" "${MINGW_PACKAGE_PREFIX}-ninja" "${MINGW_PACKAGE_PREFIX}-cython" "${MINGW_PACKAGE_PREFIX}-cc") checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest") depends=("${MINGW_PACKAGE_PREFIX}-python" "${MINGW_PACKAGE_PREFIX}-openblas" "${MINGW_PACKAGE_PREFIX}-omp") optdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest: testsuite") options=(!strip) source=(https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz 0007-disable-64bit-experimental-warning.patch) sha256sums=('784db1dcdab56bf0517743e746dfb0f885fc68d948aba86eeec2cba234bdf1c0' '3506a9c877541045ba06e118ebd37c010b5e165f90264675c04a0f935b294ea4') # Helper macros to help make tasks easier # apply_patch_with_msg() { for _patch in "$@" do msg2 "Applying ${_patch}" patch -Nbp1 -i "${srcdir}/${_patch}" done } prepare() { cd ${_realname}-${pkgver} apply_patch_with_msg \ 0007-disable-64bit-experimental-warning.patch } build() { cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}" ${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation \ -Csetup-args="-Duse-ilp64=false" \ -Csetup-args="-Dblas=openblas" \ -Csetup-args="-Dlapack=openblas" \ -Csetup-args="-Denable-openmp=true" } package() { cd python-build-${MSYSTEM} MSYS2_ARG_CONV_EXCL="--prefix=" \ ${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \ --destdir="${pkgdir}" dist/*.whl find "${pkgdir}${MINGW_PREFIX}" -name '*.dll.a' -delete _pyver=$(${MINGW_PREFIX}/bin/python -c "import sys;sys.stdout.write('.'.join(map(str, sys.version_info[:2])))") install -m755 -d "${pkgdir}${MINGW_PREFIX}/include/python${_pyver}" cp -rf "${pkgdir}"${MINGW_PREFIX}/lib/python${_pyver}/site-packages/${_realname}/_core/include/${_realname} "${pkgdir}${MINGW_PREFIX}/include/python${_pyver}/" install -Dm644 LICENSE.txt "${pkgdir}"${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE.txt }