nixpkgs/pkgs/by-name/s4/s4cmd/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

36 lines
1020 B
Nix

{ lib, python3Packages, fetchPypi }:
python3Packages.buildPythonApplication rec {
pname = "s4cmd";
version = "2.1.0";
src = fetchPypi {
inherit pname version;
sha256 = "0d4mx98i3qhvlmr9x898mjvf827smzx6x5ji6daiwgjdlxc60mj2";
};
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 lib; {
homepage = "https://github.com/bloomreach/s4cmd";
description = "Super S3 command line tool";
license = licenses.asl20;
maintainers = [ maintainers.bhipple ];
};
}