at 22.05-pre 79 lines 1.8 kB view raw
1{ lib 2, python3 3, groff 4, less 5}: 6let 7 py = python3.override { 8 packageOverrides = self: super: { 9 # TODO: https://github.com/aws/aws-cli/pull/5712 10 colorama = super.colorama.overridePythonAttrs (oldAttrs: rec { 11 version = "0.4.3"; 12 src = oldAttrs.src.override { 13 inherit version; 14 sha256 = "189n8hpijy14jfan4ha9f5n06mnl33cxz7ay92wjqgkr639s0vg9"; 15 }; 16 }); 17 }; 18 }; 19 20in 21with py.pkgs; buildPythonApplication rec { 22 pname = "awscli"; 23 version = "1.20.54"; # N.B: if you change this, change botocore and boto3 to a matching version too 24 25 src = fetchPypi { 26 inherit pname version; 27 sha256 = "sha256-stnuPobBKIpKA4iTKGTO5kmMEl7grFdZNryz40S599M="; 28 }; 29 30 # https://github.com/aws/aws-cli/issues/4837 31 postPatch = '' 32 substituteInPlace setup.py \ 33 --replace "docutils>=0.10,<0.16" "docutils>=0.10" 34 ''; 35 36 propagatedBuildInputs = [ 37 botocore 38 bcdoc 39 s3transfer 40 six 41 colorama 42 docutils 43 rsa 44 pyyaml 45 groff 46 less 47 ]; 48 49 postInstall = '' 50 mkdir -p $out/share/bash-completion/completions 51 echo "complete -C $out/bin/aws_completer aws" > $out/share/bash-completion/completions/awscli 52 53 mkdir -p $out/share/zsh/site-functions 54 mv $out/bin/aws_zsh_completer.sh $out/share/zsh/site-functions 55 56 rm $out/bin/aws.cmd 57 ''; 58 59 passthru = { 60 python = py; # for aws_shell 61 }; 62 63 doInstallCheck = true; 64 installCheckPhase = '' 65 runHook preInstallCheck 66 67 $out/bin/aws --version | grep "${py.pkgs.botocore.version}" 68 $out/bin/aws --version | grep "${version}" 69 70 runHook postInstallCheck 71 ''; 72 73 meta = with lib; { 74 homepage = "https://aws.amazon.com/cli/"; 75 description = "Unified tool to manage your AWS services"; 76 license = licenses.asl20; 77 maintainers = with maintainers; [ muflax ]; 78 }; 79}