From 00932c943cc3fd75ee1c30b2b39ae395ad012304 Mon Sep 17 00:00:00 2001 From: Brian Evans Date: Wed, 17 Feb 2021 14:13:24 -0500 Subject: sys-power/acpilight: Revbump for Python 3.9 and upstream patch Signed-off-by: Brian Evans --- sys-power/acpilight/acpilight-1.2-r2.ebuild | 56 ++++++++++++++++++++++ .../files/acpilight-1.2-fix-log10-of-zero.patch | 26 ++++++++++ 2 files changed, 82 insertions(+) create mode 100644 sys-power/acpilight/acpilight-1.2-r2.ebuild create mode 100644 sys-power/acpilight/files/acpilight-1.2-fix-log10-of-zero.patch (limited to 'sys-power/acpilight') diff --git a/sys-power/acpilight/acpilight-1.2-r2.ebuild b/sys-power/acpilight/acpilight-1.2-r2.ebuild new file mode 100644 index 000000000000..ea5d3b4b729b --- /dev/null +++ b/sys-power/acpilight/acpilight-1.2-r2.ebuild @@ -0,0 +1,56 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_7 python3_8 python3_9 ) + +inherit python-single-r1 udev + +MY_P="${PN}-v${PV}" + +DESCRIPTION="Replacement for xbacklight that uses the ACPI interface to set brightness" +HOMEPAGE="https://gitlab.com/wavexx/acpilight/" +SRC_URI="https://gitlab.com/wavexx/acpilight/-/archive/v${PV}/${MY_P}.tar.gz" +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +S="${WORKDIR}/${MY_P}" + +RDEPEND="virtual/udev + acct-group/video + ${PYTHON_DEPS} + !x11-apps/xbacklight" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" +DOCS=( README.rst NEWS.rst ) + +PATCHES=( "${FILESDIR}/acpilight-1.2-fix-log10-of-zero.patch" ) + +# Disable Makefile that installs by default +src_compile() { :; } + +src_install() { + python_doscript xbacklight + udev_dorules "${S}"/90-backlight.rules + doman xbacklight.1 + einstalldocs + newinitd "${FILESDIR}"/acpilight.initd acpilight + newconfd "${FILESDIR}"/acpilight.confd acpilight +} + +pkg_postinst() { + udev_reload + einfo + elog "To use the xbacklight binary as a regular user, you must be a part of the video group" + einfo + elog "If this utility does not find any backlights to manipulate," + elog "verify you have kernel support on the device and display driver enabled." + einfo + elog "To take advantage of the OpenRC init script, and automate the process of" + elog "saving and restoring the brightness level you should add acpilight" + elog "to the boot runlevel. You can do this as root like so:" + elog "# rc-update add acpilight boot" + einfo +} diff --git a/sys-power/acpilight/files/acpilight-1.2-fix-log10-of-zero.patch b/sys-power/acpilight/files/acpilight-1.2-fix-log10-of-zero.patch new file mode 100644 index 000000000000..ffc061910f01 --- /dev/null +++ b/sys-power/acpilight/files/acpilight-1.2-fix-log10-of-zero.patch @@ -0,0 +1,26 @@ +From fdf8a4c57c3997f95ea0571b627f3c5a31dfe7b1 Mon Sep 17 00:00:00 2001 +From: Mart +Date: Thu, 1 Oct 2020 09:55:08 +0000 +Subject: [PATCH] set the perceived to zero when the screen is off + +This fixes the issue that you cannot take the 10-log of zero +--- + xbacklight | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/xbacklight b/xbacklight +index 2cb0fa8..f1c2187 100755 +--- a/xbacklight ++++ b/xbacklight +@@ -82,6 +82,8 @@ class LogController(RawController): + + @property + def brightness(self): ++ if super().brightness == 0: ++ return 0 + return log10(super().brightness)/log10(super().max_brightness)*self.max_brightness + + @brightness.setter +-- +GitLab + -- cgit v1.2.3-65-gdbad