Files
MINGW-packages/mingw-w64-python-numpy/PKGBUILD
Christoph Reiter 8519df2bf9 Move all reverse dependencies to cython0
Which is what they used up to now, so rebuilds don't break.
We can rebuild them against cython v3 later.
2023-10-22 19:52:17 +02:00

90 lines
3.4 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=1.26.1
pkgrel=1
pkgdesc="Scientific tools for Python (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
license=('spdx:BSD-3-Clause')
url="https://www.numpy.org/"
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-wheel"
"${MINGW_PACKAGE_PREFIX}-meson-python"
"${MINGW_PACKAGE_PREFIX}-pkgconf"
"${MINGW_PACKAGE_PREFIX}-ninja"
"${MINGW_PACKAGE_PREFIX}-cython0"
"${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
0001-no-static-linking.patch
0002-no-long-double-64.patch
0003-no-strtold_l.patch
0007-disable-64bit-experimental-warning.patch)
sha256sums=('c8c6c72d4a9f831f328efb1312642a1cafafaa88981d9ab76368d50d07d93cbe'
'532eca91c3d46c102c4f81d9acaf921bedcdcd07a827820e868bfbb1f62dd258'
'0c26d7174fb0338210bfb291ca25c01074f3079232c32a1b4e9ae3da70d2fd80'
'181ffb50fccbd60b6d85aa20e94443634b99090c9ec85014f05fa532c4017446'
'cafc924fd11d8653a49970d0cce5b31869cce0e8996a3ae57bcbccca96bc8eb3')
# 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 \
0001-no-static-linking.patch \
0002-no-long-double-64.patch \
0003-no-strtold_l.patch \
0007-disable-64bit-experimental-warning.patch
find . -type f -name "*.orig" -exec rm -f {} \;
cd "$srcdir"
rm -rf python-build-${MSYSTEM} | true
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}"
}
build() {
cd python-build-${MSYSTEM}
CFLAGS+=" -Wno-implicit-function-declaration" \
${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
}