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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Aug 21 16:34:58 2008 UTC (5 years, 10 months ago) by bicatali
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Version bump
(Portage version: 2.2_rc8/cvs/Linux 2.6.23-gentoo-r9 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.91.3.ebuild,v 1.1 2008/06/23 15:16:00 bicatali Exp $
4
5 NEED_PYTHON=2.3
6
7 inherit eutils distutils
8
9 DOC_PV=0.91.2svn
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 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
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 )"
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 fltk? ( dev-python/pyfltk )
37 qt3? ( dev-python/PyQt )
38 qt4? ( dev-python/PyQt4 )"
39
40 DOCS="INTERACTIVE API_CHANGES"
41
42 pkg_setup() {
43 use tk && distutils_python_tkinter
44 }
45
46 use_setup() {
47 local uword="${2}"
48 [ -z "${2}" ] && uword="${1}"
49 if use ${1}; then
50 echo "${uword} = True"
51 echo "${uword}agg = True"
52 else
53 echo "${uword} = False"
54 echo "${uword}agg = False"
55 fi
56 }
57
58 src_unpack() {
59 unpack ${A}
60 cd "${S}"
61 # create setup.cfg (see setup.cfg.template for any changes)
62 cat > setup.cfg <<-EOF
63 [provide_packages]
64 pytz = False
65 dateutil = False
66 configobj = False
67 enthought.traits = False
68 [gui_support]
69 $(use_setup gtk)
70 $(use_setup tk)
71 $(use_setup wxwindows wx)
72 $(use_setup qt3 qt)
73 $(use_setup qt4)
74 $(use_setup fltk)
75 $(use_setup cairo)
76 EOF
77
78 # sed to avoid checks needing a X display
79 sed -i \
80 -e "s/check_for_gtk()/$(use gtk && echo True || echo False)/" \
81 -e "s/check_for_tk()/$(use tk && echo True || echo False)/" \
82 setup.py || die "sed setup.py failed"
83
84 # respect FHS: put mpl-data in /usr/share/matplotlib
85 # and config files in /etc/matplotlib
86 sed -i \
87 -e "/'mpl-data\/matplotlibrc',/d" \
88 -e "/'mpl-data\/matplotlib.conf',/d" \
89 -e "s:'lib/matplotlib/mpl-data/matplotlibrc':'matplotlibrc':" \
90 -e "s:'lib/matplotlib/mpl-data/matplotlib.conf':'matplotlib.conf':" \
91 setup.py \
92 || die "sed setup.py for FHS failed"
93
94 sed -i \
95 -e "s:path = get_data_path():path = '/etc/matplotlib':" \
96 -e "s:os.path.dirname(__file__):'/usr/share/${PN}':g" \
97 lib/matplotlib/{__init__,config/cutils}.py \
98 || die "sed init for FHS failed"
99
100 # remove vera fonts (they are now a dependency)
101 cd lib/matplotlib/mpl-data
102 rm -f ttf/Vera*.ttf ttf/*.TXT ttf/local.conf pdfcorefonts/readme.txt
103 }
104
105 src_install() {
106 distutils_src_install
107
108 # respect FHS
109 dodir /usr/share/${PN}
110 mv "${D}"/usr/*/*/site-packages/${PN}/{mpl-data,backends/Matplotlib.nib} \
111 "${D}"/usr/share/${PN} || die "failed renaming"
112
113 insinto /etc/matplotlib
114 doins matplotlibrc matplotlib.conf \
115 || die "installing config files failed"
116
117 insinto /usr/share/doc/${PF}
118 use doc && newins "${DISTDIR}"/users_guide_${DOC_PV}.pdf \
119 ${P}-users-guide.pdf
120 use examples && doins -r examples
121 }

  ViewVC Help
Powered by ViewVC 1.1.20