1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_{10..12} )
7 inherit meson python-any-r1 systemd udev xdg-utils
9 DESCRIPTION="D-Bus abstraction for enumerating power devices, querying history and statistics"
10 HOMEPAGE="https://upower.freedesktop.org/"
11 SRC_URI="https://gitlab.freedesktop.org/${PN}/${PN}/-/archive/v${PV}/${PN}-v${PV}.tar.bz2"
12 S="${WORKDIR}/${PN}-v${PV}"
15 SLOT="0/3" # based on SONAME of libupower-glib.so
16 KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86"
18 # gtk-doc files are not available as prebuilt in the tarball
19 IUSE="doc +introspection ios selinux test"
20 RESTRICT="!test? ( test )"
23 >=dev-libs/glib-2.66:2
25 introspection? ( dev-libs/gobject-introspection:= )
27 >=dev-libs/libgudev-238:=
30 >=app-pda/libimobiledevice-1:=
31 >=app-pda/libplist-2:=
36 selinux? ( sec-policy/selinux-devicekit )
39 app-text/docbook-xsl-stylesheets
41 dev-util/gdbus-codegen
42 >=sys-devel/gettext-0.19.8
44 doc? ( dev-util/gtk-doc )
46 $(python_gen_any_dep '
47 dev-python/dbus-python[${PYTHON_USEDEP}]
48 dev-python/python-dbusmock[${PYTHON_USEDEP}]
54 QA_MULTILIB_PATHS="usr/lib/${PN}/.*"
57 python_has_version -b "dev-python/dbus-python[${PYTHON_USEDEP}]" &&
58 python_has_version -b "dev-python/python-dbusmock[${PYTHON_USEDEP}]"
62 use test && python-any-r1_pkg_setup
68 # https://bugs.gentoo.org/935575
69 unset XDG_CONFIG_DIRS XDG_DATA_DIRS
75 if use kernel_linux ; then
82 --localstatedir "${EPREFIX}"/var
85 $(meson_use doc gtk-doc)
86 $(meson_feature introspection)
87 -Dsystemdsystemunitdir="$(systemd_get_systemunitdir)"
88 -Dos_backend="${backend}"
89 $(meson_feature ios idevice)
96 keepdir /var/lib/upower #383091
102 if [[ ${REPLACING_VERSIONS} ]] && ver_test ${REPLACING_VERSIONS} -lt 0.99.12; then
103 elog "Support for Logitech Unifying Receiver battery state readout was"
104 elog "removed in version 0.99.12, these devices have been directly"
105 elog "supported by the Linux kernel since version >=3.2."
107 elog "Support for CSR devices battery state was removed from udev rules"
108 elog "in version 0.99.12. This concerns the following Logitech products"
109 elog "from the mid 2000s:"
110 elog "Mouse/Dual/Keyboard+Mouse Receiver, Freedom Optical, Elite Duo,"
111 elog "MX700/MX1000, Optical TrackMan, Click! Mouse, Presenter."