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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Tue Sep 28 21:50:52 2010 UTC (3 years, 11 months ago) by arfrever
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Delete older ebuilds.

(Portage version: 2.2_rc88_p32/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.3.ebuild,v 1.2 2010/06/07 16:44:27 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 flag-o-matic
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 # allow better small docs (from upstream svn)
83 epatch "${FILESDIR}"/${PN}-0.99.1.1-docs.patch
84 # allow compatibility with pygtk-2.12 tooltop (from upstream svn)
85 epatch "${FILESDIR}"/${PN}-0.99.1.1-gtk-tooltip.patch
86 # some font stuff (from upstream svn)
87 epatch "${FILESDIR}"/${PN}-0.99.1.1-eintr.patch
88 # avoid slow piwik (bug #323005)
89 epatch "${FILESDIR}"/${PN}-0.99.3-nopiwik.patch
90
91 # create setup.cfg (see setup.cfg.template for any changes)
92 cat > setup.cfg <<-EOF
93 [provide_packages]
94 pytz = False
95 dateutil = False
96 configobj = False
97 enthought.traits = False
98 [gui_support]
99 $(use_setup gtk)
100 $(use_setup tk)
101 $(use_setup wxwidgets wx)
102 $(use_setup qt4)
103 $(use_setup fltk)
104 $(use_setup cairo)
105 EOF
106
107 # avoid checks needing a X display
108 sed -i \
109 -e "s/check_for_gtk()/$(use gtk && echo True || echo False)/" \
110 -e "s/check_for_tk()/$(use tk && echo True || echo False)/" \
111 setup.py || die "sed setup.py failed"
112
113 # respect FHS:
114 # - mpl-data in /usr/share/matplotlib
115 # - config files in /etc/matplotlib
116 sed -i \
117 -e "/'mpl-data\/matplotlibrc',/d" \
118 -e "/'mpl-data\/matplotlib.conf',/d" \
119 -e "s:'lib/matplotlib/mpl-data/matplotlibrc':'matplotlibrc':" \
120 -e "s:'lib/matplotlib/mpl-data/matplotlib.conf':'matplotlib.conf':" \
121 setup.py \
122 || die "sed setup.py for FHS failed"
123
124 # remove internal copies of fonts, pycxx, pyparsing
125 rm -rf \
126 CXX \
127 lib/matplotlib/mpl-data/fonts/{afm,pdfcorefonts} \
128 lib/matplotlib/mpl-data/fonts/ttf/{Vera*,cm*,*.TXT} \
129 lib/matplotlib/pyparsing.py \
130 || die "removed internal copies failed"
131
132 sed -i \
133 -e 's/matplotlib.pyparsing/pyparsing/g' \
134 lib/matplotlib/{mathtext,fontconfig_pattern}.py \
135 || die "sed pyparsing failed"
136 }
137
138 src_compile() {
139 unset DISPLAY # bug #278524
140 append-flags -DNDEBUG # bug #322347
141 distutils_src_compile_pre_hook() {
142 ln -fs "${EPREFIX}/usr/share/python$(python_get_version)/CXX" .
143 }
144 distutils_src_compile
145
146 if use doc; then
147 cd "${S}/doc"
148 export VARTEXFONTS="${T}"/fonts
149 MATPLOTLIBDATA="${S}/lib/matplotlib/mpl-data" \
150 PYTHONPATH=$(ls -d "${S}"/build-$(PYTHON -f --ABI)/lib*) \
151 "$(PYTHON -f)" make.py --small all
152 [[ -e build/latex/Matplotlib.pdf ]] || die "doc generation failed"
153 fi
154 }
155
156 src_test() {
157 # if doc were enabled, all examples were built and tested
158 use doc && return
159 einfo "Tests are quite long, be patient"
160 cd "${S}/examples/tests"
161 testing() {
162 PYTHONPATH=$(ls -d "${S}"/build-${PYTHON_ABI}/lib*) "$(PYTHON)" backend_driver.py agg || return 1
163 PYTHONPATH=$(ls -d "${S}"/build-${PYTHON_ABI}/lib*) "$(PYTHON)" backend_driver.py --clean
164 }
165 python_execute_function testing
166 }
167
168 src_install() {
169 # sed only after doc building, to allow using default configs
170 sed -i \
171 -e "s:path = get_data_path():path = '${EPREFIX}/etc/matplotlib':" \
172 -e "s:os.path.dirname(__file__):'${EPREFIX}/usr/share/${PN}':g" \
173 build-*/lib*/matplotlib/__init__.py \
174 || die "sed init for FHS failed"
175 [[ -z ${ED} ]] && local ED="${D}"
176 distutils_src_install
177
178 # Respect FHS
179 dodir /usr/share/${PN}
180 mv "${ED}$(python_get_sitedir -f)/${PN}/"{mpl-data,backends/Matplotlib.nib} "${ED}usr/share/${PN}" || die "Renaming failed"
181 rm -fr "${ED}"usr/lib*/python*/site-packages/${PN}/{mpl-data,backends/Matplotlib.nib}
182
183 insinto /etc/matplotlib
184 doins matplotlibrc matplotlib.conf || die "installing config files failed"
185
186 # doc and examples
187 insinto /usr/share/doc/${PF}
188 if use doc; then
189 doins doc/build/latex/Matplotlib.pdf || die
190 doins -r doc/build/html || die
191 fi
192 if use examples; then
193 doins -r examples || die
194 fi
195 }

  ViewVC Help
Powered by ViewVC 1.1.20