cargo-zigbuild: use finalAttrs

This commit is contained in:
Petr Portnov
2025-12-04 18:31:44 +03:00
parent 66603cb734
commit 42d41382ce
+9 -4
View File
@@ -4,16 +4,17 @@
fetchFromGitHub,
makeWrapper,
zig,
versionCheckHook,
}:
rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
pname = "cargo-zigbuild";
version = "0.20.1";
src = fetchFromGitHub {
owner = "messense";
repo = "cargo-zigbuild";
rev = "v${version}";
tag = "v${finalAttrs.version}";
hash = "sha256-xJiYtVrvWEBsyTbcHKsbnTpbcTryX+ZP/OjD7GP6gQU=";
};
@@ -26,12 +27,16 @@ rustPlatform.buildRustPackage rec {
--prefix PATH : ${zig}/bin
'';
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "--version";
meta = {
description = "Tool to compile Cargo projects with zig as the linker";
mainProgram = "cargo-zigbuild";
homepage = "https://github.com/messense/cargo-zigbuild";
changelog = "https://github.com/messense/cargo-zigbuild/releases/tag/v${version}";
changelog = "https://github.com/messense/cargo-zigbuild/releases/tag/v${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.progrm_jarvis ];
};
}
})