1 # Copyright © 2021 Nick Bowler
3 # License GPLv2+: GNU General Public License version 2 or any later version.
4 # This is free software: you are free to change and redistribute it.
5 # There is NO WARRANTY, to the extent permitted by law.
7 # This is a modified version of the original ebuild from Gentoo GNU/Linux,
8 # covered by the following copyright and permission notice:
10 # Copyright 1999-2020 Gentoo Authors
11 # Distributed under the terms of the GNU General Public License v2
15 GNOME_TARBALL_SUFFIX="bz2"
18 PYTHON_COMPAT=( python2_7 )
20 inherit autotools flag-o-matic gnome2 python-r1 virtualx
22 DESCRIPTION="GTK+2 bindings for Python"
23 HOMEPAGE="https://gitlab.gnome.org/Archive/pygtk"
27 KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ~ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
28 IUSE="doc examples test"
29 REQUIRED_USE=$PYTHON_REQUIRED_USE
31 RESTRICT="!test? ( test )"
33 RDEPEND="${PYTHON_DEPS}
37 >=x11-libs/gtk+-2.24:2
38 >=dev-python/pycairo-1.0.2:2[$PYTHON_USEDEP]
39 >=dev-python/pygobject-2.26.8-r53:2[$PYTHON_USEDEP]
40 >=gnome-base/libglade-2.5:2.0"
42 BDEPEND="virtual/pkgconfig
43 doc? ( dev-libs/libxslt
44 >=app-text/docbook-xsl-stylesheets-1.70.1 )"
47 # Fix declaration of codegen in .pc
48 "${FILESDIR}/${PN}-2.13.0-fix-codegen-location.patch"
49 "${FILESDIR}/${PN}-2.14.1-libdir-pc.patch"
50 # Fix leaks of Pango objects
51 "${FILESDIR}/${PN}-2.24.0-fix-leaks.patch"
52 # Fail when tests are failing, bug #391307
53 "${FILESDIR}/${PN}-2.24.0-test-fail.patch"
54 # Fix broken tests, https://bugzilla.gnome.org/show_bug.cgi?id=709304
55 "${FILESDIR}/${P}-test_dialog.patch"
57 "${FILESDIR}/${PN}-2.24.0-quartz-objc.patch"
59 "${FILESDIR}/${PN}-2.24.0-pango-1.44.patch"
65 # Examples is handled "manually"
66 sed -e 's/\(SUBDIRS = .* \)examples/\1/' \
67 -i Makefile.am Makefile.in || die
69 sed -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' \
70 -i configure.ac || die #466968
72 AT_M4DIR="m4" eautoreconf
75 mkdir -p "${BUILD_DIR}" || die
77 python_foreach_impl prepare_pygtk
81 use hppa && append-flags -ffunction-sections
83 ECONF_SOURCE="${S}" gnome2_src_configure \
84 $(use_enable doc docs) \
89 python_foreach_impl run_in_build_dir configure_pygtk
93 python_foreach_impl run_in_build_dir gnome2_src_compile
97 # Let tests pass without permissions problems, bug #245103
98 gnome2_environment_reset
99 unset DBUS_SESSION_BUS_ADDRESS
103 virtx emake check-local
105 python_foreach_impl run_in_build_dir testing
109 dodoc AUTHORS ChangeLog INSTALL MAPPING NEWS README THREADS TODO
111 if use examples; then
112 rm examples/Makefile* || die
116 python_foreach_impl run_in_build_dir gnome2_src_install
117 find "${D}" -name '*.la' -type f -delete || die