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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri Oct 10 08:44:05 2008 UTC (5 years, 11 months ago) by bicatali
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Forced wxpython:2.8, see bug #229599
(Portage version: 2.2_rc11/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.1.ebuild,v 1.1 2008/06/26 11:26:00 bicatali Exp $
4
5 inherit eutils distutils
6
7 DOC_PV=${PV}
8
9 DESCRIPTION="Pure python plotting library with matlab like syntax"
10 HOMEPAGE="http://matplotlib.sourceforge.net/"
11 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz
12 doc? ( http://matplotlib.sourceforge.net/users_guide_${DOC_PV}.pdf )"
13
14 IUSE="cairo doc examples fltk gtk latex qt3 qt4 tk wxwindows"
15 SLOT="0"
16 KEYWORDS="~amd64 ~ppc ~x86"
17 LICENSE="PYTHON BSD stix bakoma"
18
19 DEPEND=">=dev-python/numpy-1.1
20 >=media-libs/freetype-2
21 media-libs/libpng
22 dev-python/pytz
23 dev-python/python-dateutil
24 gtk? ( dev-python/pygtk )
25 wxwindows? ( dev-python/wxpython )"
26
27 RDEPEND="${DEPEND}
28 || ( media-fonts/ttf-bitstream-vera media-fonts/dejavu )
29 latex? ( virtual/latex-base
30 virtual/ghostscript
31 app-text/dvipng
32 app-text/poppler )
33 cairo? ( dev-python/pycairo )
34 fltk? ( dev-python/pyfltk )
35 qt3? ( dev-python/PyQt )
36 qt4? ( dev-python/PyQt4 )"
37
38 DOCS="INTERACTIVE API_CHANGES"
39
40 pkg_setup() {
41 use tk && distutils_python_tkinter
42 }
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_unpack() {
57 unpack ${A}
58 cd "${S}"
59 # create setup.cfg (see setup.cfg.template for any changes)
60 cat > setup.cfg <<-EOF
61 [provide_packages]
62 pytz = False
63 dateutil = False
64 configobj = False
65 enthought.traits = False
66 [gui_support]
67 $(use_setup gtk)
68 $(use_setup tk)
69 $(use_setup wxwindows wx)
70 $(use_setup qt3 qt)
71 $(use_setup qt4)
72 $(use_setup fltk)
73 $(use_setup cairo)
74 EOF
75
76 # sed to avoid checks needing a X display
77 sed -i \
78 -e "s/check_for_gtk()/$(use gtk && echo True || echo False)/" \
79 -e "s/check_for_tk()/$(use tk && echo True || echo False)/" \
80 setup.py || die "sed setup.py failed"
81
82 # respect FHS: put mpl-data in /usr/share/matplotlib
83 # and config files in /etc/matplotlib
84 sed -i \
85 -e "/'mpl-data\/matplotlibrc',/d" \
86 -e "/'mpl-data\/matplotlib.conf',/d" \
87 -e "s:'lib/matplotlib/mpl-data/matplotlibrc':'matplotlibrc':" \
88 -e "s:'lib/matplotlib/mpl-data/matplotlib.conf':'matplotlib.conf':" \
89 setup.py \
90 || die "sed setup.py for FHS failed"
91
92 sed -i \
93 -e "s:path = get_data_path():path = '/etc/matplotlib':" \
94 -e "s:os.path.dirname(__file__):'/usr/share/${PN}':g" \
95 lib/matplotlib/{__init__,config/cutils}.py \
96 || die "sed init for FHS failed"
97
98 # remove vera fonts (they are now a dependency)
99 cd lib/matplotlib/mpl-data
100 rm -f ttf/Vera*.ttf ttf/*.TXT ttf/local.conf pdfcorefonts/readme.txt
101 }
102
103 src_install() {
104 distutils_src_install
105
106 # respect FHS
107 dodir /usr/share/${PN}
108 mv "${D}"/usr/*/*/site-packages/${PN}/{mpl-data,backends/Matplotlib.nib} \
109 "${D}"/usr/share/${PN} || die "failed renaming"
110
111 insinto /etc/matplotlib
112 doins matplotlibrc matplotlib.conf \
113 || die "installing config files failed"
114
115 insinto /usr/share/doc/${PF}
116 use doc && newins "${DISTDIR}"/users_guide_${DOC_PV}.pdf \
117 ${P}-users-guide.pdf
118 use examples && doins -r examples
119 }

  ViewVC Help
Powered by ViewVC 1.1.20