mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-09-29 23:52:55 +00:00
bun: install completions
Co-authored-by: Weijia Wang <9713184+wegank@users.noreply.github.com>
This commit is contained in:
parent
9302a9ce70
commit
92f31b5b7c
@ -3,6 +3,7 @@
|
||||
, fetchurl
|
||||
, autoPatchelfHook
|
||||
, unzip
|
||||
, installShellFiles
|
||||
, openssl
|
||||
, writeShellScript
|
||||
, curl
|
||||
@ -17,7 +18,7 @@ stdenvNoCC.mkDerivation rec {
|
||||
src = passthru.sources.${stdenvNoCC.hostPlatform.system} or (throw "Unsupported system: ${stdenvNoCC.hostPlatform.system}");
|
||||
|
||||
strictDeps = true;
|
||||
nativeBuildInputs = [ unzip ] ++ lib.optionals stdenvNoCC.isLinux [ autoPatchelfHook ];
|
||||
nativeBuildInputs = [ unzip installShellFiles ] ++ lib.optionals stdenvNoCC.isLinux [ autoPatchelfHook ];
|
||||
buildInputs = [ openssl ];
|
||||
|
||||
dontConfigure = true;
|
||||
@ -31,6 +32,21 @@ stdenvNoCC.mkDerivation rec {
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
postPhases = [ "postPatchelf" ];
|
||||
postPatchelf = lib.optionalString (stdenvNoCC.buildPlatform.canExecute stdenvNoCC.hostPlatform) ''
|
||||
completions_dir=$(mktemp -d)
|
||||
|
||||
SHELL="bash" $out/bin/bun completions $completions_dir
|
||||
SHELL="zsh" $out/bin/bun completions $completions_dir
|
||||
SHELL="fish" $out/bin/bun completions $completions_dir
|
||||
|
||||
installShellCompletion --name bun \
|
||||
--bash $completions_dir/bun.completion.bash \
|
||||
--zsh $completions_dir/_bun \
|
||||
--fish $completions_dir/bun.fish
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
sources = {
|
||||
"aarch64-darwin" = fetchurl {
|
||||
|
Loading…
Reference in New Issue
Block a user