gnome-base/gnome-control-center: fix dbusmock test dep handling
authorMart Raudsepp <leio@gentoo.org>
Sun, 1 Mar 2020 15:41:00 +0000 (17:41 +0200)
committerMart Raudsepp <leio@gentoo.org>
Sun, 1 Mar 2020 16:17:41 +0000 (18:17 +0200)
Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Mart Raudsepp <leio@gentoo.org>
gnome-base/gnome-control-center/gnome-control-center-3.32.2.ebuild

index 70a11f092400778f490e20b444d37b6bf87b722f..9441fe8260da8c6bbcf736e9cab7d399a51c3e45 100644 (file)
@@ -2,8 +2,9 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
+PYTHON_COMPAT=( python3_{6,7,8} )
 
-inherit gnome.org gnome2-utils meson xdg
+inherit gnome.org gnome2-utils meson python-any-r1 xdg
 
 DESCRIPTION="GNOME's main interface to configure various aspects of the desktop"
 HOMEPAGE="https://git.gnome.org/browse/gnome-control-center/"
@@ -11,7 +12,8 @@ SRC_URI+=" https://dev.gentoo.org/~leio/distfiles/${P}-patchset.tar.xz"
 
 LICENSE="GPL-2+"
 SLOT="2"
-IUSE="+bluetooth +cups debug elogind flickr +gnome-online-accounts +ibus input_devices_wacom kerberos networkmanager systemd v4l wayland"
+IUSE="+bluetooth +cups debug elogind flickr +gnome-online-accounts +ibus input_devices_wacom kerberos networkmanager systemd test v4l wayland"
+RESTRICT="!test? ( test )"
 REQUIRED_USE="
        flickr? ( gnome-online-accounts )
        ^^ ( elogind systemd )
@@ -115,6 +117,9 @@ DEPEND="${COMMON_DEPEND}
        dev-util/glib-utils
        >=sys-devel/gettext-0.19.8
        virtual/pkgconfig
+       test? ( $(python_gen_any_dep '
+               dev-python/dbusmock[${PYTHON_USEDEP}]
+       ') )
 "
 
 PATCHES=(
@@ -127,6 +132,22 @@ PATCHES=(
        "${FILESDIR}"/${PN}-3.32.2-fix-gcc10-fno-common.patch # fixed in 3.35.90
 )
 
+python_check_deps() {
+       use test && \
+               has_version "dev-python/dbusmock[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+       use test && python-any-r1_pkg_setup
+}
+
+src_prepare() {
+       xdg_src_prepare
+       # Mark python tests with shebang executable, so that meson will launch them directly, instead
+       # of via its own python-single-r1 version, which might not match what we get from python_check_deps
+       chmod a+x tests/network/test-network-panel.py tests/datetime/test-datetime.py || die
+}
+
 src_configure() {
        local emesonargs=(
                $(meson_use bluetooth)