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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri Dec 19 15:47:55 2008 UTC (5 years, 9 months ago) by bicatali
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Version bump
(Portage version: 2.2_rc17/cvs/Linux 2.6.25-gentoo-r7 x86_64)

1 # Copyright 1999-2008 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.4.ebuild,v 1.1 2008/12/11 19:28:24 bicatali 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 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 || ( media-fonts/ttf-bitstream-vera media-fonts/dejavu )
32 latex? ( virtual/latex-base
33 virtual/ghostscript
34 app-text/dvipng
35 app-text/poppler )
36 cairo? ( dev-python/pycairo )
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 # remove vera fonts (they are now a dependency)
96 cd lib/matplotlib/mpl-data
97 rm -f ttf/Vera*.ttf ttf/*.TXT ttf/local.conf pdfcorefonts/readme.txt
98 }
99
100 src_install() {
101 distutils_src_install
102
103 # respect FHS
104 dodir /usr/share/${PN}
105 mv "${D}"/usr/*/*/site-packages/${PN}/{mpl-data,backends/Matplotlib.nib} \
106 "${D}"/usr/share/${PN} || die "failed renaming"
107
108 insinto /etc/matplotlib
109 doins matplotlibrc matplotlib.conf \
110 || die "installing config files failed"
111
112 insinto /usr/share/doc/${PF}
113 if use doc; then
114 doins "${DISTDIR}"/${PDOC}.pdf || die
115 fi
116 if use examples; then
117 doins -r examples || die
118 fi
119 }

  ViewVC Help
Powered by ViewVC 1.1.20