blob: 3fd8296f08ab3dbaad12cb40a18e0fc0fb436020 [file] [log] [blame]
Mike Frysinger2503e2e2011-11-08 15:39:00 -05001# 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/pygtk/pygtk-2.14.1-r1.ebuild,v 1.8 2009/09/06 20:57:05 ranger Exp $
4
5EAPI="2"
6
7inherit alternatives autotools eutils flag-o-matic gnome.org python virtualx
8
9DESCRIPTION="GTK+2 bindings for Python"
10HOMEPAGE="http://www.pygtk.org/"
11
12LICENSE="LGPL-2.1"
13SLOT="2"
14KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sh sparc x86 ~x86-fbsd"
15IUSE="doc examples"
16
17RDEPEND=">=dev-libs/glib-2.8.0
18 >=x11-libs/pango-1.16.0
19 >=dev-libs/atk-1.12.0
20 >=x11-libs/gtk+-2.13.6
21 >=gnome-base/libglade-2.5.0
22 >=dev-lang/python-2.4.4-r5
23 >=dev-python/pycairo-1.0.2
24 >=dev-python/pygobject-2.15.3
25 dev-python/numpy"
26
27DEPEND="${RDEPEND}
28 doc? (
29 dev-libs/libxslt
30 >=app-text/docbook-xsl-stylesheets-1.70.1 )
31 >=dev-util/pkgconfig-0.9"
32
33src_prepare() {
34 # Fix declaration of codegen in .pc
35 epatch "${FILESDIR}/${PN}-2.13.0-fix-codegen-location.patch"
36
37 # Fix test failurs due to ltihooks
38 # gentoo bug #268315, upstream bug #565593
39 epatch "${FILESDIR}/${P}-ltihooks.patch"
40
41 # Switch to numpy, bug #185692
42 epatch "${FILESDIR}/${P}-numpy.patch"
43 epatch "${FILESDIR}/${P}-fix-numpy-warning.patch"
44
45 # Fix bug with GtkToggleButton and gtk+-2.16, bug #275449
46 epatch "${FILESDIR}/${P}-gtktoggle.patch"
47
48 # disable pyc compiling
49 mv "${S}"/py-compile "${S}"/py-compile.orig
50 ln -s $(type -P true) "${S}"/py-compile
51
52 AT_M4DIR="m4" eautoreconf
53}
54
55src_configure() {
56 use hppa && append-flags -ffunction-sections
57 econf $(use_enable doc docs) --enable-thread
58}
59
60src_install() {
61 emake DESTDIR="${D}" install || die "emake install failed"
62 dodoc AUTHORS ChangeLog INSTALL MAPPING NEWS README THREADS TODO
63
64 if use examples; then
65 rm examples/Makefile*
66 insinto /usr/share/doc/${PF}
67 doins -r examples
68 fi
69}
70
71src_test() {
72 unset DBUS_SESSION_BUS_ADDRESS
73 cd tests
74 Xemake check-local || die "tests failed"
75}
76
77pkg_postinst() {
78 python_version
79 python_need_rebuild
80 python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/gtk-2.0
81}
82
83pkg_postrm() {
84 python_version
85 python_mod_cleanup /usr/$(get_libdir)/python*/site-packages/gtk-2.0
86 rm -f "${ROOT}"/usr/$(get_libdir)/python${PYVER}/site-packages/pygtk.{py,pth}
87 alternatives_auto_makesym /usr/$(get_libdir)/python${PYVER}/site-packages/pygtk.py pygtk.py-[0-9].[0-9]
88 alternatives_auto_makesym /usr/$(get_libdir)/python${PYVER}/site-packages/pygtk.pth pygtk.pth-[0-9].[0-9]
89}