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

Contents of /dev-python/matplotlib/matplotlib-1.2.0-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20