From 4248ace0609ba2aed84fba30742368ec8a736692 Mon Sep 17 00:00:00 2001 From: Atemu Date: Sun, 17 Nov 2024 03:04:09 +0100 Subject: [PATCH 1/5] lact: 0.5.6 -> 0.6.0 --- pkgs/by-name/la/lact/package.nix | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/la/lact/package.nix b/pkgs/by-name/la/lact/package.nix index ed6a4db40ffa..9118e4c79906 100644 --- a/pkgs/by-name/la/lact/package.nix +++ b/pkgs/by-name/la/lact/package.nix @@ -14,16 +14,17 @@ rustPlatform.buildRustPackage rec { pname = "lact"; - version = "0.5.6"; + version = "0.6.0"; src = fetchFromGitHub { owner = "ilya-zlobintsev"; repo = "LACT"; rev = "v${version}"; - hash = "sha256-iz6Pl+A7Y/Ljot3QH2GaopgtfuYLpTLSq6uSprQ2EEU="; + hash = "sha256-goNwLtVjNY3O/BhFrCcM3X11dtM34XgfHL6bh+YFoIY="; }; - cargoHash = "sha256-uoMkz+0Jr07GpMRUKuJvrTTSAGdhLf35q/8but1fwIk="; + useFetchCargoVendor = true; + cargoHash = "sha256-rgpBmoGCNMU5nFVxzNtqsPaOn93mHW5P2isKgbP9UN4="; nativeBuildInputs = [ blueprint-compiler @@ -40,7 +41,7 @@ rustPlatform.buildRustPackage rec { checkFlags = [ # tries and fails to initialize gtk - "--skip=app::root_stack::thermals_page::fan_curve_frame::tests::set_get_curve" + "--skip=app::pages::thermals_page::fan_curve_frame::tests::set_get_curve" ]; postPatch = '' @@ -52,13 +53,6 @@ rustPlatform.buildRustPackage rec { substituteInPlace res/io.github.lact-linux.desktop \ --replace Exec={lact,$out/bin/lact} - - pushd $cargoDepsCopy/pciid-parser - oldHash=$(sha256sum src/lib.rs | cut -d " " -f 1) - substituteInPlace src/lib.rs --subst-var-by hwdata ${hwdata} - substituteInPlace .cargo-checksum.json \ - --replace $oldHash $(sha256sum src/lib.rs | cut -d " " -f 1) - popd ''; postInstall = '' From be8bf5440a476b3ee9187c42d9eddd8963e89a12 Mon Sep 17 00:00:00 2001 From: Atemu Date: Sun, 17 Nov 2024 03:05:04 +0100 Subject: [PATCH 2/5] lact: refactor --- pkgs/by-name/la/lact/package.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/la/lact/package.nix b/pkgs/by-name/la/lact/package.nix index 9118e4c79906..149f389b64c8 100644 --- a/pkgs/by-name/la/lact/package.nix +++ b/pkgs/by-name/la/lact/package.nix @@ -9,7 +9,6 @@ , libdrm , vulkan-loader , coreutils -, hwdata }: rustPlatform.buildRustPackage rec { @@ -66,12 +65,12 @@ rustPlatform.buildRustPackage rec { --add-rpath ${lib.makeLibraryPath [ vulkan-loader ]} ''; - meta = with lib; { + meta = { description = "Linux AMDGPU Controller"; homepage = "https://github.com/ilya-zlobintsev/LACT"; - license = licenses.mit; - maintainers = with maintainers; [ figsoda ]; - platforms = platforms.linux; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ figsoda ]; + platforms = lib.platforms.linux; mainProgram = "lact"; }; } From 97a043ae9a355b7c3c64097276b230395e90b02f Mon Sep 17 00:00:00 2001 From: Atemu Date: Sun, 17 Nov 2024 03:05:59 +0100 Subject: [PATCH 3/5] lact: use --replace-fail --- pkgs/by-name/la/lact/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/la/lact/package.nix b/pkgs/by-name/la/lact/package.nix index 149f389b64c8..e9b60d743e1c 100644 --- a/pkgs/by-name/la/lact/package.nix +++ b/pkgs/by-name/la/lact/package.nix @@ -45,13 +45,13 @@ rustPlatform.buildRustPackage rec { postPatch = '' substituteInPlace lact-daemon/src/server/system.rs \ - --replace 'Command::new("uname")' 'Command::new("${coreutils}/bin/uname")' + --replace-fail 'Command::new("uname")' 'Command::new("${coreutils}/bin/uname")' substituteInPlace res/lactd.service \ - --replace ExecStart={lact,$out/bin/lact} + --replace-fail ExecStart={lact,$out/bin/lact} substituteInPlace res/io.github.lact-linux.desktop \ - --replace Exec={lact,$out/bin/lact} + --replace-fail Exec={lact,$out/bin/lact} ''; postInstall = '' From 6e1ec4b79b541beb26bfdadb9192e07e9b840e05 Mon Sep 17 00:00:00 2001 From: Atemu Date: Sun, 17 Nov 2024 03:12:12 +0100 Subject: [PATCH 4/5] lact: add libvulkan.so as NEEDED too This isn't strictly necessary but does make sense to do for transparency. --- pkgs/by-name/la/lact/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/la/lact/package.nix b/pkgs/by-name/la/lact/package.nix index e9b60d743e1c..0ead394440d4 100644 --- a/pkgs/by-name/la/lact/package.nix +++ b/pkgs/by-name/la/lact/package.nix @@ -1,5 +1,6 @@ { lib , rustPlatform +, stdenv , fetchFromGitHub , blueprint-compiler , pkg-config @@ -60,9 +61,8 @@ rustPlatform.buildRustPackage rec { install -Dm444 res/io.github.lact-linux.png -t $out/share/pixmaps ''; - postFixup = '' - patchelf $out/bin/.lact-wrapped \ - --add-rpath ${lib.makeLibraryPath [ vulkan-loader ]} + postFixup = lib.optionalString stdenv.targetPlatform.isElf '' + patchelf $out/bin/.lact-wrapped --add-needed libvulkan.so --add-rpath ${lib.makeLibraryPath [ vulkan-loader ]} ''; meta = { From bc2ad7fd696cd6876fea4642b237cda6d8c52770 Mon Sep 17 00:00:00 2001 From: Atemu Date: Sun, 17 Nov 2024 03:38:44 +0100 Subject: [PATCH 5/5] lact: add atemu to maintainers --- pkgs/by-name/la/lact/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/la/lact/package.nix b/pkgs/by-name/la/lact/package.nix index 0ead394440d4..9181dec17b73 100644 --- a/pkgs/by-name/la/lact/package.nix +++ b/pkgs/by-name/la/lact/package.nix @@ -69,7 +69,7 @@ rustPlatform.buildRustPackage rec { description = "Linux AMDGPU Controller"; homepage = "https://github.com/ilya-zlobintsev/LACT"; license = lib.licenses.mit; - maintainers = with lib.maintainers; [ figsoda ]; + maintainers = with lib.maintainers; [ figsoda atemu ]; platforms = lib.platforms.linux; mainProgram = "lact"; };