@@ -0,0 +1,35 @@
1+{ stdenv, python3Packages }:
2+
3+python3Packages.buildPythonApplication rec {
4+ pname = "s4cmd";
5+ version = "2.0.1";
6+
7+ src = python3Packages.fetchPypi {
8+ inherit pname version;
9+ sha256 = "14gfpnj4xa1sq3x3zd29drpzsygn998y32szwm069ma0w9jwjjz6";
10+ };
11+
12+ propagatedBuildInputs = with python3Packages; [ boto3 pytz ];
13+
14+ # The upstream package tries to install some bash shell completion scripts in /etc.
15+ # Setuptools is bugged and doesn't handle --prefix properly: https://github.com/pypa/setuptools/issues/130
16+ patchPhase = ''
17+ sed -i '/ data_files=/d' setup.py
18+ sed -i 's|os.chmod("/etc.*|pass|' setup.py
19+ '';
20+
21+ # Replace upstream's s4cmd wrapper script with the built-in Nix wrapper
22+ postInstall = ''
23+ ln -fs $out/bin/s4cmd.py $out/bin/s4cmd
24+ '';
25+
26+ # Test suite requires an S3 bucket
27+ doCheck = false;
28+
29+ meta = with stdenv.lib; {
30+ homepage = https://github.com/bloomreach/s4cmd;
31+ description = "Super S3 command line tool";
32+ license = licenses.asl20;
33+ maintainers = [ maintainers.bhipple ];
34+ };
35+}