From 0dcfd9b74a5174dec3c8ec09268c851337693851 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Thu, 11 Aug 2016 05:04:12 +0200 Subject: [PATCH] fixing bug from upstream --- sci-libs/scikits_learn/Manifest | 1 + .../scikits_learn-0.14.1-system-cblas.patch | 28 +++++ .../scikits_learn-0.17.1-system-cblas.patch | 30 +++++ .../scikits_learn/scikits_learn-0.17.1.ebuild | 117 ++++++++++++++++++ 4 files changed, 176 insertions(+) create mode 100644 sci-libs/scikits_learn/Manifest create mode 100644 sci-libs/scikits_learn/files/scikits_learn-0.14.1-system-cblas.patch create mode 100644 sci-libs/scikits_learn/files/scikits_learn-0.17.1-system-cblas.patch create mode 100644 sci-libs/scikits_learn/scikits_learn-0.17.1.ebuild diff --git a/sci-libs/scikits_learn/Manifest b/sci-libs/scikits_learn/Manifest new file mode 100644 index 0000000..f95554a --- /dev/null +++ b/sci-libs/scikits_learn/Manifest @@ -0,0 +1 @@ +DIST scikit-learn-0.17.1.tar.gz 7898571 SHA256 9f4cf58e57d81783289fc503caaed1f210bab49b7a6f680bf3c04b1e0a96e5f0 SHA512 5786e04a13225d2433103f1873f2753e332704b98c4c32b840970f763ec1abf0248007089e5ae47e11c66535f05a0d0402715622e6d6f0955ec7961b92e1b2e5 WHIRLPOOL cded0be080aa0e6e5486d2613c007c7ff1ea769b623f60cb97c4e03b2d130c53b66e9c22a20d644c61cd82eb8b460024a2b84365ff846aacfc07bf49a6bef0ac diff --git a/sci-libs/scikits_learn/files/scikits_learn-0.14.1-system-cblas.patch b/sci-libs/scikits_learn/files/scikits_learn-0.14.1-system-cblas.patch new file mode 100644 index 0000000..96c6cc2 --- /dev/null +++ b/sci-libs/scikits_learn/files/scikits_learn-0.14.1-system-cblas.patch @@ -0,0 +1,28 @@ +--- sklearn/setup.py.orig 2013-08-08 13:54:08.310879167 -0700 ++++ sklearn/setup.py 2013-08-08 13:52:59.808456423 -0700 +@@ -68,14 +68,6 @@ + libraries=libraries, + ) + +- # some libs needs cblas, fortran-compiled BLAS will not be sufficient +- blas_info = get_info('blas_opt', 0) +- if (not blas_info) or ( +- ('NO_ATLAS_INFO', 1) in blas_info.get('define_macros', [])): +- config.add_library('cblas', +- sources=[join('src', 'cblas', '*.c')]) +- warnings.warn(BlasNotFoundError.__doc__) +- + # the following packages depend on cblas, so they have to be build + # after the above. + config.add_subpackage('linear_model') +--- sklearn/_build_utils.py.orig 2013-08-08 14:01:35.994589269 -0700 ++++ sklearn/_build_utils.py 2013-08-08 12:19:41.875967870 -0700 +@@ -23,7 +23,7 @@ + return False + + blas_info = get_info('blas_opt', 0) +- if (not blas_info) or atlas_not_found(blas_info): ++ if (not blas_info): + cblas_libs = ['cblas'] + blas_info.pop('libraries', None) + else: diff --git a/sci-libs/scikits_learn/files/scikits_learn-0.17.1-system-cblas.patch b/sci-libs/scikits_learn/files/scikits_learn-0.17.1-system-cblas.patch new file mode 100644 index 0000000..42657a7 --- /dev/null +++ b/sci-libs/scikits_learn/files/scikits_learn-0.17.1-system-cblas.patch @@ -0,0 +1,30 @@ +diff -Nur scikit-learn-0.17.1.orig/sklearn/_build_utils.py scikit-learn-0.17.1/sklearn/_build_utils.py +--- scikit-learn-0.17.1.orig/sklearn/_build_utils.py 2016-03-09 00:27:54.756813784 +0000 ++++ scikit-learn-0.17.1/sklearn/_build_utils.py 2016-03-09 00:30:09.605118512 +0000 +@@ -23,7 +23,7 @@ + return False + + blas_info = get_info('blas_opt', 0) +- if (not blas_info) or atlas_not_found(blas_info): ++ if (not blas_info): + cblas_libs = ['cblas'] + blas_info.pop('libraries', None) + else: +diff -Nur scikit-learn-0.17.1.orig/sklearn/setup.py scikit-learn-0.17.1/sklearn/setup.py +--- scikit-learn-0.17.1.orig/sklearn/setup.py 2016-03-09 00:27:54.806813156 +0000 ++++ scikit-learn-0.17.1/sklearn/setup.py 2016-03-09 00:29:28.215638848 +0000 +@@ -58,14 +58,6 @@ + libraries=libraries, + ) + +- # some libs needs cblas, fortran-compiled BLAS will not be sufficient +- blas_info = get_info('blas_opt', 0) +- if (not blas_info) or ( +- ('NO_ATLAS_INFO', 1) in blas_info.get('define_macros', [])): +- config.add_library('cblas', +- sources=[join('src', 'cblas', '*.c')]) +- warnings.warn(BlasNotFoundError.__doc__) +- + # the following packages depend on cblas, so they have to be build + # after the above. + config.add_subpackage('linear_model') diff --git a/sci-libs/scikits_learn/scikits_learn-0.17.1.ebuild b/sci-libs/scikits_learn/scikits_learn-0.17.1.ebuild new file mode 100644 index 0000000..89c2409 --- /dev/null +++ b/sci-libs/scikits_learn/scikits_learn-0.17.1.ebuild @@ -0,0 +1,117 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +PYTHON_COMPAT=( python2_7 python3_{3,4,5} ) + +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 ~amd64-linux ~x86-linux" +IUSE="doc examples test" + +RDEPEND=" + dev-python/joblib[${PYTHON_USEDEP}] + dev-python/matplotlib[${PYTHON_USEDEP}] + dev-python/nose[${PYTHON_USEDEP}] + >=dev-python/numpy-1.6.1[lapack,${PYTHON_USEDEP}] + sci-libs/scikits[${PYTHON_USEDEP}] + >=sci-libs/scipy-0.9[${PYTHON_USEDEP}] + virtual/blas + virtual/cblas + virtual/python-funcsigs[${PYTHON_USEDEP}] + " +DEPEND=" + dev-python/cython[${PYTHON_USEDEP}] + dev-python/numpy[lapack,${PYTHON_USEDEP}] + dev-python/setuptools[${PYTHON_USEDEP}] + sci-libs/scipy[${PYTHON_USEDEP}] + virtual/blas + virtual/cblas + doc? ( + dev-python/joblib[${PYTHON_USEDEP}] + dev-python/matplotlib[${PYTHON_USEDEP}] + dev-python/sphinx[${PYTHON_USEDEP}] + )" + +S="${WORKDIR}/${MYP}" + +PATCHES=( "${FILESDIR}/${P}-system-cblas.patch" ) + +python_prepare_all() { + # bug #397605 + [[ ${CHOST} == *-darwin* ]] \ + && append-ldflags -bundle "-undefined dynamic_lookup" \ + || append-ldflags -shared + + # scikits-learn now uses the horrible numpy.distutils automagic + export SCIPY_FCONFIG="config_fc --noopt --noarch" + + # use system joblib + rm -r sklearn/externals/joblib/* || die + echo "from joblib import *" > sklearn/externals/joblib/__init__.py + sed -i -e '/joblib\/test/d' sklearn/externals/setup.py || die + sed -i -e 's/..externals.joblib/ joblib/g' \ + sklearn/cross_validation.py \ + sklearn/decomposition/tests/test_sparse_pca.py \ + sklearn/metrics/pairwise.py || die + + rm sklearn/externals/funcsigs.py || die + rm sklearn/externals/odict.py || die + sed -e 's:from ..externals.funcsigs import signature:from funcsigs import signature:g' \ + -i sklearn/utils/fixes.py || die + + distutils-r1_python_prepare_all +} + +python_compile() { + distutils-r1_python_compile ${SCIPY_FCONFIG} +} + +python_compile_all() { + if use doc; then + cd "${S}/doc" || die + local d="${BUILD_DIR}"/lib + ln -s "${S}"/sklearn/datasets/{data,descr,images} \ + "${d}"/sklearn/datasets || die + VARTEXFONTS="${T}"/fonts \ + MPLCONFIGDIR="${BUILD_DIR}" \ + PYTHONPATH="${d}" \ + emake html + rm -r "${d}"/sklearn/datasets/{data,descr,images} || die + fi +} + +python_test() { + # doc builds and runs tests + use doc && return + distutils_install_for_testing ${SCIPY_FCONFIG} + esetup.py \ + install --root="${T}/test-${EPYTHON}" \ + --no-compile ${SCIPY_FCONFIG} + pushd "${T}/test-${EPYTHON}/$(python_get_sitedir)" || die > /dev/null + nosetests -v sklearn --exe || die + popd > /dev/null +} + +python_install() { + distutils-r1_python_install ${SCIPY_FCONFIG} +} + +python_install_all() { + find "${S}" -name \*LICENSE.txt -delete + insinto /usr/share/doc/${PF} + use doc && doins -r doc/_build/html + use examples && doins -r examples + distutils-r1_python_install_all +}