From 595afc2c3f0dd94b1ad7243cc316dd17331de21f Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Fri, 17 Jul 2020 14:54:39 +0200 Subject: [PATCH] bazel: use `installShellCompletion` for completions --- .../build-managers/bazel/bazel_3/default.nix | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/pkgs/development/tools/build-managers/bazel/bazel_3/default.nix b/pkgs/development/tools/build-managers/bazel/bazel_3/default.nix index 8d307b61351b..60c1662f9ff5 100644 --- a/pkgs/development/tools/build-managers/bazel/bazel_3/default.nix +++ b/pkgs/development/tools/build-managers/bazel/bazel_3/default.nix @@ -1,4 +1,4 @@ -{ stdenv, callPackage, lib, fetchurl, fetchFromGitHub +{ stdenv, callPackage, lib, fetchurl, fetchFromGitHub, installShellFiles , runCommand, runCommandCC, makeWrapper, recurseIntoAttrs # this package (through the fixpoint glass) , bazel_self @@ -465,6 +465,7 @@ stdenv.mkDerivation rec { # when a command can’t be found in a bazel build, you might also # need to add it to `defaultShellPath`. nativeBuildInputs = [ + installShellFiles zip python3 unzip @@ -507,15 +508,15 @@ stdenv.mkDerivation rec { mv ./bazel_src/output/bazel $out/bin/bazel-${version}-${system}-${arch} # shell completion files - install -Dm644 \ - ./bazel_src/output/bazel-complete.bash \ - $out/share/bash-completion/completions/bazel/bazel-complete.bash - install -Dm644 \ - ./bazel_src/scripts/zsh_completion/_bazel \ - $out/share/zsh/site-functions/_bazel - install -Dm644 \ - ./bazel_src/scripts/fish/completions/bazel.fish \ - $out/share/fish/vendor_completions.d/bazel.fish + installShellCompletion --bash \ + --name bazel.bash \ + ./bazel_src/output/bazel-complete.bash + installShellCompletion --zsh \ + --name _bazel \ + ./bazel_src/scripts/zsh_completion/_bazel + installShellCompletion --fish \ + --name bazel.fish \ + ./bazel_src/scripts/fish/completions/bazel.fish ''; doInstallCheck = true;