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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Sun Nov 8 20:23:26 2009 UTC (4 years, 11 months ago) by arfrever
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
Delete older ebuilds.

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

  ViewVC Help
Powered by ViewVC 1.1.20