*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / media-libs / grilo / grilo-0.3.9.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 PYTHON_COMPAT=( python{2_7,3_6,3_7} )
6 VALA_USE_DEPEND="vapigen"
7
8 inherit gnome.org meson python-any-r1 vala xdg
9
10 DESCRIPTION="A framework for easy media discovery and browsing"
11 HOMEPAGE="https://wiki.gnome.org/Projects/Grilo"
12
13 LICENSE="LGPL-2.1+"
14 SLOT="0.3/0" # subslot is libgrilo-0.3 soname suffix
15 KEYWORDS="~alpha amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc x86"
16
17 IUSE="gtk gtk-doc +introspection +network +playlist test vala"
18 REQUIRED_USE="vala? ( introspection )"
19 RESTRICT="!test? ( test )"
20
21 # oauth could be optional if meson is patched - used for flickr oauth in grilo-test-ui tool
22 RDEPEND="
23         >=dev-libs/glib-2.44:2
24         dev-libs/libxml2:2
25         network? ( >=net-libs/libsoup-2.41.3:2.4[introspection?] )
26         playlist? ( >=dev-libs/totem-pl-parser-3.4.1 )
27         introspection? ( >=dev-libs/gobject-introspection-1.54:= )
28
29         gtk? (
30                 net-libs/liboauth
31                 >=x11-libs/gtk+-3.14:3 )
32 "
33 DEPEND="${RDEPEND}"
34 BDEPEND="
35         dev-util/glib-utils
36         >=sys-devel/gettext-0.19.8
37         virtual/pkgconfig
38         gtk-doc? (
39                 >=dev-util/gtk-doc-1.10
40                 app-text/docbook-xml-dtd:4.3 )
41         ${PYTHON_DEPS}
42         test? ( sys-apps/dbus )
43         vala? ( $(vala_depend) )
44 "
45
46 PATCHES=(
47         # Will be fixed in 0.3.11
48         # https://gitlab.gnome.org/GNOME/grilo/commit/60d135ef64f16671bb0ab4079ecbc59bdc32cbc7
49         "${FILESDIR}"/${PN}-0.3.9-totem-pl-parser.patch
50 )
51
52 src_prepare() {
53         sed -i -e "s:'GETTEXT_PACKAGE', meson.project_name():'GETTEXT_PACKAGE', 'grilo-${SLOT%/*}':" meson.build || die
54         sed -i -e "s:meson.project_name():'grilo-${SLOT%/*}':" po/meson.build || die
55         sed -i -e "s:'grilo':'grilo-${SLOT%/*}':" doc/grilo/meson.build || die
56
57         # Drop explicit unversioned vapigen check
58         sed -i -e "/vapigen.*=.*find_program/d" meson.build || die
59
60         # Don't build examples; they get embedded in gtk-doc, thus we don't install the sources with USE=examples either
61         sed -i -e "/subdir('examples')/d" meson.build || die
62
63         xdg_src_prepare
64         use vala && vala_src_prepare
65 }
66
67 src_configure() {
68         local emesonargs=(
69                 $(meson_use network enable-grl-net)
70                 $(meson_use playlist enable-grl-pls)
71                 $(meson_use gtk-doc enable-gtk-doc)
72                 $(meson_use introspection enable-introspection)
73                 $(meson_use gtk enable-test-ui)
74                 $(meson_use vala enable-vala)
75         )
76         meson_src_configure
77 }
78
79 src_test() {
80         dbus-run-session meson test -C "${BUILD_DIR}" || die
81 }