Lin Jian 2025-07-02 19:40:23 +08:00 committed by Masum Reza
parent f7be425bc2
commit 589257bf13

View File

@ -18,21 +18,22 @@
hwdata,
fuse3,
autoAddDriverRunpath,
fetchpatch,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "lact";
version = "0.7.4";
version = "0.8.0";
src = fetchFromGitHub {
owner = "ilya-zlobintsev";
repo = "LACT";
tag = "v${finalAttrs.version}";
hash = "sha256-zOvFWl78INlpCcEHiB3qZdxPNHXfUeKxfHyrO+wVNN0=";
hash = "sha256-HsDVz9Wd1WoGWIB4Cs/GsvC7RDyHAeXfFGXZDWEmo/c=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-10FdXUpLL+8xN818toShccgB5NfpzrOLfEeDAX5oMFw=";
cargoHash = "sha256-fgF7gOXxB9sQqA5H1hw6A0Fb5tTBPySAbSxVhcKVhcM=";
nativeBuildInputs = [
pkg-config
@ -68,14 +69,20 @@ rustPlatform.buildRustPackage (finalAttrs: {
]
);
patches = [
(fetchpatch {
name = "fix-tests::snapshot_everything-due-to-outdated-hwdata-649.patch";
url = "https://github.com/ilya-zlobintsev/LACT/commit/c9a59e48a36d590d7522c22bd15a8f9208bef0ee.patch";
hash = "sha256-Ehq8vRosqyqpRPeabkdpBHBF6ONqSJHOeq3AXw8PXPU=";
})
];
postPatch = ''
substituteInPlace lact-daemon/src/server/system.rs \
--replace-fail 'Command::new("uname")' 'Command::new("${coreutils}/bin/uname")'
substituteInPlace lact-daemon/src/server/profiles.rs \
substituteInPlace lact-daemon/src/system.rs \
--replace-fail 'Command::new("uname")' 'Command::new("${coreutils}/bin/uname")'
substituteInPlace lact-daemon/src/server/handler.rs \
--replace-fail 'Command::new("journalctl")' 'Command::new("${systemdMinimal}/bin/journalctl")'
--replace-fail 'run_command("journalctl",' 'run_command("${systemdMinimal}/bin/journalctl",'
substituteInPlace lact-daemon/src/server/vulkan.rs \
--replace-fail 'Command::new("vulkaninfo")' 'Command::new("${vulkan-tools}/bin/vulkaninfo")'