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