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/matplotlib/
Date: Thu, 01 Apr 2021 08:35:12
Message-Id: 1617266103.c942d7c49767a2cc500199cc38c39b8a9d3d4cb0.mgorny@gentoo
1 commit: c942d7c49767a2cc500199cc38c39b8a9d3d4cb0
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Apr 1 07:46:15 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 1 08:35:03 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c942d7c4
7
8 dev-python/matplotlib: Bump to 3.4.1
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/matplotlib/Manifest | 1 +
13 dev-python/matplotlib/matplotlib-3.4.1.ebuild | 280 ++++++++++++++++++++++++++
14 2 files changed, 281 insertions(+)
15
16 diff --git a/dev-python/matplotlib/Manifest b/dev-python/matplotlib/Manifest
17 index 534d40f6bb8..6825d784117 100644
18 --- a/dev-python/matplotlib/Manifest
19 +++ b/dev-python/matplotlib/Manifest
20 @@ -1,3 +1,4 @@
21 DIST freetype-2.6.1.tar.gz 2302080 BLAKE2B 6a5fb98e5fa6cf4b7d7533ad44e364227d8c2f7dded4c552d6e22e204c32b7858f20d41d1e809ecdad6e5353d6cec81bea0e0b06a4533363a41ecab83ce3f7ca SHA512 ff2daed64d712737085924c50e75862fafbcbb24eef6d72dac9eaae63bb656d7245397fd828f5d3e47ac847f7ff83d73dedfdd61fde1f7d6e0f0cdeb49bcf83b
22 DIST matplotlib-3.3.4.tar.gz 37941665 BLAKE2B 77b86dc3ceec3695a0d749197bcec684893d237da1aaf8778d9dc2038da1ba56b757bbce94efcf215ac30f35420b77e0a0e75ebb75b6d2cde5146d8a35ee25e7 SHA512 aadfe3db4edde9940b9e15daf1b6c5f237d3a6f38610956ceee994f919d711fce818ea12be4db18aa2a8638c4e8f434d79541fecaa7233e233bf4c73792bc4c4
23 DIST matplotlib-3.4.0.tar.gz 37142983 BLAKE2B 64b23d5b9e93e6b319674cea06d0ad425def952e50e7cb163ae91ae0d4460872bb329144271472b7dc2d0ab0a742c9c93ea735dca60ee4b4aa569cb4350cca0b SHA512 880c1e1027c819a34f5528b96d1b730cdd6541aa23931aef4185406ecec971ec2f4c8ca374eced56e654e016652472f7abcd0aae977dd4f327b8c511983a2a1d
24 +DIST matplotlib-3.4.1.tar.gz 37253296 BLAKE2B e1dfd1b0d8bb0d3ed13ac03a5b3112a237c4b7ef3c82694ad6779c810bbd94c165bde88d00fad270d5da6e269d778b33f276620b51e1f134fa2c5b9dcb0a4f28 SHA512 076510ddd152a395fabb76aa47566e9b75f3c8ba3c5246b39229b20fbfc209d4bbdfd441271b22e364f0974963309c02bdd0519fc2a7e8a406afc462f69246b6
25
26 diff --git a/dev-python/matplotlib/matplotlib-3.4.1.ebuild b/dev-python/matplotlib/matplotlib-3.4.1.ebuild
27 new file mode 100644
28 index 00000000000..70fc4ea111b
29 --- /dev/null
30 +++ b/dev-python/matplotlib/matplotlib-3.4.1.ebuild
31 @@ -0,0 +1,280 @@
32 +# Copyright 1999-2021 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +PYTHON_COMPAT=( python3_{7..9} )
38 +PYTHON_REQ_USE='tk?,threads(+)'
39 +
40 +inherit distutils-r1 flag-o-matic virtualx toolchain-funcs prefix
41 +
42 +FT_PV=2.6.1
43 +DESCRIPTION="Pure python plotting library with matlab like syntax"
44 +HOMEPAGE="https://matplotlib.org/"
45 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
46 + test? (
47 + https://downloads.sourceforge.net/project/freetype/freetype2/${FT_PV}/freetype-${FT_PV}.tar.gz
48 + )"
49 +
50 +# Main license: matplotlib
51 +# Some modules: BSD
52 +# matplotlib/backends/qt4_editor: MIT
53 +# Fonts: BitstreamVera, OFL-1.1
54 +LICENSE="BitstreamVera BSD matplotlib MIT OFL-1.1"
55 +SLOT="0"
56 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
57 +IUSE="cairo doc excel examples gtk3 latex qt5 tk webagg wxwidgets"
58 +
59 +# internal copy of pycxx highly patched
60 +# dev-python/pycxx
61 +RDEPEND="
62 + dev-python/certifi[${PYTHON_USEDEP}]
63 + >=dev-python/cycler-0.10.0-r1[${PYTHON_USEDEP}]
64 + >=dev-python/kiwisolver-1.2.0[${PYTHON_USEDEP}]
65 + >=dev-python/numpy-1.18.2[${PYTHON_USEDEP}]
66 + >=dev-python/pillow-7.1.1[jpeg,${PYTHON_USEDEP}]
67 + >=dev-python/pyparsing-2.2.1[${PYTHON_USEDEP}]
68 + >=dev-python/python-dateutil-2.7[${PYTHON_USEDEP}]
69 + >=dev-python/pytz-2019.3[${PYTHON_USEDEP}]
70 + >=dev-python/six-1.14.0[${PYTHON_USEDEP}]
71 + dev-python/versioneer[${PYTHON_USEDEP}]
72 + media-fonts/dejavu
73 + media-fonts/stix-fonts
74 + media-libs/freetype:2
75 + media-libs/libpng:0
76 + >=media-libs/qhull-2013:=
77 + cairo? (
78 + dev-python/cairocffi[${PYTHON_USEDEP}]
79 + )
80 + excel? (
81 + dev-python/xlwt[${PYTHON_USEDEP}]
82 + )
83 + gtk3? (
84 + dev-python/pygobject:3[cairo?,${PYTHON_USEDEP}]
85 + x11-libs/gtk+:3[introspection]
86 + )
87 + latex? (
88 + virtual/latex-base
89 + app-text/dvipng
90 + app-text/ghostscript-gpl
91 + app-text/poppler[utils]
92 + dev-texlive/texlive-fontsrecommended
93 + dev-texlive/texlive-latexextra
94 + dev-texlive/texlive-xetex
95 + )
96 + qt5? (
97 + dev-python/PyQt5[gui,widgets,${PYTHON_USEDEP}]
98 + )
99 + webagg? (
100 + >=www-servers/tornado-6.0.4[${PYTHON_USEDEP}]
101 + )
102 + wxwidgets? (
103 + $(python_gen_cond_dep '
104 + dev-python/wxpython:*[${PYTHON_USEDEP}]
105 + ' python3_{6,7,8})
106 + )
107 +"
108 +
109 +BDEPEND="
110 + ${RDEPEND}
111 + virtual/pkgconfig
112 + doc? (
113 + >=app-text/dvipng-1.15-r1
114 + >=dev-python/colorspacious-1.1.2[${PYTHON_USEDEP}]
115 + >=dev-python/ipython-1.18.2[${PYTHON_USEDEP}]
116 + >=dev-python/numpydoc-0.9.2[${PYTHON_USEDEP}]
117 + >=dev-python/scipy-1.4.1[${PYTHON_USEDEP}]
118 + >=dev-python/sphinx-1.3.1[${PYTHON_USEDEP}]
119 + >=dev-python/sphinx-gallery-0.3.1-r1[${PYTHON_USEDEP}]
120 + >=dev-python/xlwt-1.3.0-r1[${PYTHON_USEDEP}]
121 + dev-texlive/texlive-latexextra
122 + dev-texlive/texlive-fontsrecommended
123 + dev-texlive/texlive-latexrecommended
124 + >=media-gfx/graphviz-2.42.3[cairo]
125 + )
126 + test? (
127 + dev-python/flaky[${PYTHON_USEDEP}]
128 + dev-python/mock[${PYTHON_USEDEP}]
129 + dev-python/pygobject:3[cairo?,${PYTHON_USEDEP}]
130 + >=www-servers/tornado-6.0.4[${PYTHON_USEDEP}]
131 + x11-libs/gtk+:3[introspection]
132 + )
133 +"
134 +
135 +# A few C++ source files are written to srcdir.
136 +# Other than that, the ebuild shall be fit for out-of-source build.
137 +DISTUTILS_IN_SOURCE_BUILD=1
138 +
139 +distutils_enable_tests pytest
140 +
141 +pkg_setup() {
142 + unset DISPLAY # bug #278524
143 +}
144 +
145 +use_supported() {
146 + case ${1} in
147 + wxwidgets)
148 + [[ ${EPYTHON} == python3.[678] ]]
149 + ;;
150 + esac
151 +
152 + return 0
153 +}
154 +
155 +use_setup() {
156 + local uword="${2:-${1}}"
157 + if use_supported "${1}" && use "${1}"; then
158 + echo "${uword} = True"
159 + echo "${uword}agg = True"
160 + else
161 + echo "${uword} = False"
162 + echo "${uword}agg = False"
163 + fi
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 + local PATCHES=(
181 + "${FILESDIR}"/matplotlib-3.4.0-test.patch
182 + "${FILESDIR}"/matplotlib-3.3.3-disable-lto.patch
183 + )
184 +
185 + # requires jupyter-nbconvert
186 + rm lib/matplotlib/tests/test_backend_nbagg.py || die
187 +
188 + sed \
189 + -e 's/matplotlib.pyparsing_py[23]/pyparsing/g' \
190 + -i lib/matplotlib/{mathtext,fontconfig_pattern}.py \
191 + || die "sed pyparsing failed"
192 +
193 + sed -e 's:\(@pytest.mark.flaky\)(reruns=3):\1:' \
194 + -i lib/matplotlib/tests/test_*.py || die
195 +
196 + hprefixify setupext.py
197 +
198 + rm -rf libqhull || die
199 +
200 + export XDG_RUNTIME_DIR="${T}/runtime-dir"
201 + mkdir "${XDG_RUNTIME_DIR}" || die
202 + chmod 0700 "${XDG_RUNTIME_DIR}" || die
203 +
204 + distutils-r1_python_prepare_all
205 +}
206 +
207 +python_configure_all() {
208 + append-flags -fno-strict-aliasing
209 + append-cppflags -DNDEBUG # or get old trying to do triangulation
210 + tc-export PKG_CONFIG
211 +}
212 +
213 +python_configure() {
214 + mkdir -p "${BUILD_DIR}" || die
215 +
216 + # create setup.cfg (see setup.cfg.template for any changes).
217 +
218 + # common switches.
219 + cat > "${BUILD_DIR}"/setup.cfg <<- EOF || die
220 + [directories]
221 + basedirlist = ${EPREFIX}/usr
222 + [provide_packages]
223 + pytz = False
224 + dateutil = False
225 + [libs]
226 + system_freetype = True
227 + system_qhull = True
228 + [packages]
229 + tests = $(usex test True False)
230 + [gui_support]
231 + agg = True
232 + gtk = False
233 + gtkagg = False
234 + macosx = False
235 + pyside = False
236 + pysideagg = False
237 + qt4 = False
238 + qt4agg = False
239 + $(use_setup cairo)
240 + $(use_setup gtk3)
241 + $(use_setup qt5)
242 + $(use_setup tk)
243 + $(use_setup wxwidgets wx)
244 + EOF
245 +
246 + if use gtk3 && use cairo; then
247 + echo "gtk3cairo = True" >> "${BUILD_DIR}"/setup.cfg || die
248 + else
249 + echo "gtk3cairo = False" >> "${BUILD_DIR}"/setup.cfg || die
250 + fi
251 +}
252 +
253 +wrap_setup() {
254 + local MAKEOPTS=-j1
255 + local -x MPLSETUPCFG="${BUILD_DIR}"/setup.cfg
256 + "$@"
257 +}
258 +
259 +python_compile() {
260 + wrap_setup distutils-r1_python_compile --build-lib="${BUILD_DIR}"/lib
261 +}
262 +
263 +python_compile_all() {
264 + if use doc; then
265 + cd doc || die
266 +
267 + # necessary for in-source build
268 + local -x PYTHONPATH="${BUILD_DIR}"/build/lib:${PYTHONPATH}
269 +
270 + VARTEXFONTS="${T}"/fonts \
271 + emake SPHINXOPTS= O=-Dplot_formats=png:100 html
272 + fi
273 +}
274 +
275 +src_test() {
276 + virtx distutils-r1_src_test
277 +}
278 +
279 +python_test() {
280 + # we need to rebuild mpl against bundled freetype, otherwise
281 + # over 1000 tests will fail because of mismatched font rendering
282 + grep -v system_freetype "${BUILD_DIR}"/setup.cfg \
283 + > "${BUILD_DIR}"/test-setup.cfg || die
284 + local -x MPLSETUPCFG="${BUILD_DIR}"/test-setup.cfg
285 + ln -s "${WORKDIR}/freetype-${FT_PV}" "${BUILD_DIR}" || die
286 + distutils-r1_python_compile -j1 --build-lib="${BUILD_DIR}"/test-lib
287 + local -x PYTHONPATH=${BUILD_DIR}/test-lib:${PYTHONPATH}
288 +
289 + "${EPYTHON}" -c "import sys, matplotlib as m; sys.exit(m.test(argv=['-m', 'not network'], verbosity=2))" || die
290 +}
291 +
292 +python_install() {
293 + wrap_setup distutils-r1_python_install
294 +
295 + # mpl_toolkits namespace
296 + python_moduleinto mpl_toolkits
297 + python_domodule lib/mpl_toolkits/__init__.py
298 +}
299 +
300 +python_install_all() {
301 + use doc && local HTML_DOCS=( doc/build/html/. )
302 +
303 + distutils-r1_python_install_all
304 +
305 + if use examples; then
306 + dodoc -r examples
307 + docompress -x /usr/share/doc/${PF}/examples
308 + fi
309 +
310 + find "${D}" -name '*.pth' -delete || die
311 +}