mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2025-12-21 21:17:37 -08:00
The sys-power/tlp-1.9.0 ebuild had several bugs around dependency and style: - Blockers against tuned, laptop-mode-tools, and power-profiles-daemon were too aggressive. Moved to a warning instead of a hard block to make migrations easy/possible. - non-standard gentoo style of repeating use? ( pkg ) in each row instead of using one use? () block for multiple packages - dbus-python and pygobject were missing the proper dynamic python use dependencies. - renaming USE=pd to USE=ppd for consistency with tuned The original commit had more changes than would be expected due to it adding a tlp-pd daemon which implements power-profile-daemon abilities. As part of this, we noticed and added additional dependencies as documented here: https://linrunner.de/tlp/developers/dependencies.html Closes: https://bugs.gentoo.org/967685 Closes: https://bugs.gentoo.org/967686 Closes: https://bugs.gentoo.org/967687 Signed-off-by: Jay Faulkner <jayf@gentoo.org>
108 lines
2.7 KiB
Bash
108 lines
2.7 KiB
Bash
# 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="ppd? ( ${PYTHON_REQUIRED_USE} )"
|
|
|
|
IUSE="
|
|
+ppd
|
|
+rdw
|
|
"
|
|
|
|
# NOTE(JayF): Upstream dep list in human-readable format:
|
|
# https://linrunner.de/tlp/developers/dependencies.html
|
|
RDEPEND="
|
|
dev-lang/perl
|
|
net-wireless/iw
|
|
sys-apps/hdparm
|
|
sys-apps/pciutils
|
|
sys-apps/usbutils
|
|
virtual/udev
|
|
ppd? (
|
|
$(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}"
|
|
|
|
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
|
|
}
|
|
|
|
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-power/power-profiles-daemon" && use ppd; then
|
|
ewarn
|
|
ewarn "sys-power/power-profiles-daemon is installed, but is "
|
|
ewarn "incompatible with tlp-pd daemon. For best results, "
|
|
ewarn "uninstall one of these packages or set use tlp[-ppd]."
|
|
ewarn
|
|
fi
|
|
|
|
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
|
|
}
|