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