Gentoo Archives: gentoo-commits

From: Justin Lecher <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/matplotlib/
Date: Sat, 31 Oct 2015 08:41:58
Message-Id: 1446280896.015afb5045e0a3900c209802aaca8081dd40395a.jlec@gentoo
1 commit: 015afb5045e0a3900c209802aaca8081dd40395a
2 Author: Justin Lecher <jlec <AT> gentoo <DOT> org>
3 AuthorDate: Fri Oct 30 15:05:16 2015 +0000
4 Commit: Justin Lecher <jlec <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 31 08:41:36 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=015afb50
7
8 dev-python/matplotlib: Version Bump
9
10 Package-Manager: portage-2.2.23
11 Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>
12
13 dev-python/matplotlib/Manifest | 1 +
14 dev-python/matplotlib/matplotlib-1.5.0.ebuild | 272 ++++++++++++++++++++++++++
15 2 files changed, 273 insertions(+)
16
17 diff --git a/dev-python/matplotlib/Manifest b/dev-python/matplotlib/Manifest
18 index a73396a..ccfe5f4 100644
19 --- a/dev-python/matplotlib/Manifest
20 +++ b/dev-python/matplotlib/Manifest
21 @@ -1,2 +1,3 @@
22 DIST matplotlib-1.4.2.tar.gz 50139344 SHA256 17a3c7154f152d8dfed1f37517c0a8c5db6ade4f6334f684989c36dab84ddb54 SHA512 3525f4e6414042fabf8d18ce9041d61197465dc07c766730c187a512277907ba33f56d49d5a468d82f65bce57217e8eb48ecfa143e55152a15607b79a7b25adc WHIRLPOOL ce6e5a15676b939bda7ad1be0f27766314f60ed44ebfba1e73d2c3d00a31d5492722cde73f943de72da038772519068602e60c830af9ffdf52710a24ce98fe7a
23 DIST matplotlib-1.4.3.tar.gz 49933525 SHA256 5b9544472d9d6ab3d47423bdb5a0e64fdf913e505c1c083f25283dd0362bc0b6 SHA512 51b0f58b2618b47b653e17e4f6b6a1215d3a3b0f1331ce3555cc7435e365d9c75693f289ce12fe3bf8f69fd57b663e545f0f1c2c94e81eaa661cac0689e125f5 WHIRLPOOL 160ca48ecb44db58f1c56bd6e89592c5d1badd8e434fc25d32aa6d4d7a346ae7c7444d1c8e0c2ca2bf5c3246fd56cd93856ec7b1e3e51f5e471b9b55a0f2c1ad
24 +DIST matplotlib-1.5.0.tar.gz 53962448 SHA256 67b08b1650a00a6317d94b76a30a47320087e5244920604c5462188cba0c2646 SHA512 559a3ef031ca65b431157f0dd50f7d81f2d854f92150ee2b9de5e44b31d49615bfdc049a682667bc2e1399b8cd724dfcefec8f4de7e92848fe5756f93ddef5fa WHIRLPOOL b30a7299dd0690cd0355883cbe7d335d76314bab85f5b67b326b0e600b479db3cd5e7f48e9e68d3604832e9605f5025c70ff0006b1980b945aeaf22f78e3469f
25
26 diff --git a/dev-python/matplotlib/matplotlib-1.5.0.ebuild b/dev-python/matplotlib/matplotlib-1.5.0.ebuild
27 new file mode 100644
28 index 0000000..f644ffe
29 --- /dev/null
30 +++ b/dev-python/matplotlib/matplotlib-1.5.0.ebuild
31 @@ -0,0 +1,272 @@
32 +# Copyright 1999-2015 Gentoo Foundation
33 +# Distributed under the terms of the GNU General Public License v2
34 +# $Id$
35 +
36 +EAPI=5
37 +
38 +PYTHON_COMPAT=( python2_7 python3_{3,4,5} )
39 +
40 +PYTHON_REQ_USE='tk?'
41 +
42 +inherit distutils-r1 eutils flag-o-matic virtualx toolchain-funcs
43 +
44 +DESCRIPTION="Pure python plotting library with matlab like syntax"
45 +HOMEPAGE="http://matplotlib.org/"
46 +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
47 +
48 +SLOT="0"
49 +# Main license: matplotlib
50 +# Some modules: BSD
51 +# matplotlib/backends/qt4_editor: MIT
52 +# Fonts: BitstreamVera, OFL-1.1
53 +LICENSE="BitstreamVera BSD matplotlib MIT OFL-1.1"
54 +KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
55 +IUSE="cairo doc excel examples fltk gtk gtk3 latex pyside qt4 qt5 test tk wxwidgets"
56 +
57 +PY2_FLAGS="|| ( $(python_gen_useflags python2_7) )"
58 +REQUIRED_USE="
59 + doc? ( ${PY2_FLAGS} )
60 + excel? ( ${PY2_FLAGS} )
61 + fltk? ( ${PY2_FLAGS} )
62 + gtk? ( ${PY2_FLAGS} )
63 + wxwidgets? ( ${PY2_FLAGS} )
64 + test? (
65 + cairo fltk latex pyside qt5 qt4 tk wxwidgets
66 + || ( gtk gtk3 )
67 + )"
68 +
69 +# #456704 -- a lot of py2-only deps
70 +PY2_USEDEP=$(python_gen_usedep python2_7)
71 +COMMON_DEPEND="
72 + dev-python/cycler[${PYTHON_USEDEP}]
73 + >=dev-python/numpy-1.6[${PYTHON_USEDEP}]
74 + dev-python/python-dateutil:0[${PYTHON_USEDEP}]
75 + dev-python/pytz[${PYTHON_USEDEP}]
76 + >=dev-python/six-1.4[${PYTHON_USEDEP}]
77 + media-fonts/stix-fonts
78 + media-libs/freetype:2
79 + media-libs/libpng:0
80 + media-libs/qhull
81 + gtk? (
82 + dev-libs/glib:2=
83 + x11-libs/gdk-pixbuf
84 + x11-libs/gtk+:2
85 + dev-python/pygtk[${PY2_USEDEP}] )
86 + wxwidgets? ( >=dev-python/wxpython-2.8:*[${PY2_USEDEP}] )"
87 +
88 +# internal copy of pycxx highly patched
89 +# dev-python/pycxx
90 +
91 +DEPEND="${COMMON_DEPEND}
92 + dev-python/versioneer[${PYTHON_USEDEP}]
93 + virtual/pkgconfig
94 + doc? (
95 + app-text/dvipng
96 + virtual/python-imaging[${PYTHON_USEDEP}]
97 + dev-python/ipython[${PYTHON_USEDEP}]
98 + dev-python/numpydoc[${PYTHON_USEDEP}]
99 + dev-python/xlwt[${PYTHON_USEDEP}]
100 + dev-python/sphinx[${PYTHON_USEDEP}]
101 + dev-texlive/texlive-latexextra
102 + dev-texlive/texlive-fontsrecommended
103 + dev-texlive/texlive-latexrecommended
104 + media-gfx/graphviz[cairo]
105 + )
106 + test? (
107 + dev-python/mock[${PYTHON_USEDEP}]
108 + >=dev-python/nose-0.11.1[${PYTHON_USEDEP}]
109 + )"
110 +
111 +RDEPEND="${COMMON_DEPEND}
112 + >=dev-python/pyparsing-1.5.6[${PYTHON_USEDEP}]
113 + cairo? (
114 + || (
115 + dev-python/pycairo[${PYTHON_USEDEP}]
116 + dev-python/cairocffi[${PYTHON_USEDEP}]
117 + )
118 + )
119 + excel? ( dev-python/xlwt[${PYTHON_USEDEP}] )
120 + fltk? (
121 + $(python_gen_cond_dep 'dev-python/pyfltk[${PYTHON_USEDEP}]' python2_7)
122 + $(python_gen_cond_dep 'dev-python/pyfltk[${PYTHON_USEDEP}]' 'python3*')
123 + )
124 + gtk3? (
125 + dev-python/pygobject:3[${PYTHON_USEDEP}]
126 + x11-libs/gtk+:3[introspection] )
127 + latex? (
128 + virtual/latex-base
129 + app-text/ghostscript-gpl
130 + app-text/dvipng
131 + app-text/poppler[utils]
132 + dev-texlive/texlive-fontsrecommended
133 + dev-texlive/texlive-latexextra
134 + dev-texlive/texlive-xetex
135 + )
136 + pyside? ( dev-python/pyside[X,${PYTHON_USEDEP}] )
137 + qt4? ( dev-python/PyQt4[X,${PYTHON_USEDEP}] )
138 + qt5? ( dev-python/PyQt5[gui,widgets,${PYTHON_USEDEP}] )
139 + "
140 +
141 +RESTRICT="mirror"
142 +
143 +# A few C++ source files are written to srcdir.
144 +# Other than that, the ebuild shall be fit for out-of-source build.
145 +DISTUTILS_IN_SOURCE_BUILD=1
146 +
147 +pkg_setup() {
148 + unset DISPLAY # bug #278524
149 +}
150 +
151 +use_setup() {
152 + local uword="${2:-${1}}"
153 + if use ${1}; then
154 + echo "${uword} = True"
155 + echo "${uword}agg = True"
156 + else
157 + echo "${uword} = False"
158 + echo "${uword}agg = False"
159 + fi
160 +}
161 +
162 +_PATCHES=(
163 + "${FILESDIR}"/${P}-backport-GH5291-2462.patch
164 +)
165 +
166 +python_prepare_all() {
167 +# Generates test failures, but fedora does it
168 +# local PATCHES=(
169 +# "${FILESDIR}"/${P}-unbundle-pycxx.patch
170 +# "${FILESDIR}"/${P}-unbundle-agg.patch
171 +# )
172 +# rm -r agg24 CXX || die
173 +# rm -r agg24 || die
174 +
175 +# cat > lib/${PN}/externals/six.py <<-EOF
176 +# from __future__ import absolute_import
177 +# from six import *
178 +# EOF
179 +
180 + sed \
181 + -e 's/matplotlib.pyparsing_py[23]/pyparsing/g' \
182 + -i lib/matplotlib/{mathtext,fontconfig_pattern}.py \
183 + || die "sed pyparsing failed"
184 +
185 + # suggested by upstream
186 +# sed \
187 +# -e '/tol/s:32:35:g' \
188 +# -i lib/matplotlib/tests/test_mathtext.py || die
189 +
190 + sed \
191 + -e "s:/usr/:${EPREFIX}/usr/:g" \
192 + -i setupext.py || die
193 +
194 + export XDG_RUNTIME_DIR="${T}/runtime-dir"
195 + mkdir "${XDG_RUNTIME_DIR}" || die
196 + chmod 0700 "${XDG_RUNTIME_DIR}" || die
197 +
198 + distutils-r1_python_prepare_all
199 +}
200 +
201 +python_configure_all() {
202 + append-flags -fno-strict-aliasing
203 + append-cppflags -DNDEBUG # or get old trying to do triangulation
204 + tc-export PKG_CONFIG
205 +}
206 +
207 +python_configure() {
208 + mkdir -p "${BUILD_DIR}" || die
209 +
210 + # create setup.cfg (see setup.cfg.template for any changes).
211 +
212 + # common switches.
213 + cat > "${BUILD_DIR}"/setup.cfg <<- EOF
214 + [directories]
215 + basedirlist = "${EPREFIX}/usr"
216 + [provide_packages]
217 + pytz = False
218 + dateutil = False
219 + [gui_support]
220 + agg = True
221 + $(use_setup cairo)
222 + $(use_setup pyside)
223 + $(use_setup qt4)
224 + $(use_setup qt5)
225 + $(use_setup tk)
226 + EOF
227 +
228 + if use gtk3 && use cairo; then
229 + echo "gtk3cairo = True" >> "${BUILD_DIR}"/setup.cfg || die
230 + else
231 + echo "gtk3cairo = False" >> "${BUILD_DIR}"/setup.cfg || die
232 + fi
233 +
234 + if $(python_is_python3); then
235 + cat >> "${BUILD_DIR}"/setup.cfg <<- EOF
236 + six = True
237 + fltk = False
238 + fltkagg = False
239 + gtk = False
240 + gtkagg = False
241 + wx = False
242 + wxagg = False
243 + EOF
244 + else
245 + cat >> "${BUILD_DIR}"/setup.cfg <<-EOF
246 + six = False
247 + $(use_setup fltk)
248 + $(use_setup gtk)
249 + $(use_setup gtk3)
250 + $(use_setup wxwidgets wx)
251 + EOF
252 + fi
253 +}
254 +
255 +wrap_setup() {
256 + local MPLSETUPCFG=${BUILD_DIR}/setup.cfg
257 + export MPLSETUPCFG
258 +
259 + # Note: remove build... if switching to out-of-source build
260 + "${@}" build --build-lib="${BUILD_DIR}"/build/lib
261 +}
262 +
263 +python_compile() {
264 + wrap_setup distutils-r1_python_compile
265 +}
266 +
267 +python_compile_all() {
268 + if use doc; then
269 + cd doc || die
270 +
271 + # necessary for in-source build
272 + local -x PYTHONPATH="${BUILD_DIR}"/build/lib:${PYTHONPATH}
273 +
274 + VARTEXFONTS="${T}"/fonts \
275 + "${PYTHON}" ./make.py --small html || die
276 + fi
277 +}
278 +
279 +python_test() {
280 + wrap_setup distutils_install_for_testing
281 +
282 + #cd "${TMPDIR}" || die
283 + VIRTUALX_COMMAND="${PYTHON}"
284 + virtualmake -c "import sys, matplotlib as m; sys.exit(0 if m.test(verbosity=2) else 1)" || \
285 + die "Tests fail with ${EPYTHON}"
286 +# VIRTUALX_COMMAND=esetup.py
287 +# virtualmake test
288 +}
289 +
290 +python_install() {
291 + wrap_setup distutils-r1_python_install
292 +}
293 +
294 +python_install_all() {
295 + use doc && local HTML_DOCS=( doc/build/html/. )
296 +
297 + distutils-r1_python_install_all
298 +
299 + if use examples; then
300 + dodoc -r examples
301 + docompress -x /usr/share/doc/${PF}/examples
302 + fi
303 +}