commit:     14486dcd3d1a14cac702d3a0af77ba10bd7a8083
Author:     Sven Willett <sven.willett <AT> gmail <DOT> com>
AuthorDate: Sun Dec 14 11:23:38 2025 +0000
Commit:     Jay Faulkner <jayf <AT> gentoo <DOT> org>
CommitDate: Tue Dec 16 18:50:41 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=14486dcd

sys-power/tlp: add 1.9.0

Closes: https://bugs.gentoo.org/967063
Signed-off-by: Sven Willett <sven.willett <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/45022
Closes: https://github.com/gentoo/gentoo/pull/45022
Signed-off-by: Jay Faulkner <jay <AT> jvf.cc>
Signed-off-by: Jay Faulkner <jayf <AT> gentoo.org>

 sys-power/tlp/Manifest          |  1 +
 sys-power/tlp/files/tlp-pd.init |  9 +++++
 sys-power/tlp/metadata.xml      |  4 ++
 sys-power/tlp/tlp-1.9.0.ebuild  | 83 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 97 insertions(+)

diff --git a/sys-power/tlp/Manifest b/sys-power/tlp/Manifest
index 38dfe53bd87d..4ed976c79507 100644
--- a/sys-power/tlp/Manifest
+++ b/sys-power/tlp/Manifest
@@ -1 +1,2 @@
 DIST tlp-1.8.0.tar.gz 172154 BLAKE2B 
843951699bab3237e3f3869393fe9890088da950101c13351e175287734871e1a72e368264b775a3f1c128fe8ae3225db1e4b6fac9fb72260a59a02028f48647
 SHA512 
d1c133faf2c7870b66a363ff84e5e0fafc6be2e36b5440336e3f4c45e68a9a8b7524f697af7a509cf724e21c3a43f976f9814e627531148e9ddaff267564d3c7
+DIST tlp-1.9.0.tar.gz 210317 BLAKE2B 
46011d70859509de4026d0e705a8bd0d2fd17297ba7458b6e8063bb6247c0408cb207f2b88373fc04132776dd45cb8347df213297cf7b278ec01de6eb50b2e44
 SHA512 
1b9a298563951751b07f63d41a56a9266fea730133209d5ddfc22e778c18df5a3ee7093d05c99c7fd7e25998e26a228bf3d41ebcfb8258f72ce5544aee6cd404

diff --git a/sys-power/tlp/files/tlp-pd.init b/sys-power/tlp/files/tlp-pd.init
new file mode 100644
index 000000000000..eeccaaa68f8f
--- /dev/null
+++ b/sys-power/tlp/files/tlp-pd.init
@@ -0,0 +1,9 @@
+#!/sbin/openrc-run
+command=/usr/sbin/tlp-pd
+name="TLP Profile Daemon"
+command_background=true
+pidfile="/run/tlp-pd.pid"
+
+depend() {
+       need udev
+}

diff --git a/sys-power/tlp/metadata.xml b/sys-power/tlp/metadata.xml
index f5feb7b94155..6103ff627ceb 100644
--- a/sys-power/tlp/metadata.xml
+++ b/sys-power/tlp/metadata.xml
@@ -9,6 +9,10 @@
                TLP is a command line utility for Linux to optimize laptop 
battery life. Primarily by tweaking
                kernel settings that affect power consumption.
        </longdescription>
+       <use>
+               <flag name="pd">TLP Profiles Daemon that replaces 
power-profiles-daemon by using the same D-Bus API.</flag>
+               <flag name="rdw">Enables TLP Radio Device Wizard feature</flag> 
+       </use>
        <upstream>
                <remote-id type="github">linrunner/TLP</remote-id>
        </upstream>

diff --git a/sys-power/tlp/tlp-1.9.0.ebuild b/sys-power/tlp/tlp-1.9.0.ebuild
new file mode 100644
index 000000000000..fbac4f688f06
--- /dev/null
+++ b/sys-power/tlp/tlp-1.9.0.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..14} )
+
+inherit udev optfeature python-single-r1
+
+DESCRIPTION="Optimize laptop battery life"
+HOMEPAGE="https://linrunner.de/tlp/";
+SRC_URI="https://github.com/linrunner/TLP/archive/refs/tags/${PV}.tar.gz -> 
${P}.tar.gz"
+S="${WORKDIR}/TLP-${PV}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+REQUIRED_USE="pd? ( ${PYTHON_REQUIRED_USE} )"
+
+IUSE="
+       +pd
+       +rdw
+"
+
+RDEPEND="
+       dev-lang/perl
+       virtual/udev
+       sys-apps/hdparm
+       net-wireless/iw
+       !app-laptop/laptop-mode-tools
+       sys-apps/pciutils
+       !sys-apps/tuned
+       sys-apps/usbutils
+       pd? ( dev-python/dbus-python )
+       pd? ( !sys-power/power-profiles-daemon )
+       pd? ( dev-python/pygobject )
+       pd? ( ${PYTHON_DEPS} )
+       pd? ( !sys-apps/tuned )
+       rdw? ( net-misc/networkmanager )
+"
+DEPEND="${RDEPEND}"
+
+src_install() {
+       # NOTE(JayF): TLP_WITH_ELOGIND/TLP_WITH_SYSTEMD are both only installing
+       #             small init/config files.
+       local myemakeargs=(
+               DESTDIR="${D}"
+               TLP_NO_INIT=1
+               TLP_WITH_ELOGIND=1
+               TLP_WITH_SYSTEMD=1
+               install-tlp install-man-tlp
+       )
+
+       use pd && myemakeargs+=(
+               install-pd
+               install-man-pd
+       )
+
+       use rdw && myemakeargs+=(
+               install-rdw
+               install-man-rdw
+       )
+
+       emake "${myemakeargs[@]}"
+
+       fperms 444 /usr/share/tlp/defaults.conf # manpage says this file should 
not be edited
+       newinitd "${FILESDIR}/tlp.init" tlp
+       newinitd "${FILESDIR}/tlp-pd.init" tlp-pd
+       keepdir /var/lib/tlp # created by Makefile, probably important
+}
+
+pkg_postinst() {
+       udev_reload
+
+       optfeature "disable Wake-on-LAN" sys-apps/ethtool
+       optfeature "see disk drive health info in tlp-stat" 
sys-apps/smartmontools
+       optfeature "Sleep hooks" sys-auth/elogind sys-apps/systemd
+       optfeature "Battery functions for ThinkPads prior to the Sandy Bridge 
generation (2011)" app-laptop/tp_smapi
+}
+
+pkg_postrm() {
+       udev_reload
+}

Reply via email to