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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Thu Sep 12 22:29:33 2013 UTC (9 months, 4 weeks ago) by mgorny
Branch: MAIN
Changes since 1.5: +2 -2 lines
Replace virtual/pyparsing dep with dev-python/pyparsing. The split versions were removed and all in-tree versions support all impls now.

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

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.2.1.ebuild,v 1.5 2013/09/05 18:46:20 mgorny Exp $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python{2_6,2_7,3_2,3_3} )
8 PYTHON_REQ_USE='tk?'
9
10 inherit distutils-r1 eutils flag-o-matic
11
12 DESCRIPTION="Pure python plotting library with matlab like syntax"
13 HOMEPAGE="http://matplotlib.org/"
14 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
15
16 IUSE="cairo doc excel examples fltk gtk gtk3 latex qt4 test tk wxwidgets"
17 SLOT="0"
18 KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
19
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
26 # #456704 -- a lot of py2-only deps
27 PY2_USEDEP=$(python_gen_usedep 'python2*')
28 PY32_USEDEP=$(python_gen_usedep python{3_2,3_3})
29 COMMON_DEPEND="
30 dev-python/numpy[${PYTHON_USEDEP}]
31 dev-python/python-dateutil[${PYTHON_USEDEP}]
32 dev-python/pytz[${PYTHON_USEDEP}]
33 dev-python/six[${PYTHON_USEDEP}]
34 media-fonts/stix-fonts
35 media-libs/freetype:2
36 media-libs/libpng
37 gtk? ( dev-python/pygtk[${PY2_USEDEP}] )
38 wxwidgets? ( dev-python/wxpython:2.8[${PY2_USEDEP}] )"
39
40 # internal copy of pycxx highly patched
41 # dev-python/pycxx
42
43 DEPEND="${COMMON_DEPEND}
44 virtual/pkgconfig
45 doc? (
46 app-text/dvipng
47 virtual/python-imaging[${PY2_USEDEP},${PY32_USEDEP}]
48 dev-python/ipython
49 dev-python/xlwt[${PY2_USEDEP}]
50 dev-python/sphinx[${PYTHON_USEDEP}]
51 dev-texlive/texlive-latexextra
52 dev-texlive/texlive-fontsrecommended
53 dev-texlive/texlive-latexrecommended
54 media-gfx/graphviz[cairo]
55 )
56 test? ( dev-python/nose[${PYTHON_USEDEP}] )"
57
58 RDEPEND="${COMMON_DEPEND}
59 dev-python/pyparsing[${PYTHON_USEDEP}]
60 cairo? ( dev-python/pycairo[${PYTHON_USEDEP}] )
61 excel? ( dev-python/xlwt[${PY2_USEDEP}] )
62 fltk? ( dev-python/pyfltk[${PY2_USEDEP}] )
63 gtk3? ( dev-python/pygobject:3[${PYTHON_USEDEP}]
64 x11-libs/gtk+:3[introspection] )
65 latex? (
66 virtual/latex-base
67 app-text/ghostscript-gpl
68 app-text/dvipng
69 app-text/poppler[utils]
70 dev-texlive/texlive-fontsrecommended
71 )
72 qt4? ( || ( dev-python/PyQt4[X,${PYTHON_USEDEP}] dev-python/pyside[X,${PYTHON_USEDEP}] ) )"
73
74 PY2_FLAGS="|| ( $(python_gen_useflags python2*) )"
75 REQUIRED_USE="doc? ( ${PY2_FLAGS} )
76 excel? ( ${PY2_FLAGS} )
77 fltk? ( ${PY2_FLAGS} )
78 gtk? ( ${PY2_FLAGS} )
79 wxwidgets? ( ${PY2_FLAGS} )"
80
81 RESTRICT="mirror"
82
83 # A few C++ source files are written to srcdir.
84 # Other than that, the ebuild shall be fit for out-of-source build.
85 DISTUTILS_IN_SOURCE_BUILD=1
86
87 use_setup() {
88 local uword="${2:-${1}}"
89 if use ${1}; then
90 echo "${uword} = True"
91 echo "${uword}agg = True"
92 else
93 echo "${uword} = False"
94 echo "${uword}agg = False"
95 fi
96 }
97
98 python_prepare_all() {
99 # remove internal copies of pyparsing
100 rm lib/matplotlib/pyparsing{_py2,_py3}.py || die
101
102 sed -i -e 's/matplotlib.pyparsing_py[23]/pyparsing/g' \
103 lib/matplotlib/{mathtext,fontconfig_pattern}.py \
104 || die "sed pyparsing failed"
105
106 local PATCHES=(
107 # avoid checks needing a X display
108 "${FILESDIR}"/${PN}-1.2.0-setup.patch
109 )
110
111 distutils-r1_python_prepare_all
112 }
113
114 python_configure_all() {
115 append-flags -fno-strict-aliasing
116 }
117
118 python_configure() {
119 mkdir -p "${BUILD_DIR}" || die
120
121 # create setup.cfg (see setup.cfg.template for any changes).
122
123 # common switches.
124 cat > "${BUILD_DIR}"/setup.cfg <<-EOF || die
125 [provide_packages]
126 pytz = False
127 dateutil = False
128 [gui_support]
129 $(use_setup cairo)
130 $(use_setup qt4)
131 $(use_setup tk)
132 EOF
133
134 if [[ ${EPYTHON} == python3* ]]; then
135 cat >> "${BUILD_DIR}"/setup.cfg <<-EOF || die
136 six = True
137 fltk = False
138 fltkagg = False
139 gtk = False
140 gtkagg = False
141 wx = False
142 wxagg = False
143 EOF
144 else
145 cat >> "${BUILD_DIR}"/setup.cfg <<-EOF || die
146 six = False
147 $(use_setup fltk)
148 $(use_setup gtk)
149 $(use_setup wxwidgets wx)
150 EOF
151 fi
152 }
153
154 wrap_setup() {
155 local MPLSETUPCFG=${BUILD_DIR}/setup.cfg
156 export MPLSETUPCFG
157
158 # Note: remove build... if switching to out-of-source build
159 "${@}" build --build-lib="${BUILD_DIR}"/build/lib
160 }
161
162 python_compile() {
163 wrap_setup distutils-r1_python_compile
164 }
165
166 python_compile_all() {
167 if use doc; then
168 cd doc || die
169
170 # necessary for in-source build
171 local -x PYTHONPATH="${BUILD_DIR}"/build/lib:${PYTHONPATH}
172
173 unset DISPLAY # bug #278524
174 VARTEXFONTS="${T}"/fonts \
175 "${PYTHON}" ./make.py --small html || die
176 fi
177 }
178
179 python_test() {
180 wrap_setup distutils_install_for_testing
181
182 cd "${TMPDIR}" || die
183 "${PYTHON}" -c "
184 import sys, matplotlib as m
185 sys.exit(0 if m.test(verbosity=2) else 1)
186 " || die "Tests fail with ${EPYTHON}"
187 }
188
189 python_install() {
190 wrap_setup distutils-r1_python_install
191 }
192
193 python_install_all() {
194 use doc && local HTML_DOCS=( doc/build/html/. )
195
196 distutils-r1_python_install_all
197
198 if use examples; then
199 dodoc -r examples
200 docompress -x /usr/share/doc/${PF}/examples
201 fi
202 }

  ViewVC Help
Powered by ViewVC 1.1.20