This allows us to include a version and we already use PURL for other things, so might as well remove the pypi special case. Normalize the names, since that is required for PURLs.
84 lines
3.0 KiB
Bash
84 lines
3.0 KiB
Bash
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
|
|
# Contributor: Ray Donnelly <mingw.android@gmail.com>
|
|
# Contributor: Duong Pham <dthpham@gmail.com>
|
|
|
|
_realname=numpy
|
|
pkgbase=mingw-w64-python-${_realname}
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
|
|
provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
|
|
conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
|
|
replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
|
|
pkgver=2.2.3
|
|
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"
|
|
"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")
|
|
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=('dbdc15f0c81611925f382dfa97b3bd0bc2c1ce19d4fe50482cb0ddc12ba30020'
|
|
'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
|
|
|
|
cd "$srcdir"
|
|
rm -rf python-build-${MSYSTEM} | true
|
|
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}"
|
|
}
|
|
|
|
build() {
|
|
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"
|
|
}
|
|
|
|
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
|
|
}
|