![Horea Christian](/assets/img/avatar_default.png)
https://github.com/gentoo/gentoo/pull/15065#issuecomment-610712405 Package-Manager: Portage-2.3.96, Repoman-2.3.22 Signed-off-by: Horea Christian <chr@chymera.eu>
84 lines
1.8 KiB
Bash
84 lines
1.8 KiB
Bash
# Copyright 1999-2020 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=7
|
|
|
|
PYTHON_COMPAT=( python3_{6,7} )
|
|
|
|
inherit distutils-r1 flag-o-matic
|
|
|
|
MYPN="${PN/scikits_/scikit-}"
|
|
MYP="${MYPN}-${PV}"
|
|
|
|
DESCRIPTION="Python modules for machine learning and data mining"
|
|
HOMEPAGE="http://scikit-learn.org"
|
|
SRC_URI="mirror://pypi/${MYPN:0:1}/${MYPN}/${MYP}.tar.gz"
|
|
|
|
LICENSE="BSD"
|
|
SLOT="0"
|
|
KEYWORDS="~amd64 ~x86"
|
|
IUSE="doc examples test"
|
|
RESTRICT="!test? ( test )"
|
|
|
|
RDEPEND="
|
|
dev-python/joblib[${PYTHON_USEDEP}]
|
|
dev-python/matplotlib[${PYTHON_USEDEP}]
|
|
dev-python/nose[${PYTHON_USEDEP}]
|
|
dev-python/numpy[lapack,${PYTHON_USEDEP}]
|
|
sci-libs/scikits[${PYTHON_USEDEP}]
|
|
sci-libs/scipy[${PYTHON_USEDEP}]
|
|
virtual/blas:=
|
|
virtual/cblas:=
|
|
"
|
|
|
|
BDEPEND="
|
|
dev-python/cython[${PYTHON_USEDEP}]
|
|
dev-python/numpy[lapack,${PYTHON_USEDEP}]
|
|
sci-libs/scipy[${PYTHON_USEDEP}]
|
|
test? ( dev-python/pytest[${PYTHON_USEDEP}] )
|
|
virtual/blas:=
|
|
virtual/cblas:=
|
|
"
|
|
|
|
S="${WORKDIR}/${MYP}"
|
|
|
|
python_prepare_all() {
|
|
# bug #397605
|
|
[[ ${CHOST} == *-darwin* ]] &&
|
|
append-ldflags -bundle "-undefined dynamic_lookup" ||
|
|
append-ldflags -shared
|
|
|
|
# remove bundled cblas
|
|
rm -rf sklearn/src || die "failed to remove bundled cblas"
|
|
|
|
distutils-r1_python_prepare_all
|
|
}
|
|
|
|
python_compile() {
|
|
distutils-r1_python_compile
|
|
}
|
|
|
|
python_test() {
|
|
esetup.py install \
|
|
--root="${T}/test-${EPYTHON}"
|
|
pushd "${T}/test-${EPYTHON}/$(python_get_sitedir)" || die > /dev/null
|
|
pytest -m "not network" -vv || die
|
|
popd > /dev/null
|
|
#distutils_install_for_testing
|
|
#${EPYTHON} -m pytest -v "${BUILD_DIR}/test/lib/sklearn" || die
|
|
}
|
|
|
|
python_install() {
|
|
distutils-r1_python_install
|
|
}
|
|
|
|
python_install_all() {
|
|
find "${S}" -name \*LICENSE.txt -delete || die
|
|
distutils-r1_python_install_all
|
|
if use examples; then
|
|
dodoc -r examples
|
|
docompress -x /usr/share/doc/${PF}/examples
|
|
fi
|
|
|
|
}
|