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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Jun 3 19:12:10 2010 UTC (4 years, 1 month ago) by bicatali
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Version bump. Also forced -DNDEBUG to fix doc generation (bug #322347)
(Portage version: 2.2_rc67/cvs/Linux x86_64)

1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-python/matplotlib/matplotlib-0.99.1.1-r2.ebuild,v 1.1 2010/05/31 20:23:16 bicatali Exp $
4
5 EAPI="2"
6 PYTHON_DEPEND="2"
7 SUPPORT_PYTHON_ABIS="1"
8 WX_GTK_VER="2.8"
9
10 inherit eutils distutils wxwidgets
11
12 PDOC="users_guide_${PV}"
13
14 DESCRIPTION="Pure python plotting library with matlab like syntax"
15 HOMEPAGE="http://matplotlib.sourceforge.net/ http://pypi.python.org/pypi/matplotlib"
16 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
17
18 IUSE="cairo doc excel examples fltk gtk latex qt4 traits tk wxwidgets"
19 SLOT="0"
20 KEYWORDS="~amd64 ~ppc ~x86 ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
21 LICENSE="PYTHON BSD"
22
23 CDEPEND="dev-python/numpy
24 dev-python/python-dateutil
25 dev-python/pytz
26 media-libs/freetype:2
27 media-libs/libpng
28 gtk? ( dev-python/pygtk )
29 tk? ( dev-lang/python[tk] )
30 wxwidgets? ( dev-python/wxpython:2.8 )"
31
32 DEPEND="${CDEPEND}
33 dev-python/pycxx
34 dev-util/pkgconfig
35 doc? (
36 dev-python/sphinx
37 media-gfx/graphviz[cairo]
38 || ( ( dev-texlive/texlive-latexextra
39 dev-texlive/texlive-fontsrecommended
40 dev-texlive/texlive-latexrecommended )
41 ( app-text/ptex dev-tex/latex-unicode ) )
42 app-text/dvipng
43 dev-python/imaging
44 dev-python/ipython
45 excel? ( dev-python/xlwt ) )"
46
47 RDEPEND="${CDEPEND}
48 virtual/ttf-fonts
49 media-fonts/texcm-ttf
50 dev-python/pyparsing
51 cairo? ( dev-python/pycairo )
52 excel? ( dev-python/xlwt )
53 fltk? ( dev-python/pyfltk )
54 qt4? ( dev-python/PyQt4[X] )
55 traits? ( dev-python/traits dev-python/configobj )
56 latex? (
57 virtual/latex-base
58 app-text/ghostscript-gpl
59 app-text/dvipng
60 app-text/poppler[utils]
61 || ( dev-texlive/texlive-fontsrecommended
62 app-text/ptex ) )"
63 RESTRICT_PYTHON_ABIS="3.*"
64
65 DOCS="INTERACTIVE"
66
67 use_setup() {
68 local uword="${2}"
69 [ -z "${2}" ] && uword="${1}"
70 if use ${1}; then
71 echo "${uword} = True"
72 echo "${uword}agg = True"
73 else
74 echo "${uword} = False"
75 echo "${uword}agg = False"
76 fi
77 }
78
79 src_prepare() {
80 # avoid to launch xv while building examples docs
81 epatch "${FILESDIR}"/${PN}-0.98.5.2-no-xv.patch
82
83 # removes hardcoded lib paths, should not break non-Prefix, more
84 # likely to fix it in case of multilib
85 epatch "${FILESDIR}"/${P}-prefix.patch
86 epatch "${FILESDIR}"/${PN}-0.99.0-freebsd7+.patch
87
88 # support libpng-1.4 (from upstream svn)
89 epatch "${FILESDIR}"/${P}-libpng14.patch
90 # allow better small docs (from upstream svn)
91 epatch "${FILESDIR}"/${P}-docs.patch
92 # allow compatibility with pygtk-2.12 tooltop (from upstream svn)
93 epatch "${FILESDIR}"/${P}-gtk-tooltip.patch
94 # some font stuff (from upstream svn)
95 epatch "${FILESDIR}"/${P}-eintr.patch
96
97 # create setup.cfg (see setup.cfg.template for any changes)
98 cat > setup.cfg <<-EOF
99 [provide_packages]
100 pytz = False
101 dateutil = False
102 configobj = False
103 enthought.traits = False
104 [gui_support]
105 $(use_setup gtk)
106 $(use_setup tk)
107 $(use_setup wxwidgets wx)
108 $(use_setup qt4)
109 $(use_setup fltk)
110 $(use_setup cairo)
111 EOF
112
113 # avoid checks needing a X display
114 sed -i \
115 -e "s/check_for_gtk()/$(use gtk && echo True || echo False)/" \
116 -e "s/check_for_tk()/$(use tk && echo True || echo False)/" \
117 setup.py || die "sed setup.py failed"
118
119 # respect FHS:
120 # - mpl-data in /usr/share/matplotlib
121 # - config files in /etc/matplotlib
122 sed -i \
123 -e "/'mpl-data\/matplotlibrc',/d" \
124 -e "/'mpl-data\/matplotlib.conf',/d" \
125 -e "s:'lib/matplotlib/mpl-data/matplotlibrc':'matplotlibrc':" \
126 -e "s:'lib/matplotlib/mpl-data/matplotlib.conf':'matplotlib.conf':" \
127 setup.py \
128 || die "sed setup.py for FHS failed"
129
130 # remove internal copies of fonts, pycxx, pyparsing
131 rm -rf \
132 CXX \
133 lib/matplotlib/mpl-data/fonts/{afm,pdfcorefonts} \
134 lib/matplotlib/mpl-data/fonts/ttf/{Vera*,cm*,*.TXT} \
135 lib/matplotlib/pyparsing.py \
136 || die "removed internal copies failed"
137
138 sed -i \
139 -e 's/matplotlib.pyparsing/pyparsing/g' \
140 lib/matplotlib/{mathtext,fontconfig_pattern}.py \
141 || die "sed pyparsing failed"
142 }
143
144 src_compile() {
145 unset DISPLAY # bug #278524
146
147 distutils_src_compile_pre_hook() {
148 ln -fs "${EPREFIX}/usr/share/python$(python_get_version)/CXX" .
149 }
150 distutils_src_compile
151
152 if use doc; then
153 cd "${S}/doc"
154 export VARTEXFONTS="${T}"/fonts
155 MATPLOTLIBDATA="${S}/lib/matplotlib/mpl-data" \
156 PYTHONPATH=$(ls -d "${S}"/build-$(PYTHON -f --ABI)/lib*) \
157 "$(PYTHON -f)" make.py --small all
158 MATPLOTLIBDATA="${S}/lib/matplotlib/mpl-data" \
159 PYTHONPATH=$(ls -d "${S}"/build-$(PYTHON -f --ABI)/lib*) \
160 "$(PYTHON -f)" make.py --small all
161 [[ -e build/latex/Matplotlib.pdf ]] && die "doc generation failed"
162 fi
163 }
164
165 src_test() {
166 # if doc were enabled, all examples were built and tested
167 use doc && return
168 einfo "Tests are quite long, be patient"
169 cd "${S}/examples/tests"
170 testing() {
171 PYTHONPATH=$(ls -d "${S}"/build-${PYTHON_ABI}/lib*) "$(PYTHON)" backend_driver.py agg || return 1
172 PYTHONPATH=$(ls -d "${S}"/build-${PYTHON_ABI}/lib*) "$(PYTHON)" backend_driver.py --clean
173 }
174 python_execute_function testing
175 }
176
177 src_install() {
178 # sed only after doc building, to allow using default configs
179 sed -i \
180 -e "s:path = get_data_path():path = '${EPREFIX}/etc/matplotlib':" \
181 -e "s:os.path.dirname(__file__):'${EPREFIX}/usr/share/${PN}':g" \
182 build-*/lib*/matplotlib/__init__.py \
183 || die "sed init for FHS failed"
184 [[ -z ${ED} ]] && local ED="${D}"
185 distutils_src_install
186
187 # Respect FHS
188 dodir /usr/share/${PN}
189 mv "${ED}$(python_get_sitedir -f)/${PN}/"{mpl-data,backends/Matplotlib.nib} "${ED}usr/share/${PN}" || die "Renaming failed"
190 rm -fr "${ED}"usr/lib*/python*/site-packages/${PN}/{mpl-data,backends/Matplotlib.nib}
191
192 insinto /etc/matplotlib
193 doins matplotlibrc matplotlib.conf || die "installing config files failed"
194
195 # doc and examples
196 insinto /usr/share/doc/${PF}
197 if use doc; then
198 doins doc/build/latex/Matplotlib.pdf || die
199 doins -r doc/build/html || die
200 fi
201 if use examples; then
202 doins -r examples || die
203 fi
204 }

  ViewVC Help
Powered by ViewVC 1.1.20