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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Thu Jul 23 02:59:38 2009 UTC (5 years ago) by bicatali
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +1 -1 lines
FILE REMOVED
unset the DISPLAY, bug #278524, thanks to Pinky
(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.ebuild,v 1.5 2009/03/30 15:32:32 loki_val 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/"
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 tk wxwindows"
17 SLOT="0"
18 KEYWORDS="~amd64 ~ppc ~x86"
19 LICENSE="PYTHON BSD stix bakoma"
20
21 DEPEND=">=dev-python/numpy-1.1
22 >=media-libs/freetype-2
23 media-libs/libpng
24 dev-python/pytz
25 dev-python/python-dateutil
26 gtk? ( dev-python/pygtk )
27 tk? ( dev-lang/python[tk] )
28 wxwindows? ( dev-python/wxpython:2.8 )"
29
30 RDEPEND="${DEPEND}
31 latex? ( virtual/latex-base
32 virtual/ghostscript
33 app-text/dvipng
34 virtual/poppler-utils )
35 cairo? ( dev-python/pycairo )
36 excel? ( dev-python/xlwt )
37 fltk? ( dev-python/pyfltk )
38 qt3? ( dev-python/PyQt )
39 qt4? ( dev-python/PyQt4 )"
40
41 DOCS="INTERACTIVE"
42
43 use_setup() {
44 local uword="${2}"
45 [ -z "${2}" ] && uword="${1}"
46 if use ${1}; then
47 echo "${uword} = True"
48 echo "${uword}agg = True"
49 else
50 echo "${uword} = False"
51 echo "${uword}agg = False"
52 fi
53 }
54
55 src_prepare() {
56 # create setup.cfg (see setup.cfg.template for any changes)
57 cat > setup.cfg <<-EOF
58 [provide_packages]
59 pytz = False
60 dateutil = False
61 configobj = False
62 enthought.traits = False
63 [gui_support]
64 $(use_setup gtk)
65 $(use_setup tk)
66 $(use_setup wxwindows wx)
67 $(use_setup qt3 qt)
68 $(use_setup qt4)
69 $(use_setup fltk)
70 $(use_setup cairo)
71 EOF
72
73 # sed to avoid checks needing a X display
74 sed -i \
75 -e "s/check_for_gtk()/$(use gtk && echo True || echo False)/" \
76 -e "s/check_for_tk()/$(use tk && echo True || echo False)/" \
77 setup.py || die "sed setup.py failed"
78
79 # respect FHS: put mpl-data in /usr/share/matplotlib
80 # and config files in /etc/matplotlib
81 sed -i \
82 -e "/'mpl-data\/matplotlibrc',/d" \
83 -e "/'mpl-data\/matplotlib.conf',/d" \
84 -e "s:'lib/matplotlib/mpl-data/matplotlibrc':'matplotlibrc':" \
85 -e "s:'lib/matplotlib/mpl-data/matplotlib.conf':'matplotlib.conf':" \
86 setup.py \
87 || die "sed setup.py for FHS failed"
88
89 sed -i \
90 -e "s:path = get_data_path():path = '/etc/matplotlib':" \
91 -e "s:os.path.dirname(__file__):'/usr/share/${PN}':g" \
92 lib/matplotlib/{__init__,config/cutils}.py \
93 || die "sed init for FHS failed"
94 }
95
96 src_install() {
97 distutils_src_install
98
99 # respect FHS
100 dodir /usr/share/${PN}
101 mv "${D}"/usr/*/*/site-packages/${PN}/{mpl-data,backends/Matplotlib.nib} \
102 "${D}"/usr/share/${PN} || die "failed renaming"
103
104 insinto /etc/matplotlib
105 doins matplotlibrc matplotlib.conf \
106 || die "installing config files failed"
107
108 insinto /usr/share/doc/${PF}
109 if use doc; then
110 doins "${DISTDIR}"/${PDOC}.pdf || die
111 fi
112 if use examples; then
113 doins -r examples || die
114 fi
115 }

  ViewVC Help
Powered by ViewVC 1.1.20