diff --git a/pkgs/development/python-modules/patool/default.nix b/pkgs/development/python-modules/patool/default.nix new file mode 100644 index 000000000000..1420597a1f32 --- /dev/null +++ b/pkgs/development/python-modules/patool/default.nix @@ -0,0 +1,57 @@ +{ stdenv, lib, buildPythonPackage, fetchFromGitHub, pytestCheckHook, p7zip, + unzip, cabextract, zip, zopfli, lzip, zpaq, gnutar, gnugrep, diffutils, file, + gzip, bzip2, xz}: + +# unrar is unfree, as well as 7z with unrar support, not including it (patool doesn't support unar) + +let + compression-utilities = [ + p7zip + unzip + gnutar + cabextract + zip + zopfli + lzip + zpaq + gzip + gnugrep + diffutils + bzip2 + file + xz + ]; +in +buildPythonPackage rec { + pname = "patool"; + version = "1.12"; + + #pypi doesn't have test data + src = fetchFromGitHub { + owner = "wummel"; + repo = pname; + rev = "upstream/${version}"; + sha256 = "0v4r77sm3yzh7y1whfwxmp01cchd82jbhvbg9zsyd2yb944imzjy"; + }; + + prePatch = '' + substituteInPlace patoolib/util.py \ + --replace "path = None" 'path = append_to_path(os.environ["PATH"], "${lib.makeBinPath compression-utilities}")' + ''; + + checkInputs = [ pytestCheckHook ] ++ compression-utilities; + + disabledTests = [ + "test_unzip" + "test_unzip_file" + "test_zip" + "test_zip_file" + ]; + + meta = with lib; { + description = "portable archive file manager"; + homepage = "https://wummel.github.io/patool/"; + license = licenses.gpl3; + maintainers = with maintainers; [ marius851000 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 538559bb407c..e30a096b0239 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2298,6 +2298,8 @@ in patdiff = callPackage ../tools/misc/patdiff { }; + patool = with python3Packages; toPythonApplication patool; + pbpst = callPackage ../applications/misc/pbpst { }; pbzx = callPackage ../tools/compression/pbzx { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ae0d3bda8195..8ff240f4eb7c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4290,6 +4290,8 @@ in { pathtools = callPackage ../development/python-modules/pathtools { }; + patool = callPackage ../development/python-modules/patool { }; + patsy = callPackage ../development/python-modules/patsy { }; paver = callPackage ../development/python-modules/paver { };