Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/matplotlib-python2/
Date: Sat, 01 Aug 2020 23:20:36
Message-Id: 1596323975.9e7edcb5705f819c62cc4bda92162e05b2bd2b37.asturm@gentoo
1 commit: 9e7edcb5705f819c62cc4bda92162e05b2bd2b37
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sat Aug 1 09:38:31 2020 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 1 23:19:35 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e7edcb5
7
8 dev-python/matplotlib-python2: Drop IUSE="qt5"
9
10 Package-Manager: Portage-3.0.1, Repoman-2.3.23
11 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
12
13 .../matplotlib-python2-2.2.5-r2.ebuild | 208 +++++++++++++++++++++
14 1 file changed, 208 insertions(+)
15
16 diff --git a/dev-python/matplotlib-python2/matplotlib-python2-2.2.5-r2.ebuild b/dev-python/matplotlib-python2/matplotlib-python2-2.2.5-r2.ebuild
17 new file mode 100644
18 index 00000000000..4d925d88348
19 --- /dev/null
20 +++ b/dev-python/matplotlib-python2/matplotlib-python2-2.2.5-r2.ebuild
21 @@ -0,0 +1,208 @@
22 +# Copyright 1999-2020 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=6
26 +
27 +PYTHON_COMPAT=( python2_7 )
28 +PYTHON_REQ_USE='tk?,threads(+)'
29 +
30 +inherit distutils-r1 flag-o-matic virtualx toolchain-funcs prefix
31 +
32 +MY_PN=${PN/-python2}
33 +MY_P=${MY_PN}-${PV}
34 +
35 +DESCRIPTION="Pure python plotting library with matlab like syntax (py2 version)"
36 +HOMEPAGE="https://matplotlib.org/"
37 +SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
38 +S=${WORKDIR}/${MY_P}
39 +
40 +# Main license: matplotlib
41 +# Some modules: BSD
42 +# matplotlib/backends/qt4_editor: MIT
43 +# Fonts: BitstreamVera, OFL-1.1
44 +LICENSE="BitstreamVera BSD matplotlib MIT OFL-1.1"
45 +SLOT="0"
46 +KEYWORDS="amd64 ~arm arm64 ~ppc ~ppc64 x86"
47 +IUSE="cairo excel gtk3 latex test tk wxwidgets"
48 +REQUIRED_USE="test? ( cairo gtk3 latex tk wxwidgets )"
49 +
50 +RESTRICT="!test? ( test )"
51 +
52 +# #456704 -- a lot of py2-only deps
53 +COMMON_DEPEND="
54 + dev-python/functools32[${PYTHON_USEDEP}]
55 + dev-python/subprocess32[${PYTHON_USEDEP}]
56 + dev-python/backports-functools-lru-cache[${PYTHON_USEDEP}]
57 + dev-python/cycler[${PYTHON_USEDEP}]
58 + || (
59 + dev-python/numpy-python2[${PYTHON_USEDEP}]
60 + >=dev-python/numpy-1.7.1[${PYTHON_USEDEP}]
61 + )
62 + dev-python/python-dateutil:0[${PYTHON_USEDEP}]
63 + dev-python/pytz[${PYTHON_USEDEP}]
64 + >=dev-python/six-1.10[${PYTHON_USEDEP}]
65 + media-fonts/stix-fonts
66 + media-libs/freetype:2
67 + media-libs/libpng:0
68 + >=media-libs/qhull-2013
69 + >=dev-python/kiwisolver-1.0.0[${PYTHON_USEDEP}]
70 + cairo? ( dev-python/cairocffi[${PYTHON_USEDEP}] )
71 + wxwidgets? ( >=dev-python/wxpython-2.8:*[${PYTHON_USEDEP}] )"
72 +
73 +# internal copy of pycxx highly patched
74 +# dev-python/pycxx
75 +
76 +DEPEND="${COMMON_DEPEND}
77 + dev-python/versioneer[${PYTHON_USEDEP}]
78 + dev-python/setuptools[${PYTHON_USEDEP}]
79 + virtual/pkgconfig
80 + test? (
81 + dev-python/mock[${PYTHON_USEDEP}]
82 + >=dev-python/nose-0.11.1[${PYTHON_USEDEP}]
83 + )"
84 +
85 +RDEPEND="${COMMON_DEPEND}
86 + !<dev-python/matplotlib-3
87 + >=dev-python/pyparsing-1.5.6[${PYTHON_USEDEP}]
88 + excel? ( dev-python/xlwt[${PYTHON_USEDEP}] )
89 + gtk3? (
90 + dev-python/pygobject:3[${PYTHON_USEDEP}]
91 + x11-libs/gtk+:3[introspection]
92 + )
93 + latex? (
94 + virtual/latex-base
95 + app-text/ghostscript-gpl
96 + app-text/dvipng
97 + app-text/poppler[utils]
98 + dev-texlive/texlive-fontsrecommended
99 + dev-texlive/texlive-latexextra
100 + dev-texlive/texlive-xetex
101 + )"
102 +
103 +# A few C++ source files are written to srcdir.
104 +# Other than that, the ebuild shall be fit for out-of-source build.
105 +DISTUTILS_IN_SOURCE_BUILD=1
106 +
107 +pkg_setup() {
108 + unset DISPLAY # bug #278524
109 +}
110 +
111 +use_setup() {
112 + local uword="${2:-${1}}"
113 + if use ${1}; then
114 + echo "${uword} = True"
115 + echo "${uword}agg = True"
116 + else
117 + echo "${uword} = False"
118 + echo "${uword}agg = False"
119 + fi
120 +}
121 +
122 +python_prepare_all() {
123 +# Generates test failures, but fedora does it
124 +# local PATCHES=(
125 +# "${FILESDIR}"/${P}-unbundle-pycxx.patch
126 +# "${FILESDIR}"/${P}-unbundle-agg.patch
127 +# )
128 +# rm -r agg24 CXX || die
129 +# rm -r agg24 || die
130 +
131 +# cat > lib/${PN}/externals/six.py <<-EOF
132 +# from __future__ import absolute_import
133 +# from six import *
134 +# EOF
135 +
136 + local PATCHES=(
137 + "${FILESDIR}"/${MY_PN}-2.2.4-doc-fix.patch
138 + )
139 +
140 + sed \
141 + -e 's/matplotlib.pyparsing_py[23]/pyparsing/g' \
142 + -i lib/matplotlib/{mathtext,fontconfig_pattern}.py \
143 + || die "sed pyparsing failed"
144 +
145 + hprefixify setupext.py
146 +
147 + export XDG_RUNTIME_DIR="${T}/runtime-dir"
148 + mkdir "${XDG_RUNTIME_DIR}" || die
149 + chmod 0700 "${XDG_RUNTIME_DIR}" || die
150 +
151 + distutils-r1_python_prepare_all
152 +}
153 +
154 +python_configure_all() {
155 + append-flags -fno-strict-aliasing
156 + append-cppflags -DNDEBUG # or get old trying to do triangulation
157 + tc-export PKG_CONFIG
158 +}
159 +
160 +python_configure() {
161 + mkdir -p "${BUILD_DIR}" || die
162 +
163 + # create setup.cfg (see setup.cfg.template for any changes).
164 +
165 + # common switches.
166 + cat > "${BUILD_DIR}"/setup.cfg <<- EOF || die
167 + [directories]
168 + basedirlist = ${EPREFIX}/usr
169 + [provide_packages]
170 + pytz = False
171 + dateutil = False
172 + [packages]
173 + tests = $(usex test True False)
174 + [gui_support]
175 + agg = True
176 + pyside = False
177 + pysideagg = False
178 + qt4 = False
179 + qt4agg = False
180 + qt5 = False
181 + qt5agg = False
182 + $(use_setup cairo)
183 + $(use_setup gtk3)
184 + $(use_setup tk)
185 + EOF
186 +
187 + if use gtk3 && use cairo; then
188 + echo "gtk3cairo = True" >> "${BUILD_DIR}"/setup.cfg || die
189 + else
190 + echo "gtk3cairo = False" >> "${BUILD_DIR}"/setup.cfg || die
191 + fi
192 +
193 + cat >> "${BUILD_DIR}"/setup.cfg <<-EOF || die
194 + gtk = False
195 + gtkagg = False
196 + $(use_setup wxwidgets wx)
197 + EOF
198 +}
199 +
200 +wrap_setup() {
201 + local MAKEOPTS=-j1
202 + local -x MPLSETUPCFG="${BUILD_DIR}"/setup.cfg
203 + unset DISPLAY
204 + "$@"
205 +}
206 +
207 +python_compile() {
208 + wrap_setup distutils-r1_python_compile --build-lib="${BUILD_DIR}"/lib
209 +}
210 +
211 +python_test() {
212 + wrap_setup distutils_install_for_testing
213 +
214 + virtx "${EPYTHON}" -c "import sys, matplotlib as m; sys.exit(0 if m.test(verbosity=2) else 1)"
215 +}
216 +
217 +python_install() {
218 + wrap_setup distutils-r1_python_install
219 +
220 + # mpl_toolkits namespace
221 + python_moduleinto mpl_toolkits
222 + python_domodule lib/mpl_toolkits/__init__.py
223 +}
224 +
225 +python_install_all() {
226 + distutils-r1_python_install_all
227 +
228 + find "${D}" -name '*.pth' -delete || die
229 +}