nixpkgs/pkgs/tools/admin/awscli/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

75 lines
1.7 KiB
Nix
Raw Normal View History

2018-02-27 08:26:19 +00:00
{ lib
2019-10-27 15:02:22 +00:00
, python3
2023-05-25 18:37:59 +00:00
, fetchPypi
2017-11-10 17:02:35 +00:00
, groff
, less
, nix-update-script
, testers
, awscli
2017-11-10 17:02:35 +00:00
}:
2023-07-22 01:16:10 +00:00
python3.pkgs.buildPythonApplication rec {
2017-11-10 17:02:35 +00:00
pname = "awscli";
version = "1.32.21"; # N.B: if you change this, change botocore and boto3 to a matching version too
2017-11-10 17:02:35 +00:00
src = fetchPypi {
2017-11-10 17:02:35 +00:00
inherit pname version;
hash = "sha256-euz3pcTKCPjgP7mKVoOf/62JPp0rRevbcYf/RfZTNd0=";
2017-11-10 17:02:35 +00:00
};
2023-07-22 01:16:10 +00:00
propagatedBuildInputs = with python3.pkgs; [
2017-11-10 17:02:35 +00:00
botocore
bcdoc
s3transfer
2018-02-27 08:26:19 +00:00
colorama
2017-11-10 17:02:35 +00:00
docutils
rsa
pyyaml
groff
less
];
postInstall = ''
mkdir -p $out/share/bash-completion/completions
echo "complete -C $out/bin/aws_completer aws" > $out/share/bash-completion/completions/awscli
2017-11-10 17:02:35 +00:00
mkdir -p $out/share/zsh/site-functions
mv $out/bin/aws_zsh_completer.sh $out/share/zsh/site-functions
2017-11-10 17:02:35 +00:00
rm $out/bin/aws.cmd
'';
doInstallCheck = true;
2023-07-22 01:16:10 +00:00
installCheckPhase = ''
runHook preInstallCheck
2023-07-22 01:16:10 +00:00
$out/bin/aws --version | grep "${python3.pkgs.botocore.version}"
$out/bin/aws --version | grep "${version}"
runHook postInstallCheck
'';
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;
};
};
2018-02-27 08:26:19 +00:00
meta = with lib; {
homepage = "https://aws.amazon.com/cli/";
2022-12-09 22:39:27 +00:00
changelog = "https://github.com/aws/aws-cli/blob/${version}/CHANGELOG.rst";
2017-11-10 17:02:35 +00:00
description = "Unified tool to manage your AWS services";
2018-02-27 08:26:19 +00:00
license = licenses.asl20;
mainProgram = "aws";
maintainers = with maintainers; [ anthonyroussel ];
2017-11-10 17:02:35 +00:00
};
}