sys-power/tlp: add 1.10.1

Signed-off-by: Jay Faulkner <jayf@gentoo.org>
This commit is contained in:
Jay Faulkner
2026-06-14 13:00:20 -07:00
parent 0f72074671
commit 7728894a9f
2 changed files with 127 additions and 0 deletions

View File

@@ -1 +1,2 @@
DIST tlp-1.10.1.tar.gz 217945 BLAKE2B 604ab1e5ef99ca944511be47b4999eb1b4efc40e04520632f3a07eb2547cd2a9d7f833211d35641bf1506f3e70d1245616bb59af71d65e4f0f399ac7181cc7fa SHA512 ee3ae1d32fe436c25f8a9a4fe14d049989708faf72318c01f651c7245f6bfd62b86c3f149ca236871bb7a1182728cc859188ddc0a798601db1543e99f709850e
DIST tlp-1.9.1.tar.gz 210993 BLAKE2B b6ab4a81852ace750cd6ef49b1fb595b85a9f9cafcf8da3f79dfbc0cbe09af62da9a1777e3b70ac03695a59cd45369ca11c1aa00e3a824a92683b5e652df4633 SHA512 9abb0e3fdfc99de0f3c11ee473064663d9baedb1181d2c13c7dd58362c8bbb269108157600f1f674aeb49cf9776cfdf366352cb59ac649e5093e2b843f88debf

View File

@@ -0,0 +1,126 @@
# Copyright 1999-2026 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="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_prepare() {
# Add support for a PREFIX variable in the Makefile
sed -e '/^TLP_[A-Z_]\+ \+?= \//s|/|$(TLP_PREFIX)/|' \
-i Makefile || die
default
}
src_compile() {
# NOTE(JayF): TLP_WITH_ELOGIND/TLP_WITH_SYSTEMD are both only installing
# small init/config files.
EMAKEARGS=(
TLP_PREFIX="${EPREFIX}"
TLP_ULIB="${EPREFIX}$(get_udevdir)"
TLP_NO_INIT=1
TLP_WITH_ELOGIND=1
TLP_WITH_SYSTEMD=1
)
emake "${EMAKEARGS[@]}"
}
src_install() {
local myemakeargs=(
"${EMAKEARGS[@]}"
DESTDIR="${D}"
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
}