sys-apps/coolercontrold: add 2.1.0, new package

Bug: https://bugs.gentoo.org/907178
Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
This commit is contained in:
Paul Zander
2025-05-08 21:57:00 +02:00
parent ca357b211e
commit c8f109aab9
4 changed files with 162 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
DIST coolercontrol-2.1.0-dist.tar.xz 867648 BLAKE2B 529ed66ae42f8cd35e2818ab7bd7a4d893850a216286153b0583f74cb31a529e14359579d4698bd6fec1fce00a4765ab85d7b94c992d01fb441954354e929b25 SHA512 d210fedb513e8c21f7ce93a814074d025c490cbc9726fd78d740b706ad07f1f7acda58fd572c582c221fe05680188ce720b718daa0fc2832d3ce7c770e0cec75
DIST coolercontrol-2.1.0.tar.bz2 15732132 BLAKE2B e90692b6b5d9b99ebc2bd26d519f9311600664c8296d1264ccd3d1d81b70e80ffa353eeae65a55e8398fc6e992dec0e7c451f22fe39bc0eec9cee1364a9004e8 SHA512 975877f0bbea06e294ff7b1d07ad7c12543b4dfc044e1500daf4658d3a9b13e49c52a66847b81f4d81d6c8604b6e3526c9fdc93f0a830650f8e0b3b081cefd81
DIST coolercontrold-2.1.0-crates.tar.xz 45467392 BLAKE2B e0e26e43b86df39e6c896c46beb3fdb4c4115628ef58d5d5ad03a0c353dd9af3f420a7c3f1b3d0799d45d1bb5b28e144f1f4cccc82a74ca50de071f073ad8821 SHA512 4dec1899ab32b6df6f2da642c868cb18519df2da88e9908dd4a0c108cca78bbe054b825402e0621099ac4bb556a3a031fdaecd033f76186c184091f2f0ac6ef1
DIST nvml-wrapper-572095f631da93be8d243c73820e581676969897.gh.tar.gz 234938 BLAKE2B 91820ff38212c176027ab6fb0552efb1544e539fc0dda29e1f7d82e2cec8dce1ecd6cc499c120049869cde638ecf3918db3f73f86ea73214135e83c4bccbf8b7 SHA512 1ead616cd59058e3c2f100cc0dff9b6f4f97aeb70d30ef7d9667eef3e8b272bfae487e1c68e042680c4be8667246b4048cf8124ffe6a7011899cd2b87d8e9ec2
DIST tower-governor-fd799d86418e58179468953c80ad7094a81a9e37.gh.tar.gz 31787 BLAKE2B 452d9423efbb4230bd88dfd58418850d0ccd53d5d7a45ff5f60005f292637c296c4c67d75397a7f4a59af51028b2fa95a2ef69b372c18b1dc02408437e8aac81 SHA512 40819f6d2dd7f1471af403e0314d261d043c6fddde12c55b797412d07f0ae6db3cfb640cbe3e2ebfea1be11794ed8ded20c39ca489784a4dbbbfdead3ff2f38c

View File

