1 # Copyright © 2020-2022 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
13 # The modifications are:
15 # * Resurrect python2 version installable alongside newer version (2020-11)
16 # * Avoid python eclasses as there is no more python2 support (2022-12)
21 GNOME2_EAUTORECONF=yes
23 inherit autotools eutils virtualx gnome2
25 DESCRIPTION="GLib's GObject library bindings for Python 2"
26 HOMEPAGE="http://www.pygtk.org/"
30 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
31 IUSE="examples libffi test"
33 # Tests seem to require network access which can't work.
36 BDEPEND="virtual/pkgconfig
39 RDEPEND=">=dev-libs/glib-2.24.0:2
40 libffi? ( dev-libs/libffi:= )
41 !<dev-python/pygtk-2.23
46 media-fonts/font-cursor-misc
47 media-fonts/font-misc-misc )"
50 # Fix FHS compliance, see upstream bug #535524
51 "$FILESDIR/$PN-2.28.3-fix-codegen-location.patch"
53 # Do not build tests if unneeded, bug #226345
54 "$FILESDIR/$PN-2.28.3-make_check.patch"
56 # Support installation for multiple Python versions, upstream bug #648292
57 "$FILESDIR/$PN-2.28.3-support_multiple_python_versions.patch"
59 # Disable tests that fail
60 "$FILESDIR/$P-disable-failing-tests.patch"
62 # Disable introspection tests when we build with --disable-introspection
63 "$FILESDIR/$P-tests-no-introspection.patch"
66 "$FILESDIR/$P-set_qdata.patch"
67 "$FILESDIR/$P-gio-types-2.32.patch"
69 # Fix glib-2.36 compatibility, bug #486602
70 "$FILESDIR/$P-glib-2.36-class_init.patch"
72 # Fix python byte-compilation
73 "$FILESDIR/$P-python-byte-compile.patch"
78 -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' \
79 -e 's:AM_PROG_CC_STDC:AC_PROG_CC:' \
86 DOCS="AUTHORS ChangeLog* NEWS README"
88 # --disable-introspection and --disable-cairo because we use pygobject:3
89 # for introspection support
91 --disable-introspection
93 $(use_with libffi ffi)
97 gnome2_src_configure "${myconf[@]}"
100 # FIXME: With python multiple ABI support, tests return 1 even when they pass
102 unset DBUS_SESSION_BUS_ADDRESS
103 export GIO_USE_VFS="local" # prevents odd issues with deleting ${T}/.gvfs
104 export XDG_CACHE_HOME="${T}/${EPYTHON}"
106 virtx emake -j1 check
108 unset XDG_CACHE_HOME GIO_USE_VFS
114 if use examples; then