]> git.draconx.ca Git - gentoo-fixes.git/blob - dev-python/pygtk/pygtk-2.24.0-r5.ebuild
Resurrect dev-python/pygtk.
[gentoo-fixes.git] / dev-python / pygtk / pygtk-2.24.0-r5.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 GNOME_TARBALL_SUFFIX="bz2"
7
8 PYTHON_COMPAT=( python2_7 )
9
10 inherit autotools flag-o-matic gnome2 python-r1 virtualx
11
12 DESCRIPTION="GTK+2 bindings for Python"
13 HOMEPAGE="https://gitlab.gnome.org/Archive/pygtk"
14
15 LICENSE="LGPL-2.1"
16 SLOT="2"
17 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"
18 IUSE="doc examples test"
19 REQUIRED_USE=$PYTHON_REQUIRED_USE
20
21 RESTRICT="!test? ( test )"
22
23 RDEPEND="${PYTHON_DEPS}
24         >=dev-libs/glib-2.8:2
25         >=x11-libs/pango-1.16
26         >=dev-libs/atk-1.12
27         >=x11-libs/gtk+-2.24:2
28         >=dev-python/pycairo-1.0.2:2[$PYTHON_USEDEP]
29         >=dev-python/pygobject-2.26.8-r53:2[$PYTHON_USEDEP]
30         >=gnome-base/libglade-2.5:2.0
31 "
32 DEPEND="${RDEPEND}
33         virtual/pkgconfig
34         doc? (
35                 dev-libs/libxslt
36                 >=app-text/docbook-xsl-stylesheets-1.70.1 )
37 "
38
39 PATCHES=(
40         # Fix declaration of codegen in .pc
41         "${FILESDIR}/${PN}-2.13.0-fix-codegen-location.patch"
42         "${FILESDIR}/${PN}-2.14.1-libdir-pc.patch"
43         # Fix leaks of Pango objects
44         "${FILESDIR}/${PN}-2.24.0-fix-leaks.patch"
45         # Fail when tests are failing, bug #391307
46         "${FILESDIR}/${PN}-2.24.0-test-fail.patch"
47         # Fix broken tests, https://bugzilla.gnome.org/show_bug.cgi?id=709304
48         "${FILESDIR}/${P}-test_dialog.patch"
49         # Fix build on Darwin
50         "${FILESDIR}/${PN}-2.24.0-quartz-objc.patch"
51         # x11-libs/pango-1.44
52         "${FILESDIR}/${PN}-2.24.0-pango-1.44.patch"
53 )
54
55 src_prepare() {
56         default
57
58         # Examples is handled "manually"
59         sed -e 's/\(SUBDIRS = .* \)examples/\1/' \
60                 -i Makefile.am Makefile.in || die
61
62         sed -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' \
63                 -i configure.ac || die #466968
64
65         AT_M4DIR="m4" eautoreconf
66
67         prepare_pygtk() {
68                 mkdir -p "${BUILD_DIR}" || die
69         }
70         python_foreach_impl prepare_pygtk
71 }
72
73 src_configure() {
74         use hppa && append-flags -ffunction-sections
75         configure_pygtk() {
76                 ECONF_SOURCE="${S}" gnome2_src_configure \
77                         $(use_enable doc docs) \
78                         --disable-numpy \
79                         --with-glade \
80                         --enable-thread
81         }
82         python_foreach_impl run_in_build_dir configure_pygtk
83 }
84
85 src_compile() {
86         python_foreach_impl run_in_build_dir gnome2_src_compile
87 }
88
89 src_test() {
90         # Let tests pass without permissions problems, bug #245103
91         gnome2_environment_reset
92         unset DBUS_SESSION_BUS_ADDRESS
93
94         testing() {
95                 cd tests
96                 virtx emake check-local
97         }
98         python_foreach_impl run_in_build_dir testing
99 }
100
101 src_install() {
102         dodoc AUTHORS ChangeLog INSTALL MAPPING NEWS README THREADS TODO
103
104         if use examples; then
105                 rm examples/Makefile* || die
106                 dodoc -r examples
107         fi
108
109         python_foreach_impl run_in_build_dir gnome2_src_install
110         find "${D}" -name '*.la' -type f -delete || die
111 }