argc: use finalAttrs

This commit is contained in:
Petr Portnov
2025-12-08 21:09:30 +03:00
parent 9f992822cb
commit 4a235ebf76
+9 -4
View File
@@ -7,19 +7,20 @@
glibcLocales,
fetchFromGitHub,
installShellFiles,
versionCheckHook,
}:
let
canExecuteHost = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
in
rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
pname = "argc";
version = "1.23.0";
src = fetchFromGitHub {
owner = "sigoden";
repo = "argc";
rev = "v${version}";
tag = "v${finalAttrs.version}";
hash = "sha256-in2ymxiSZbs3wZwo/aKfu11x8SLx4OHOoa/tVxr3FyM=";
};
@@ -45,6 +46,10 @@ rustPlatform.buildRustPackage rec {
LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive";
};
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "--argc-version";
passthru = {
tests = {
cross =
@@ -63,7 +68,7 @@ rustPlatform.buildRustPackage rec {
description = "Command-line options, arguments and sub-commands parser for bash";
mainProgram = "argc";
homepage = "https://github.com/sigoden/argc";
changelog = "https://github.com/sigoden/argc/releases/tag/v${version}";
changelog = "https://github.com/sigoden/argc/releases/tag/v${finalAttrs.version}";
license = with lib.licenses; [
mit
# or
@@ -71,4 +76,4 @@ rustPlatform.buildRustPackage rec {
];
maintainers = [ lib.maintainers.progrm_jarvis ];
};
}
})