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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Thu Jan 15 09:57:46 2009 UTC (5 years, 6 months ago) by bicatali
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
Reorganized dependencies. Added enthought traits support, removed bundled pyparsing, pycxx (bug #252947) and fonts. Temporary mirror restricting since upstream has changed source (bug #252578)
(Portage version: 2.2_rc20/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.3.ebuild,v 1.4 2009/01/03 04:44:19 mr_bones_ Exp $
4
5 WX_GTK_VER=2.8
6 EAPI=1
7 inherit eutils distutils wxwidgets
8
9 DOC_PV=${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/users_guide_${DOC_PV}.pdf )"
15
16 IUSE="cairo doc examples excel 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 wxwindows? ( dev-python/wxpython:2.8 )"
28
29 RDEPEND="${DEPEND}
30 || ( media-fonts/ttf-bitstream-vera media-fonts/dejavu )
31 latex? ( virtual/latex-base
32 virtual/ghostscript
33 app-text/dvipng
34 app-text/poppler )
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 API_CHANGES"
42
43 pkg_setup() {
44 use tk && distutils_python_tkinter
45 }
46
47 use_setup() {
48 local uword="${2}"
49 [ -z "${2}" ] && uword="${1}"
50 if use ${1}; then
51 echo "${uword} = True"
52 echo "${uword}agg = True"
53 else
54 echo "${uword} = False"
55 echo "${uword}agg = False"
56 fi
57 }
58
59 src_unpack() {
60 unpack ${A}
61 cd "${S}"
62 # create setup.cfg (see setup.cfg.template for any changes)
63 cat > setup.cfg <<-EOF
64 [provide_packages]
65 pytz = False
66 dateutil = False
67 configobj = False
68 enthought.traits = False
69 [gui_support]
70 $(use_setup gtk)
71 $(use_setup tk)
72 $(use_setup wxwindows wx)
73 $(use_setup qt3 qt)
74 $(use_setup qt4)
75 $(use_setup fltk)
76 $(use_setup cairo)
77 EOF
78
79 # sed to avoid checks needing a X display
80 sed -i \
81 -e "s/check_for_gtk()/$(use gtk && echo True || echo False)/" \
82 -e "s/check_for_tk()/$(use tk && echo True || echo False)/" \
83 setup.py || die "sed setup.py failed"
84
85 # respect FHS: put mpl-data in /usr/share/matplotlib
86 # and config files in /etc/matplotlib
87 sed -i \
88 -e "/'mpl-data\/matplotlibrc',/d" \
89 -e "/'mpl-data\/matplotlib.conf',/d" \
90 -e "s:'lib/matplotlib/mpl-data/matplotlibrc':'matplotlibrc':" \
91 -e "s:'lib/matplotlib/mpl-data/matplotlib.conf':'matplotlib.conf':" \
92 setup.py \
93 || die "sed setup.py for FHS failed"
94
95 sed -i \
96 -e "s:path = get_data_path():path = '/etc/matplotlib':" \
97 -e "s:os.path.dirname(__file__):'/usr/share/${PN}':g" \
98 lib/matplotlib/{__init__,config/cutils}.py \
99 || die "sed init for FHS failed"
100
101 # remove vera fonts (they are now a dependency)
102 cd lib/matplotlib/mpl-data
103 rm -f ttf/Vera*.ttf ttf/*.TXT ttf/local.conf pdfcorefonts/readme.txt
104 }
105
106 src_install() {
107 distutils_src_install
108
109 # respect FHS
110 dodir /usr/share/${PN}
111 mv "${D}"/usr/*/*/site-packages/${PN}/{mpl-data,backends/Matplotlib.nib} \
112 "${D}"/usr/share/${PN} || die "failed renaming"
113
114 insinto /etc/matplotlib
115 doins matplotlibrc matplotlib.conf \
116 || die "installing config files failed"
117
118 insinto /usr/share/doc/${PF}
119 use doc && newins "${DISTDIR}"/users_guide_${DOC_PV}.pdf \
120 ${P}-users-guide.pdf
121 use examples && doins -r examples
122 }

  ViewVC Help
Powered by ViewVC 1.1.20