Files
MINGW-packages/mingw-w64-python3-numpy/PKGBUILD
2019-11-12 12:42:33 +03:00

99 lines
4.5 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}-python3-${_realname}")
pkgver=1.17.4
pkgrel=1
pkgdesc="Scientific tools for Python (mingw-w64)"
arch=('any')
license=('BSD')
url="https://www.numpy.org/"
makedepends=("${MINGW_PACKAGE_PREFIX}-openblas"
"${MINGW_PACKAGE_PREFIX}-python3-setuptools"
"${MINGW_PACKAGE_PREFIX}-python3-pytest"
"${MINGW_PACKAGE_PREFIX}-gcc-fortran")
depends=("${MINGW_PACKAGE_PREFIX}-openblas"
"${MINGW_PACKAGE_PREFIX}-python3")
optdepends=("${MINGW_PACKAGE_PREFIX}-python3-pytest: testsuite")
#options=('!strip' 'debug')
source=(https://github.com/numpy/numpy/releases/download/v${pkgver}/${_realname}-${pkgver}.tar.gz
0001-detect-mingw-environment.patch
0002-fix-finding-python2.patch
0003-gfortran-better-version-check.patch
0004-fix-testsuite.patch
0005-mincoming-stack-boundary-32bit-optimized-64bit.patch
0006-disable-visualcompaq-for-mingw.patch
0007-disable-64bit-experimental-warning.patch
0008-mingw-gcc-doesnt-support-visibility.patch
0009-disable-old-mingw-stuff.patch
0010-mingw-inline-stuff.patch)
sha256sums=('fb0415475e673cb9a6dd816df999e0ab9f86fa3af2b1770944e7288d2bea4ac9'
'173e9020eb88a9b281180024ad0f137f86f893e2099693693e42a5bf5944381a'
'140c23c214cae880833380e8479e4ce45c8439b22b1432d73ff0cc2cd58da886'
'3b640625b56b158465d6628f75fadce90af8825259d04af1b1af09fef53a720c'
'720fbba58ac6a73e9476266d033ada9bdc809ec5a6c3cd518fc2f1efec34c3f9'
'3cc0176440f4f474612cb3c28b94d0846b74b508631b399aec0a5c0943c4cf1a'
'e8f2c52131e79a4e36c98f499efa85bc56254e577fae11ebce0093422114a306'
'c1114a027fc797bb6c5c6f7b3044fa853b9e9263555088b4b2b12bdb77baefd5'
'9204922151a7459ed0ecb5d7379fc16bdee6b8c74c925c575667b0ac6ff6441a'
'a089bb11db5110903dba987c2ffb0ab9468414c5828bdc18809b1baeebe61b92'
'c95b2702467055f2f0ff68fe6ba339999d4843ad1c0b8401be16a775e1ffc170')
prepare() {
cd ${_realname}-${pkgver}
patch -Np1 -i ${srcdir}/0001-detect-mingw-environment.patch
patch -Np1 -i ${srcdir}/0002-fix-finding-python2.patch
patch -Np1 -i ${srcdir}/0003-gfortran-better-version-check.patch
patch -Np1 -i ${srcdir}/0004-fix-testsuite.patch
# Note, -mincoming-stack-boundary (and the other flags set) doesn't get used except
# in a test compilation, AFAICT.
patch -Np1 -i ${srcdir}/0005-mincoming-stack-boundary-32bit-optimized-64bit.patch
patch -Np1 -i ${srcdir}/0006-disable-visualcompaq-for-mingw.patch
patch -Np1 -i ${srcdir}/0007-disable-64bit-experimental-warning.patch
patch -Np1 -i ${srcdir}/0008-mingw-gcc-doesnt-support-visibility.patch
patch -Np1 -i ${srcdir}/0009-disable-old-mingw-stuff.patch
patch -Np1 -i ${srcdir}/0010-mingw-inline-stuff.patch
cd ..
cp -a ${_realname}-${pkgver} ${_realname}-py3-${CARCH}
}
build() {
export ATLAS=None
export LDFLAGS="$LDFLAGS -shared"
# See: https://sourceforge.net/p/mingw-w64/mailman/message/36287627/
export CFLAGS="$CFLAGS -fno-asynchronous-unwind-tables"
cd ${_realname}-py3-${CARCH}
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python3 setup.py config_fc --fcompiler=gnu95 build
}
package() {
_pyver=$(${MINGW_PREFIX}/bin/python3 -c "import sys;sys.stdout.write('.'.join(map(str, sys.version_info[:2])))")
_pyinc=${_pyver}m
export ATLAS=None
export LDFLAGS="$LDFLAGS -shared"
export CFLAGS="$CFLAGS -fno-asynchronous-unwind-tables"
cd ${_realname}-py3-${CARCH}
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python3 setup.py config_fc --fcompiler=gnu95 install --prefix=${MINGW_PREFIX} --root="${pkgdir}" --optimize=1
install -m755 -d "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}"
install -m644 LICENSE.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}/"
install -m755 -d "${pkgdir}${MINGW_PREFIX}/include/python${_pyinc}"
cp -rf ${pkgdir}${MINGW_PREFIX}/lib/python${_pyver}/site-packages/${_realname}/core/include/${_realname} "${pkgdir}${MINGW_PREFIX}/include/python${_pyinc}/"
# fix python command in files
local _mingw_prefix=$(cygpath -am ${MINGW_PREFIX})
for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do
sed -e "s|${_mingw_prefix}/bin/|/usr/bin/env |g" -i ${_f}
done
}