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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Sat Dec 7 19:18:30 2013 UTC (9 months, 2 weeks ago) by pacho
Branch: MAIN
Changes since 1.7: +2 -2 lines
x86 stable, bug #488738

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

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.0.ebuild,v 1.7 2013/11/29 22:48:02 pacho 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 ~mips ~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:0[${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:0
37 gtk? ( dev-python/pygtk[${PY2_USEDEP}] )
38 wxwidgets? ( dev-python/wxpython[${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/numpydoc[${PY2_USEDEP}]
50 dev-python/xlwt[${PY2_USEDEP}]
51 dev-python/sphinx[${PYTHON_USEDEP}]
52 dev-texlive/texlive-latexextra
53 dev-texlive/texlive-fontsrecommended
54 dev-texlive/texlive-latexrecommended
55 media-gfx/graphviz[cairo]
56 )
57 test? ( dev-python/nose[${PYTHON_USEDEP}] )"
58
59 RDEPEND="${COMMON_DEPEND}
60 dev-python/pyparsing[${PYTHON_USEDEP}]
61 cairo? ( dev-python/pycairo[${PYTHON_USEDEP}] )
62 excel? ( dev-python/xlwt[${PY2_USEDEP}] )
63 fltk? ( dev-python/pyfltk[${PY2_USEDEP}] )
64 gtk3? ( dev-python/pygobject:3[${PYTHON_USEDEP}]
65 x11-libs/gtk+:3[introspection] )
66 latex? (
67 virtual/latex-base
68 app-text/ghostscript-gpl
69 app-text/dvipng
70 app-text/poppler[utils]
71 dev-texlive/texlive-fontsrecommended
72 )
73 qt4? ( || ( dev-python/PyQt4[X,${PYTHON_USEDEP}] dev-python/pyside[X,${PYTHON_USEDEP}] ) )"
74
75 PY2_FLAGS="|| ( $(python_gen_useflags python2*) )"
76 REQUIRED_USE="doc? ( ${PY2_FLAGS} )
77 excel? ( ${PY2_FLAGS} )
78 fltk? ( ${PY2_FLAGS} )
79 gtk? ( ${PY2_FLAGS} )
80 wxwidgets? ( ${PY2_FLAGS} )"
81
82 RESTRICT="mirror"
83
84 # A few C++ source files are written to srcdir.
85 # Other than that, the ebuild shall be fit for out-of-source build.
86 DISTUTILS_IN_SOURCE_BUILD=1
87
88 use_setup() {
89 local uword="${2:-${1}}"
90 if use ${1}; then
91 echo "${uword} = True"
92 echo "${uword}agg = True"
93 else
94 echo "${uword} = False"
95 echo "${uword}agg = False"
96 fi
97 }
98
99 python_prepare_all() {
100 sed -i -e 's/matplotlib.pyparsing_py[23]/pyparsing/g' \
101 lib/matplotlib/{mathtext,fontconfig_pattern}.py \
102 || die "sed pyparsing failed"
103
104 local PATCHES=(
105 # avoid checks needing a X display
106 "${FILESDIR}"/${P}-setup_without_X11.patch
107 )
108
109 distutils-r1_python_prepare_all
110 }
111
112 python_configure_all() {
113 append-flags -fno-strict-aliasing
114 }
115
116 python_configure() {
117 mkdir -p "${BUILD_DIR}" || die
118
119 # create setup.cfg (see setup.cfg.template for any changes).
120
121 # common switches.
122 cat > "${BUILD_DIR}"/setup.cfg <<-EOF
123 [directories]
124 basedirlist = ${EPREFIX}/usr
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
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
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