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

Contents of /dev-python/matplotlib/matplotlib-0.98.5.2-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Mon Jun 15 05:32:10 2009 UTC (4 years, 10 months ago) by bicatali
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
Version bumps with fixes for bug #266612 and bug #272147
(Portage version: 2.2_rc33/cvs/Linux x86_64)

1 # Copyright 1999-2009 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.98.5.2-r3.ebuild,v 1.6 2009/05/30 09:07:05 ulm Exp $
4
5 WX_GTK_VER=2.8
6 EAPI=2
7 inherit distutils wxwidgets
8
9 PDOC="users_guide_${PV}"
10
11 DESCRIPTION="Pure python plotting library with matlab like syntax"
12 HOMEPAGE="http://matplotlib.sourceforge.net/"
13 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
14
15 IUSE="cairo doc excel examples fltk gtk latex qt3 qt4 traits tk wxwindows"
16 SLOT="0"
17 KEYWORDS="~amd64 ~x86"
18 LICENSE="PYTHON BSD"
19
20 CDEPEND=">=dev-python/numpy-1.1
21 dev-python/python-dateutil
22 dev-python/pytz
23 media-libs/freetype:2
24 media-libs/libpng
25 gtk? ( dev-python/pygtk )
26 tk? ( dev-lang/python[tk] )
27 wxwindows? ( dev-python/wxpython:2.8 )"
28
29 DEPEND="${CDEPEND}
30 dev-python/pycxx
31 dev-util/pkgconfig
32 doc? (
33 >=dev-python/sphinx-0.5.1
34 media-gfx/graphviz[cairo,png]
35 || ( ( dev-texlive/texlive-latexextra
36 dev-texlive/texlive-latexrecommended )
37 ( app-text/ptex dev-tex/latex-unicode ) )
38 app-text/dvipng
39 dev-python/ipython )"
40
41 RDEPEND="${CDEPEND}
42 || ( media-fonts/dejavu media-fonts/ttf-bitstream-vera )
43 media-fonts/texcm-ttf
44 cairo? ( dev-python/pycairo )
45 excel? ( dev-python/xlwt )
46 fltk? ( dev-python/pyfltk )
47 qt3? ( dev-python/PyQt )
48 qt4? ( dev-python/PyQt4 )
49 traits? ( dev-python/traits dev-python/configobj )
50 latex? (
51 virtual/latex-base
52 virtual/ghostscript
53 app-text/dvipng
54 virtual/poppler-utils
55 || ( dev-texlive/texlive-fontsrecommended
56 app-text/ptex ) )"
57
58 DOCS="INTERACTIVE"
59
60 use_setup() {
61 local uword="${2}"
62 [ -z "${2}" ] && uword="${1}"
63 if use ${1}; then
64 echo "${uword} = True"
65 echo "${uword}agg = True"
66 else
67 echo "${uword} = False"
68 echo "${uword}agg = False"
69 fi
70 }
71
72 src_prepare() {
73 # patch from mandriva
74 epatch "${FILESDIR}"/${P}-literal.patch
75 # avoid to launch xv while building examples docs
76 epatch "${FILESDIR}"/${P}-no-xv.patch
77
78 # create setup.cfg (see setup.cfg.template for any changes)
79 cat > setup.cfg <<-EOF
80 [provide_packages]
81 pytz = False
82 dateutil = False
83 configobj = False
84 enthought.traits = False
85 [gui_support]
86 $(use_setup gtk)
87 $(use_setup tk)
88 $(use_setup wxwindows wx)
89 $(use_setup qt3 qt)
90 $(use_setup qt4)
91 $(use_setup fltk)
92 $(use_setup cairo)
93 EOF
94
95 # avoid checks needing a X display
96 sed -i \
97 -e "s/check_for_gtk()/$(use gtk && echo True || echo False)/" \
98 -e "s/check_for_tk()/$(use tk && echo True || echo False)/" \
99 setup.py || die "sed setup.py failed"
100
101 # respect FHS:
102 # - mpl-data in /usr/share/matplotlib
103 # - config files in /etc/matplotlib
104 sed -i \
105 -e "/'mpl-data\/matplotlibrc',/d" \
106 -e "/'mpl-data\/matplotlib.conf',/d" \
107 -e "s:'lib/matplotlib/mpl-data/matplotlibrc':'matplotlibrc':" \
108 -e "s:'lib/matplotlib/mpl-data/matplotlib.conf':'matplotlib.conf':" \
109 setup.py \
110 || die "sed setup.py for FHS failed"
111
112 sed -i \
113 -e "s:path = get_data_path():path = '/etc/matplotlib':" \
114 -e "s:os.path.dirname(__file__):'/usr/share/${PN}':g" \
115 lib/matplotlib/{__init__,config/cutils}.py \
116 || die "sed init for FHS failed"
117
118 # remove internal copies of fonts, pycxx, pyparsing
119 rm -rf \
120 CXX \
121 lib/matplotlib/mpl-data/fonts/{afm,pdfcorefonts} \
122 lib/matplotlib/mpl-data/fonts/ttf/{Vera*,cm*,*.TXT} \
123 || die "removed internal copies failed"
124 ln -s /usr/share/python*/CXX . || die
125
126 # remove pyparsing only when upstream pyparsing included matplotlib
127 # fixes. See bug #260025
128 #rm -f lib/matplotlib/pyparsing.py
129 }
130
131 src_compile() {
132 distutils_src_compile
133 if use doc; then
134 cd "${S}/doc"
135 export VARTEXFONTS="${T}"/fonts
136 # no die function here: broken compilation at the end, do it twice,
137 # result ok.
138 MATPLOTLIBDATA="${S}/lib/matplotlib/mpl-data" \
139 PYTHONPATH=$(dir -d "${S}"/build/lib*) \
140 ${python} make.py html
141 MATPLOTLIBDATA="${S}/lib/matplotlib/mpl-data" \
142 PYTHONPATH=$(dir -d "${S}"/build/lib*) \
143 ${python} make.py
144 fi
145 }
146
147 src_test() {
148 einfo "Tests are quite long, be patient"
149 cd "${S}/examples/tests"
150 PYTHONPATH=$(dir -d "${S}"/build/lib*) ${python} backend_driver.py agg \
151 || die "tests failed"
152 PYTHONPATH=$(dir -d "${S}"/build/lib*) ${python} backend_driver.py \
153 --clean
154 }
155
156 src_install() {
157 distutils_src_install
158
159 # respect FHS
160 dodir /usr/share/${PN}
161 mv "${D}"/usr/*/*/site-packages/${PN}/{mpl-data,backends/Matplotlib.nib} \
162 "${D}"/usr/share/${PN} || die "failed renaming"
163 insinto /etc/matplotlib
164 doins matplotlibrc matplotlib.conf \
165 || die "installing config files failed"
166
167 # doc and examples
168 insinto /usr/share/doc/${PF}
169 if use doc; then
170 doins doc/build/latex/Matplotlib.pdf || die
171 doins -r doc/build/html || die
172 fi
173 if use examples; then
174 doins -r examples || die
175 fi
176 }

  ViewVC Help
Powered by ViewVC 1.1.20