sys-apps/corefreq: add 2.0.9

Rework `CONFIG_CHECK` to make it clear some options are indeed optional.

Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
This commit is contained in:
Paul Zander
2025-12-18 22:05:17 +01:00
parent 0f042155c3
commit ef8fad4c68
2 changed files with 75 additions and 0 deletions

View File

@@ -1 +1,2 @@
DIST corefreq-2.0.8.tar.gz 1236511 BLAKE2B bb125d356e9b140bf9e93b3e5d96a27f2bdc56f6588fcf24bfd423fa7a11a04a1e2f777aab0141cbffeb0757133a22c01599d791df38f3230e6a413e1e1f78d3 SHA512 efbebb70d80425db2f448814e2c219013f795150a1cf13246565e3863fd0c66780e38f7a673479fe99cc3d5605d260e6caa77671cdfa74edf75d28db26817109
DIST corefreq-2.0.9.tar.gz 1237167 BLAKE2B 711de9b3293082997e62b7909bee6839bf7c02ee54ff564566f0791fd34f16c187951606dbc53f82117a00626a1e1a2a1be48f90f24aa44e1dcf6cb4f778908f SHA512 dfc6da41a3345b8d66dff7a7359e4cfc860f4fe2756820f9bc782feb64491b5e74e5ff8aaba43d94cdd830d42aa2c896dacfe0564504adc5e379ddeb120b075f

View File

@@ -0,0 +1,74 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit linux-mod-r1 systemd toolchain-funcs
DESCRIPTION="CPU monitoring and tuning software designed for 64-bit processors"
HOMEPAGE="https://www.cyring.fr/"
SRC_URI="https://github.com/cyring/CoreFreq/archive/${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/CoreFreq-${PV}"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"
DOCS=( README.md )
pkg_setup() {
# see README.md
# required
local CONFIG_CHECK="SMP X86_MSR"
# optional
local optional_checks=(
HOTPLUG_CPU
CPU_IDLE
CPU_FREQ
PM_SLEEP
DMI
HAVE_NMI
XEN
AMD_NB
HAVE_PERF_EVENTS
SCHED_MUQSS
SCHED_BMQ
SCHED_PDS
)
CONFIG_CHECK+="$(printf " ~%s" "${optional_checks[@]}")"
local check
for check in "${optional_checks[@]}"; do
eval "WARNING_${check}"="\"CONFIG_${check} is optional and not enabled\""
done
linux-mod-r1_pkg_setup
}
src_compile() {
local modlist=( corefreqk=misc::build )
local modargs=( KERNELDIR="${KV_OUT_DIR}" )
linux-mod-r1_src_compile
emake V=1 CC="$(tc-getCC)" OPTIM_FLG="${CFLAGS} ${LDFLAGS}" corefreqd corefreq-cli
}
src_install() {
linux-mod-r1_src_install
dobin build/{corefreqd,corefreq-cli}
newconfd "${FILESDIR}/${PN}.conf" "${PN}"
doinitd "${FILESDIR}/${PN}"
systemd_dounit "${PN}d.service"
}
pkg_postinst() {
linux-mod-r1_pkg_postinst
einfo "To be able to use corefreq, you need to load kernel module:"
einfo "modprobe corefreqk"
einfo "After that - start daemon with corefreqd"
einfo "or by 'rc-service corefreq start'"
einfo "And only after that you can start corefreq-cli"
}