summaryrefslogtreecommitdiff
path: root/sys-power/tlp
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-06-04 05:48:38 -0500
committerroot <root@alpha.trunkmasters.com>2026-06-04 05:48:38 -0500
commitbfd9c39e4712ebdb442d4ca0673061faed1e70e1 (patch)
tree0d7a74b4463ee387f9cf9368ceb1b757f694f72a /sys-power/tlp
parentf716a9fe6455d39eef01e718aae68dae61c19704 (diff)
downloadbaldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.tar.gz
baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.tar.xz
baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.zip
Revert "Adding metadata"
This reverts commit f716a9fe6455d39eef01e718aae68dae61c19704.
Diffstat (limited to 'sys-power/tlp')
-rw-r--r--sys-power/tlp/Manifest2
-rw-r--r--sys-power/tlp/files/tlp-pd.init9
-rw-r--r--sys-power/tlp/files/tlp.init28
-rw-r--r--sys-power/tlp/metadata.xml19
-rw-r--r--sys-power/tlp/tlp-1.8.0-r1.ebuild50
-rw-r--r--sys-power/tlp/tlp-1.9.1.ebuild108
6 files changed, 216 insertions, 0 deletions
diff --git a/sys-power/tlp/Manifest b/sys-power/tlp/Manifest
new file mode 100644
index 000000000000..99e73e53b141
--- /dev/null
+++ b/sys-power/tlp/Manifest
@@ -0,0 +1,2 @@
+DIST tlp-1.8.0.tar.gz 172154 BLAKE2B 843951699bab3237e3f3869393fe9890088da950101c13351e175287734871e1a72e368264b775a3f1c128fe8ae3225db1e4b6fac9fb72260a59a02028f48647 SHA512 d1c133faf2c7870b66a363ff84e5e0fafc6be2e36b5440336e3f4c45e68a9a8b7524f697af7a509cf724e21c3a43f976f9814e627531148e9ddaff267564d3c7
+DIST tlp-1.9.1.tar.gz 210993 BLAKE2B b6ab4a81852ace750cd6ef49b1fb595b85a9f9cafcf8da3f79dfbc0cbe09af62da9a1777e3b70ac03695a59cd45369ca11c1aa00e3a824a92683b5e652df4633 SHA512 9abb0e3fdfc99de0f3c11ee473064663d9baedb1181d2c13c7dd58362c8bbb269108157600f1f674aeb49cf9776cfdf366352cb59ac649e5093e2b843f88debf
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/files/tlp.init b/sys-power/tlp/files/tlp.init
new file mode 100644
index 000000000000..27b60dfeab13
--- /dev/null
+++ b/sys-power/tlp/files/tlp.init
@@ -0,0 +1,28 @@
+#!/sbin/openrc-run
+command=/usr/sbin/tlp
+name="TLP"
+extra_started_commands="reload stat"
+
+depend() {
+ need udev
+}
+
+start() {
+ ebegin "Starting tlp..."
+ $command init start
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading tlp's configuration..."
+ $command start
+ eend $?
+}
+
+stop() {
+ einfo "Reboot to stop tlp."
+}
+
+stat() {
+ /usr/bin/tlp-stat
+}
diff --git a/sys-power/tlp/metadata.xml b/sys-power/tlp/metadata.xml
new file mode 100644
index 000000000000..67faef85edd8
--- /dev/null
+++ b/sys-power/tlp/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM 'https://www.gentoo.org/dtd/metadata.dtd'>
+<pkgmetadata>
+ <maintainer type="person">
+ <email>jayf@gentoo.org</email>
+ <name>Jay Faulkner</name>
+ </maintainer>
+ <longdescription lang="en">
+ 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="ppd">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>
+</pkgmetadata>
diff --git a/sys-power/tlp/tlp-1.8.0-r1.ebuild b/sys-power/tlp/tlp-1.8.0-r1.ebuild
new file mode 100644
index 000000000000..4c3ac97819fc
--- /dev/null
+++ b/sys-power/tlp/tlp-1.8.0-r1.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit udev optfeature
+
+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"
+
+RDEPEND="
+ dev-lang/perl
+ virtual/udev
+"
+
+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_ELOD=/usr/lib/elogind/system-sleep
+ TLP_WITH_ELOGIND=1
+ TLP_WITH_SYSTEMD=1
+ install install-man
+ )
+ emake "${myemakeargs[@]}"
+
+ fperms 444 /usr/share/tlp/defaults.conf # manpage says this file should not be edited
+ newinitd "${FILESDIR}/tlp.init" tlp
+ 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
+}
+
+pkg_postrm() {
+ udev_reload
+}
diff --git a/sys-power/tlp/tlp-1.9.1.ebuild b/sys-power/tlp/tlp-1.9.1.ebuild
new file mode 100644
index 000000000000..74d09e74d378
--- /dev/null
+++ b/sys-power/tlp/tlp-1.9.1.ebuild
@@ -0,0 +1,108 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{13..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="ppd? ( ${PYTHON_REQUIRED_USE} )"
+
+IUSE="
+ +ppd
+ +rdw
+"
+
+# NOTE(JayF): Upstream dep list in human-readable format:
+# https://linrunner.de/tlp/developers/dependencies.html
+# NOTE(JayF): Blockers for these are not ideal, however all three
+# of these packages implement the same service on dbus
+# and have conflicting files as a result. Long-term
+# there likely needs to be a better solution. See
+# https://bugs.gentoo.org/967823.
+RDEPEND="
+ dev-lang/perl
+ net-wireless/iw
+ sys-apps/hdparm
+ sys-apps/pciutils
+ sys-apps/usbutils
+ virtual/udev
+ ppd? (
+ !sys-apps/tuned[ppd]
+ !sys-power/power-profiles-daemon
+ $(python_gen_cond_dep 'dev-python/dbus-python[${PYTHON_USEDEP}]')
+ $(python_gen_cond_dep 'dev-python/pygobject[${PYTHON_USEDEP}]')
+ ${PYTHON_DEPS}
+ )
+ rdw? ( net-misc/networkmanager )
+"
+DEPEND="${RDEPEND}"
+DOCS=( changelog README.rst )
+
+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 ppd && 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
+ einstalldocs
+}
+
+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
+
+ if has_version "sys-apps/tuned"; then
+ ewarn
+ ewarn "sys-apps/tuned is installed, but is "
+ ewarn "documented by upstream sys-power/tlp to be conficting. "
+ ewarn "For best results, uninstall one of these packages."
+ ewarn
+ fi
+
+ if has_version "app-laptop/laptop-mode-tools"; then
+ ewarn
+ ewarn "app-laptop/laptop-mode-tools is installed, but is "
+ ewarn "documented by upstream sys-power/tlp to be conficting. "
+ ewarn "For best results, uninstall one of these packages."
+ ewarn
+ fi
+}
+
+pkg_postrm() {
+ udev_reload
+}