Mike Frysinger | 2503e2e | 2011-11-08 15:39:00 -0500 | [diff] [blame] | 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/pygtk/pygtk-2.14.1-r1.ebuild,v 1.8 2009/09/06 20:57:05 ranger Exp $ |
| 4 | |
| 5 | EAPI="2" |
| 6 | |
| 7 | inherit alternatives autotools eutils flag-o-matic gnome.org python virtualx |
| 8 | |
| 9 | DESCRIPTION="GTK+2 bindings for Python" |
| 10 | HOMEPAGE="http://www.pygtk.org/" |
| 11 | |
| 12 | LICENSE="LGPL-2.1" |
| 13 | SLOT="2" |
| 14 | KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sh sparc x86 ~x86-fbsd" |
| 15 | IUSE="doc examples" |
| 16 | |
| 17 | RDEPEND=">=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 | |
| 27 | DEPEND="${RDEPEND} |
| 28 | doc? ( |
| 29 | dev-libs/libxslt |
| 30 | >=app-text/docbook-xsl-stylesheets-1.70.1 ) |
| 31 | >=dev-util/pkgconfig-0.9" |
| 32 | |
| 33 | src_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 | |
Mike Frysinger | fb89f9c | 2011-11-02 14:13:01 -0400 | [diff] [blame] | 48 | epatch "${FILESDIR}"/${PN}-2.14.1-libdir-pc.patch |
| 49 | |
Mike Frysinger | 2503e2e | 2011-11-08 15:39:00 -0500 | [diff] [blame] | 50 | # disable pyc compiling |
| 51 | mv "${S}"/py-compile "${S}"/py-compile.orig |
| 52 | ln -s $(type -P true) "${S}"/py-compile |
| 53 | |
| 54 | AT_M4DIR="m4" eautoreconf |
| 55 | } |
| 56 | |
| 57 | src_configure() { |
| 58 | use hppa && append-flags -ffunction-sections |
| 59 | econf $(use_enable doc docs) --enable-thread |
| 60 | } |
| 61 | |
| 62 | src_install() { |
| 63 | emake DESTDIR="${D}" install || die "emake install failed" |
| 64 | dodoc AUTHORS ChangeLog INSTALL MAPPING NEWS README THREADS TODO |
| 65 | |
| 66 | if use examples; then |
| 67 | rm examples/Makefile* |
| 68 | insinto /usr/share/doc/${PF} |
| 69 | doins -r examples |
| 70 | fi |
| 71 | } |
| 72 | |
| 73 | src_test() { |
| 74 | unset DBUS_SESSION_BUS_ADDRESS |
| 75 | cd tests |
| 76 | Xemake check-local || die "tests failed" |
| 77 | } |
| 78 | |
| 79 | pkg_postinst() { |
| 80 | python_version |
| 81 | python_need_rebuild |
| 82 | python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/gtk-2.0 |
| 83 | } |
| 84 | |
| 85 | pkg_postrm() { |
| 86 | python_version |
| 87 | python_mod_cleanup /usr/$(get_libdir)/python*/site-packages/gtk-2.0 |
| 88 | rm -f "${ROOT}"/usr/$(get_libdir)/python${PYVER}/site-packages/pygtk.{py,pth} |
| 89 | alternatives_auto_makesym /usr/$(get_libdir)/python${PYVER}/site-packages/pygtk.py pygtk.py-[0-9].[0-9] |
| 90 | alternatives_auto_makesym /usr/$(get_libdir)/python${PYVER}/site-packages/pygtk.pth pygtk.pth-[0-9].[0-9] |
| 91 | } |