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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (show annotations) (download)
Sun May 30 20:18:45 2010 UTC (4 years, 1 month ago) by arfrever
Branch: MAIN
CVS Tags: HEAD
Changes since 1.13: +1 -1 lines
FILE REMOVED
Delete older ebuild.

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.ebuild,v 1.13 2010/03/26 17:19:45 spatz Exp $
4
5 WX_GTK_VER=2.8
6 EAPI=2
7 inherit eutils 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/ http://pypi.python.org/pypi/matplotlib"
13 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
14
15 IUSE="cairo doc excel examples fltk gtk latex qt4 traits tk wxwidgets"
16 SLOT="0"
17 KEYWORDS="amd64 ppc x86 ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
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/imaging
43 dev-python/ipython )"
44
45 RDEPEND="${CDEPEND}
46 virtual/ttf-fonts
47 media-fonts/texcm-ttf
48 cairo? ( dev-python/pycairo )
49 excel? ( dev-python/xlwt )
50 fltk? ( dev-python/pyfltk )
51 qt4? ( dev-python/PyQt4[X] )
52 traits? ( dev-python/traits dev-python/configobj )
53 latex? (
54 virtual/latex-base
55 app-text/ghostscript-gpl
56 app-text/dvipng
57 >=app-text/poppler-0.12.3-r3[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 # avoid to launch xv while building examples docs
77 epatch "${FILESDIR}"/${PN}-0.98.5.2-no-xv.patch
78
79 # removes hardcoded lib paths, should not break non-Prefix, more
80 # likely to fix it in case of multilib
81 epatch "${FILESDIR}"/${P}-prefix.patch
82 epatch "${FILESDIR}"/${PN}-0.99.0-freebsd7+.patch
83
84 # create setup.cfg (see setup.cfg.template for any changes)
85 cat > setup.cfg <<-EOF
86 [provide_packages]
87 pytz = False
88 dateutil = False
89 configobj = False
90 enthought.traits = False
91 [gui_support]
92 $(use_setup gtk)
93 $(use_setup tk)
94 $(use_setup wxwidgets wx)
95 $(use_setup qt4)
96 $(use_setup fltk)
97 $(use_setup cairo)
98 EOF
99
100 # avoid checks needing a X display
101 sed -i \
102 -e "s/check_for_gtk()/$(use gtk && echo True || echo False)/" \
103 -e "s/check_for_tk()/$(use tk && echo True || echo False)/" \
104 setup.py || die "sed setup.py failed"
105
106 # respect FHS:
107 # - mpl-data in /usr/share/matplotlib
108 # - config files in /etc/matplotlib
109 sed -i \
110 -e "/'mpl-data\/matplotlibrc',/d" \
111 -e "/'mpl-data\/matplotlib.conf',/d" \
112 -e "s:'lib/matplotlib/mpl-data/matplotlibrc':'matplotlibrc':" \
113 -e "s:'lib/matplotlib/mpl-data/matplotlib.conf':'matplotlib.conf':" \
114 setup.py \
115 || die "sed setup.py for FHS failed"
116
117 sed -i \
118 -e "s:path = get_data_path():path = '${EPREFIX}/etc/matplotlib':" \
119 -e "s:os.path.dirname(__file__):'${EPREFIX}/usr/share/${PN}':g" \
120 lib/matplotlib/{__init__,config/cutils}.py \
121 || die "sed init for FHS failed"
122
123 # remove internal copies of fonts, pycxx, pyparsing
124 rm -rf \
125 CXX \
126 lib/matplotlib/mpl-data/fonts/{afm,pdfcorefonts} \
127 lib/matplotlib/mpl-data/fonts/ttf/{Vera*,cm*,*.TXT} \
128 || die "removed internal copies failed"
129 python_version
130 ln -s "${EPREFIX}"/usr/share/python${PYVER}/CXX . || die
131
132 # remove pyparsing only when upstream pyparsing included matplotlib
133 # fixes. See bug #260025
134 #rm -f lib/matplotlib/pyparsing.py
135 }
136
137 src_compile() {
138 unset DISPLAY # bug #278524
139 distutils_src_compile
140 if use doc; then
141 cd "${S}/doc"
142 export VARTEXFONTS="${T}"/fonts
143 # no die function here: broken compilation at the end, do it twice,
144 # result ok.
145 MATPLOTLIBDATA="${S}/lib/matplotlib/mpl-data" \
146 PYTHONPATH=$(dir -d "${S}"/build/lib*) \
147 ${python} make.py html
148 MATPLOTLIBDATA="${S}/lib/matplotlib/mpl-data" \
149 PYTHONPATH=$(dir -d "${S}"/build/lib*) \
150 ${python} make.py
151 fi
152 }
153
154 src_test() {
155 einfo "Tests are quite long, be patient"
156 cd "${S}/examples/tests"
157 PYTHONPATH=$(dir -d "${S}"/build/lib*) ${python} backend_driver.py agg \
158 || die "tests failed"
159 PYTHONPATH=$(dir -d "${S}"/build/lib*) ${python} backend_driver.py \
160 --clean
161 }
162
163 src_install() {
164 [[ -z ${ED} ]] && local ED=${D}
165 distutils_src_install
166
167 # respect FHS
168 dodir /usr/share/${PN}
169 mv "${ED}"/usr/*/*/site-packages/${PN}/{mpl-data,backends/Matplotlib.nib} \
170 "${ED}"/usr/share/${PN} || die "failed renaming"
171 insinto /etc/matplotlib
172 doins matplotlibrc matplotlib.conf \
173 || die "installing config files failed"
174
175 # doc and examples
176 insinto /usr/share/doc/${PF}
177 if use doc; then
178 doins doc/build/latex/Matplotlib.pdf || die
179 doins -r doc/build/html || die
180 fi
181 if use examples; then
182 doins -r examples || die
183 fi
184 }

  ViewVC Help
Powered by ViewVC 1.1.20