From 2f6dc366e8a8df99b703ed737611f125f6ba2284 Mon Sep 17 00:00:00 2001 From: Jasi Date: Wed, 25 Jun 2025 15:14:34 -0400 Subject: [PATCH 1/7] triforce-lv2: add normalcea as maintainer --- pkgs/by-name/tr/triforce-lv2/package.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/tr/triforce-lv2/package.nix b/pkgs/by-name/tr/triforce-lv2/package.nix index 657233da0b8d..5798e8c57007 100644 --- a/pkgs/by-name/tr/triforce-lv2/package.nix +++ b/pkgs/by-name/tr/triforce-lv2/package.nix @@ -30,7 +30,10 @@ rustPlatform.buildRustPackage rec { homepage = "https://github.com/chadmed/triforce"; description = "Minimum Variance Distortionless Response adaptive beamformer for the microphone array found in some Apple Silicon laptops"; license = licenses.gpl2Plus; - maintainers = with maintainers; [ yuka ]; + maintainers = with maintainers; [ + normalcea + yuka + ]; platforms = platforms.linux; }; } From 825cdd97ebd48095267b48b45ba19e9a100dc3c0 Mon Sep 17 00:00:00 2001 From: Jasi Date: Tue, 24 Jun 2025 20:07:39 -0400 Subject: [PATCH 2/7] triforce-lv2: remove overriding default phases --- pkgs/by-name/tr/triforce-lv2/package.nix | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/tr/triforce-lv2/package.nix b/pkgs/by-name/tr/triforce-lv2/package.nix index 5798e8c57007..2418ae07a1fc 100644 --- a/pkgs/by-name/tr/triforce-lv2/package.nix +++ b/pkgs/by-name/tr/triforce-lv2/package.nix @@ -2,6 +2,7 @@ lib, rustPlatform, fetchFromGitHub, + stdenv, }: rustPlatform.buildRustPackage rec { @@ -15,16 +16,21 @@ rustPlatform.buildRustPackage rec { hash = "sha256-f4i0S6UaVfs1CUeQRqo22PRgMNwYDNoMunHidI1XzBk="; }; + postPatch = '' + substituteInPlace Makefile \ + --replace-fail "target/release" \ + "target/${stdenv.hostPlatform.rust.cargoShortTarget}/$cargoBuildType" + ''; + useFetchCargoVendor = true; cargoHash = "sha256-2FC6wlFJkQryA/bcjF0GjrMQVb8hlUY+muFqPqShWss="; - installPhase = '' - export LIBDIR=$out/lib - mkdir -p $LIBDIR + dontCargoInstall = true; - make - make install - ''; + installFlags = [ + "DESTDIR=$(out)" + "LIBDIR=lib" + ]; meta = with lib; { homepage = "https://github.com/chadmed/triforce"; From 43e2026ced79e750f1bd555133fc2d8b3b16eb20 Mon Sep 17 00:00:00 2001 From: Jasi Date: Wed, 25 Jun 2025 16:21:26 -0400 Subject: [PATCH 3/7] triforce-lv2: use `finalAttrs`; remove unused `useFetchCargoVendor` --- pkgs/by-name/tr/triforce-lv2/package.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/tr/triforce-lv2/package.nix b/pkgs/by-name/tr/triforce-lv2/package.nix index 2418ae07a1fc..63ca1424fbf0 100644 --- a/pkgs/by-name/tr/triforce-lv2/package.nix +++ b/pkgs/by-name/tr/triforce-lv2/package.nix @@ -5,14 +5,14 @@ stdenv, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "triforce-lv2"; version = "0.3.2"; src = fetchFromGitHub { owner = "chadmed"; repo = "triforce"; - rev = version; + tag = finalAttrs.version; hash = "sha256-f4i0S6UaVfs1CUeQRqo22PRgMNwYDNoMunHidI1XzBk="; }; @@ -22,7 +22,6 @@ rustPlatform.buildRustPackage rec { "target/${stdenv.hostPlatform.rust.cargoShortTarget}/$cargoBuildType" ''; - useFetchCargoVendor = true; cargoHash = "sha256-2FC6wlFJkQryA/bcjF0GjrMQVb8hlUY+muFqPqShWss="; dontCargoInstall = true; @@ -42,4 +41,4 @@ rustPlatform.buildRustPackage rec { ]; platforms = platforms.linux; }; -} +}) From f0f84f5ffd0c913d2bcc6bc811b03c3e0ae5d5c5 Mon Sep 17 00:00:00 2001 From: Jasi Date: Wed, 25 Jun 2025 14:14:39 -0400 Subject: [PATCH 4/7] triforce-lv2: shorten `meta.description`; add `meta.longDescription` --- pkgs/by-name/tr/triforce-lv2/package.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/tr/triforce-lv2/package.nix b/pkgs/by-name/tr/triforce-lv2/package.nix index 63ca1424fbf0..71df43f9b6dd 100644 --- a/pkgs/by-name/tr/triforce-lv2/package.nix +++ b/pkgs/by-name/tr/triforce-lv2/package.nix @@ -33,7 +33,18 @@ rustPlatform.buildRustPackage (finalAttrs: { meta = with lib; { homepage = "https://github.com/chadmed/triforce"; - description = "Minimum Variance Distortionless Response adaptive beamformer for the microphone array found in some Apple Silicon laptops"; + description = "Beamformer for Apple Silicon laptops"; + longDescription = '' + Triforce implements a Minimum Variance Distortionless Response + adaptive beamformer for the microphone array found in the + following Apple Silicon laptops: + + - MacBook Pro 13" (M1/M2) + - MacBook Air 13" (M1/M2) + - MacBook Pro 14" (M1 Pro/Max, M2 Pro/Max) + - MacBook Pro 16" (M1 Pro/Max, M2 Pro/Max) + - MacBook Air 15" (M2) + ''; license = licenses.gpl2Plus; maintainers = with maintainers; [ normalcea From 737f0b98d7d3a1e343a4c2e85c541c471f7ce5d1 Mon Sep 17 00:00:00 2001 From: Jasi Date: Wed, 25 Jun 2025 15:15:38 -0400 Subject: [PATCH 5/7] triforce-lv2: remove `with lib;` usage --- pkgs/by-name/tr/triforce-lv2/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/tr/triforce-lv2/package.nix b/pkgs/by-name/tr/triforce-lv2/package.nix index 71df43f9b6dd..0d736c449692 100644 --- a/pkgs/by-name/tr/triforce-lv2/package.nix +++ b/pkgs/by-name/tr/triforce-lv2/package.nix @@ -31,7 +31,7 @@ rustPlatform.buildRustPackage (finalAttrs: { "LIBDIR=lib" ]; - meta = with lib; { + meta = { homepage = "https://github.com/chadmed/triforce"; description = "Beamformer for Apple Silicon laptops"; longDescription = '' @@ -45,11 +45,11 @@ rustPlatform.buildRustPackage (finalAttrs: { - MacBook Pro 16" (M1 Pro/Max, M2 Pro/Max) - MacBook Air 15" (M2) ''; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ + license = lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [ normalcea yuka ]; - platforms = platforms.linux; + platforms = lib.platforms.linux; }; }) From efb035360f21fb3c7b356e518daa4dfa2d069692 Mon Sep 17 00:00:00 2001 From: Jasi Date: Wed, 25 Jun 2025 18:38:36 -0400 Subject: [PATCH 6/7] triforce-lv2: add `nix-update-script` --- pkgs/by-name/tr/triforce-lv2/package.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/by-name/tr/triforce-lv2/package.nix b/pkgs/by-name/tr/triforce-lv2/package.nix index 0d736c449692..6ad7d5e6059c 100644 --- a/pkgs/by-name/tr/triforce-lv2/package.nix +++ b/pkgs/by-name/tr/triforce-lv2/package.nix @@ -3,6 +3,7 @@ rustPlatform, fetchFromGitHub, stdenv, + nix-update-script, }: rustPlatform.buildRustPackage (finalAttrs: { @@ -31,6 +32,10 @@ rustPlatform.buildRustPackage (finalAttrs: { "LIBDIR=lib" ]; + passthru = { + updateScript = nix-update-script { }; + }; + meta = { homepage = "https://github.com/chadmed/triforce"; description = "Beamformer for Apple Silicon laptops"; From edc4fedd7f01fa6eacd0d2395895909fea19e7f1 Mon Sep 17 00:00:00 2001 From: Jasi Date: Fri, 27 Jun 2025 12:41:18 -0400 Subject: [PATCH 7/7] triforce-lv2: restrict platforms to `"aarch64-linux"` only --- pkgs/by-name/tr/triforce-lv2/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/tr/triforce-lv2/package.nix b/pkgs/by-name/tr/triforce-lv2/package.nix index 6ad7d5e6059c..e52a62ef43c5 100644 --- a/pkgs/by-name/tr/triforce-lv2/package.nix +++ b/pkgs/by-name/tr/triforce-lv2/package.nix @@ -55,6 +55,6 @@ rustPlatform.buildRustPackage (finalAttrs: { normalcea yuka ]; - platforms = lib.platforms.linux; + platforms = [ "aarch64-linux" ]; }; })