Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/scipy/
Date: Thu, 31 Dec 2020 20:22:03
Message-Id: 1609446117.49571f608157efeba94b19bdf767c8bec9bea8f4.mgorny@gentoo
1 commit: 49571f608157efeba94b19bdf767c8bec9bea8f4
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 31 19:01:55 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 31 20:21:57 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=49571f60
7
8 dev-python/scipy: Bump to 1.6.0
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/scipy/Manifest | 3 +
13 dev-python/scipy/scipy-1.6.0.ebuild | 155 ++++++++++++++++++++++++++++++++++++
14 2 files changed, 158 insertions(+)
15
16 diff --git a/dev-python/scipy/Manifest b/dev-python/scipy/Manifest
17 index dd57f9badef..43540d9367a 100644
18 --- a/dev-python/scipy/Manifest
19 +++ b/dev-python/scipy/Manifest
20 @@ -13,3 +13,6 @@ DIST scipy-1.5.3.tar.gz 25234560 BLAKE2B 734f29b7e3f6591b265ec43e173d1303683e2fc
21 DIST scipy-1.5.4-html.zip 23175279 BLAKE2B 79cf621daa4c41414cd6d52364481ff5df4a21232bc37a5c60f9e63b60e9ad9b07a1603865fd60b2041375ae12791d761fe5d3cbd1f5c0977a37e8bf497c1e3c SHA512 eb93b2ae1dcb916bfbe77ac0ccb7f7f66af3ad3965d397c84dfbc725af08060dccf3fb0988961bf2051f0236c64066dd28f01d85484babb3ee997a9d0bab8069
22 DIST scipy-1.5.4-ref.pdf 33467477 BLAKE2B d7a110258d6fe0430c380b34e2053b6b0ef8da7a6b3bee35314d55beae887afb32d01479f1ad6b8bf6847c2225890c20c118e3fd692dae55292793f38b484a9d SHA512 7f98b5014553f73880fe18d942684b8282c6aefb90b329865b65d45cfa0cffac0a8808e970af291a96e4d326ec8b284dc4385ffa5469049b4f643be8642329e7
23 DIST scipy-1.5.4.tar.gz 25237512 BLAKE2B 719cfecd6794b037dc636793ba38a3b39f5fd1a44ce2fd2cf2418b0ca6d1a7898b34c4cf684752fdde635107744773c796b998418d5a983450b70beb461e32df SHA512 d23f68911a8880f87767819750d4d175ba8f9c72fcb9b8080305ee65722c046d4485fde4f0c85cc53c46247dd99813afe675a38b3b0569a683ddc2c2e021b8fc
24 +DIST scipy-1.6.0-html.zip 23941941 BLAKE2B 3222e9b1e1aeebfd1ab0f8d179d25c25d6ab26a54c3d6c7f12d5cb24dd59af216685cb1db1d11980ca32c8e14595a1753b69438d8c7504f7c4fc1b386e1c944d SHA512 42cd5595e1f260bcd14d5ce159d9acd0eaefbcb1401270b90efe48b0e743681361dba5ee410e5932533bca03c19daaacb6042ef8edea9b2cccd5dae21a612072
25 +DIST scipy-1.6.0-ref.pdf 34332184 BLAKE2B 948a03372797915e47d5e8ce44a32dcacb3448a20e06c5233d3362f0f04f228e8f7505aa918dbbd9a50ad64adb7a17181acab6a726ab251b8e8acf245a1550d6 SHA512 fe4c316f91cffb10d14207882ceb7a1d3711b03ad74857d771d0ec244caad60f878902f7279f6688c947fd415762abbb5a7082c810dd85c73385e8f58fbc056c
26 +DIST scipy-1.6.0.tar.gz 27275413 BLAKE2B f65fca81a21a3077ead119123fc3bb2ed96aaacfee6f291473ef6780c291f3e9fee88d86501d4cb966f1d601fb7f0656956134f0437eb8fefb8030e762c363a5 SHA512 995ffaf56b713cdd4bdb98d8525b892e9ad84a511878b43213cb71a67f34d87c111da36cf1e0b044c75c0d5af64bfde4ad0f3e9c5e71cae2dbf053251f37064e
27
28 diff --git a/dev-python/scipy/scipy-1.6.0.ebuild b/dev-python/scipy/scipy-1.6.0.ebuild
29 new file mode 100644
30 index 00000000000..8c943a4bf01
31 --- /dev/null
32 +++ b/dev-python/scipy/scipy-1.6.0.ebuild
33 @@ -0,0 +1,155 @@
34 +# Copyright 1999-2020 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=7
38 +
39 +PYTHON_COMPAT=( python3_{7..9} )
40 +PYTHON_REQ_USE="threads(+)"
41 +
42 +inherit fortran-2 distutils-r1 flag-o-matic multiprocessing toolchain-funcs
43 +
44 +DESCRIPTION="Scientific algorithms library for Python"
45 +HOMEPAGE="https://www.scipy.org/"
46 +SRC_URI="
47 + mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
48 + doc? (
49 + https://docs.scipy.org/doc/${P}/${PN}-html-${PV}.zip -> ${P}-html.zip
50 + https://docs.scipy.org/doc/${P}/${PN}-ref-${PV}.pdf -> ${P}-ref.pdf
51 + )"
52 +
53 +LICENSE="BSD LGPL-2"
54 +SLOT="0"
55 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
56 +IUSE="doc sparse test"
57 +RESTRICT="!test? ( test )"
58 +
59 +DEPEND="
60 + >=dev-python/numpy-1.16.5[lapack,${PYTHON_USEDEP}]
61 + sci-libs/arpack:0=
62 + virtual/cblas
63 + virtual/lapack
64 + sparse? ( sci-libs/umfpack:0= )"
65 +RDEPEND="${DEPEND}
66 + dev-python/pillow[${PYTHON_USEDEP}]"
67 +BDEPEND="
68 + dev-lang/swig
69 + >=dev-python/cython-0.29.13[${PYTHON_USEDEP}]
70 + dev-python/pybind11[${PYTHON_USEDEP}]
71 + virtual/pkgconfig
72 + doc? ( app-arch/unzip )
73 + test? (
74 + dev-python/nose[${PYTHON_USEDEP}]
75 + dev-python/pytest[${PYTHON_USEDEP}]
76 + )"
77 +
78 +DISTUTILS_IN_SOURCE_BUILD=1
79 +
80 +src_unpack() {
81 + default
82 + if use doc; then
83 + unzip -qo "${DISTDIR}"/${P}-html.zip -d html || die
84 + fi
85 +}
86 +
87 +pc_incdir() {
88 + $(tc-getPKG_CONFIG) --cflags-only-I $@ | \
89 + sed -e 's/^-I//' -e 's/[ ]*-I/:/g' -e 's/[ ]*$//' -e 's|^:||'
90 +}
91 +
92 +pc_libdir() {
93 + $(tc-getPKG_CONFIG) --libs-only-L $@ | \
94 + sed -e 's/^-L//' -e 's/[ ]*-L/:/g' -e 's/[ ]*$//' -e 's|^:||'
95 +}
96 +
97 +pc_libs() {
98 + $(tc-getPKG_CONFIG) --libs-only-l $@ | \
99 + sed -e 's/[ ]-l*\(pthread\|m\)\([ ]\|$\)//g' \
100 + -e 's/^-l//' -e 's/[ ]*-l/,/g' -e 's/[ ]*$//' \
101 + | tr ',' '\n' | sort -u | tr '\n' ',' | sed -e 's|,$||'
102 +}
103 +
104 +python_prepare_all() {
105 + # scipy automatically detects libraries by default
106 + export {FFTW,FFTW3,UMFPACK}=None
107 + use sparse && unset UMFPACK
108 + # the missing symbols are in -lpythonX.Y, but since the version can
109 + # differ, we just introduce the same scaryness as on Linux/ELF
110 + [[ ${CHOST} == *-darwin* ]] \
111 + && append-ldflags -bundle "-undefined dynamic_lookup" \
112 + || append-ldflags -shared
113 + [[ -z ${FC} ]] && export FC="$(tc-getFC)"
114 + # hack to force F77 to be FC until bug #278772 is fixed
115 + [[ -z ${F77} ]] && export F77="$(tc-getFC)"
116 + export F90="${FC}"
117 + export SCIPY_FCONFIG="config_fc --noopt --noarch"
118 + append-fflags -fPIC
119 +
120 + local libdir="${EPREFIX}"/usr/$(get_libdir)
121 + cat >> site.cfg <<-EOF || die
122 + [blas]
123 + include_dirs = $(pc_incdir cblas)
124 + library_dirs = $(pc_libdir cblas blas):${libdir}
125 + blas_libs = $(pc_libs cblas blas)
126 + [lapack]
127 + library_dirs = $(pc_libdir lapack):${libdir}
128 + lapack_libs = $(pc_libs lapack)
129 + EOF
130 + cat >> setup.cfg <<-EOF || die
131 + [options]
132 + zip_safe = False
133 + EOF
134 +
135 + # Drop hashes to force rebuild of cython based .c code
136 + rm cythonize.dat || die
137 +
138 + # TODO
139 + sed -e 's:test_magic_square_sparse_no_presolve:_&:' \
140 + -i scipy/optimize/tests/test_linprog.py || die
141 + sed -e "s:== 'levy_stable':in ('levy_stable', 'crystalball', 'ncf'):" \
142 + -i scipy/stats/tests/test_continuous_basic.py || die
143 +
144 + distutils-r1_python_prepare_all
145 +}
146 +
147 +python_configure_all() {
148 + # bug 721860
149 + test-flag-FC -fallow-argument-mismatch &&
150 + append-fflags -fallow-argument-mismatch
151 +}
152 +
153 +python_compile() {
154 + # FIXME: parallel python building fails, bug #614464
155 + export MAKEOPTS=-j1
156 +
157 + ${EPYTHON} tools/cythonize.py || die
158 + distutils-r1_python_compile \
159 + ${SCIPY_FCONFIG}
160 +}
161 +
162 +python_test() {
163 + # fails with bdist_egg. should it be fixed in distutils-r1 eclass?
164 + distutils_install_for_testing ${SCIPY_FCONFIG}
165 + cd "${TEST_DIR}/lib" || die "no ${TEST_DIR} available"
166 + PYTHONPATH=. "${EPYTHON}" -c "
167 +import scipy, sys
168 +r = scipy.test('fast', verbose=2)
169 +sys.exit(0 if r else 1)" || die "Tests fail with ${EPYTHON}"
170 +}
171 +
172 +python_install_all() {
173 + use doc && \
174 + local DOCS=( "${DISTDIR}"/${P}-ref.pdf ) \
175 + local HTML_DOCS=( "${WORKDIR}"/html/. )
176 + distutils-r1_python_install_all
177 +}
178 +
179 +python_install() {
180 + distutils-r1_python_install ${SCIPY_FCONFIG}
181 + python_optimize
182 +}
183 +
184 +pkg_postinst() {
185 + elog "You might want to set the variable SCIPY_PIL_IMAGE_VIEWER"
186 + elog "to your prefered image viewer. Example:"
187 + elog " echo \"export SCIPY_PIL_IMAGE_VIEWER=display\" >> ~/.bashrc"
188 +}