1 # Copyright © 2020-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
16 GNOME2_EAUTORECONF=yes
19 PYTHON_COMPAT=( python2_7 )
21 inherit autotools eutils gnome2 python-r1 virtualx
23 DESCRIPTION="GLib's GObject library bindings for Python 2"
24 HOMEPAGE="http://www.pygtk.org/"
28 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"
29 IUSE="examples libffi test +python_targets_python2_7"
30 RESTRICT="!test? ( test )"
31 REQUIRED_USE=$PYTHON_REQUIRED_USE
33 BDEPEND="virtual/pkgconfig
36 RDEPEND=">=dev-libs/glib-2.24.0:2
37 libffi? ( dev-libs/libffi:= )
38 !<dev-python/pygtk-2.23
43 media-fonts/font-cursor-misc
44 media-fonts/font-misc-misc )"
47 # Fix FHS compliance, see upstream bug #535524
48 "$FILESDIR/$PN-2.28.3-fix-codegen-location.patch"
50 # Do not build tests if unneeded, bug #226345
51 "$FILESDIR/$PN-2.28.3-make_check.patch"
53 # Support installation for multiple Python versions, upstream bug #648292
54 "$FILESDIR/$PN-2.28.3-support_multiple_python_versions.patch"
56 # Disable tests that fail
57 "$FILESDIR/$P-disable-failing-tests.patch"
59 # Disable introspection tests when we build with --disable-introspection
60 "$FILESDIR/$P-tests-no-introspection.patch"
63 "$FILESDIR/$P-set_qdata.patch"
64 "$FILESDIR/$P-gio-types-2.32.patch"
66 # Fix glib-2.36 compatibility, bug #486602
67 "$FILESDIR/$P-glib-2.36-class_init.patch"
69 # Fix python byte-compilation
70 "$FILESDIR/$P-python-byte-compile.patch"
75 -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' \
76 -e 's:AM_PROG_CC_STDC:AC_PROG_CC:' \
85 DOCS="AUTHORS ChangeLog* NEWS README"
87 # --disable-introspection and --disable-cairo because we use pygobject:3
88 # for introspection support
90 --disable-introspection
92 $(use_with libffi ffi)
95 python_foreach_impl run_in_build_dir gnome2_src_configure "${myconf[@]}"
99 python_foreach_impl run_in_build_dir gnome2_src_compile
102 # FIXME: With python multiple ABI support, tests return 1 even when they pass
104 unset DBUS_SESSION_BUS_ADDRESS
105 export GIO_USE_VFS="local" # prevents odd issues with deleting ${T}/.gvfs
108 export XDG_CACHE_HOME="${T}/${EPYTHON}"
109 run_in_build_dir Xemake -j1 check
112 python_foreach_impl testing
117 python_foreach_impl run_in_build_dir gnome2_src_install
119 if use examples; then
120 insinto /usr/share/doc/${PF}