Gentoo Archives: gentoo-commits

From: "罗百科" <patrick@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/scikits_learn/, sci-libs/scikits_learn/files/
Date: Sun, 29 Dec 2019 18:24:12
Message-Id: 1577643801.a1444fbbd220ed8e8357631a0d9d333551fea43b.patrick@gentoo
1 commit: a1444fbbd220ed8e8357631a0d9d333551fea43b
2 Author: Patrick Lauer <patrick <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 29 18:23:08 2019 +0000
4 Commit: 罗百科 <patrick <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 29 18:23:21 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a1444fbb
7
8 sci-libs/scikits_learn: Bump, fix build
9
10 Fixes #630294
11
12 Package-Manager: Portage-2.3.84, Repoman-2.3.20
13 Signed-off-by: Patrick Lauer <patrick <AT> gentoo.org>
14
15 sci-libs/scikits_learn/Manifest | 2 +
16 .../files/scikits_learn-0.20.2-fix-cdfast.patch | 42 ++++++++
17 sci-libs/scikits_learn/scikits_learn-0.20.2.ebuild | 107 +++++++++++++++++++++
18 sci-libs/scikits_learn/scikits_learn-0.20.4.ebuild | 107 +++++++++++++++++++++
19 4 files changed, 258 insertions(+)
20
21 diff --git a/sci-libs/scikits_learn/Manifest b/sci-libs/scikits_learn/Manifest
22 index cc6598f1275..bb13bbcc95f 100644
23 --- a/sci-libs/scikits_learn/Manifest
24 +++ b/sci-libs/scikits_learn/Manifest
25 @@ -1 +1,3 @@
26 DIST scikit-learn-0.19.0.tar.gz 9341628 BLAKE2B c9e0c12558e81efb6f5cfddead028980b0019d2f6d0fdce5662c9138ec3a5b2a3d30b022a5713578bc7effd09894006e8f7f60a3e038ca66297502d9d4212686 SHA512 1b88bc043b08de9b5bb1f3814b8101c73ced010cf94bd725fb69e1ef95b4a9597a34de4a19f84fbbf63e54d47e95b3ff498d611234fcdfcaa5e4e3cf696289d2
27 +DIST scikit-learn-0.20.2.tar.gz 10275187 BLAKE2B 6865fd101f99930e014f4a2a89616e1ee917df27a5a1b0a931d47503d7df509fe6490799e876a5d68b1cb76a35c6f85e4acbb31a28adfc528720fe9a69e108a7 SHA512 5e0bdea3c40e38880683c6a49cdf2f4c0d40c1f5436c1d8209d613440d5d9d13b9a608e73943a890ef3effaddd930b5c171c45d29700afb8629285ba4aad414f
28 +DIST scikit-learn-0.20.4.tar.gz 11684276 BLAKE2B 791fd5c7e3ebfdb9bf01524be46b19341b5750fdc5352de9e50cc395a34cf91551825352f18f235b658b55b38829981884fca9f0535a1c505adeb18ac5d87ceb SHA512 a94c254440641a987df1eaec63302639b8e6f56705ec426c350070658141dd574b502eb1e4b94ae9c766c1becfd911f08bb97d5c87d39b0546d8444ed281b06a
29
30 diff --git a/sci-libs/scikits_learn/files/scikits_learn-0.20.2-fix-cdfast.patch b/sci-libs/scikits_learn/files/scikits_learn-0.20.2-fix-cdfast.patch
31 new file mode 100644
32 index 00000000000..1d1de4a3e0e
33 --- /dev/null
34 +++ b/sci-libs/scikits_learn/files/scikits_learn-0.20.2-fix-cdfast.patch
35 @@ -0,0 +1,42 @@
36 +--- scikit-learn-0.20.3.orig/sklearn/linear_model/cd_fast.c 2019-08-09 03:05:05.351926119 +0500
37 ++++ scikit-learn-0.20.3/sklearn/linear_model/cd_fast.c 2019-08-09 03:05:35.022926006 +0500
38 +@@ -4889,7 +4889,7 @@
39 +
40 + static PyObject *__pyx_pf_7sklearn_12linear_model_7cd_fast_8enet_coordinate_descent(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_w, float __pyx_v_alpha, float __pyx_v_beta, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y, int __pyx_v_max_iter, float __pyx_v_tol, PyObject *__pyx_v_rng, int __pyx_v_random, int __pyx_v_positive) {
41 + PyObject *__pyx_v_dtype = NULL;
42 +- void (*__pyx_v_gemv)(enum CBLAS_ORDER, enum CBLAS_TRANSPOSE, int, int, float, float *, int, float *, int, float, float *, int);
43 ++ void (*__pyx_v_gemv)(CBLAS_ORDER, CBLAS_TRANSPOSE, int, int, float, float *, int, float *, int, float, float *, int);
44 + float (*__pyx_v_dot)(int, float *, int, float *, int);
45 + void (*__pyx_v_axpy)(int, float, float *, int, float *, int);
46 + float (*__pyx_v_asum)(int, float *, int);
47 +@@ -6279,7 +6279,7 @@
48 +
49 + static PyObject *__pyx_pf_7sklearn_12linear_model_7cd_fast_10enet_coordinate_descent(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_w, double __pyx_v_alpha, double __pyx_v_beta, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y, int __pyx_v_max_iter, double __pyx_v_tol, PyObject *__pyx_v_rng, int __pyx_v_random, int __pyx_v_positive) {
50 + PyObject *__pyx_v_dtype = NULL;
51 +- void (*__pyx_v_gemv)(enum CBLAS_ORDER, enum CBLAS_TRANSPOSE, int, int, double, double *, int, double *, int, double, double *, int);
52 ++ void (*__pyx_v_gemv)(CBLAS_ORDER, CBLAS_TRANSPOSE, int, int, double, double *, int, double *, int, double, double *, int);
53 + double (*__pyx_v_dot)(int, double *, int, double *, int);
54 + void (*__pyx_v_axpy)(int, double, double *, int, double *, int);
55 + double (*__pyx_v_asum)(int, double *, int);
56 +@@ -16246,8 +16246,8 @@
57 + CYTHON_UNUSED float (*__pyx_v_asum)(int, float *, int);
58 + void (*__pyx_v_copy)(int, float *, int, float *, int);
59 + void (*__pyx_v_scal)(int, float, float *, int);
60 +- void (*__pyx_v_ger)(enum CBLAS_ORDER, int, int, float, float *, int, float *, int, float *, int);
61 +- void (*__pyx_v_gemv)(enum CBLAS_ORDER, enum CBLAS_TRANSPOSE, int, int, float, float *, int, float *, int, float, float *, int);
62 ++ void (*__pyx_v_ger)(CBLAS_ORDER, int, int, float, float *, int, float *, int, float *, int);
63 ++ void (*__pyx_v_gemv)(CBLAS_ORDER, CBLAS_TRANSPOSE, int, int, float, float *, int, float *, int, float, float *, int);
64 + unsigned int __pyx_v_n_samples;
65 + unsigned int __pyx_v_n_features;
66 + unsigned int __pyx_v_n_tasks;
67 +@@ -17965,8 +17965,8 @@
68 + CYTHON_UNUSED double (*__pyx_v_asum)(int, double *, int);
69 + void (*__pyx_v_copy)(int, double *, int, double *, int);
70 + void (*__pyx_v_scal)(int, double, double *, int);
71 +- void (*__pyx_v_ger)(enum CBLAS_ORDER, int, int, double, double *, int, double *, int, double *, int);
72 +- void (*__pyx_v_gemv)(enum CBLAS_ORDER, enum CBLAS_TRANSPOSE, int, int, double, double *, int, double *, int, double, double *, int);
73 ++ void (*__pyx_v_ger)(CBLAS_ORDER, int, int, double, double *, int, double *, int, double *, int);
74 ++ void (*__pyx_v_gemv)(CBLAS_ORDER, CBLAS_TRANSPOSE, int, int, double, double *, int, double *, int, double, double *, int);
75 + unsigned int __pyx_v_n_samples;
76 + unsigned int __pyx_v_n_features;
77 + unsigned int __pyx_v_n_tasks;
78
79 diff --git a/sci-libs/scikits_learn/scikits_learn-0.20.2.ebuild b/sci-libs/scikits_learn/scikits_learn-0.20.2.ebuild
80 new file mode 100644
81 index 00000000000..727ee44984b
82 --- /dev/null
83 +++ b/sci-libs/scikits_learn/scikits_learn-0.20.2.ebuild
84 @@ -0,0 +1,107 @@
85 +# Copyright 1999-2019 Gentoo Authors
86 +# Distributed under the terms of the GNU General Public License v2
87 +
88 +EAPI=6
89 +
90 +PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
91 +
92 +inherit distutils-r1 flag-o-matic
93 +
94 +MYPN="${PN/scikits_/scikit-}"
95 +MYP="${MYPN}-${PV}"
96 +
97 +DESCRIPTION="Python modules for machine learning and data mining"
98 +HOMEPAGE="http://scikit-learn.org"
99 +SRC_URI="mirror://pypi/${MYPN:0:1}/${MYPN}/${MYP}.tar.gz"
100 +
101 +LICENSE="BSD"
102 +SLOT="0"
103 +KEYWORDS="~amd64 ~x86"
104 +IUSE="examples test"
105 +
106 +# tried to unbundle virtual/python-funcsigs, funcsigs, odict
107 +# but it is a large mess to maintain
108 +
109 +RDEPEND="
110 + dev-python/matplotlib[${PYTHON_USEDEP}]
111 + dev-python/nose[${PYTHON_USEDEP}]
112 + dev-python/numpy[lapack,${PYTHON_USEDEP}]
113 + sci-libs/scikits[${PYTHON_USEDEP}]
114 + sci-libs/scipy[${PYTHON_USEDEP}]
115 + virtual/blas:=
116 + virtual/cblas:=
117 +"
118 +
119 +DEPEND="
120 + dev-python/cython[${PYTHON_USEDEP}]
121 + dev-python/numpy[lapack,${PYTHON_USEDEP}]
122 + dev-python/setuptools[${PYTHON_USEDEP}]
123 + sci-libs/scipy[${PYTHON_USEDEP}]
124 + virtual/blas:=
125 + virtual/cblas:=
126 +"
127 +
128 +S="${WORKDIR}/${MYP}"
129 +
130 +PATCHES=( "${FILESDIR}"/${PN}-0.18.1-system-cblas.patch
131 + "${FILESDIR}"/${PN}-0.20.2-fix-cdfast.patch )
132 +
133 +python_prepare_all() {
134 + # bug #397605
135 + [[ ${CHOST} == *-darwin* ]] \
136 + && append-ldflags -bundle "-undefined dynamic_lookup" \
137 + || append-ldflags -shared
138 +
139 + # scikits-learn now uses the horrible numpy.distutils automagic
140 + export SCIPY_FCONFIG="config_fc --noopt --noarch"
141 +
142 + # remove bundled cblas
143 + rm -rf sklearn/src || die "failed to remove bundled cblas"
144 +
145 + # commented out, since it is a mess to maintain
146 + # use system joblib
147 + #rm -r sklearn/externals/joblib || die
148 + #sed -i -e '/joblib/d' sklearn/externals/setup.py || die
149 + #for f in sklearn/{*/,}*.py; do
150 + # sed -r -e '/^from/s/(sklearn|\.|)\.externals\.joblib/joblib/' \
151 + # -e 's/from (sklearn|\.|)\.externals import/import/' -i $f || die
152 + #done
153 +
154 + # use system funcsigs and odict
155 + #rm sklearn/externals/funcsigs.py || die
156 + #rm sklearn/externals/odict.py || die
157 + #for f in sklearn/{utils/fixes.py,gaussian_process/{tests/test_,}kernels.py}; do
158 + # sed -r -e 's/from (sklearn|\.|)\.externals\.funcsigs/from funcsigs/' -i $f || die
159 + #done
160 + distutils-r1_python_prepare_all
161 +}
162 +
163 +python_compile() {
164 + distutils-r1_python_compile ${SCIPY_FCONFIG}
165 +}
166 +
167 +python_test() {
168 + # doc builds and runs tests
169 + use doc && return
170 + distutils_install_for_testing ${SCIPY_FCONFIG}
171 + esetup.py install \
172 + --root="${T}/test-${EPYTHON}" \
173 + --no-compile ${SCIPY_FCONFIG}
174 + pushd "${T}/test-${EPYTHON}/$(python_get_sitedir)" || die > /dev/null
175 + JOBLIB_MULTIPROCESSING=2 SKLEARN_SKIP_NETWORK_TESTS=1 nosetests -v sklearn --exe || die
176 + popd > /dev/null
177 +}
178 +
179 +python_install() {
180 + distutils-r1_python_install ${SCIPY_FCONFIG}
181 +}
182 +
183 +python_install_all() {
184 + find "${S}" -name \*LICENSE.txt -delete
185 + distutils-r1_python_install_all
186 + if use examples; then
187 + dodoc -r examples
188 + docompress -x /usr/share/doc/${PF}/examples
189 + fi
190 +
191 +}
192
193 diff --git a/sci-libs/scikits_learn/scikits_learn-0.20.4.ebuild b/sci-libs/scikits_learn/scikits_learn-0.20.4.ebuild
194 new file mode 100644
195 index 00000000000..727ee44984b
196 --- /dev/null
197 +++ b/sci-libs/scikits_learn/scikits_learn-0.20.4.ebuild
198 @@ -0,0 +1,107 @@
199 +# Copyright 1999-2019 Gentoo Authors
200 +# Distributed under the terms of the GNU General Public License v2
201 +
202 +EAPI=6
203 +
204 +PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
205 +
206 +inherit distutils-r1 flag-o-matic
207 +
208 +MYPN="${PN/scikits_/scikit-}"
209 +MYP="${MYPN}-${PV}"
210 +
211 +DESCRIPTION="Python modules for machine learning and data mining"
212 +HOMEPAGE="http://scikit-learn.org"
213 +SRC_URI="mirror://pypi/${MYPN:0:1}/${MYPN}/${MYP}.tar.gz"
214 +
215 +LICENSE="BSD"
216 +SLOT="0"
217 +KEYWORDS="~amd64 ~x86"
218 +IUSE="examples test"
219 +
220 +# tried to unbundle virtual/python-funcsigs, funcsigs, odict
221 +# but it is a large mess to maintain
222 +
223 +RDEPEND="
224 + dev-python/matplotlib[${PYTHON_USEDEP}]
225 + dev-python/nose[${PYTHON_USEDEP}]
226 + dev-python/numpy[lapack,${PYTHON_USEDEP}]
227 + sci-libs/scikits[${PYTHON_USEDEP}]
228 + sci-libs/scipy[${PYTHON_USEDEP}]
229 + virtual/blas:=
230 + virtual/cblas:=
231 +"
232 +
233 +DEPEND="
234 + dev-python/cython[${PYTHON_USEDEP}]
235 + dev-python/numpy[lapack,${PYTHON_USEDEP}]
236 + dev-python/setuptools[${PYTHON_USEDEP}]
237 + sci-libs/scipy[${PYTHON_USEDEP}]
238 + virtual/blas:=
239 + virtual/cblas:=
240 +"
241 +
242 +S="${WORKDIR}/${MYP}"
243 +
244 +PATCHES=( "${FILESDIR}"/${PN}-0.18.1-system-cblas.patch
245 + "${FILESDIR}"/${PN}-0.20.2-fix-cdfast.patch )
246 +
247 +python_prepare_all() {
248 + # bug #397605
249 + [[ ${CHOST} == *-darwin* ]] \
250 + && append-ldflags -bundle "-undefined dynamic_lookup" \
251 + || append-ldflags -shared
252 +
253 + # scikits-learn now uses the horrible numpy.distutils automagic
254 + export SCIPY_FCONFIG="config_fc --noopt --noarch"
255 +
256 + # remove bundled cblas
257 + rm -rf sklearn/src || die "failed to remove bundled cblas"
258 +
259 + # commented out, since it is a mess to maintain
260 + # use system joblib
261 + #rm -r sklearn/externals/joblib || die
262 + #sed -i -e '/joblib/d' sklearn/externals/setup.py || die
263 + #for f in sklearn/{*/,}*.py; do
264 + # sed -r -e '/^from/s/(sklearn|\.|)\.externals\.joblib/joblib/' \
265 + # -e 's/from (sklearn|\.|)\.externals import/import/' -i $f || die
266 + #done
267 +
268 + # use system funcsigs and odict
269 + #rm sklearn/externals/funcsigs.py || die
270 + #rm sklearn/externals/odict.py || die
271 + #for f in sklearn/{utils/fixes.py,gaussian_process/{tests/test_,}kernels.py}; do
272 + # sed -r -e 's/from (sklearn|\.|)\.externals\.funcsigs/from funcsigs/' -i $f || die
273 + #done
274 + distutils-r1_python_prepare_all
275 +}
276 +
277 +python_compile() {
278 + distutils-r1_python_compile ${SCIPY_FCONFIG}
279 +}
280 +
281 +python_test() {
282 + # doc builds and runs tests
283 + use doc && return
284 + distutils_install_for_testing ${SCIPY_FCONFIG}
285 + esetup.py install \
286 + --root="${T}/test-${EPYTHON}" \
287 + --no-compile ${SCIPY_FCONFIG}
288 + pushd "${T}/test-${EPYTHON}/$(python_get_sitedir)" || die > /dev/null
289 + JOBLIB_MULTIPROCESSING=2 SKLEARN_SKIP_NETWORK_TESTS=1 nosetests -v sklearn --exe || die
290 + popd > /dev/null
291 +}
292 +
293 +python_install() {
294 + distutils-r1_python_install ${SCIPY_FCONFIG}
295 +}
296 +
297 +python_install_all() {
298 + find "${S}" -name \*LICENSE.txt -delete
299 + distutils-r1_python_install_all
300 + if use examples; then
301 + dodoc -r examples
302 + docompress -x /usr/share/doc/${PF}/examples
303 + fi
304 +
305 +}