Skip to content

Commit

Permalink
s4cmd: init at 2.0.1
Browse files Browse the repository at this point in the history
Tool for interacting with S3 buckets, with some performance optimizations over s3cmd.

Skips installing the bash shell completion scripts in /etc, to work around:
NixOS#4968
pypa/setuptools#130
  • Loading branch information
bhipple committed Jul 13, 2018
1 parent 9bbb84f commit 47dfba8
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
35 changes: 35 additions & 0 deletions pkgs/tools/networking/s4cmd/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{ stdenv, python3Packages }:

python3Packages.buildPythonApplication rec {
pname = "s4cmd";
version = "2.0.1";

src = python3Packages.fetchPypi {
inherit pname version;
sha256 = "14gfpnj4xa1sq3x3zd29drpzsygn998y32szwm069ma0w9jwjjz6";
};

propagatedBuildInputs = with python3Packages; [ boto3 pytz ];

# The upstream package tries to install some bash shell completion scripts in /etc.
# Setuptools is bugged and doesn't handle --prefix properly: https://github.com/pypa/setuptools/issues/130
patchPhase = ''
sed -i '/ data_files=/d' setup.py
sed -i 's|os.chmod("/etc.*|pass|' setup.py
'';

# Replace upstream's s4cmd wrapper script with the built-in Nix wrapper
postInstall = ''
ln -fs $out/bin/s4cmd.py $out/bin/s4cmd
'';

# Test suite requires an S3 bucket
doCheck = false;

meta = with stdenv.lib; {
homepage = https://github.com/bloomreach/s4cmd;
description = "Super S3 command line tool";
license = licenses.asl20;
maintainers = [ maintainers.bhipple ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4912,6 +4912,8 @@ with pkgs;

s3cmd = callPackage ../tools/networking/s3cmd { };

s4cmd = callPackage ../tools/networking/s4cmd { };

s3gof3r = callPackage ../tools/networking/s3gof3r { };

s6Dns = callPackage ../tools/networking/s6-dns { };
Expand Down

0 comments on commit 47dfba8

Please sign in to comment.