Files
haikuports/dev-python/scipy/scipy-1.15.1.recipe
OscarL abca667abe scipy: update to version 1.15.1. (#11783)
Needs fixed lapack package (#11801) merged first.

With that, this builds, installs and smoke test (`python3 -c "import scipy; help(scipy)"`)
work OK. Previously we where getting missing symbols when attempting scipy builds using meson.

Now we instruct the build to use lapack for LAPACK. At least until we decide to just let openblas
handle BLAS *and* LAPACK.

Solves the issue seen on PR #11536.
2025-02-21 06:03:26 +00:00

120 lines
3.4 KiB
Bash

SUMMARY="Scientific algorithms library for Python"
DESCRIPTION="SciPy is an open source library of scientific tools for Python. \
SciPy supplements the popular numpy module, gathering a variety of high level \
science and engineering modules together as a single package. SciPy includes \
modules for graphics and plotting, optimization, integration, special \
functions, signal and image processing, genetic algorithms, ODE solvers, and \
others."
HOMEPAGE="https://www.scipy.org/"
COPYRIGHT=" 2001-2002 Enthought, Inc.
2003-2025 SciPy Developers"
LICENSE="BSD (3-clause)"
REVISION="1"
SOURCE_URI="https://files.pythonhosted.org/packages/source/s/scipy/scipy-$portVersion.tar.gz"
CHECKSUM_SHA256="033a75ddad1463970c96a88063a1df87ccfddd526437136b6ee81ff0312ebdf6"
SOURCE_DIR="scipy-$portVersion"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
gcc${secondaryArchSuffix}_syslibs # for libgfortran.so.5 and libstdc++.so.6
# lib:libarpack$secondaryArchSuffix # has embedded fallback under scipy/sparse/linalg/eigen/arpack/ARPACK
lib:liblapack$secondaryArchSuffix
lib:libopenblas$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
# devel:libarpack$secondaryArchSuffix
devel:liblapack$secondaryArchSuffix
devel:libopenblas$secondaryArchSuffix
"
BUILD_PREREQUIRES+="
cmd:cython # >=3.0.8,<3.1.0
cmd:g++$secondaryArchSuffix
cmd:gfortran$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
# cmd:pythran # optional. >=0.14.0,<0.18.0 (require pythran_$pythonPackage instead?)
"
PYTHON_VERSIONS=(3.10)
for i in "${!PYTHON_VERSIONS[@]}"; do
pythonVersion=${PYTHON_VERSIONS[$i]}
pythonPackage=python${pythonVersion//.}
eval "PROVIDES_$pythonPackage=\"
${portName}_$pythonPackage = $portVersion
\""
if [ "$targetArchitecture" = x86_gcc2 ]; then
eval "PROVIDES_$pythonPackage+=\"
scipy_$pythonPackage = $portVersion
\""
fi
eval "REQUIRES_$pythonPackage=\"
$REQUIRES
haiku$secondaryArchSuffix
cmd:python$pythonVersion
\""
BUILD_REQUIRES+="
build_$pythonPackage
installer_$pythonPackage
meson_python_$pythonPackage # >=0.15.0,<0.20.0
numpy_$pythonPackage
pybind11_$pythonPackage # >=2.13.2,<2.14.0
"
BUILD_PREREQUIRES+="
cmd:python$pythonVersion
"
done
BUILD()
{
rm -rf doc/sphinxext/.git
# Note: ATM, lapack and openblas packages over HaikuPorts are used to provide
# LAPACK and BLAS respectively (with BLAS disabled in lapack, and LAPACK disabled
# on openblas).
# Thus, we need to instruct the build to look for "-Dlapack=lapack" (instead of
# expecting it to be in bopenblas).
# That might change that in the future, and we could make scipy only rely on openblas.
for i in "${!PYTHON_VERSIONS[@]}"; do
pythonVersion=${PYTHON_VERSIONS[$i]}
python=python$pythonVersion
$python -m build --wheel --skip-dependency-check --no-isolation \
-Ccompile-args=$jobArgs \
-Csetup-args="-Duse-pythran=false" \
-Csetup-args="-Dlapack=lapack" \
-Cbuilddir="build"
# Using a explicit build dir here to stop meson from auto-cleaning it on error.
# (this way you can actually access meson-log.txt if needed).
done
}
INSTALL()
{
for i in "${!PYTHON_VERSIONS[@]}"; do
pythonVersion=${PYTHON_VERSIONS[$i]}
pythonPackage=python${pythonVersion//.}
python=python$pythonVersion
$python -m installer --p $prefix dist/*-$portVersion-*.whl
packageEntries $pythonPackage \
$prefix/lib/python*
done
}