# Maintainer: Peter Budai _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.4.1.post1 pkgrel=1 pkgdesc="A set of python modules for machine learning and data mining (mingw-w64)" arch=('any') mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') url='https://scikit-learn.org' msys2_repository_url="https://github.com/scikit-learn/scikit-learn" msys2_references=( 'pypi: scikit-learn' "cpe: cpe:/a:scikit-learn:scikit-learn" ) 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" "${MINGW_PACKAGE_PREFIX}-gcc-libs" "${MINGW_PACKAGE_PREFIX}-omp") 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=('93d3d496ff1965470f9977d05e5ec3376fb1e63b10e4fda5e39d23c2d8969a30' '8ec903dec6dbe788e24d3d7e800f933d6380329d6427c1873947aac7d5a74023' '88c35335818321275e5d8b1a851d967faff48ad628c0dd5954e955689cc5d6b9' '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 }