commit: aa45b888e03660098459622f4d149b5db6081392 Author: Jay Faulkner <jayf <AT> gentoo <DOT> org> AuthorDate: Wed Mar 12 20:40:45 2025 +0000 Commit: Jay Faulkner <jayf <AT> gentoo <DOT> org> CommitDate: Wed Mar 12 20:40:45 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa45b888
sys-power/tlp: add 1.8.0 Signed-off-by: Jay Faulkner <jayf <AT> gentoo.org> sys-power/tlp/Manifest | 1 + sys-power/tlp/tlp-1.8.0.ebuild | 52 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/sys-power/tlp/Manifest b/sys-power/tlp/Manifest index 68e509588b5e..76a00d77ecd8 100644 --- a/sys-power/tlp/Manifest +++ b/sys-power/tlp/Manifest @@ -1 +1,2 @@ DIST tlp-1.7.0.tar.gz 151003 BLAKE2B 3dbd600921fe29d6adc4d195000087c969b4be8f8c3b6052cf411ad820f06c47e31e2cf93a0c33f822491f1cf2420fd6cf1193d45846b067975b4efbb3e5407e SHA512 db6777dff1b253f63941271d39b3785646ad15b4351a4a647ec748d9beabcc891b70d4070d0ce5b01919024e7560eac6ee858b720f8ec0a5535c51513ccf7a3d +DIST tlp-1.8.0.tar.gz 172154 BLAKE2B 843951699bab3237e3f3869393fe9890088da950101c13351e175287734871e1a72e368264b775a3f1c128fe8ae3225db1e4b6fac9fb72260a59a02028f48647 SHA512 d1c133faf2c7870b66a363ff84e5e0fafc6be2e36b5440336e3f4c45e68a9a8b7524f697af7a509cf724e21c3a43f976f9814e627531148e9ddaff267564d3c7 diff --git a/sys-power/tlp/tlp-1.8.0.ebuild b/sys-power/tlp/tlp-1.8.0.ebuild new file mode 100644 index 000000000000..4a97a332593a --- /dev/null +++ b/sys-power/tlp/tlp-1.8.0.ebuild @@ -0,0 +1,52 @@ +# 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" + +# It's uncertain if elogind/systemd is actually required, however, without the sleep +# hooks working, which require one of them, it doesn't seem like this app is very useful. +RDEPEND=" + dev-lang/perl + virtual/udev + || ( sys-auth/elogind sys-apps/systemd ) +" + +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 +} + +pkg_postrm() { + udev_reload +}
