python3-scipy: update to 1.5.0; make cross compilation work

This commit is contained in:
Andrew J. Hesford 2020-06-28 20:30:06 -04:00 committed by Piraty
parent 0ced2ca4f5
commit 755b49bcc8

View file

@ -1,13 +1,12 @@
# Template file for 'python3-scipy'
pkgname=python3-scipy
version=1.3.2
revision=2
version=1.5.0
revision=1
wrksrc="scipy-${version}"
build_style=python3-module
pycompile_module="scipy"
make_check_args="--force"
hostmakedepends="python3-setuptools python3-Cython gcc-fortran"
makedepends="python3-devel python3-numpy lapack-devel"
hostmakedepends="python3-setuptools python3-Cython python3-numpy gcc-fortran"
makedepends="python3-devel python3-numpy python3-pybind11 lapack-devel openblas-devel"
depends="python3-numpy"
checkdepends="python3-nose"
short_desc="Scientific library for Python3"
@ -15,11 +14,39 @@ maintainer="Alessio Sergi <al3hex@gmail.com>"
license="BSD-3-Clause"
homepage="https://scipy.org/scipylib/"
distfiles="https://github.com/scipy/scipy/releases/download/v${version}/scipy-${version}.tar.xz"
checksum=1d2f09bcb6c4b66a65d9f49d21fa065f5396c940edac8285b87947b8d21b55f8
checksum=23baeaa18803d12d1abdff3f5c148b1085c2dc4028c6b8efce652dde2119b41c
nocross="https://build.voidlinux.org/builders/aarch64_builder/builds/24733/steps/shell_3/logs/stdio"
if [ "$CROSS_BUILD" ]; then
# Make sure numpy is found for the target arch first
CFLAGS+=" -I${XBPS_CROSS_BASE}/${py3_sitelib}/numpy/core/include"
LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py3_sitelib}/numpy/core/lib"
LDFLAGS+="-shared"
# Tell numpy.distutils where to find FORTRAN compilers
export F77="${FC}"
export F90="${FC}"
fi
LDFLAGS+=" -shared"
pre_build() {
cat > site.cfg <<-EOF
[openblas]
libraries = openblas
EOF
if [ "$CROSS_BUILD" ]; then
# Make sure scipy knows how to find openblas
cat >> site.cfg <<-EOF
library_dirs = ${XBPS_CROSS_BASE}/usr/lib
include_dirs = ${XBPS_CROSS_BASE}/usr/include
runtime_library_dirs = ${XBPS_CROSS_BASE}/usr/lib
EOF
# numpy.distutils refuses to find the right linker for FORTRAN
# Link the cross compiler so the module will find it as gfortran
ln -sf "/usr/bin/${FC}" "${XBPS_WRAPPERDIR}/gfortran"
fi
}
post_install() {
rm ${DESTDIR}/${py3_sitelib}/scipy/*.txt