diff options
author | Pacho Ramos <pacho@gentoo.org> | 2018-10-13 11:04:46 +0200 |
---|---|---|
committer | Pacho Ramos <pacho@gentoo.org> | 2018-10-13 11:06:30 +0200 |
commit | 71d8682c51b91e629fff6cb3bddbca9378650406 (patch) | |
tree | d71bfc814c48a7789b7e6696558fbdd27ec9573f /sys-power/upower | |
parent | media-libs/openexr: Drop old (EAPI=2) (diff) | |
download | gentoo-71d8682c51b91e629fff6cb3bddbca9378650406.tar.gz gentoo-71d8682c51b91e629fff6cb3bddbca9378650406.tar.bz2 gentoo-71d8682c51b91e629fff6cb3bddbca9378650406.zip |
sys-power/upower: Apply important fixes from upstream
- Fix upower not having access to udev events (#668084)
- Fix upower's keyboard backlight support
Thanks-to: Peter Tworek
Closes: https://bugs.gentoo.org/668084
Signed-off-by: Pacho Ramos <pacho@gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11
Diffstat (limited to 'sys-power/upower')
-rw-r--r-- | sys-power/upower/files/upower-0.99.8-keyboard-backlight.patch | 30 | ||||
-rw-r--r-- | sys-power/upower/files/upower-0.99.8-udev-events.patch | 32 | ||||
-rw-r--r-- | sys-power/upower/upower-0.99.8-r1.ebuild | 99 |
3 files changed, 161 insertions, 0 deletions
diff --git a/sys-power/upower/files/upower-0.99.8-keyboard-backlight.patch b/sys-power/upower/files/upower-0.99.8-keyboard-backlight.patch new file mode 100644 index 000000000000..07b1731ad2c4 --- /dev/null +++ b/sys-power/upower/files/upower-0.99.8-keyboard-backlight.patch @@ -0,0 +1,30 @@ +From 0a9d9ab4949effb20e77aa52e7b4ee07e776fc0d Mon Sep 17 00:00:00 2001 +From: Bastien Nocera <hadess@hadess.net> +Date: Tue, 4 Sep 2018 09:58:21 +0200 +Subject: daemon: Fix upower's keyboard backlight support + +Disabling kernel tunables blocked us from accessing /sys, meaning we +couldn't change keyboard backlight levels. + +Closes: #73 +--- + src/upower.service.in | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/upower.service.in b/src/upower.service.in +index 8838655..4566ad3 100644 +--- a/src/upower.service.in ++++ b/src/upower.service.in +@@ -10,7 +10,8 @@ Restart=on-failure + + # Filesystem lockdown + ProtectSystem=strict +-ProtectKernelTunables=true ++# Needed by keyboard backlight support ++ProtectKernelTunables=false + ProtectControlGroups=true + ReadWritePaths=@historydir@ + ProtectHome=true +-- +cgit v1.1 + diff --git a/sys-power/upower/files/upower-0.99.8-udev-events.patch b/sys-power/upower/files/upower-0.99.8-udev-events.patch new file mode 100644 index 000000000000..d164824b735f --- /dev/null +++ b/sys-power/upower/files/upower-0.99.8-udev-events.patch @@ -0,0 +1,32 @@ +From fe356951a9d45fee73036aaa72661f0319dffba3 Mon Sep 17 00:00:00 2001 +From: Bastien Nocera <hadess@hadess.net> +Date: Tue, 21 Aug 2018 13:30:44 +0200 +Subject: daemon: Fix upower not having access to udev events + +PrivateNetwork=true will cut off upower from the udev netlink socket, so +it's not what we want to use, as we want those events. + +See https://lists.freedesktop.org/archives/systemd-devel/2018-July/041000.html + +Closes: #68 +--- + src/upower.service.in | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/upower.service.in b/src/upower.service.in +index 835529a..8838655 100644 +--- a/src/upower.service.in ++++ b/src/upower.service.in +@@ -17,7 +17,8 @@ ProtectHome=true + PrivateTmp=true + + # Network +-PrivateNetwork=true ++# PrivateNetwork=true would block udev's netlink socket ++RestrictAddressFamilies=AF_UNIX AF_NETLINK + + # Execute Mappings + MemoryDenyWriteExecute=true +-- +cgit v1.1 + diff --git a/sys-power/upower/upower-0.99.8-r1.ebuild b/sys-power/upower/upower-0.99.8-r1.ebuild new file mode 100644 index 000000000000..0fa1a0d4d9bf --- /dev/null +++ b/sys-power/upower/upower-0.99.8-r1.ebuild @@ -0,0 +1,99 @@ +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit systemd xdg-utils + +DESCRIPTION="D-Bus abstraction for enumerating power devices, querying history and statistics" +HOMEPAGE="https://upower.freedesktop.org/" + +# No tarball released, use the same commit as Fedora +#SRC_URI="https://${PN}.freedesktop.org/releases/${P}.tar.xz" +COMMIT="9125ab7ee96fdc4ecc68cfefb50c1cab" +SRC_URI="https://gitlab.freedesktop.org/upower/upower/uploads/${COMMIT}/${P}.tar.xz" + +LICENSE="GPL-2" +SLOT="0/3" # based on SONAME of libupower-glib.so +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" + +# gtk-doc files are not available as prebuilt in the tarball +IUSE="doc +introspection ios kernel_FreeBSD kernel_linux selinux" + +COMMON_DEPS=" + >=dev-libs/dbus-glib-0.100 + >=dev-libs/glib-2.34:2 + sys-apps/dbus:= + introspection? ( dev-libs/gobject-introspection:= ) + kernel_linux? ( + virtual/libusb:1 + virtual/libgudev:= + virtual/udev + ios? ( + >=app-pda/libimobiledevice-1:= + >=app-pda/libplist-1:= + ) + ) +" +RDEPEND=" + ${COMMON_DEPS} + selinux? ( sec-policy/selinux-devicekit ) +" +DEPEND="${COMMON_DEPS} + doc? ( dev-util/gtk-doc ) + dev-libs/libxslt + app-text/docbook-xsl-stylesheets + dev-util/intltool + >=sys-devel/gettext-0.17 + virtual/pkgconfig +" + +QA_MULTILIB_PATHS="usr/lib/${PN}/.*" + +DOCS=( AUTHORS HACKING NEWS README ) + +PATCHES=( + # daemon: Fix upower not having access to udev events + "${FILESDIR}"/${P}-udev-events.patch + + # daemon: Fix upower's keyboard backlight support + "${FILESDIR}"/${P}-keyboard-backlight.patch +) + +src_prepare() { + default + xdg_environment_reset + sed -i -e '/DISABLE_DEPRECATED/d' configure || die +} + +src_configure() { + local backend + + if use kernel_linux ; then + backend=linux + elif use kernel_FreeBSD ; then + backend=freebsd + else + backend=dummy + fi + + local myeconfargs=( + --disable-static + --disable-tests + --enable-man-pages + --libexecdir="${EPREFIX%/}"/usr/lib/${PN} + --localstatedir="${EPREFIX%/}"/var + --with-backend=${backend} + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" + --with-systemdutildir="$(systemd_get_utildir)" + $(use_enable doc gtk-doc) + $(use_enable introspection) + $(use_with ios idevice) + ) + econf "${myeconfargs[@]}" +} + +src_install() { + default + find "${D}" -name '*.la' -delete || die + keepdir /var/lib/upower #383091 +} |