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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Wed Feb 18 14:40:19 2009 UTC (5 years, 7 months ago) by bicatali
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
dev-python/f2py removal (now included in numpy)

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-r1.ebuild,v 1.2 2009/01/21 09:32:07 bicatali 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 doc? ( http://matplotlib.sourceforge.net/Matplotlib.pdf -> ${PDOC}.pdf )"
15
16 IUSE="cairo doc excel examples fltk gtk latex qt3 qt4 traits tk wxwindows"
17 SLOT="0"
18 KEYWORDS="~amd64 ~x86"
19 LICENSE="PYTHON BSD"
20
21 CDEPEND=">=dev-python/numpy-1.1
22 dev-python/python-dateutil
23 dev-python/pytz
24 media-libs/freetype:2
25 media-libs/libpng
26 gtk? ( dev-python/pygtk )
27 tk? ( dev-lang/python[tk] )
28 wxwindows? ( dev-python/wxpython:2.8 )"
29
30 DEPEND="${CDEPEND}
31 dev-python/pycxx
32 dev-util/pkgconfig"
33
34 RDEPEND="${CDEPEND}
35 dev-python/pyparsing
36 || ( media-fonts/dejavu media-fonts/ttf-bitstream-vera )
37 cairo? ( dev-python/pycairo )
38 excel? ( dev-python/xlwt )
39 fltk? ( dev-python/pyfltk )
40 qt3? ( dev-python/PyQt )
41 qt4? ( dev-python/PyQt4 )
42 traits? ( dev-python/traits dev-python/configobj )
43 latex? (
44 virtual/latex-base
45 virtual/ghostscript
46 app-text/dvipng
47 app-text/poppler
48 media-fonts/stix-fonts
49 || ( dev-texlive/texlive-fontsrecommended
50 app-text/tetex
51 app-text/ptex ) )"
52
53 DOCS="INTERACTIVE"
54
55 use_setup() {
56 local uword="${2}"
57 [ -z "${2}" ] && uword="${1}"
58 if use ${1}; then
59 echo "${uword} = True"
60 echo "${uword}agg = True"
61 else
62 echo "${uword} = False"
63 echo "${uword}agg = False"
64 fi
65 }
66
67 src_prepare() {
68 # create setup.cfg (see setup.cfg.template for any changes)
69 cat > setup.cfg <<-EOF
70 [provide_packages]
71 pytz = False
72 dateutil = False
73 configobj = False
74 enthought.traits = False
75 [gui_support]
76 $(use_setup gtk)
77 $(use_setup tk)
78 $(use_setup wxwindows wx)
79 $(use_setup qt3 qt)
80 $(use_setup qt4)
81 $(use_setup fltk)
82 $(use_setup cairo)
83 EOF
84
85 # avoid checks needing a X display
86 sed -i \
87 -e "s/check_for_gtk()/$(use gtk && echo True || echo False)/" \
88 -e "s/check_for_tk()/$(use tk && echo True || echo False)/" \
89 setup.py || die "sed setup.py failed"
90
91 # respect FHS:
92 # - mpl-data in /usr/share/matplotlib
93 # - config files in /etc/matplotlib
94 sed -i \
95 -e "/'mpl-data\/matplotlibrc',/d" \
96 -e "/'mpl-data\/matplotlib.conf',/d" \
97 -e "s:'lib/matplotlib/mpl-data/matplotlibrc':'matplotlibrc':" \
98 -e "s:'lib/matplotlib/mpl-data/matplotlib.conf':'matplotlib.conf':" \
99 setup.py \
100 || die "sed setup.py for FHS failed"
101
102 sed -i \
103 -e "s:path = get_data_path():path = '/etc/matplotlib':" \
104 -e "s:os.path.dirname(__file__):'/usr/share/${PN}':g" \
105 lib/matplotlib/{__init__,config/cutils}.py \
106 || die "sed init for FHS failed"
107
108 # remove internal copies of fonts, pycxx, pyparsing
109 rm -rf \
110 CXX \
111 lib/matplotlib/mpl-data/fonts \
112 lib/matplotlib/pyparsing.py \
113 || die "removed internal copies failed"
114 ln -s /usr/share/python*/CXX . || die
115 sed -i \
116 -e 's/matplotlib.pyparsing/pyparsing/g' \
117 lib/matplotlib/*.py || die "sed for pyparsing failed"
118 }
119
120 src_install() {
121 distutils_src_install
122
123 # respect FHS
124 dodir /usr/share/${PN}
125 mv "${D}"/usr/*/*/site-packages/${PN}/{mpl-data,backends/Matplotlib.nib} \
126 "${D}"/usr/share/${PN} || die "failed renaming"
127 insinto /etc/matplotlib
128 doins matplotlibrc matplotlib.conf \
129 || die "installing config files failed"
130
131 # doc and examples
132 insinto /usr/share/doc/${PF}
133 if use doc; then
134 doins "${DISTDIR}"/${PDOC}.pdf || die
135 fi
136 if use examples; then
137 doins -r examples || die
138 fi
139 }

  ViewVC Help
Powered by ViewVC 1.1.20