Venkat-Sundaraneedi
2026-08-18 21:44:32 +05:30
committed by 0xgsvs
parent b6c2725f12
commit 0055bb67af

View File

@@ -6,22 +6,23 @@
installShellFiles,
nix-update-script,
nodejs,
bashInteractive,
usage,
testers,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "usage";
version = "4.0.0";
version = "5.1.0";
src = fetchFromGitHub {
owner = "jdx";
repo = "usage";
tag = "v${finalAttrs.version}";
hash = "sha256-OY+cwnwaJ9WBufCVp8x1SloWfAwH8obSfinDhdFbSM8=";
hash = "sha256-UbZ1KCTgFTwzZWxxwaQcoR1B7uHdP0OxJUKBvanIvbQ=";
};
cargoHash = "sha256-vICOSUnHMzzg4LBdzImLSnRxxhnfzB0elXvirYkBPqM=";
cargoHash = "sha256-4NZdBvURBpfaaPAjtCmpDV99OE4/6HTZf5mmHcQ5NNU=";
postPatch = ''
substituteInPlace ./examples/*.sh \
@@ -33,12 +34,16 @@ rustPlatform.buildRustPackage (finalAttrs: {
nativeCheckInputs = [
# for some tests
nodejs
bashInteractive
];
checkFlags = [
# has --include-bash-completion-lib so requires external lib downloaded on runtime
"--skip=test_bash_completion_init_integration"
];
# The bash completion tests drive `complete -D`, a builtin that bash only
# compiles in when readline support is enabled. The plain `bash` used in the
# build sandbox is built with `--disable-readline`, so the tests honor the
# USAGE_SHELL_BASH env var to run under a readline-enabled bash instead.
preCheck = ''
export USAGE_SHELL_BASH="${bashInteractive}/bin/bash"
'';
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd usage \