| 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 | |
|---|
| 5 | inherit autotools gnome2 python virtualx |
|---|
| 6 | |
|---|
| 7 | DESCRIPTION="GLib's GObject library bindings for Python" |
|---|
| 8 | HOMEPAGE="http://www.pygtk.org/" |
|---|
| 9 | |
|---|
| 10 | LICENSE="LGPL-2" |
|---|
| 11 | SLOT="2" |
|---|
| 12 | KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd" |
|---|
| 13 | IUSE="doc examples" # libffi |
|---|
| 14 | |
|---|
| 15 | RDEPEND=">=dev-lang/python-2.4.4-r5 |
|---|
| 16 | >=dev-libs/glib-2.16 |
|---|
| 17 | !<dev-python/pygtk-2.13" |
|---|
| 18 | DEPEND="${RDEPEND} |
|---|
| 19 | doc? ( dev-libs/libxslt >=app-text/docbook-xsl-stylesheets-1.70.1 ) |
|---|
| 20 | >=dev-util/pkgconfig-0.12.0" |
|---|
| 21 | |
|---|
| 22 | DOCS="AUTHORS ChangeLog NEWS README" |
|---|
| 23 | |
|---|
| 24 | pkg_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 | |
|---|
| 32 | src_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 | |
|---|
| 54 | src_test() { |
|---|
| 55 | unset DBUS_SESSION_BUS_ADDRESS |
|---|
| 56 | Xemake check || die "tests failed" |
|---|
| 57 | } |
|---|
| 58 | |
|---|
| 59 | src_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 | |
|---|
| 74 | pkg_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 | |
|---|
| 83 | pkg_postrm() { |
|---|
| 84 | python_version |
|---|
| 85 | python_mod_cleanup |
|---|
| 86 | } |
|---|