]> git.draconx.ca Git - gentoo-fixes.git/blob - dev-python/pygobject/pygobject-2.28.6-r59.ebuild
app-emulation/wine-vanilla-4.0.4: Adapt mpg123 dependency.
[gentoo-fixes.git] / dev-python / pygobject / pygobject-2.28.6-r59.ebuild
1 # This ebuild is a modified version of the work originally distributed with
2 # Gentoo GNU/Linux, covered by the following copyright and permission notice:
3 #
4 #   Copyright 1999-2020 Gentoo Authors
5 #   Distributed under the terms of the GNU General Public License v2
6 #
7 # The modifications are:
8 #
9 #   * Resurrect python2 version installable alongside newer version (2020-11)
10 #   * Avoid python eclasses as there is no more python2 support (2022-12)
11 #   * Drop unused eutils inherit (2023-09)
12
13 EAPI=7
14
15 GNOME2_LA_PUNT=yes
16 GNOME2_EAUTORECONF=yes
17
18 inherit autotools virtualx gnome2
19
20 DESCRIPTION="GLib's GObject library bindings for Python 2"
21 HOMEPAGE="http://www.pygtk.org/"
22
23 LICENSE="LGPL-2.1+"
24 SLOT="2"
25 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"
26 IUSE="examples libffi test"
27
28 # Tests seem to require network access which can't work.
29 RESTRICT="test"
30
31 BDEPEND="virtual/pkgconfig
32         dev-util/gtk-doc-am"
33
34 RDEPEND=">=dev-libs/glib-2.24.0:2
35         libffi? ( dev-libs/libffi:= )
36         !<dev-python/pygtk-2.23
37         dev-lang/python:2.7"
38
39 DEPEND="$RDEPEND
40         test? (
41                 media-fonts/font-cursor-misc
42                 media-fonts/font-misc-misc )"
43
44 PATCHES=(
45         # Fix FHS compliance, see upstream bug #535524
46         "$FILESDIR/$PN-2.28.3-fix-codegen-location.patch"
47
48         # Do not build tests if unneeded, bug #226345
49         "$FILESDIR/$PN-2.28.3-make_check.patch"
50
51         # Support installation for multiple Python versions, upstream bug #648292
52         "$FILESDIR/$PN-2.28.3-support_multiple_python_versions.patch"
53
54         # Disable tests that fail
55         "$FILESDIR/$P-disable-failing-tests.patch"
56
57         # Disable introspection tests when we build with --disable-introspection
58         "$FILESDIR/$P-tests-no-introspection.patch"
59
60         # Fix warning spam
61         "$FILESDIR/$P-set_qdata.patch"
62         "$FILESDIR/$P-gio-types-2.32.patch"
63
64         # Fix glib-2.36 compatibility, bug #486602
65         "$FILESDIR/$P-glib-2.36-class_init.patch"
66
67         # Fix python byte-compilation
68         "$FILESDIR/$P-python-byte-compile.patch"
69 )
70
71 src_prepare() {
72         sed -i \
73                 -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' \
74                 -e 's:AM_PROG_CC_STDC:AC_PROG_CC:' \
75                 configure.ac || die
76
77         gnome2_src_prepare
78 }
79
80 src_configure() {
81         DOCS="AUTHORS ChangeLog* NEWS README"
82
83         # --disable-introspection and --disable-cairo because we use pygobject:3
84         # for introspection support
85         myconf=(
86                 --disable-introspection
87                 --disable-cairo
88                 $(use_with libffi ffi)
89                 PYTHON=python2.7
90         )
91
92         gnome2_src_configure "${myconf[@]}"
93 }
94
95 # FIXME: With python multiple ABI support, tests return 1 even when they pass
96 src_test() {
97         unset DBUS_SESSION_BUS_ADDRESS
98         export GIO_USE_VFS="local" # prevents odd issues with deleting ${T}/.gvfs
99         export XDG_CACHE_HOME="${T}/${EPYTHON}"
100
101         virtx emake -j1 check
102
103         unset XDG_CACHE_HOME GIO_USE_VFS
104 }
105
106 src_install() {
107         gnome2_src_install
108
109         if use examples; then
110                 dodoc -r examples
111         fi
112 }