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

Contents of /dev-python/matplotlib/matplotlib-0.91.4.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, 5 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.91.4.ebuild,v 1.4 2009/03/30 15:32:32 loki_val Exp $
4
5 NEED_PYTHON=2.3
6 WX_GTK_VER=2.8
7 EAPI=2
8 inherit eutils distutils wxwidgets
9
10 DOC_PV=0.91.2svn
11
12 DESCRIPTION="Pure python plotting library with matlab like syntax"
13 HOMEPAGE="http://matplotlib.sourceforge.net/"
14 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz
15 doc? ( http://matplotlib.sourceforge.net/users_guide_${DOC_PV}.pdf )"
16
17 IUSE="cairo doc examples fltk gtk latex qt3 qt4 tk wxwindows"
18 SLOT="0"
19 KEYWORDS="~amd64 ~ppc ~x86"
20 LICENSE="PYTHON BSD stix bakoma"
21
22 DEPEND="dev-python/numpy
23 >=media-libs/freetype-2
24 media-libs/libpng
25 dev-python/pytz
26 dev-python/python-dateutil
27 gtk? ( dev-python/pygtk )
28 tk? ( dev-lang/python[tk] )
29 wxwindows? ( dev-python/wxpython:2.8 )"
30
31 RDEPEND="${DEPEND}
32 || ( media-fonts/ttf-bitstream-vera media-fonts/dejavu )
33 latex? ( virtual/latex-base
34 virtual/ghostscript
35 app-text/dvipng
36 virtual/poppler-utils )
37 cairo? ( dev-python/pycairo )
38 fltk? ( dev-python/pyfltk )
39 qt3? ( dev-python/PyQt )
40 qt4? ( dev-python/PyQt4 )"
41
42 DOCS="INTERACTIVE API_CHANGES"
43
44 use_setup() {
45 local uword="${2}"
46 [ -z "${2}" ] && uword="${1}"
47 if use ${1}; then
48 echo "${uword} = True"
49 echo "${uword}agg = True"
50 else
51 echo "${uword} = False"
52 echo "${uword}agg = False"
53 fi
54 }
55
56 src_prepare() {
57 # create setup.cfg (see setup.cfg.template for any changes)
58 cat > setup.cfg <<-EOF
59 [provide_packages]
60 pytz = False
61 dateutil = False
62 configobj = False
63 enthought.traits = False
64 [gui_support]
65 $(use_setup gtk)
66 $(use_setup tk)
67 $(use_setup wxwindows wx)
68 $(use_setup qt3 qt)
69 $(use_setup qt4)
70 $(use_setup fltk)
71 $(use_setup cairo)
72 EOF
73
74 # sed to avoid checks needing a X display
75 sed -i \
76 -e "s/check_for_gtk()/$(use gtk && echo True || echo False)/" \
77 -e "s/check_for_tk()/$(use tk && echo True || echo False)/" \
78 setup.py || die "sed setup.py failed"
79
80 # respect FHS: put mpl-data in /usr/share/matplotlib
81 # and config files in /etc/matplotlib
82 sed -i \
83 -e "/'mpl-data\/matplotlibrc',/d" \
84 -e "/'mpl-data\/matplotlib.conf',/d" \
85 -e "s:'lib/matplotlib/mpl-data/matplotlibrc':'matplotlibrc':" \
86 -e "s:'lib/matplotlib/mpl-data/matplotlib.conf':'matplotlib.conf':" \
87 setup.py \
88 || die "sed setup.py for FHS failed"
89
90 sed -i \
91 -e "s:path = get_data_path():path = '/etc/matplotlib':" \
92 -e "s:os.path.dirname(__file__):'/usr/share/${PN}':g" \
93 lib/matplotlib/{__init__,config/cutils}.py \
94 || die "sed init for FHS failed"
95
96 # remove vera fonts (they are now a dependency)
97 cd lib/matplotlib/mpl-data
98 rm -f ttf/Vera*.ttf ttf/*.TXT ttf/local.conf pdfcorefonts/readme.txt
99 }
100
101 src_install() {
102 distutils_src_install
103
104 # respect FHS
105 dodir /usr/share/${PN}
106 mv "${D}"/usr/*/*/site-packages/${PN}/{mpl-data,backends/Matplotlib.nib} \
107 "${D}"/usr/share/${PN} || die "failed renaming"
108
109 insinto /etc/matplotlib
110 doins matplotlibrc matplotlib.conf \
111 || die "installing config files failed"
112
113 insinto /usr/share/doc/${PF}
114 use doc && newins "${DISTDIR}"/users_guide_${DOC_PV}.pdf \
115 ${P}-users-guide.pdf
116 use examples && doins -r examples
117 }

  ViewVC Help
Powered by ViewVC 1.1.20