bazel: use installShellCompletion for completions

This commit is contained in:
Profpatsch 2020-07-17 14:54:39 +02:00
parent a06fda4c5d
commit 595afc2c3f

View File

@ -1,4 +1,4 @@
{ stdenv, callPackage, lib, fetchurl, fetchFromGitHub { stdenv, callPackage, lib, fetchurl, fetchFromGitHub, installShellFiles
, runCommand, runCommandCC, makeWrapper, recurseIntoAttrs , runCommand, runCommandCC, makeWrapper, recurseIntoAttrs
# this package (through the fixpoint glass) # this package (through the fixpoint glass)
, bazel_self , bazel_self
@ -465,6 +465,7 @@ stdenv.mkDerivation rec {
# when a command cant be found in a bazel build, you might also # when a command cant be found in a bazel build, you might also
# need to add it to `defaultShellPath`. # need to add it to `defaultShellPath`.
nativeBuildInputs = [ nativeBuildInputs = [
installShellFiles
zip zip
python3 python3
unzip unzip
@ -507,15 +508,15 @@ stdenv.mkDerivation rec {
mv ./bazel_src/output/bazel $out/bin/bazel-${version}-${system}-${arch} mv ./bazel_src/output/bazel $out/bin/bazel-${version}-${system}-${arch}
# shell completion files # shell completion files
install -Dm644 \ installShellCompletion --bash \
./bazel_src/output/bazel-complete.bash \ --name bazel.bash \
$out/share/bash-completion/completions/bazel/bazel-complete.bash ./bazel_src/output/bazel-complete.bash
install -Dm644 \ installShellCompletion --zsh \
./bazel_src/scripts/zsh_completion/_bazel \ --name _bazel \
$out/share/zsh/site-functions/_bazel ./bazel_src/scripts/zsh_completion/_bazel
install -Dm644 \ installShellCompletion --fish \
./bazel_src/scripts/fish/completions/bazel.fish \ --name bazel.fish \
$out/share/fish/vendor_completions.d/bazel.fish ./bazel_src/scripts/fish/completions/bazel.fish
''; '';
doInstallCheck = true; doInstallCheck = true;