1 |
commit: 299f1dd7ed390a82802f8f58c270181e52346c57 |
2 |
Author: Sean Vig <sean.v.775 <AT> gmail <DOT> com> |
3 |
AuthorDate: Mon Mar 20 00:53:20 2017 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jun 3 10:27:55 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=299f1dd7 |
7 |
|
8 |
dev-python/matplotlib: Version bump to 2.0.2, #608062 |
9 |
|
10 |
Closes: https://github.com/gentoo/gentoo/pull/4249 |
11 |
|
12 |
dev-python/matplotlib/Manifest | 1 + |
13 |
...atplotlib-2.0.2-freetype-spurious-failure.patch | 27 +++ |
14 |
.../files/matplotlib-2.0.2-nose-fixes.patch | 13 ++ |
15 |
dev-python/matplotlib/matplotlib-2.0.2.ebuild | 257 +++++++++++++++++++++ |
16 |
4 files changed, 298 insertions(+) |
17 |
|
18 |
diff --git a/dev-python/matplotlib/Manifest b/dev-python/matplotlib/Manifest |
19 |
index fde7fcea976..78018b44cef 100644 |
20 |
--- a/dev-python/matplotlib/Manifest |
21 |
+++ b/dev-python/matplotlib/Manifest |
22 |
@@ -1,2 +1,3 @@ |
23 |
DIST matplotlib-1.4.3.tar.gz 49933525 SHA256 5b9544472d9d6ab3d47423bdb5a0e64fdf913e505c1c083f25283dd0362bc0b6 SHA512 51b0f58b2618b47b653e17e4f6b6a1215d3a3b0f1331ce3555cc7435e365d9c75693f289ce12fe3bf8f69fd57b663e545f0f1c2c94e81eaa661cac0689e125f5 WHIRLPOOL 160ca48ecb44db58f1c56bd6e89592c5d1badd8e434fc25d32aa6d4d7a346ae7c7444d1c8e0c2ca2bf5c3246fd56cd93856ec7b1e3e51f5e471b9b55a0f2c1ad |
24 |
DIST matplotlib-1.5.3.tar.gz 51606089 SHA256 a0a5dc39f785014f2088fed2c6d2d129f0444f71afbb9c44f7bdf1b14d86ebbc SHA512 553be9f661a1923d8ec7504a11dd3317e5ffb429c19339c58047715f4c28358d6d2ac38d46bd27ecd1dcf7159f157aab80d90713fbc4071e2e395bbf11ee6385 WHIRLPOOL 7e2b0472bb7d913e78260da95c93c3243562e76352790318286e5d194f88ac05a9f51fa029a7b0ad17bbbbd0dc9658769fe6301b544ec03f1ab5c205835ea894 |
25 |
+DIST matplotlib-2.0.2.tar.gz 53879938 SHA256 0ffbc44faa34a8b1704bc108c451ecf87988f900ef7ce757b8e2e84383121ff1 SHA512 39d68aee87fac2c246cdee7941ffaae1b8d586fa75c351bc94f963def66df32c3aba13fa0be94e1f8d21f06e068565b1a79c6d4f65589d8dd23cd48b32ab474f WHIRLPOOL 5ab8f9edb4591205d61bd47c5125520c0d24b8ce44e0041b99a5a0c692ffd3ff581cd6e092d18a64ddf6fb4f43ace6ee8c2bce19f5acd01d022d8a46e472b2df |
26 |
|
27 |
diff --git a/dev-python/matplotlib/files/matplotlib-2.0.2-freetype-spurious-failure.patch b/dev-python/matplotlib/files/matplotlib-2.0.2-freetype-spurious-failure.patch |
28 |
new file mode 100644 |
29 |
index 00000000000..b6450a83fed |
30 |
--- /dev/null |
31 |
+++ b/dev-python/matplotlib/files/matplotlib-2.0.2-freetype-spurious-failure.patch |
32 |
@@ -0,0 +1,27 @@ |
33 |
+diff --git a/lib/matplotlib/testing/decorators.py b/lib/matplotlib/testing/decorators.py |
34 |
+index 5e738ad9b..78b3f8169 100644 |
35 |
+--- a/lib/matplotlib/testing/decorators.py |
36 |
++++ b/lib/matplotlib/testing/decorators.py |
37 |
+@@ -266,7 +266,7 @@ class ImageComparisonTest(CleanupTest): |
38 |
+ |
39 |
+ yield do_test, fignum, actual_fname, expected_fname |
40 |
+ |
41 |
+-def image_comparison(baseline_images=None, extensions=None, tol=0, |
42 |
++def image_comparison(baseline_images=None, extensions=None, tol=20, |
43 |
+ freetype_version=None, remove_text=False, |
44 |
+ savefig_kwarg=None, style='_classic_test'): |
45 |
+ """ |
46 |
+diff --git a/lib/matplotlib/tests/test_mathtext.py b/lib/matplotlib/tests/test_mathtext.py |
47 |
+index 39f5d7ef1..7681e5cb9 100644 |
48 |
+--- a/lib/matplotlib/tests/test_mathtext.py |
49 |
++++ b/lib/matplotlib/tests/test_mathtext.py |
50 |
+@@ -159,7 +159,8 @@ for fonts, chars in font_test_specs: |
51 |
+ |
52 |
+ def make_set(basename, fontset, tests, extensions=None): |
53 |
+ def make_test(filename, test): |
54 |
+- @image_comparison(baseline_images=[filename], extensions=extensions) |
55 |
++ @image_comparison(baseline_images=[filename], extensions=extensions, |
56 |
++ tol=40) |
57 |
+ def single_test(): |
58 |
+ matplotlib.rcParams['mathtext.fontset'] = fontset |
59 |
+ fig = plt.figure(figsize=(5.25, 0.75)) |
60 |
|
61 |
diff --git a/dev-python/matplotlib/files/matplotlib-2.0.2-nose-fixes.patch b/dev-python/matplotlib/files/matplotlib-2.0.2-nose-fixes.patch |
62 |
new file mode 100644 |
63 |
index 00000000000..ab1181bd017 |
64 |
--- /dev/null |
65 |
+++ b/dev-python/matplotlib/files/matplotlib-2.0.2-nose-fixes.patch |
66 |
@@ -0,0 +1,13 @@ |
67 |
+diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py |
68 |
+index 530c889a9..8231c2bb8 100644 |
69 |
+--- a/lib/matplotlib/__init__.py |
70 |
++++ b/lib/matplotlib/__init__.py |
71 |
+@@ -1609,7 +1609,7 @@ def test(verbosity=1): |
72 |
+ |
73 |
+ # store the old values before overriding |
74 |
+ plugins = _get_extra_test_plugins() |
75 |
+- plugins.extend([plugin() for plugin in nose.plugins.builtin.plugins]) |
76 |
++ plugins.extend(nose.plugins.builtin.plugins) |
77 |
+ |
78 |
+ manager = PluginManager(plugins=[x() for x in plugins]) |
79 |
+ config = nose.config.Config(verbosity=verbosity, plugins=manager) |
80 |
|
81 |
diff --git a/dev-python/matplotlib/matplotlib-2.0.2.ebuild b/dev-python/matplotlib/matplotlib-2.0.2.ebuild |
82 |
new file mode 100644 |
83 |
index 00000000000..2e703e5dcb6 |
84 |
--- /dev/null |
85 |
+++ b/dev-python/matplotlib/matplotlib-2.0.2.ebuild |
86 |
@@ -0,0 +1,257 @@ |
87 |
+# Copyright 1999-2017 Gentoo Foundation |
88 |
+# Distributed under the terms of the GNU General Public License v2 |
89 |
+ |
90 |
+EAPI=6 |
91 |
+ |
92 |
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) |
93 |
+PYTHON_REQ_USE='tk?,threads(+)' |
94 |
+ |
95 |
+inherit distutils-r1 flag-o-matic virtualx toolchain-funcs |
96 |
+ |
97 |
+DESCRIPTION="Pure python plotting library with matlab like syntax" |
98 |
+HOMEPAGE="http://matplotlib.org/" |
99 |
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" |
100 |
+ |
101 |
+SLOT="0" |
102 |
+# Main license: matplotlib |
103 |
+# Some modules: BSD |
104 |
+# matplotlib/backends/qt4_editor: MIT |
105 |
+# Fonts: BitstreamVera, OFL-1.1 |
106 |
+LICENSE="BitstreamVera BSD matplotlib MIT OFL-1.1" |
107 |
+KEYWORDS="~amd64 ~x86" |
108 |
+IUSE="cairo doc excel examples gtk2 gtk3 latex pyside qt4 qt5 test tk wxwidgets" |
109 |
+ |
110 |
+PY2_FLAGS="|| ( $(python_gen_useflags python2_7) )" |
111 |
+REQUIRED_USE=" |
112 |
+ doc? ( ${PY2_FLAGS} ) |
113 |
+ excel? ( ${PY2_FLAGS} ) |
114 |
+ gtk2? ( ${PY2_FLAGS} ) |
115 |
+ wxwidgets? ( ${PY2_FLAGS} ) |
116 |
+ test? ( |
117 |
+ cairo latex qt5 tk wxwidgets |
118 |
+ || ( gtk2 gtk3 ) |
119 |
+ )" |
120 |
+ |
121 |
+# #456704 -- a lot of py2-only deps |
122 |
+PY2_USEDEP=$(python_gen_usedep python2_7) |
123 |
+COMMON_DEPEND=" |
124 |
+ dev-python/cycler[${PYTHON_USEDEP}] |
125 |
+ dev-python/functools32[${PY2_USEDEP}] |
126 |
+ >=dev-python/numpy-1.7.1[${PYTHON_USEDEP}] |
127 |
+ dev-python/python-dateutil:0[${PYTHON_USEDEP}] |
128 |
+ dev-python/pytz[${PYTHON_USEDEP}] |
129 |
+ >=dev-python/six-1.10[${PYTHON_USEDEP}] |
130 |
+ dev-python/subprocess32[${PY2_USEDEP}] |
131 |
+ media-fonts/stix-fonts |
132 |
+ media-libs/freetype:2 |
133 |
+ media-libs/libpng:0 |
134 |
+ media-libs/qhull |
135 |
+ cairo? ( dev-python/cairocffi[${PYTHON_USEDEP}] ) |
136 |
+ gtk2? ( |
137 |
+ dev-libs/glib:2= |
138 |
+ x11-libs/gdk-pixbuf |
139 |
+ x11-libs/gtk+:2 |
140 |
+ dev-python/pygtk[${PY2_USEDEP}] ) |
141 |
+ wxwidgets? ( >=dev-python/wxpython-2.8:*[${PY2_USEDEP}] )" |
142 |
+ |
143 |
+# internal copy of pycxx highly patched |
144 |
+# dev-python/pycxx |
145 |
+ |
146 |
+DEPEND="${COMMON_DEPEND} |
147 |
+ dev-python/versioneer[${PYTHON_USEDEP}] |
148 |
+ dev-python/setuptools[${PYTHON_USEDEP}] |
149 |
+ virtual/pkgconfig |
150 |
+ doc? ( |
151 |
+ app-text/dvipng |
152 |
+ dev-python/pillow[${PYTHON_USEDEP}] |
153 |
+ dev-python/ipython[${PYTHON_USEDEP}] |
154 |
+ dev-python/mock[${PY2_USEDEP}] |
155 |
+ dev-python/numpydoc[${PYTHON_USEDEP}] |
156 |
+ dev-python/sphinx[${PYTHON_USEDEP}] |
157 |
+ dev-python/xlwt[${PYTHON_USEDEP}] |
158 |
+ dev-texlive/texlive-latexextra |
159 |
+ dev-texlive/texlive-fontsrecommended |
160 |
+ dev-texlive/texlive-latexrecommended |
161 |
+ media-gfx/graphviz[cairo] |
162 |
+ ) |
163 |
+ test? ( |
164 |
+ dev-python/mock[${PYTHON_USEDEP}] |
165 |
+ >=dev-python/nose-0.11.1[${PYTHON_USEDEP}] |
166 |
+ )" |
167 |
+ |
168 |
+RDEPEND="${COMMON_DEPEND} |
169 |
+ >=dev-python/pyparsing-1.5.6[${PYTHON_USEDEP}] |
170 |
+ excel? ( dev-python/xlwt[${PYTHON_USEDEP}] ) |
171 |
+ gtk3? ( |
172 |
+ dev-python/pygobject:3[${PYTHON_USEDEP}] |
173 |
+ x11-libs/gtk+:3[introspection] ) |
174 |
+ latex? ( |
175 |
+ virtual/latex-base |
176 |
+ app-text/ghostscript-gpl |
177 |
+ app-text/dvipng |
178 |
+ app-text/poppler[utils] |
179 |
+ dev-texlive/texlive-fontsrecommended |
180 |
+ dev-texlive/texlive-latexextra |
181 |
+ dev-texlive/texlive-xetex |
182 |
+ ) |
183 |
+ pyside? ( dev-python/pyside[X,${PYTHON_USEDEP}] ) |
184 |
+ qt4? ( dev-python/PyQt4[X,${PYTHON_USEDEP}] ) |
185 |
+ qt5? ( dev-python/PyQt5[gui,widgets,${PYTHON_USEDEP}] ) |
186 |
+ " |
187 |
+ |
188 |
+# A few C++ source files are written to srcdir. |
189 |
+# Other than that, the ebuild shall be fit for out-of-source build. |
190 |
+DISTUTILS_IN_SOURCE_BUILD=1 |
191 |
+ |
192 |
+PATCHES=( |
193 |
+ "${FILESDIR}"/${P}-nose-fixes.patch |
194 |
+ "${FILESDIR}"/${P}-freetype-spurious-failure.patch |
195 |
+) |
196 |
+ |
197 |
+pkg_setup() { |
198 |
+ unset DISPLAY # bug #278524 |
199 |
+ use doc && DISTUTILS_ALL_SUBPHASE_IMPLS=( python2.7 ) |
200 |
+} |
201 |
+ |
202 |
+use_setup() { |
203 |
+ local uword="${2:-${1}}" |
204 |
+ if use ${1}; then |
205 |
+ echo "${uword} = True" |
206 |
+ echo "${uword}agg = True" |
207 |
+ else |
208 |
+ echo "${uword} = False" |
209 |
+ echo "${uword}agg = False" |
210 |
+ fi |
211 |
+} |
212 |
+ |
213 |
+python_prepare_all() { |
214 |
+# Generates test failures, but fedora does it |
215 |
+# local PATCHES=( |
216 |
+# "${FILESDIR}"/${P}-unbundle-pycxx.patch |
217 |
+# "${FILESDIR}"/${P}-unbundle-agg.patch |
218 |
+# ) |
219 |
+# rm -r agg24 CXX || die |
220 |
+# rm -r agg24 || die |
221 |
+ |
222 |
+# cat > lib/${PN}/externals/six.py <<-EOF |
223 |
+# from __future__ import absolute_import |
224 |
+# from six import * |
225 |
+# EOF |
226 |
+ |
227 |
+ sed \ |
228 |
+ -e 's/matplotlib.pyparsing_py[23]/pyparsing/g' \ |
229 |
+ -i lib/matplotlib/{mathtext,fontconfig_pattern}.py \ |
230 |
+ || die "sed pyparsing failed" |
231 |
+ |
232 |
+ sed \ |
233 |
+ -e "s:/usr/:${EPREFIX}/usr/:g" \ |
234 |
+ -i setupext.py || die |
235 |
+ |
236 |
+ export XDG_RUNTIME_DIR="${T}/runtime-dir" |
237 |
+ mkdir "${XDG_RUNTIME_DIR}" || die |
238 |
+ chmod 0700 "${XDG_RUNTIME_DIR}" || die |
239 |
+ |
240 |
+ distutils-r1_python_prepare_all |
241 |
+} |
242 |
+ |
243 |
+python_configure_all() { |
244 |
+ append-flags -fno-strict-aliasing |
245 |
+ append-cppflags -DNDEBUG # or get old trying to do triangulation |
246 |
+ tc-export PKG_CONFIG |
247 |
+} |
248 |
+ |
249 |
+python_configure() { |
250 |
+ mkdir -p "${BUILD_DIR}" || die |
251 |
+ |
252 |
+ # create setup.cfg (see setup.cfg.template for any changes). |
253 |
+ |
254 |
+ # common switches. |
255 |
+ cat > "${BUILD_DIR}"/setup.cfg <<- EOF || die |
256 |
+ [directories] |
257 |
+ basedirlist = "${EPREFIX}/usr" |
258 |
+ [provide_packages] |
259 |
+ pytz = False |
260 |
+ dateutil = False |
261 |
+ [packages] |
262 |
+ tests = $(usex test True False) |
263 |
+ [gui_support] |
264 |
+ agg = True |
265 |
+ $(use_setup cairo) |
266 |
+ $(use_setup gtk3) |
267 |
+ $(use_setup pyside) |
268 |
+ $(use_setup qt4) |
269 |
+ $(use_setup qt5) |
270 |
+ $(use_setup tk) |
271 |
+ EOF |
272 |
+ |
273 |
+ if use gtk3 && use cairo; then |
274 |
+ echo "gtk3cairo = True" >> "${BUILD_DIR}"/setup.cfg || die |
275 |
+ else |
276 |
+ echo "gtk3cairo = False" >> "${BUILD_DIR}"/setup.cfg || die |
277 |
+ fi |
278 |
+ |
279 |
+ if python_is_python3; then |
280 |
+ cat >> "${BUILD_DIR}"/setup.cfg <<- EOF || die |
281 |
+ gtk = False |
282 |
+ gtkagg = False |
283 |
+ wx = False |
284 |
+ wxagg = False |
285 |
+ EOF |
286 |
+ else |
287 |
+ cat >> "${BUILD_DIR}"/setup.cfg <<-EOF || die |
288 |
+ $(use_setup gtk2 gtk) |
289 |
+ $(use_setup wxwidgets wx) |
290 |
+ EOF |
291 |
+ fi |
292 |
+} |
293 |
+ |
294 |
+wrap_setup() { |
295 |
+ local -x MPLSETUPCFG=${BUILD_DIR}/setup.cfg |
296 |
+ unset DISPLAY |
297 |
+ |
298 |
+ # Note: remove build... if switching to out-of-source build |
299 |
+ "${@}" build --build-lib="${BUILD_DIR}"/build/lib |
300 |
+} |
301 |
+ |
302 |
+python_compile() { |
303 |
+ wrap_setup distutils-r1_python_compile |
304 |
+} |
305 |
+ |
306 |
+python_compile_all() { |
307 |
+ if use doc; then |
308 |
+ cd doc || die |
309 |
+ |
310 |
+ # necessary for in-source build |
311 |
+ local -x PYTHONPATH="${BUILD_DIR}"/build/lib:${PYTHONPATH} |
312 |
+ |
313 |
+ VARTEXFONTS="${T}"/fonts \ |
314 |
+ "${EPYTHON}" ./make.py --small html || die |
315 |
+ fi |
316 |
+} |
317 |
+ |
318 |
+python_test() { |
319 |
+ wrap_setup distutils_install_for_testing |
320 |
+ |
321 |
+ virtx "${EPYTHON}" -c "import sys, matplotlib as m; sys.exit(0 if m.test(verbosity=2) else 1)" |
322 |
+} |
323 |
+ |
324 |
+python_install() { |
325 |
+ wrap_setup distutils-r1_python_install |
326 |
+ |
327 |
+ # mpl_toolkits namespace |
328 |
+ python_moduleinto mpl_toolkits |
329 |
+ python_domodule lib/mpl_toolkits/__init__.py |
330 |
+} |
331 |
+ |
332 |
+python_install_all() { |
333 |
+ use doc && local HTML_DOCS=( doc/build/html/. ) |
334 |
+ |
335 |
+ distutils-r1_python_install_all |
336 |
+ |
337 |
+ if use examples; then |
338 |
+ dodoc -r examples |
339 |
+ docompress -x /usr/share/doc/${PF}/examples |
340 |
+ fi |
341 |
+ |
342 |
+ find "${D}" -name '*.pth' -delete || die |
343 |
+} |