107 lines
3.3 KiB
Bash
107 lines
3.3 KiB
Bash
# Contributor: Runar Tenfjord < runar dot tenfjord at gmail dot com >
|
|
# Contributor: Naveen M K <naveen521kk@gmail.com> @naveen521kk on Github
|
|
|
|
_realname=scipy
|
|
pkgbase=mingw-w64-python-${_realname}
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
|
|
pkgver=1.16.3
|
|
pkgrel=1
|
|
pkgdesc="SciPy is open-source software for mathematics, science, and engineering (mingw-w64)"
|
|
arch=('any')
|
|
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
|
|
url="https://www.scipy.org/"
|
|
msys2_repository_url="https://github.com/scipy/scipy"
|
|
msys2_references=(
|
|
'purl: pkg:pypi/scipy'
|
|
"cpe: cpe:2.3:a:scipy:scipy"
|
|
)
|
|
license=('spdx:BSD-3-Clause')
|
|
depends=(
|
|
$([[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]] || echo "${MINGW_PACKAGE_PREFIX}-gcc-libgfortran")
|
|
"${MINGW_PACKAGE_PREFIX}-openblas"
|
|
"${MINGW_PACKAGE_PREFIX}-python"
|
|
"${MINGW_PACKAGE_PREFIX}-python-numpy")
|
|
optdepends=(
|
|
"${MINGW_PACKAGE_PREFIX}-python-pillow: for image saving module"
|
|
)
|
|
checkdepends=(
|
|
"${MINGW_PACKAGE_PREFIX}-python-pytest"
|
|
)
|
|
makedepends=(
|
|
"${MINGW_PACKAGE_PREFIX}-cc"
|
|
"${MINGW_PACKAGE_PREFIX}-fc"
|
|
"${MINGW_PACKAGE_PREFIX}-meson"
|
|
"${MINGW_PACKAGE_PREFIX}-ninja"
|
|
"${MINGW_PACKAGE_PREFIX}-pkgconf"
|
|
"${MINGW_PACKAGE_PREFIX}-cython"
|
|
"${MINGW_PACKAGE_PREFIX}-pybind11"
|
|
"${MINGW_PACKAGE_PREFIX}-python-pythran"
|
|
)
|
|
source=("https://pypi.python.org/packages/source/${_realname:0:1}/${_realname}/${_realname}-${pkgver}.tar.gz"
|
|
"001-no-static-linking.patch"
|
|
"002-no-long-double-64.patch")
|
|
sha256sums=('01e87659402762f43bd2fee13370553a17ada367d42e7487800bf2916535aecb'
|
|
'd418dffecdce7c746d08db5d6301798d6b60444572d85f10789e07995397f2a2'
|
|
'5531a507a0c958687e7476f896d88dbd6f948f121f75da46e2eee31be9f0b8ca')
|
|
|
|
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 \
|
|
001-no-static-linking.patch \
|
|
002-no-long-double-64.patch
|
|
}
|
|
|
|
build() {
|
|
mkdir -p build-${MSYSTEM} && cd build-${MSYSTEM}
|
|
|
|
declare -a _extra_config
|
|
if check_option "debug" "n"; then
|
|
_extra_config+=("-Dbuildtype=release")
|
|
else
|
|
_extra_config+=("-Dbuildtype=debug")
|
|
fi
|
|
|
|
if [[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]]; then
|
|
_extra_config+=("-Dfortran_std=none")
|
|
fi
|
|
|
|
MSYS2_ARG_CONV_EXCL="--prefix=" \
|
|
${MINGW_PREFIX}/bin/meson setup \
|
|
--prefix="${MINGW_PREFIX}" \
|
|
--wrap-mode=nodownload \
|
|
--auto-features=enabled \
|
|
-Dwarning_level=0 \
|
|
"${_extra_config[@]}" \
|
|
../${_realname}-${pkgver}
|
|
|
|
${MINGW_PREFIX}/bin/meson compile
|
|
}
|
|
|
|
package() {
|
|
cd "${srcdir}/build-${MSYSTEM}"
|
|
|
|
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/meson install
|
|
|
|
# https://github.com/msys2/MINGW-packages/pull/12386#issuecomment-1201661997
|
|
_purelib="$(python -c "import sysconfig; print(sysconfig.get_path('purelib'))")"
|
|
_site_packages="${pkgdir}$(cygpath "${_purelib}")"
|
|
cp "${srcdir}/${_realname}-${pkgver}/PKG-INFO" "${_site_packages}/${_realname}-${pkgver}.egg-info"
|
|
|
|
find "${pkgdir}${MINGW_PREFIX}" -name '*.dll.a' -delete
|
|
|
|
MSYS2_ARG_CONV_EXCL="-p" python -m compileall \
|
|
-o 0 -o 1 -q -s"${pkgdir}" -p"/" "${pkgdir}${MINGW_PREFIX}/lib/python"*
|
|
|
|
install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE.txt" \
|
|
"${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
|
|
}
|