72 lines
2.6 KiB
Bash
72 lines
2.6 KiB
Bash
# Maintainer: Peter Budai <peterbudai@hotmail.com>
|
|
|
|
_realname=scikit-learn
|
|
pkgbase=mingw-w64-python-${_realname}
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
|
|
provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
|
|
conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
|
|
replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
|
|
pkgver=1.2.1
|
|
pkgrel=1
|
|
pkgdesc="A set of python modules for machine learning and data mining (mingw-w64)"
|
|
arch=('any')
|
|
mingw_arch=('mingw32' 'mingw64' 'ucrt64')
|
|
url='https://scikit-learn.org'
|
|
license=('spdx:BSD-3-Clause')
|
|
depends=("${MINGW_PACKAGE_PREFIX}-python"
|
|
"${MINGW_PACKAGE_PREFIX}-python-numpy"
|
|
"${MINGW_PACKAGE_PREFIX}-python-scipy"
|
|
"${MINGW_PACKAGE_PREFIX}-python-joblib"
|
|
"${MINGW_PACKAGE_PREFIX}-python-threadpoolctl")
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
|
|
"${MINGW_PACKAGE_PREFIX}-python-installer"
|
|
"${MINGW_PACKAGE_PREFIX}-python-setuptools"
|
|
"${MINGW_PACKAGE_PREFIX}-python-wheel"
|
|
"${MINGW_PACKAGE_PREFIX}-cython"
|
|
"${MINGW_PACKAGE_PREFIX}-cc")
|
|
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz"
|
|
001-mingw-python-openmp-flag.patch
|
|
002-openmp-cleanup-wait.patch
|
|
003-Fix-optimization-flag.patch)
|
|
sha256sums=('fbf8a5c893c9b4b99bcc7ed8fb3e8500957a113f4101860386d06635520f7cfb'
|
|
'7817f0ac38fd47fb5731abf6ba76f0e8d6534f98e085048d0bc9cb5e402c8d43'
|
|
'b9e8d52dd9f989c8b75c086653690598f28378451fbd7078e8163bff1d76452e'
|
|
'653f294ec5185ff2df98144e67327ed85ba5412e29e8e5b936074894025ba540')
|
|
|
|
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-mingw-python-openmp-flag.patch \
|
|
002-openmp-cleanup-wait.patch \
|
|
003-Fix-optimization-flag.patch
|
|
|
|
cd ${srcdir}
|
|
rm -rf python-build-${MSYSTEM} | true
|
|
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}"
|
|
}
|
|
|
|
build() {
|
|
cd "${srcdir}/python-build-${MSYSTEM}"
|
|
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
|
|
}
|
|
|
|
package() {
|
|
cd "${srcdir}/python-build-${MSYSTEM}"
|
|
MSYS2_ARG_CONV_EXCL="--prefix=" \
|
|
${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \
|
|
--destdir="${pkgdir}" dist/*.whl
|
|
|
|
install -Dm644 COPYING "${pkgdir}"${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE
|
|
|
|
install -d ${pkgdir}${MINGW_PREFIX}/share/doc/python-${_realname}
|
|
cp -r doc/tutorial ${pkgdir}${MINGW_PREFIX}/share/doc/python-${_realname}/tutorial
|
|
}
|