67 lines
1.7 KiB
Bash
67 lines
1.7 KiB
Bash
# Template file for 'python3-scipy'
|
|
pkgname=python3-scipy
|
|
version=1.7.1
|
|
revision=2
|
|
wrksrc="scipy-${version}"
|
|
build_style=python3-module
|
|
build_helper="numpy"
|
|
make_check_args="--force"
|
|
hostmakedepends="gcc-fortran python3-setuptools python3-Cython python3-pybind11"
|
|
makedepends="python3-devel python3-pybind11
|
|
$(vopt_if openblas openblas-devel lapack-devel)"
|
|
depends="python3-numpy"
|
|
checkdepends="python3-pytest"
|
|
short_desc="Scientific library for Python3"
|
|
maintainer="Andrew J. Hesford <ajh@sideband.org>"
|
|
license="BSD-3-Clause"
|
|
homepage="https://scipy.org/scipylib/"
|
|
distfiles="https://github.com/scipy/scipy/releases/download/v${version}/scipy-${version}.tar.xz"
|
|
checksum=fdfe1d1eb1569846e331bd8d72106a8c446dafb2192c00adbb5376b02a0a1104
|
|
|
|
build_options="openblas"
|
|
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
x86_64*|i686*|aarch64*|armv[67]*|ppc64*)
|
|
# Prefer accelerated routines where available
|
|
build_options_default="openblas"
|
|
;;
|
|
*) ;;
|
|
esac
|
|
|
|
if [ "$build_option_openblas" ]; then
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
ppc64*) ;;
|
|
ppc*) broken="numpy can't be built with openblas";;
|
|
esac
|
|
fi
|
|
|
|
LDFLAGS+=" -shared"
|
|
|
|
# Tell numpy to build in parallel
|
|
export NPY_NUM_BUILD_JOBS="${XBPS_MAKEJOBS}"
|
|
|
|
# Pythran isn't packaged, disable for now
|
|
export SCIPY_USE_PYTHRAN=0
|
|
|
|
pre_build() {
|
|
# Find the right linear algebra subroutines on the target arch
|
|
: > site.cfg
|
|
for _blaslib in $(vopt_if openblas openblas "lapack blas"); do
|
|
cat >> site.cfg <<-EOF
|
|
[$_blaslib]
|
|
libraries = ${_blaslib}
|
|
include_dirs = ${XBPS_CROSS_BASE}/usr/include
|
|
library_dirs = ${XBPS_CROSS_BASE}/usr/lib
|
|
runtime_library_dirs = ${XBPS_CROSS_BASE}/usr/lib
|
|
EOF
|
|
done
|
|
}
|
|
|
|
do_check() {
|
|
python3 ./runtests.py --verbose
|
|
}
|
|
|
|
post_install() {
|
|
rm ${DESTDIR}/${py3_sitelib}/scipy/*.txt
|
|
vlicense LICENSE.txt
|
|
}
|