awscli2: use installShellFiles & build ac.index only once

ac.index is now automatically built by backends/pep517.py
This commit is contained in:
Anthony Roussel 2023-11-07 00:20:24 +01:00
parent b6d78ddeb0
commit 9f668dc7c6
No known key found for this signature in database
GPG Key ID: 9DC4987B1A55E75E

View File

@ -1,8 +1,10 @@
{ lib
, stdenv
, python3
, groff
, less
, fetchFromGitHub
, installShellFiles
, nix-update-script
, testers
, awscli2
@ -59,6 +61,7 @@ with py.pkgs; buildPythonApplication rec {
'';
nativeBuildInputs = [
installShellFiles
flit-core
];
@ -87,15 +90,10 @@ with py.pkgs; buildPythonApplication rec {
];
postInstall = ''
mkdir -p $out/${python3.sitePackages}/awscli/data
${python3.interpreter} scripts/gen-ac-index --index-location $out/${python3.sitePackages}/awscli/data/ac.index
mkdir -p $out/share/bash-completion/completions
echo "complete -C $out/bin/aws_completer aws" > $out/share/bash-completion/completions/aws
mkdir -p $out/share/zsh/site-functions
mv $out/bin/aws_zsh_completer.sh $out/share/zsh/site-functions
installShellCompletion --cmd aws \
--bash <(echo "complete -C $out/bin/aws_completer aws") \
--zsh $out/bin/aws_zsh_completer.sh
'' + lib.optionalString (!stdenv.hostPlatform.isWindows) ''
rm $out/bin/aws.cmd
'';