diff --git a/pkgs/by-name/ar/argc/package.nix b/pkgs/by-name/ar/argc/package.nix index 2a5b0cf715ad..b354e1230765 100644 --- a/pkgs/by-name/ar/argc/package.nix +++ b/pkgs/by-name/ar/argc/package.nix @@ -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 ]; }; -} +})