2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, python3
|
2023-07-15 17:15:38 +00:00
|
|
|
, fetchPypi
|
2020-04-24 23:36:52 +00:00
|
|
|
, groff
|
|
|
|
, less
|
2023-11-16 04:20:00 +00:00
|
|
|
, nix-update-script
|
|
|
|
, testers
|
|
|
|
, awscli
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "awscli";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "1.32.21"; # N.B: if you change this, change botocore and boto3 to a matching version too
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-euz3pcTKCPjgP7mKVoOf/62JPp0rRevbcYf/RfZTNd0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
2020-04-24 23:36:52 +00:00
|
|
|
botocore
|
|
|
|
bcdoc
|
|
|
|
s3transfer
|
|
|
|
colorama
|
|
|
|
docutils
|
|
|
|
rsa
|
|
|
|
pyyaml
|
|
|
|
groff
|
|
|
|
less
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
2020-11-21 19:51:51 +00:00
|
|
|
mkdir -p $out/share/bash-completion/completions
|
|
|
|
echo "complete -C $out/bin/aws_completer aws" > $out/share/bash-completion/completions/awscli
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out/share/zsh/site-functions
|
|
|
|
mv $out/bin/aws_zsh_completer.sh $out/share/zsh/site-functions
|
2020-11-21 19:51:51 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
rm $out/bin/aws.cmd
|
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
doInstallCheck = true;
|
2023-08-10 07:59:29 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
installCheckPhase = ''
|
|
|
|
runHook preInstallCheck
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
$out/bin/aws --version | grep "${python3.pkgs.botocore.version}"
|
2021-12-06 16:07:01 +00:00
|
|
|
$out/bin/aws --version | grep "${version}"
|
|
|
|
|
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
passthru = {
|
|
|
|
python = python3; # for aws_shell
|
|
|
|
updateScript = nix-update-script {
|
|
|
|
# Excludes 1.x versions from the Github tags list
|
|
|
|
extraArgs = [ "--version-regex" "^(1\.(.*))" ];
|
|
|
|
};
|
|
|
|
tests.version = testers.testVersion {
|
|
|
|
package = awscli;
|
|
|
|
command = "aws --version";
|
|
|
|
inherit version;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://aws.amazon.com/cli/";
|
2023-01-20 10:41:00 +00:00
|
|
|
changelog = "https://github.com/aws/aws-cli/blob/${version}/CHANGELOG.rst";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Unified tool to manage your AWS services";
|
|
|
|
license = licenses.asl20;
|
2022-09-30 11:47:45 +00:00
|
|
|
mainProgram = "aws";
|
2023-11-16 04:20:00 +00:00
|
|
|
maintainers = with maintainers; [ anthonyroussel ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|