public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-power/upower/, profiles/arch/alpha/
@ 2022-04-29  8:13 Sam James
  0 siblings, 0 replies; only message in thread
From: Sam James @ 2022-04-29  8:13 UTC (permalink / raw
  To: gentoo-commits

commit:     3e2c5fa402036e2953057cd98cd80a71565dc3ce
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 29 08:12:07 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Apr 29 08:13:35 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e2c5fa4

sys-power/upower: fix tests

Closes: https://bugs.gentoo.org/836269
Signed-off-by: Sam James <sam <AT> gentoo.org>

 profiles/arch/alpha/package.use.mask   |  4 ++++
 sys-power/upower/upower-0.99.17.ebuild | 22 ++++++++++++++++++++--
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/profiles/arch/alpha/package.use.mask b/profiles/arch/alpha/package.use.mask
index 7f798ffa6b0e..d97f9162b1fd 100644
--- a/profiles/arch/alpha/package.use.mask
+++ b/profiles/arch/alpha/package.use.mask
@@ -1,6 +1,10 @@
 # Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# Sam James <sam@gentoo.org> (2022-04-29)
+# Needs unkeyworded dev-util/umockdev
+sys-power/upower test
+
 # Michał Górny <mgorny@gentoo.org> (2022-04-26)
 # Unkeyworded dependencies.
 dev-python/click doc

diff --git a/sys-power/upower/upower-0.99.17.ebuild b/sys-power/upower/upower-0.99.17.ebuild
index 3e2e50731bc6..c1206d3987ed 100644
--- a/sys-power/upower/upower-0.99.17.ebuild
+++ b/sys-power/upower/upower-0.99.17.ebuild
@@ -3,7 +3,8 @@
 
 EAPI=8
 
-inherit meson systemd udev xdg-utils
+PYTHON_COMPAT=( python3_{8..10} )
+inherit meson python-any-r1 systemd udev xdg-utils
 
 DESCRIPTION="D-Bus abstraction for enumerating power devices, querying history and statistics"
 HOMEPAGE="https://upower.freedesktop.org/"
@@ -14,7 +15,8 @@ SLOT="0/3" # based on SONAME of libupower-glib.so
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
 
 # gtk-doc files are not available as prebuilt in the tarball
-IUSE="doc +introspection ios selinux"
+IUSE="doc +introspection ios selinux test"
+RESTRICT="!test? ( test )"
 
 DEPEND="
 	>=dev-libs/glib-2.56:2
@@ -39,6 +41,13 @@ BDEPEND="
 	>=sys-devel/gettext-0.19.8
 	virtual/pkgconfig
 	doc? ( dev-util/gtk-doc )
+	test? (
+		$(python_gen_any_dep '
+			dev-python/dbus-python[${PYTHON_USEDEP}]
+			dev-python/python-dbusmock[${PYTHON_USEDEP}]
+		')
+		dev-util/umockdev
+	)
 "
 
 S="${WORKDIR}/${PN}-v${PV}"
@@ -49,6 +58,15 @@ PATCHES=(
 	"${FILESDIR}"/${P}-meson-Don-t-search-for-gtk-doc-if-disabled.patch
 )
 
+python_check_deps() {
+	python_has_version -b "dev-python/dbus-python[${PYTHON_USEDEP}]" &&
+	python_has_version -b "dev-python/python-dbusmock[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+	use test && python-any-r1_pkg_setup
+}
+
 src_prepare() {
 	default
 	xdg_environment_reset


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-29  8:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-29  8:13 [gentoo-commits] repo/gentoo:master commit in: sys-power/upower/, profiles/arch/alpha/ Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox