Ticket #262: pygobject-2.18.0.ebuild

File pygobject-2.18.0.ebuild, 2.4 KB (added by pierrearinsal, 3 years ago)
Line 
1# 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/pygobject/pygobject-2.16.1.ebuild,v 1.8 2009/04/27 13:11:12 jer Exp $
4
5inherit autotools gnome2 python virtualx
6
7DESCRIPTION="GLib's GObject library bindings for Python"
8HOMEPAGE="http://www.pygtk.org/"
9
10LICENSE="LGPL-2"
11SLOT="2"
12KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
13IUSE="doc examples" # libffi
14
15RDEPEND=">=dev-lang/python-2.4.4-r5
16        >=dev-libs/glib-2.16
17        !<dev-python/pygtk-2.13"
18DEPEND="${RDEPEND}
19        doc? ( dev-libs/libxslt >=app-text/docbook-xsl-stylesheets-1.70.1 )
20        >=dev-util/pkgconfig-0.12.0"
21
22DOCS="AUTHORS ChangeLog NEWS README"
23
24pkg_setup() {
25#       if use libffi && ! built_with_use sys-devel/gcc libffi; then
26#               eerror "libffi support not found in sys-devel/gcc." && die
27#       fi
28
29        G2CONF="${G2CONF} $(use_enable doc docs)" # $(use_with libffi ffi)
30}
31
32src_unpack() {
33        gnome2_src_unpack
34
35# The generate-constants program needs to be executed to extract
36# the G_* constants from glib. So build it for the host architecture.
37        if tc-is-cross-compiler ; then
38           epatch "${FILESDIR}/${P}-cross-generate-constants.patch"
39        fi
40
41        # Fix FHS compliance, see upstream bug #535524
42        epatch "${FILESDIR}/${PN}-2.15.4-fix-codegen-location.patch"
43
44        # needed to build on a libtool-1 system, bug #255542
45        rm m4/lt* m4/libtool.m4 ltmain.sh
46
47        eautoreconf
48
49        # disable pyc compiling
50        mv py-compile py-compile.orig
51        ln -s $(type -P true) py-compile
52}
53
54src_test() {
55        unset DBUS_SESSION_BUS_ADDRESS
56        Xemake check || die "tests failed"
57}
58
59src_install() {
60        gnome2_src_install
61
62        if use examples; then
63                insinto /usr/share/doc/${P}
64                doins -r examples
65        fi
66
67        python_version
68        mv "${D}"/usr/$(get_libdir)/python${PYVER}/site-packages/pygtk.py \
69                "${D}"/usr/$(get_libdir)/python${PYVER}/site-packages/pygtk.py-2.0
70        mv "${D}"/usr/$(get_libdir)/python${PYVER}/site-packages/pygtk.pth \
71                "${D}"/usr/$(get_libdir)/python${PYVER}/site-packages/pygtk.pth-2.0
72}
73
74pkg_postinst() {
75        python_version
76        python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/gtk-2.0
77        alternatives_auto_makesym /usr/$(get_libdir)/python${PYVER}/site-packages/pygtk.py pygtk.py-[0-9].[0-9]
78        alternatives_auto_makesym /usr/$(get_libdir)/python${PYVER}/site-packages/pygtk.pth pygtk.pth-[0-9].[0-9]
79        python_mod_compile /usr/$(get_libdir)/python${PYVER}/site-packages/pygtk.py
80        python_need_rebuild
81}
82
83pkg_postrm() {
84        python_version
85        python_mod_cleanup
86}