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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Dec 26 19:01:54 2013 UTC (11 months ago) by jlec
Branch: MAIN
Changes since 1.1: +21 -11 lines
dev-python/matplotlib: Propagate changes into live ebuild

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

  ViewVC Help
Powered by ViewVC 1.1.20