dev-python/kombu: 4.6.8 allarches stablized
[gentoo.git] / dev-python / pygobject / pygobject-3.34.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python2_7 python3_{6,7,8} )
7
8 inherit gnome.org meson python-r1 virtualx xdg
9
10 DESCRIPTION="Python bindings for GObject Introspection"
11 HOMEPAGE="https://pygobject.readthedocs.io/"
12
13 LICENSE="LGPL-2.1+"
14 SLOT="3"
15 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"
16 IUSE="+cairo examples test"
17
18 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
19
20 RDEPEND="${PYTHON_DEPS}
21         >=dev-libs/glib-2.48:2
22         >=dev-libs/gobject-introspection-1.54:=
23         virtual/libffi:=
24         cairo? (
25                 >=dev-python/pycairo-1.11.1[${PYTHON_USEDEP}]
26                 x11-libs/cairo[glib] )
27 "
28 DEPEND="${RDEPEND}
29         test? (
30                 dev-libs/atk[introspection]
31                 dev-python/pytest[${PYTHON_USEDEP}]
32                 x11-libs/gdk-pixbuf:2[introspection,jpeg]
33                 x11-libs/gtk+:3[introspection]
34                 x11-libs/pango[introspection] )
35 "
36 BDEPEND="
37         virtual/pkgconfig
38 "
39
40 RESTRICT="!test? ( test )"
41
42 src_configure() {
43         configuring() {
44                 meson_src_configure \
45                         $(meson_use cairo pycairo) \
46                         $(meson_use test tests) \
47                         -Dpython="${EPYTHON}"
48         }
49
50         python_foreach_impl configuring
51 }
52
53 src_compile() {
54         python_foreach_impl meson_src_compile
55 }
56
57 src_test() {
58         local -x GIO_USE_VFS="local" # prevents odd issues with deleting ${T}/.gvfs
59         local -x GIO_USE_VOLUME_MONITOR="unix" # prevent udisks-related failures in chroots, bug #449484
60
61         testing() {
62                 local -x XDG_CACHE_HOME="${T}/${EPYTHON}"
63                 meson_src_test || die "test failed for ${EPYTHON}"
64         }
65         virtx python_foreach_impl testing
66 }
67
68 src_install() {
69         installing() {
70                 meson_src_install
71                 python_optimize
72         }
73         python_foreach_impl installing
74         use examples && dodoc -r examples
75 }