From 198e3588dc827df210ac3576258a90ea26529708 Mon Sep 17 00:00:00 2001 From: Conroy Cheers Date: Fri, 14 Nov 2025 23:56:37 +1100 Subject: [PATCH] fan2go: 0.10.0 -> 0.11.1 Changelog: https://github.com/markusressel/fan2go/releases Co-authored-by: Guillaume Girol --- pkgs/by-name/fa/fan2go/lazy-binding.patch | 18 ------------------ pkgs/by-name/fa/fan2go/package.nix | 21 +++++++++++++++------ 2 files changed, 15 insertions(+), 24 deletions(-) delete mode 100644 pkgs/by-name/fa/fan2go/lazy-binding.patch diff --git a/pkgs/by-name/fa/fan2go/lazy-binding.patch b/pkgs/by-name/fa/fan2go/lazy-binding.patch deleted file mode 100644 index fc5d07fd2e1d..000000000000 --- a/pkgs/by-name/fa/fan2go/lazy-binding.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/Makefile b/Makefile -index c92df71..724911a 100644 ---- a/Makefile -+++ b/Makefile -@@ -10,11 +10,12 @@ DATE ?= $(shell date -u -d @${SOURCE_DATE_EPOCH} +"%Y-%m-%dT%H:%M:%SZ") - VERSION ?= 0.10.0 - - test: ## Run all tests -- @go clean --testcache && go test -v ./... -+ @go clean --testcache && go test -ldflags -extldflags=-Wl,-z,lazy -v ./... - - build: ## Builds the CLI - @go build ${GO_FLAGS} \ - -ldflags "-w -s \ -+ -extldflags=-Wl,-z,lazy \ - -X ${NAME}/cmd/global.Version=${VERSION} \ - -X ${PACKAGE}/cmd/global.Version=${VERSION} \ - -X ${NAME}/cmd/global.Commit=${GIT_REV} \ diff --git a/pkgs/by-name/fa/fan2go/package.nix b/pkgs/by-name/fa/fan2go/package.nix index 08c9ab25b497..aff0ff0a7167 100644 --- a/pkgs/by-name/fa/fan2go/package.nix +++ b/pkgs/by-name/fa/fan2go/package.nix @@ -1,19 +1,22 @@ { + config, buildGoModule, fetchFromGitHub, lib, lm_sensors, + autoAddDriverRunpath, + enableNVML ? config.cudaSupport, }: buildGoModule rec { pname = "fan2go"; - version = "0.10.0"; + version = "0.11.1"; src = fetchFromGitHub { owner = "markusressel"; repo = "fan2go"; tag = version; - hash = "sha256-mLypuOGjYrXFf3BGCDggEDk1+PVx2CgsxAjZQ7uiSW0="; + hash = "sha256-CHBJhG10RD5rQW1SFk7ffV9M4t6LtJR6xQrw47KQzC0="; leaveDotGit = true; postFetch = '' cd $out @@ -22,12 +25,14 @@ buildGoModule rec { ''; }; - vendorHash = "sha256-IJJTolpOtstVov8MNel6EOJqv1oCkTOTiPyW42ElQjc="; + vendorHash = "sha256-BSZwvD9psXtSmoUPBxMVuvbcpqDSpFEKVskJo05e4fo="; + + nativeBuildInputs = lib.optionals enableNVML [ + autoAddDriverRunpath + ]; buildInputs = [ lm_sensors ]; - patches = [ ./lazy-binding.patch ]; - postConfigure = '' substituteInPlace vendor/github.com/md14454/gosensors/gosensors.go \ --replace-fail '"/etc/sensors3.conf"' '"${lib.getLib lm_sensors}/etc/sensors3.conf"' @@ -41,7 +46,7 @@ buildGoModule rec { buildPhase = '' runHook preBuild - make build GIT_REV="$(cat GIT_REV)" + make build${lib.optionalString (!enableNVML) "-no-nvml"} GIT_REV="$(cat GIT_REV)" dir="$GOPATH/bin" mkdir -p "$dir" @@ -50,6 +55,10 @@ buildGoModule rec { runHook postBuild ''; + postFixup = lib.optionalString enableNVML '' + patchelf --add-needed libnvidia-ml.so "$out/bin/fan2go" + ''; + checkPhase = '' runHook preCheck make test