@@ -0,0 +1,90 @@
# Copyright 2024-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
CRATES="
"
declare -A GIT_CRATES=(
[nvml-wrapper-sys]='https://github.com/codifryed/nvml-wrapper;572095f631da93be8d243c73820e581676969897;nvml-wrapper-%commit%/nvml-wrapper-sys'
[nvml-wrapper]='https://github.com/codifryed/nvml-wrapper;572095f631da93be8d243c73820e581676969897;nvml-wrapper-%commit%/nvml-wrapper'
[tower_governor]='https://github.com/codifryed/tower-governor;fd799d86418e58179468953c80ad7094a81a9e37;tower-governor-%commit%'
)
inherit cargo optfeature systemd
DESCRIPTION="Monitor and control your cooling and other devices (daemon)"
HOMEPAGE="https://gitlab.com/coolercontrol/coolercontrol"
SRC_URI="
https://gitlab.com/coolercontrol/coolercontrol/-/archive/${PV}/coolercontrol-${PV}.tar.bz2
https://gitlab.com/api/v4/projects/32909921/packages/generic/coolercontrol/${PV}/coolercontrol-${PV}-dist.tar.xz
https://gitlab.com/api/v4/projects/32909921/packages/generic/coolercontrol/${PV}/coolercontrold-${PV}-crates.tar.xz
${CARGO_CRATE_URIS}
"
S="${WORKDIR}/coolercontrol-${PV}/${PN}"
LICENSE="GPL-3+"
# Dependent crate licenses
LICENSE+="
AGPL-3+ Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD-2 BSD CC-PD
GPL-3+ ISC MIT MPL-2.0 UoI-NCSA Unicode-3.0 ZLIB
"
SLOT="0"
KEYWORDS="~amd64"
IUSE="video_cards_amdgpu"
RDEPEND="
app-arch/zstd:=
video_cards_amdgpu? (
x11-libs/libdrm[video_cards_amdgpu]
)
"
DEPEND="${RDEPEND}"
QA_FLAGS_IGNORED=".*"
PATCHES=(
"${FILESDIR}"/coolercontrold-2.1.0-optional-libdrm_amdgpu.patch
)
src_prepare() {
pushd .. >/dev/null || die
default
popd >/dev/null || die
# Disable stripping
sed -i -e '/^strip =/d' Cargo.toml || die
cp -rf "${WORKDIR}"/dist/* "${S}"/resources/app/ || die
}
src_configure() {
export ZSTD_SYS_USE_PKG_CONFIG=1
local myfeatures=(
$(usev video_cards_amdgpu libdrm_amdgpu)
)
cargo_src_configure
}
src_install() {
cargo_src_install
einstalldocs
doinitd ../packaging/openrc/init.d/coolercontrol
doconfd ../packaging/openrc/conf.d/coolercontrol
systemd_dounit ../packaging/systemd/coolercontrold.service
}
pkg_postinst() {
optfeature "interact with AIO liquid coolers and other devices" sys-apps/coolercontrol-liqctld
if [[ -n ${REPLACING_VERSIONS} ]]; then
elog "Remember to restart coolercontrol service to use the new version."
fi
}

View File

@@ -0,0 +1,54 @@
From e55e506862c8c2bc37520fc72a16093f9a2a23fc Mon Sep 17 00:00:00 2001
From: Alfred Wingate <parona@protonmail.com>
Date: Mon, 23 Sep 2024 14:35:35 +0300
Subject: [PATCH] Allow disabling linking to libdrm_amdgpu
Notably users on Gentoo may choose to disable building libdrm with amdgpu support leading to a build
failure.
Signed-off-by: Alfred Wingate <parona@protonmail.com>
--- a/coolercontrold/Cargo.toml
+++ b/coolercontrold/Cargo.toml
@@ -17,6 +17,7 @@ license = "GPL-3.0-or-later"
[features]
default = []
io_uring = ["dep:tokio-uring"]
+libdrm_amdgpu = []
[dependencies]
log = "0.4.27"
--- a/coolercontrold/src/repositories/gpu/amd.rs
+++ b/coolercontrold/src/repositories/gpu/amd.rs
@@ -37,7 +37,9 @@ use crate::repositories::hwmon::{devices, fans, freqs, power, temps};
use crate::repositories::repository::DeviceLock;
use anyhow::{anyhow, Context, Result};
use heck::ToTitleCase;
+#[cfg(feature = "libdrm_amdgpu")]
use libdrm_amdgpu_sys::LibDrmAmdgpu;
+#[cfg(feature = "libdrm_amdgpu")]
use libdrm_amdgpu_sys::AMDGPU::GPU_INFO;
use log::{debug, error, info, trace, warn};
use regex::Regex;
@@ -145,7 +147,11 @@ impl GpuAMD {
debug!("Could not get RDNA3/4 fan curve info: {err}");
})
.ok();
+ #[cfg(feature = "libdrm_amdgpu")]
let drm_device_name = Self::get_drm_device_name(&path).await;
+ #[cfg(not(feature = "libdrm_amdgpu"))]
+ // https://github.com/Umio-Yasuno/libdrm-amdgpu-sys-rs/blob/c10593dd00ad822d71e284424455023a3ad6a20c/amdgpu/mod.rs#L14
+ let drm_device_name = Some(String::from("AMD Radeon Graphics"));
let pci_device_names = devices::get_device_pci_names(&path).await;
let model = devices::get_device_model_name(&path)
.await
@@ -187,6 +193,7 @@ impl GpuAMD {
}
}
+ #[cfg(feature = "libdrm_amdgpu")]
async fn get_drm_device_name(base_path: &Path) -> Option<String> {
let drm_amdgpu = LibDrmAmdgpu::new().ok()?;
let slot_name = devices::get_pci_slot_name(base_path).await?;
--
2.49.0

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>negril.nx+gentoo@gmail.com</email>
<name>Paul Zander</name>
</maintainer>
<upstream>
<doc>https://docs.coolercontrol.org/</doc>
<remote-id type="gitlab">coolercontrol/coolercontrol</remote-id>
<remote-id type="github">codifryed/nvml-wrapper</remote-id>
</upstream>
</pkgmetadata>