blob: b7fda8bf0c7749ca3abac2c9e82b2942a45b660c [file] [log] [blame]
Mike Frysingerff205d22011-11-10 19:27:33 -05001# Copyright 1999-2011 Gentoo Foundation
Mike Frysinger2503e2e2011-11-08 15:39:00 -05002# 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
Mike Frysingerff205d22011-11-10 19:27:33 -05005EAPI="3"
6GCONF_DEBUG="no"
7PYTHON_DEPEND="2:2.6"
8SUPPORT_PYTHON_ABIS="1"
9# dev-python/pycairo does not support Python 2.4 / 2.5.
10RESTRICT_PYTHON_ABIS="2.4 2.5 3.* *-jython"
11PYTHON_EXPORT_PHASE_FUNCTIONS="1"
Mike Frysinger2503e2e2011-11-08 15:39:00 -050012
13inherit alternatives autotools eutils flag-o-matic gnome.org python virtualx
14
15DESCRIPTION="GTK+2 bindings for Python"
16HOMEPAGE="http://www.pygtk.org/"
17
18LICENSE="LGPL-2.1"
19SLOT="2"
20KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sh sparc x86 ~x86-fbsd"
21IUSE="doc examples"
22
Mike Frysingerff205d22011-11-10 19:27:33 -050023RDEPEND=">=dev-libs/glib-2.8:2
24 >=x11-libs/pango-1.16
25 >=dev-libs/atk-1.12
Mike Frysinger2503e2e2011-11-08 15:39:00 -050026 >=x11-libs/gtk+-2.13.6
Mike Frysinger2503e2e2011-11-08 15:39:00 -050027 >=dev-python/pycairo-1.0.2
28 >=dev-python/pygobject-2.15.3
Mike Frysingerff205d22011-11-10 19:27:33 -050029 dev-python/numpy
30 >=gnome-base/libglade-2.5:2.0
31"
Mike Frysinger2503e2e2011-11-08 15:39:00 -050032DEPEND="${RDEPEND}
33 doc? (
34 dev-libs/libxslt
35 >=app-text/docbook-xsl-stylesheets-1.70.1 )
36 >=dev-util/pkgconfig-0.9"
37
38src_prepare() {
39 # Fix declaration of codegen in .pc
40 epatch "${FILESDIR}/${PN}-2.13.0-fix-codegen-location.patch"
41
42 # Fix test failurs due to ltihooks
43 # gentoo bug #268315, upstream bug #565593
44 epatch "${FILESDIR}/${P}-ltihooks.patch"
45
46 # Switch to numpy, bug #185692
47 epatch "${FILESDIR}/${P}-numpy.patch"
48 epatch "${FILESDIR}/${P}-fix-numpy-warning.patch"
49
50 # Fix bug with GtkToggleButton and gtk+-2.16, bug #275449
51 epatch "${FILESDIR}/${P}-gtktoggle.patch"
52
Mike Frysingerfb89f9c2011-11-02 14:13:01 -040053 epatch "${FILESDIR}"/${PN}-2.14.1-libdir-pc.patch
54
Mike Frysingerff205d22011-11-10 19:27:33 -050055 # Disable pyc compiling
Mike Frysinger2503e2e2011-11-08 15:39:00 -050056 mv "${S}"/py-compile "${S}"/py-compile.orig
57 ln -s $(type -P true) "${S}"/py-compile
58
59 AT_M4DIR="m4" eautoreconf
Mike Frysingerff205d22011-11-10 19:27:33 -050060
61 python_copy_sources
Mike Frysinger2503e2e2011-11-08 15:39:00 -050062}
63
64src_configure() {
65 use hppa && append-flags -ffunction-sections
Mike Frysingerff205d22011-11-10 19:27:33 -050066 python_src_configure \
67 $(use_enable doc docs) \
68 --enable-thread
Mike Frysinger2503e2e2011-11-08 15:39:00 -050069}
70
71src_test() {
72 unset DBUS_SESSION_BUS_ADDRESS
Mike Frysingerff205d22011-11-10 19:27:33 -050073
74 testing() {
75 cd tests
76 export XDG_CONFIG_HOME="${T}/$(PYTHON --ABI)"
77 Xemake check-local
78 }
79 python_execute_function -s testing
80}
81
82src_install() {
83 python_src_install
84 python_clean_installation_image
85 dodoc AUTHORS ChangeLog INSTALL MAPPING NEWS README THREADS TODO || die
86
87 if use examples; then
88 rm examples/Makefile*
89 insinto /usr/share/doc/${PF}
90 doins -r examples || die
91 fi
Mike Frysinger2503e2e2011-11-08 15:39:00 -050092}
93
94pkg_postinst() {
Mike Frysingerff205d22011-11-10 19:27:33 -050095 python_mod_optimize gtk-2.0
96
97 create_symlinks() {
98 alternatives_auto_makesym $(python_get_sitedir)/pygtk.py pygtk.py-[0-9].[0-9]
99 alternatives_auto_makesym $(python_get_sitedir)/pygtk.pth pygtk.pth-[0-9].[0-9]
100 }
101 python_execute_function create_symlinks
Mike Frysinger2503e2e2011-11-08 15:39:00 -0500102}
103
104pkg_postrm() {
Mike Frysingerff205d22011-11-10 19:27:33 -0500105 python_mod_cleanup gtk-2.0
106
107 create_symlinks() {
108 alternatives_auto_makesym $(python_get_sitedir)/pygtk.py pygtk.py-[0-9].[0-9]
109 alternatives_auto_makesym $(python_get_sitedir)/pygtk.pth pygtk.pth-[0-9].[0-9]
110 }
111 python_execute_function create_symlinks
Mike Frysinger2503e2e2011-11-08 15:39:00 -0500112}