Gentoo Archives: gentoo-commits

From: Andrey Grozin <grozin@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/matplotlib/
Date: Fri, 10 Nov 2017 11:15:37
Message-Id: 1510312455.7c1aeb6e0a5ea23b25e91dd641e6d6a7e1888b9f.grozin@gentoo
1 commit: 7c1aeb6e0a5ea23b25e91dd641e6d6a7e1888b9f
2 Author: Andrey Grozin <grozin <AT> gentoo <DOT> org>
3 AuthorDate: Fri Nov 10 11:14:15 2017 +0000
4 Commit: Andrey Grozin <grozin <AT> gentoo <DOT> org>
5 CommitDate: Fri Nov 10 11:14:15 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c1aeb6e
7
8 dev-python/matplotlib: replaced an incomplete 2.1.0 tarball by the full one
9
10 The released source tarball of matplotlib-2.1.0 has many files missing.
11 I've checked out the v2.1.0 tar from their git and prepared a better tarball.
12 Closes: https://bugs.gentoo.org/636848
13 Package-Manager: Portage-2.3.13, Repoman-2.3.4
14
15 dev-python/matplotlib/Manifest | 1 +
16 dev-python/matplotlib/matplotlib-2.1.0-r1.ebuild | 249 +++++++++++++++++++++++
17 2 files changed, 250 insertions(+)
18
19 diff --git a/dev-python/matplotlib/Manifest b/dev-python/matplotlib/Manifest
20 index d3db25ffa58..4a07535caec 100644
21 --- a/dev-python/matplotlib/Manifest
22 +++ b/dev-python/matplotlib/Manifest
23 @@ -1,4 +1,5 @@
24 DIST matplotlib-1.4.3.tar.gz 49933525 SHA256 5b9544472d9d6ab3d47423bdb5a0e64fdf913e505c1c083f25283dd0362bc0b6 SHA512 51b0f58b2618b47b653e17e4f6b6a1215d3a3b0f1331ce3555cc7435e365d9c75693f289ce12fe3bf8f69fd57b663e545f0f1c2c94e81eaa661cac0689e125f5 WHIRLPOOL 160ca48ecb44db58f1c56bd6e89592c5d1badd8e434fc25d32aa6d4d7a346ae7c7444d1c8e0c2ca2bf5c3246fd56cd93856ec7b1e3e51f5e471b9b55a0f2c1ad
25 DIST matplotlib-1.5.3.tar.gz 51606089 SHA256 a0a5dc39f785014f2088fed2c6d2d129f0444f71afbb9c44f7bdf1b14d86ebbc SHA512 553be9f661a1923d8ec7504a11dd3317e5ffb429c19339c58047715f4c28358d6d2ac38d46bd27ecd1dcf7159f157aab80d90713fbc4071e2e395bbf11ee6385 WHIRLPOOL 7e2b0472bb7d913e78260da95c93c3243562e76352790318286e5d194f88ac05a9f51fa029a7b0ad17bbbbd0dc9658769fe6301b544ec03f1ab5c205835ea894
26 DIST matplotlib-2.0.2.tar.gz 53879938 SHA256 0ffbc44faa34a8b1704bc108c451ecf87988f900ef7ce757b8e2e84383121ff1 SHA512 39d68aee87fac2c246cdee7941ffaae1b8d586fa75c351bc94f963def66df32c3aba13fa0be94e1f8d21f06e068565b1a79c6d4f65589d8dd23cd48b32ab474f WHIRLPOOL 5ab8f9edb4591205d61bd47c5125520c0d24b8ce44e0041b99a5a0c692ffd3ff581cd6e092d18a64ddf6fb4f43ace6ee8c2bce19f5acd01d022d8a46e472b2df
27 +DIST matplotlib-2.1.0.tar.bz2 33051088 SHA256 0ab32ed55311dccdb42a488e1e7be5029695adf9219bc2b545ee0443dcf365c7 SHA512 872ff86e989b4e9352663f4abde1768aa05b1adea3e1b234efdb301429d421718314b27950e508d92df8fc9136764b07e8a6861b66512e9695a496993076bb5f WHIRLPOOL 0fb7d7e7e2b45ca6ae9ece32fa413f9c5b47fc59f64b877fad1f8becff4828a3be948f6433222008256c469b7760075c1d694b13ea771dfcd4193c2cda405aa6
28 DIST matplotlib-2.1.0.tar.gz 35727251 SHA256 4b5f16c9cefde553ea79975305dcaa67c8e13d927b6e55aa14b4a8d867e25387 SHA512 8f512400f1f15d5400e23dd8e402783c54f62567d412863530a982c6513206d49fb91fadb3ef477648a4a38d6dd032eb90741ff4495d2be71911f83677d768b4 WHIRLPOOL 4795f3d49e3a624a22debe738cbe42ce3594c91880b3e6273f7ee05ecb7016353550cb39367f1edc6588d0e75d227d79f29af709e9471147171dd7ea5b6aa687
29
30 diff --git a/dev-python/matplotlib/matplotlib-2.1.0-r1.ebuild b/dev-python/matplotlib/matplotlib-2.1.0-r1.ebuild
31 new file mode 100644
32 index 00000000000..db96f8cb7fb
33 --- /dev/null
34 +++ b/dev-python/matplotlib/matplotlib-2.1.0-r1.ebuild
35 @@ -0,0 +1,249 @@
36 +# Copyright 1999-2017 Gentoo Foundation
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=6
40 +
41 +PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
42 +PYTHON_REQ_USE='tk?,threads(+)'
43 +
44 +inherit distutils-r1 flag-o-matic virtualx toolchain-funcs prefix
45 +
46 +DESCRIPTION="Pure python plotting library with matlab like syntax"
47 +HOMEPAGE="http://matplotlib.org/"
48 +SRC_URI="https://dev.gentoo.org/~grozin/${P}.tar.bz2"
49 +
50 +SLOT="0"
51 +# Main license: matplotlib
52 +# Some modules: BSD
53 +# matplotlib/backends/qt4_editor: MIT
54 +# Fonts: BitstreamVera, OFL-1.1
55 +LICENSE="BitstreamVera BSD matplotlib MIT OFL-1.1"
56 +KEYWORDS="~amd64 ~arm64 ~x86"
57 +IUSE="cairo doc excel examples gtk2 gtk3 latex pyside qt5 test tk wxwidgets"
58 +
59 +PY2_FLAGS="|| ( $(python_gen_useflags python2_7) )"
60 +REQUIRED_USE="
61 + doc? ( ${PY2_FLAGS} )
62 + excel? ( ${PY2_FLAGS} )
63 + gtk2? ( ${PY2_FLAGS} )
64 + wxwidgets? ( ${PY2_FLAGS} )
65 + test? (
66 + cairo latex qt5 tk wxwidgets
67 + || ( gtk2 gtk3 )
68 + )"
69 +
70 +# #456704 -- a lot of py2-only deps
71 +PY2_USEDEP=$(python_gen_usedep python2_7)
72 +COMMON_DEPEND="
73 + dev-python/cycler[${PYTHON_USEDEP}]
74 + dev-python/functools32[${PY2_USEDEP}]
75 + >=dev-python/numpy-1.7.1[${PYTHON_USEDEP}]
76 + dev-python/python-dateutil:0[${PYTHON_USEDEP}]
77 + dev-python/pytz[${PYTHON_USEDEP}]
78 + >=dev-python/six-1.10[${PYTHON_USEDEP}]
79 + dev-python/subprocess32[${PY2_USEDEP}]
80 + media-fonts/stix-fonts
81 + media-libs/freetype:2
82 + media-libs/libpng:0
83 + >=media-libs/qhull-2013
84 + cairo? ( dev-python/cairocffi[${PYTHON_USEDEP}] )
85 + gtk2? (
86 + dev-libs/glib:2=
87 + x11-libs/gdk-pixbuf
88 + x11-libs/gtk+:2
89 + dev-python/pygtk[${PY2_USEDEP}] )
90 + wxwidgets? ( >=dev-python/wxpython-2.8:*[${PY2_USEDEP}] )"
91 +
92 +# internal copy of pycxx highly patched
93 +# dev-python/pycxx
94 +
95 +DEPEND="${COMMON_DEPEND}
96 + dev-python/versioneer[${PYTHON_USEDEP}]
97 + dev-python/setuptools[${PYTHON_USEDEP}]
98 + virtual/pkgconfig
99 + doc? (
100 + app-text/dvipng
101 + dev-python/colorspacious[${PYTHON_USEDEP}]
102 + dev-python/pillow[${PYTHON_USEDEP}]
103 + dev-python/ipython[${PYTHON_USEDEP}]
104 + dev-python/mock[${PY2_USEDEP}]
105 + dev-python/numpydoc[${PYTHON_USEDEP}]
106 + dev-python/sphinx[${PYTHON_USEDEP}]
107 + dev-python/xlwt[${PYTHON_USEDEP}]
108 + dev-texlive/texlive-latexextra
109 + dev-texlive/texlive-fontsrecommended
110 + dev-texlive/texlive-latexrecommended
111 + media-gfx/graphviz[cairo]
112 + )
113 + test? (
114 + dev-python/backports-functools-lru-cache[${PY2_USEDEP}]
115 + dev-python/mock[${PYTHON_USEDEP}]
116 + >=dev-python/nose-0.11.1[${PYTHON_USEDEP}]
117 + )"
118 +
119 +RDEPEND="${COMMON_DEPEND}
120 + >=dev-python/pyparsing-1.5.6[${PYTHON_USEDEP}]
121 + excel? ( dev-python/xlwt[${PYTHON_USEDEP}] )
122 + gtk3? (
123 + dev-python/pygobject:3[${PYTHON_USEDEP}]
124 + x11-libs/gtk+:3[introspection] )
125 + latex? (
126 + virtual/latex-base
127 + app-text/ghostscript-gpl
128 + app-text/dvipng
129 + app-text/poppler[utils]
130 + dev-texlive/texlive-fontsrecommended
131 + dev-texlive/texlive-latexextra
132 + dev-texlive/texlive-xetex
133 + )
134 + pyside? ( dev-python/pyside[X,${PYTHON_USEDEP}] )
135 + qt5? ( dev-python/PyQt5[gui,widgets,${PYTHON_USEDEP}] )
136 + "
137 +
138 +# A few C++ source files are written to srcdir.
139 +# Other than that, the ebuild shall be fit for out-of-source build.
140 +DISTUTILS_IN_SOURCE_BUILD=1
141 +
142 +pkg_setup() {
143 + unset DISPLAY # bug #278524
144 +}
145 +
146 +use_setup() {
147 + local uword="${2:-${1}}"
148 + if use ${1}; then
149 + echo "${uword} = True"
150 + echo "${uword}agg = True"
151 + else
152 + echo "${uword} = False"
153 + echo "${uword}agg = False"
154 + fi
155 +}
156 +
157 +python_prepare_all() {
158 +# Generates test failures, but fedora does it
159 +# local PATCHES=(
160 +# "${FILESDIR}"/${P}-unbundle-pycxx.patch
161 +# "${FILESDIR}"/${P}-unbundle-agg.patch
162 +# )
163 +# rm -r agg24 CXX || die
164 +# rm -r agg24 || die
165 +
166 +# cat > lib/${PN}/externals/six.py <<-EOF
167 +# from __future__ import absolute_import
168 +# from six import *
169 +# EOF
170 +
171 + sed \
172 + -e 's/matplotlib.pyparsing_py[23]/pyparsing/g' \
173 + -i lib/matplotlib/{mathtext,fontconfig_pattern}.py \
174 + || die "sed pyparsing failed"
175 +
176 + hprefixify setupext.py
177 +
178 + export XDG_RUNTIME_DIR="${T}/runtime-dir"
179 + mkdir "${XDG_RUNTIME_DIR}" || die
180 + chmod 0700 "${XDG_RUNTIME_DIR}" || die
181 +
182 + distutils-r1_python_prepare_all
183 +}
184 +
185 +python_configure_all() {
186 + append-flags -fno-strict-aliasing
187 + append-cppflags -DNDEBUG # or get old trying to do triangulation
188 + tc-export PKG_CONFIG
189 +}
190 +
191 +python_configure() {
192 + mkdir -p "${BUILD_DIR}" || die
193 +
194 + # create setup.cfg (see setup.cfg.template for any changes).
195 +
196 + # common switches.
197 + cat > "${BUILD_DIR}"/setup.cfg <<- EOF || die
198 + [directories]
199 + basedirlist = ${EPREFIX}/usr
200 + [provide_packages]
201 + pytz = False
202 + dateutil = False
203 + [packages]
204 + tests = $(usex test True False)
205 + [gui_support]
206 + agg = True
207 + qt4 = False
208 + qt4agg = False
209 + $(use_setup cairo)
210 + $(use_setup gtk3)
211 + $(use_setup pyside)
212 + $(use_setup qt5)
213 + $(use_setup tk)
214 + EOF
215 +
216 + if use gtk3 && use cairo; then
217 + echo "gtk3cairo = True" >> "${BUILD_DIR}"/setup.cfg || die
218 + else
219 + echo "gtk3cairo = False" >> "${BUILD_DIR}"/setup.cfg || die
220 + fi
221 +
222 + if python_is_python3; then
223 + cat >> "${BUILD_DIR}"/setup.cfg <<- EOF || die
224 + gtk = False
225 + gtkagg = False
226 + wx = False
227 + wxagg = False
228 + EOF
229 + else
230 + cat >> "${BUILD_DIR}"/setup.cfg <<-EOF || die
231 + $(use_setup gtk2 gtk)
232 + $(use_setup wxwidgets wx)
233 + EOF
234 + fi
235 +}
236 +
237 +wrap_setup() {
238 + local -x MPLSETUPCFG=${BUILD_DIR}/setup.cfg
239 + unset DISPLAY
240 + "$@"
241 +}
242 +
243 +python_compile() {
244 + wrap_setup distutils-r1_python_compile --build-lib="${BUILD_DIR}"/lib
245 +}
246 +
247 +python_compile_all() {
248 + if use doc; then
249 + cd doc || die
250 +
251 + # necessary for in-source build
252 + local -x PYTHONPATH="${BUILD_DIR}"/build/lib:${PYTHONPATH}
253 +
254 + VARTEXFONTS="${T}"/fonts \
255 + "${EPYTHON}" ./make.py --small html || die
256 + fi
257 +}
258 +
259 +python_test() {
260 + wrap_setup distutils_install_for_testing
261 +
262 + virtx "${EPYTHON}" -c "import sys, matplotlib as m; sys.exit(0 if m.test(verbosity=2) else 1)"
263 +}
264 +
265 +python_install() {
266 + wrap_setup distutils-r1_python_install
267 +
268 + # mpl_toolkits namespace
269 + python_moduleinto mpl_toolkits
270 + python_domodule lib/mpl_toolkits/__init__.py
271 +}
272 +
273 +python_install_all() {
274 + use doc && local HTML_DOCS=( doc/build/html/. )
275 +
276 + distutils-r1_python_install_all
277 +
278 + if use examples; then
279 + dodoc -r examples
280 + docompress -x /usr/share/doc/${PF}/examples
281 + fi
282 +
283 + find "${D}" -name '*.pth' -delete || die
284 +}