/[gentoo-x86]/dev-python/matplotlib/matplotlib-1.3.1.ebuild
Gentoo

Contents of /dev-python/matplotlib/matplotlib-1.3.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Dec 26 18:55:53 2013 UTC (8 months, 2 weeks ago) by jlec
Branch: MAIN
Changes since 1.1: +15 -11 lines
dev-python/matplotlib: Update deps for USE=pyside and fix sandbox problems for gtk+3

(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key B9D4F231BD1558AB!)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-python/matplotlib/matplotlib-1.3.1.ebuild,v 1.1 2013/12/12 14:30:20 jlec Exp $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python{2_6,2_7,3_2,3_3} )
8
9 PYTHON_REQ_USE='tk?'
10
11 VIRTUALX_REQUIRED="always"
12
13 inherit distutils-r1 eutils flag-o-matic virtualx
14
15 DESCRIPTION="Pure python plotting library with matlab like syntax"
16 HOMEPAGE="http://matplotlib.org/"
17 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
18
19 SLOT="0"
20 # Main license: matplotlib
21 # Some modules: BSD
22 # matplotlib/backends/qt4_editor: MIT
23 # Fonts: BitstreamVera, OFL-1.1
24 LICENSE="BitstreamVera BSD matplotlib MIT OFL-1.1"
25 KEYWORDS="~amd64 ~arm ~x86 ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
26 IUSE="cairo doc excel examples fltk gtk gtk3 latex pyside qt4 test tk wxwidgets"
27
28 # #456704 -- a lot of py2-only deps
29 PY2_USEDEP=$(python_gen_usedep 'python2*')
30 PY32_USEDEP=$(python_gen_usedep python3_2)
31 PY3_USEDEP=$(python_gen_usedep python{3_2,3_3})
32 COMMON_DEPEND="
33 dev-python/numpy[${PYTHON_USEDEP}]
34 dev-python/python-dateutil:0[${PYTHON_USEDEP}]
35 dev-python/pytz[${PYTHON_USEDEP}]
36 dev-python/six[${PYTHON_USEDEP}]
37 media-fonts/stix-fonts
38 media-libs/freetype:2
39 media-libs/libpng:0
40 gtk? ( dev-python/pygtk[${PY2_USEDEP}] )
41 wxwidgets? ( >=dev-python/wxpython-2.8[${PY2_USEDEP}] )"
42
43 # internal copy of pycxx highly patched
44 # dev-python/pycxx
45
46 DEPEND="${COMMON_DEPEND}
47 virtual/pkgconfig
48 doc? (
49 app-text/dvipng
50 virtual/python-imaging[${PYTHON_USEDEP}]
51 dev-python/ipython[${PYTHON_USEDEP}]
52 dev-python/numpydoc[${PY2_USEDEP}]
53 dev-python/xlwt[${PY2_USEDEP}]
54 dev-python/sphinx[${PYTHON_USEDEP}]
55 dev-texlive/texlive-latexextra
56 dev-texlive/texlive-fontsrecommended
57 dev-texlive/texlive-latexrecommended
58 media-gfx/graphviz[cairo]
59 )
60 test? ( dev-python/nose[${PYTHON_USEDEP}] )"
61
62 RDEPEND="${COMMON_DEPEND}
63 dev-python/pyparsing[${PYTHON_USEDEP}]
64 cairo? ( dev-python/pycairo[${PYTHON_USEDEP}] )
65 excel? ( dev-python/xlwt[${PY2_USEDEP}] )
66 fltk? ( dev-python/pyfltk[${PY2_USEDEP}] )
67 gtk3? (
68 dev-python/pygobject:3[${PYTHON_USEDEP}]
69 x11-libs/gtk+:3[introspection] )
70 latex? (
71 virtual/latex-base
72 app-text/ghostscript-gpl
73 app-text/dvipng
74 app-text/poppler[utils]
75 dev-texlive/texlive-fontsrecommended
76 dev-texlive/texlive-latexextra
77 dev-texlive/texlive-xetex
78 )
79 pyside? ( dev-python/pyside[X,${PYTHON_USEDEP}] )
80 qt4? ( dev-python/PyQt4[X,${PYTHON_USEDEP}] )"
81
82 PY2_FLAGS="|| ( $(python_gen_useflags python2*) )"
83 PY32_FLAGS="|| ( $(python_gen_useflags python3_2) )"
84 REQUIRED_USE="
85 doc? ( ${PY2_FLAGS} )
86 excel? ( ${PY2_FLAGS} )
87 fltk? ( ${PY2_FLAGS} )
88 gtk? ( ${PY2_FLAGS} )
89 wxwidgets? ( ${PY2_FLAGS} )
90 test? (
91 cairo fltk latex pyside qt4 tk wxwidgets
92 || ( gtk gtk3 )
93 )"
94
95 RESTRICT="mirror"
96
97 # A few C++ source files are written to srcdir.
98 # Other than that, the ebuild shall be fit for out-of-source build.
99 DISTUTILS_IN_SOURCE_BUILD=1
100
101 use_setup() {
102 local uword="${2:-${1}}"
103 if use ${1}; then
104 echo "${uword} = True"
105 echo "${uword}agg = True"
106 else
107 echo "${uword} = False"
108 echo "${uword}agg = False"
109 fi
110 }
111
112 python_prepare_all() {
113 # Generates test failures, but fedora does it
114 # local PATCHES=(
115 # "${FILESDIR}"/${P}-unbundle-pycxx.patch
116 # "${FILESDIR}"/${P}-unbundle-agg.patch
117 # )
118 # rm -r agg24 CXX || die
119 # rm -r agg24 || die
120
121 sed \
122 -e 's/matplotlib.pyparsing_py[23]/pyparsing/g' \
123 -i lib/matplotlib/{mathtext,fontconfig_pattern}.py \
124 || die "sed pyparsing failed"
125
126 # suggested by upstream
127 sed \
128 -e '/tol/s:32:35:g' \
129 -i lib/matplotlib/tests/test_mathtext.py || die
130
131 if use gtk || use gtk3; then
132 export XDG_RUNTIME_DIR="${T}/runtime-dir"
133 mkdir "${XDG_RUNTIME_DIR}" || die
134 chmod 0700 "${XDG_RUNTIME_DIR}" || die
135 fi
136
137 distutils-r1_python_prepare_all
138 }
139
140 python_configure_all() {
141 append-flags -fno-strict-aliasing
142 }
143
144 python_configure() {
145 mkdir -p "${BUILD_DIR}" || die
146
147 # create setup.cfg (see setup.cfg.template for any changes).
148
149 # common switches.
150 cat > "${BUILD_DIR}"/setup.cfg <<-EOF
151 [directories]
152 basedirlist = ${EPREFIX}/usr
153 [provide_packages]
154 pytz = False
155 dateutil = False
156 [gui_support]
157 agg = True
158 $(use_setup cairo)
159 $(use_setup pyside)
160 $(use_setup qt4)
161 $(use_setup tk)
162 EOF
163
164 if use gtk3 && use cairo; then
165 echo "gtk3cairo = True" >> "${BUILD_DIR}"/setup.cfg || die
166 else
167 echo "gtk3cairo = False" >> "${BUILD_DIR}"/setup.cfg || die
168 fi
169
170 if $(python_is_python3); then
171 cat >> "${BUILD_DIR}"/setup.cfg <<-EOF
172 six = True
173 fltk = False
174 fltkagg = False
175 gtk = False
176 gtkagg = False
177 wx = False
178 wxagg = False
179 EOF
180 else
181 cat >> "${BUILD_DIR}"/setup.cfg <<-EOF
182 six = False
183 $(use_setup fltk)
184 $(use_setup gtk)
185 $(use_setup gtk3)
186 $(use_setup wxwidgets wx)
187 EOF
188 fi
189 }
190
191 wrap_setup() {
192 local MPLSETUPCFG=${BUILD_DIR}/setup.cfg
193 export MPLSETUPCFG
194
195 # Note: remove build... if switching to out-of-source build
196 "${@}" build --build-lib="${BUILD_DIR}"/build/lib
197 }
198
199 python_compile() {
200 VIRTUALX_COMMAND="wrap_setup distutils-r1_python_compile"
201 virtualmake
202 }
203
204 python_compile_all() {
205 if use doc; then
206 cd doc || die
207
208 # necessary for in-source build
209 local -x PYTHONPATH="${BUILD_DIR}"/build/lib:${PYTHONPATH}
210
211 unset DISPLAY # bug #278524
212 VARTEXFONTS="${T}"/fonts \
213 "${PYTHON}" ./make.py --small html || die
214 fi
215 }
216
217 python_test() {
218 wrap_setup distutils_install_for_testing
219
220 cd "${TMPDIR}" || die
221 VIRTUALX_COMMAND="${PYTHON}"
222 virtualmake -c "import sys, matplotlib as m; sys.exit(0 if m.test(verbosity=2) else 1)" || \
223 die "Tests fail with ${EPYTHON}"
224 }
225
226 python_install() {
227 wrap_setup distutils-r1_python_install
228 }
229
230 python_install_all() {
231 use doc && local HTML_DOCS=( doc/build/html/. )
232
233 distutils-r1_python_install_all
234
235 if use examples; then
236 dodoc -r examples
237 docompress -x /usr/share/doc/${PF}/examples
238 fi
239 }

  ViewVC Help
Powered by ViewVC 1.1.20