Skip to content

Commit 4c35ed6

Browse files
authored
usage: 0.3.1 -> 1.7.4 (#369640)
2 parents 7eade95 + 4dbb65b commit 4c35ed6

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

pkgs/by-name/us/usage/package.nix

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,39 @@
22
lib,
33
rustPlatform,
44
fetchFromGitHub,
5+
stdenv,
6+
installShellFiles,
57
nix-update-script,
68
usage,
79
testers,
810
}:
911

1012
rustPlatform.buildRustPackage rec {
11-
pname = "jdx";
12-
version = "0.3.1";
13+
pname = "usage";
14+
version = "1.7.4";
1315

1416
src = fetchFromGitHub {
1517
owner = "jdx";
1618
repo = "usage";
1719
rev = "v${version}";
18-
hash = "sha256-9zQ+gkBVhzjqSIieGjxoD9vc7999lfRQ7awkvlEkseE=";
20+
hash = "sha256-+Wt/ZOwj9LHgt0EOFF554TGf2tZyuRoXAPpCebPZfNY=";
1921
};
2022

21-
cargoHash = "sha256-4ebjD1Tf7F2YyNrF7eEi2yKonctprnyu4nMf+vE2whY=";
23+
cargoHash = "sha256-w8GWvMjC6Plho+zw542Q00hU/KZMdyyoP/rGAg72h1s=";
24+
25+
postPatch = ''
26+
substituteInPlace ./examples/mounted.sh \
27+
--replace-fail '/usr/bin/env -S usage' "$(pwd)/target/${stdenv.targetPlatform.rust.rustcTargetSpec}/release/usage"
28+
'';
29+
30+
nativeBuildInputs = [ installShellFiles ];
31+
32+
postInstall = ''
33+
installShellCompletion --cmd usage \
34+
--bash <($out/bin/usage --completions bash) \
35+
--fish <($out/bin/usage --completions fish) \
36+
--zsh <($out/bin/usage --completions zsh)
37+
'';
2238

2339
passthru = {
2440
updateScript = nix-update-script { };

0 commit comments

Comments
 (0)