Merge updates from master

This commit is contained in:
Repository mirror & CI
2024-01-31 22:33:23 +00:00
4 changed files with 96 additions and 1 deletions

View File

@@ -1,2 +1,2 @@
DIST himitsu-0.4.tar.gz 42135 BLAKE2B 3921887f8398890b43b8f9219bdfa5dac2c44689c2b52e605d447795469827a3fbe86dec227fa799cd38926c0c2cb727feef885ab03658eec13f7239fcbd98cb SHA512 a42b8088f0ddf8931347fc16d5b6404e21e7603025d444e734beeb57da3f9fefdc4e55993dd613ef77d3eb9448fd9acf43c109dc199e97e5d259a3f5a3267571
DIST himitsu-0.5.tar.gz 42924 BLAKE2B 808a62c13e950d102f27c3219f15b23ed414ec5d9e9029dee0ac8e1b217d199fe9ade707d23a3f016098e661e4416e5d8aaa445a55caaed834444a266ba29d7b SHA512 6e9c304df824814179dd99e67dbed6c78860127eabe73df13d7b8f06e32cf47700cb7e1450e862d68ad4e1004d5feb9195cb1b91849b8b8436a1d149d5d0ace2
DIST himitsu-0.6.tar.gz 43271 BLAKE2B 7c1e92ad50727985bc4db9e1f424900187a08e2b9a06306f455f459ef188de8632160d45881008d73fae8a29e814b7b63903110f75c90cc5605b7c9e1b614d6c SHA512 ebc40fc37a565507dcf219698844846d2e73db300d5432119c71ce6013cf623bc5ba96e36a5e38e3927235bda8d482a548fa7a7dbac89acb0a6673c18239cfbb

View File

@@ -0,0 +1,83 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
DISTUTILS_USE_PEP517=poetry
inherit distutils-r1 systemd
DESCRIPTION="Automatic CPU speed & power optimizer for Linux"
HOMEPAGE="https://github.com/AdnanHodzic/auto-cpufreq"
SRC_URI="https://github.com/AdnanHodzic/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="GPL-3"
KEYWORDS="~amd64"
SLOT="0"
RDEPEND="
dev-python/click[${PYTHON_USEDEP}]
dev-python/distro[${PYTHON_USEDEP}]
dev-python/psutil[${PYTHON_USEDEP}]
dev-python/pygobject[${PYTHON_USEDEP}]
dev-python/requests[${PYTHON_USEDEP}]
"
DEPEND="${RDEPEND}"
DOCS=( README.md )
PATCHES=( "${FILESDIR}/${PN}-remove-poetry_versioning.patch" )
src_prepare() {
sed -i 's|usr/local|usr|g' "scripts/${PN}.service" "scripts/${PN}-openrc" auto_cpufreq/core.py || die
sed -i 's|usr/local|usr|g' "scripts/${PN}.service" "scripts/${PN}-openrc" auto_cpufreq/gui/app.py || die
distutils-r1_src_prepare
}
python_install() {
distutils-r1_python_install
exeinto "/usr/share/${PN}/scripts"
doexe scripts/cpufreqctl.sh
insinto "/usr/share/${PN}/scripts"
doins scripts/style.css
insinto "/usr/share/${PN}/images"
doins images/*
systemd_douserunit "${FILESDIR}/${PN}.service"
newinitd "scripts/${PN}-openrc" "${PN}"
}
pkg_postinst() {
touch /var/log/auto-cpufreq.log
elog ""
elog "Enable auto-cpufreq daemon service at boot:"
elog "systemd: systemctl enable --now auto-cpufreq"
elog "openrc: rc-update add auto-cpufreq default"
elog ""
elog "To view live log, run:"
elog "auto-cpufreq --stats"
}
pkg_postrm() {
# Remove auto-cpufreq log file
if [ -f "/var/log/auto-cpufreq.log" ]; then
rm /var/log/auto-cpufreq.log || die
fi
# Remove auto-cpufreq's cpufreqctl binary
# it overwrites cpufreqctl.sh
if [ -f "/usr/bin/cpufreqctl" ]; then
rm /usr/bin/cpufreqctl || die
fi
# Restore original cpufreqctl binary if backup was made
if [ -f "/usr/bin/cpufreqctl.auto-cpufreq.bak" ]; then
mv /usr/bin/cpufreqctl.auto-cpufreq.bak /usr/bin/cpufreqctl || die
fi
}

View File

@@ -0,0 +1,12 @@
[Unit]
Description=auto-cpufreq - Automatic CPU speed & power optimizer for Linux
After=network.target network-online.target
[Service]
Type=simple
User=root
ExecStart=auto-cpufreq --daemon
Restart=on-failure
[Install]
WantedBy=multi-user.target