Gentoo Archives: gentoo-commits

From: "Sebastien Fabbro (bicatali)" <bicatali@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-python/matplotlib: ChangeLog matplotlib-0.98.5.2-r3.ebuild
Date: Wed, 25 Feb 2009 20:33:43
Message-Id: E1LcQRp-000323-Ea@stork.gentoo.org
1 bicatali 09/02/25 20:33:41
2
3 Modified: ChangeLog
4 Added: matplotlib-0.98.5.2-r3.ebuild
5 Log:
6 Re-added pyparsing (hopefully temporarily) for proper outputs and stix-fonts for ttf, but added media-fonts/texcm-ttf. More information on bundled packages, see bug #260025, thanks Michael Droettboom for explanations. Also now builds documentation from source (html and pdf), and added a src_test for regression. Finally added a small patch on string literal from Mandriva.
7 (Portage version: 2.2_rc23/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.59 dev-python/matplotlib/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-python/matplotlib/ChangeLog?rev=1.59&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-python/matplotlib/ChangeLog?rev=1.59&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-python/matplotlib/ChangeLog?r1=1.58&r2=1.59
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/dev-python/matplotlib/ChangeLog,v
19 retrieving revision 1.58
20 retrieving revision 1.59
21 diff -u -r1.58 -r1.59
22 --- ChangeLog 25 Jan 2009 16:01:56 -0000 1.58
23 +++ ChangeLog 25 Feb 2009 20:33:41 -0000 1.59
24 @@ -1,6 +1,17 @@
25 # ChangeLog for dev-python/matplotlib
26 # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/dev-python/matplotlib/ChangeLog,v 1.58 2009/01/25 16:01:56 patrick Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/dev-python/matplotlib/ChangeLog,v 1.59 2009/02/25 20:33:41 bicatali Exp $
29 +
30 +*matplotlib-0.98.5.2-r3 (25 Feb 2009)
31 +
32 + 25 Feb 2009; Sébastien Fabbro <bicatali@g.o>
33 + +files/matplotlib-0.98.5.2-literal.patch, +matplotlib-0.98.5.2-r3.ebuild:
34 + Re-added pyparsing (hopefully temporarily) for proper outputs and
35 + stix-fonts for ttf, but added media-fonts/texcm-ttf. More information on
36 + bundled packages, see bug #260025, thanks Michael Droettboom for
37 + explanations. Also now builds documentation from source (html and pdf),
38 + and added a src_test for regression. Finally added a small patch on string
39 + literal from Mandriva.
40
41 *matplotlib-0.98.5.2-r2 (25 Jan 2009)
42
43
44
45
46 1.1 dev-python/matplotlib/matplotlib-0.98.5.2-r3.ebuild
47
48 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-python/matplotlib/matplotlib-0.98.5.2-r3.ebuild?rev=1.1&view=markup
49 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-python/matplotlib/matplotlib-0.98.5.2-r3.ebuild?rev=1.1&content-type=text/plain
50
51 Index: matplotlib-0.98.5.2-r3.ebuild
52 ===================================================================
53 # Copyright 1999-2009 Gentoo Foundation
54 # Distributed under the terms of the GNU General Public License v2
55 # $Header: /var/cvsroot/gentoo-x86/dev-python/matplotlib/matplotlib-0.98.5.2-r3.ebuild,v 1.1 2009/02/25 20:33:41 bicatali Exp $
56
57 WX_GTK_VER=2.8
58 EAPI=2
59 inherit distutils wxwidgets
60
61 PDOC="users_guide_${PV}"
62
63 DESCRIPTION="Pure python plotting library with matlab like syntax"
64 HOMEPAGE="http://matplotlib.sourceforge.net/"
65 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
66
67 IUSE="cairo doc excel examples fltk gtk latex qt3 qt4 traits tk wxwindows"
68 SLOT="0"
69 KEYWORDS="~amd64 ~x86"
70 LICENSE="PYTHON BSD"
71
72 CDEPEND=">=dev-python/numpy-1.1
73 dev-python/python-dateutil
74 dev-python/pytz
75 media-libs/freetype:2
76 media-libs/libpng
77 gtk? ( dev-python/pygtk )
78 tk? ( dev-lang/python[tk] )
79 wxwindows? ( dev-python/wxpython:2.8 )"
80
81 DEPEND="${CDEPEND}
82 dev-python/pycxx
83 dev-util/pkgconfig
84 doc? ( >=dev-python/sphinx-0.5.1
85 app-text/dvipng
86 dev-python/ipython )"
87
88 RDEPEND="${CDEPEND}
89 || ( media-fonts/dejavu media-fonts/ttf-bitstream-vera )
90 media-fonts/texcm-ttf
91 cairo? ( dev-python/pycairo )
92 excel? ( dev-python/xlwt )
93 fltk? ( dev-python/pyfltk )
94 qt3? ( dev-python/PyQt )
95 qt4? ( dev-python/PyQt4 )
96 traits? ( dev-python/traits dev-python/configobj )
97 latex? (
98 virtual/latex-base
99 virtual/ghostscript
100 app-text/dvipng
101 app-text/poppler
102 || ( dev-texlive/texlive-fontsrecommended
103 app-text/tetex
104 app-text/ptex ) )"
105
106 DOCS="INTERACTIVE"
107
108 use_setup() {
109 local uword="${2}"
110 [ -z "${2}" ] && uword="${1}"
111 if use ${1}; then
112 echo "${uword} = True"
113 echo "${uword}agg = True"
114 else
115 echo "${uword} = False"
116 echo "${uword}agg = False"
117 fi
118 }
119
120 src_prepare() {
121 # patch from mandriva
122 epatch "${FILESDIR}"/${P}-literal.patch
123
124 # create setup.cfg (see setup.cfg.template for any changes)
125 cat > setup.cfg <<-EOF
126 [provide_packages]
127 pytz = False
128 dateutil = False
129 configobj = False
130 enthought.traits = False
131 [gui_support]
132 $(use_setup gtk)
133 $(use_setup tk)
134 $(use_setup wxwindows wx)
135 $(use_setup qt3 qt)
136 $(use_setup qt4)
137 $(use_setup fltk)
138 $(use_setup cairo)
139 EOF
140
141 # avoid checks needing a X display
142 sed -i \
143 -e "s/check_for_gtk()/$(use gtk && echo True || echo False)/" \
144 -e "s/check_for_tk()/$(use tk && echo True || echo False)/" \
145 setup.py || die "sed setup.py failed"
146
147 # respect FHS:
148 # - mpl-data in /usr/share/matplotlib
149 # - config files in /etc/matplotlib
150 sed -i \
151 -e "/'mpl-data\/matplotlibrc',/d" \
152 -e "/'mpl-data\/matplotlib.conf',/d" \
153 -e "s:'lib/matplotlib/mpl-data/matplotlibrc':'matplotlibrc':" \
154 -e "s:'lib/matplotlib/mpl-data/matplotlib.conf':'matplotlib.conf':" \
155 setup.py \
156 || die "sed setup.py for FHS failed"
157
158 sed -i \
159 -e "s:path = get_data_path():path = '/etc/matplotlib':" \
160 -e "s:os.path.dirname(__file__):'/usr/share/${PN}':g" \
161 lib/matplotlib/{__init__,config/cutils}.py \
162 || die "sed init for FHS failed"
163
164 # remove internal copies of fonts, pycxx, pyparsing
165 rm -rf \
166 CXX \
167 lib/matplotlib/mpl-data/fonts/{afm,pdfcorefonts} \
168 lib/matplotlib/mpl-data/fonts/ttf/{Vera*,cm*,*.TXT} \
169 || die "removed internal copies failed"
170 ln -s /usr/share/python*/CXX . || die
171
172 # remove pyparsing only when upstream pyparsing included matplotlib
173 # fixes. See bug #260025
174 #rm -f lib/matplotlib/pyparsing.py
175 }
176
177 src_compile() {
178 distutils_src_compile
179 if use doc; then
180 cd "${S}/doc"
181 # no die function here: broken compilation at the end, do it twice,
182 # result ok.
183 MATPLOTLIBDATA="${S}/lib/matplotlib/mpl-data" \
184 PYTHONPATH=$(dir -d "${S}"/build/lib*) \
185 ${python} make.py html
186 MATPLOTLIBDATA="${S}/lib/matplotlib/mpl-data" \
187 PYTHONPATH=$(dir -d "${S}"/build/lib*) \
188 ${python} make.py
189 fi
190 }
191
192 src_test() {
193 einfo "Tests are quite long, be patient"
194 cd "${S}/examples/tests"
195 PYTHONPATH=$(dir -d "${S}"/build/lib*) ${python} backend_driver.py agg \
196 || die "tests failed"
197 PYTHONPATH=$(dir -d "${S}"/build/lib*) ${python} backend_driver.py \
198 --clean
199 }
200
201 src_install() {
202 distutils_src_install
203
204 # respect FHS
205 dodir /usr/share/${PN}
206 mv "${D}"/usr/*/*/site-packages/${PN}/{mpl-data,backends/Matplotlib.nib} \
207 "${D}"/usr/share/${PN} || die "failed renaming"
208 insinto /etc/matplotlib
209 doins matplotlibrc matplotlib.conf \
210 || die "installing config files failed"
211
212 # doc and examples
213 insinto /usr/share/doc/${PF}
214 if use doc; then
215 doins doc/build/latex/Matplotlib.pdf || die
216 doins -r doc/build/html || die
217 fi
218 if use examples; then
219 doins -r examples || die
220 fi
221 }