]> git.draconx.ca Git - gentoo-fixes.git/blob - dev-python/pygtk/pygtk-2.24.0-r6.ebuild
dev-python/pygobject: Adapt to more python2 disabling.
[gentoo-fixes.git] / dev-python / pygtk / pygtk-2.24.0-r6.ebuild
1 # Copyright © 2021 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 EAPI=7
14
15 GNOME_TARBALL_SUFFIX="bz2"
16
17 _PYTHON_ALLOW_PY27=1
18 PYTHON_COMPAT=( python2_7 )
19
20 inherit autotools flag-o-matic gnome2 python-r1 virtualx
21
22 DESCRIPTION="GTK+2 bindings for Python"
23 HOMEPAGE="https://gitlab.gnome.org/Archive/pygtk"
24
25 LICENSE="LGPL-2.1"
26 SLOT="2"
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
30
31 RESTRICT="!test? ( test )"
32
33 RDEPEND="${PYTHON_DEPS}
34         >=dev-libs/glib-2.8:2
35         >=x11-libs/pango-1.16
36         >=dev-libs/atk-1.12
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"
41 DEPEND=$RDEPEND
42 BDEPEND="virtual/pkgconfig
43         doc? ( dev-libs/libxslt
44                 >=app-text/docbook-xsl-stylesheets-1.70.1 )"
45
46 PATCHES=(
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"
56         # Fix build on Darwin
57         "${FILESDIR}/${PN}-2.24.0-quartz-objc.patch"
58         # x11-libs/pango-1.44
59         "${FILESDIR}/${PN}-2.24.0-pango-1.44.patch"
60 )
61
62 src_prepare() {
63         default
64
65         # Examples is handled "manually"
66         sed -e 's/\(SUBDIRS = .* \)examples/\1/' \
67                 -i Makefile.am Makefile.in || die
68
69         sed -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' \
70                 -i configure.ac || die #466968
71
72         AT_M4DIR="m4" eautoreconf
73
74         prepare_pygtk() {
75                 mkdir -p "${BUILD_DIR}" || die
76         }
77         python_foreach_impl prepare_pygtk
78 }
79
80 src_configure() {
81         use hppa && append-flags -ffunction-sections
82         configure_pygtk() {
83                 ECONF_SOURCE="${S}" gnome2_src_configure \
84                         $(use_enable doc docs) \
85                         --disable-numpy \
86                         --with-glade \
87                         --enable-thread
88         }
89         python_foreach_impl run_in_build_dir configure_pygtk
90 }
91
92 src_compile() {
93         python_foreach_impl run_in_build_dir gnome2_src_compile
94 }
95
96 src_test() {
97         # Let tests pass without permissions problems, bug #245103
98         gnome2_environment_reset
99         unset DBUS_SESSION_BUS_ADDRESS
100
101         testing() {
102                 cd tests
103                 virtx emake check-local
104         }
105         python_foreach_impl run_in_build_dir testing
106 }
107
108 src_install() {
109         dodoc AUTHORS ChangeLog INSTALL MAPPING NEWS README THREADS TODO
110
111         if use examples; then
112                 rm examples/Makefile* || die
113                 dodoc -r examples
114         fi
115
116         python_foreach_impl run_in_build_dir gnome2_src_install
117         find "${D}" -name '*.la' -type f -delete || die
118 }