1{ lib, buildPythonPackage, fetchFromGitHub, pytestCheckHook, p7zip,
2 unzip, cabextract, zip, zopfli, lzip, zpaq, gnutar, gnugrep, diffutils, file,
3 gzip, bzip2, xz}:
4
5# unrar is unfree, as well as 7z with unrar support, not including it (patool doesn't support unar)
6
7let
8 compression-utilities = [
9 p7zip
10 unzip
11 gnutar
12 cabextract
13 zip
14 zopfli
15 lzip
16 zpaq
17 gzip
18 gnugrep
19 diffutils
20 bzip2
21 file
22 xz
23 ];
24in
25buildPythonPackage rec {
26 pname = "patool";
27 version = "1.12";
28
29 #pypi doesn't have test data
30 src = fetchFromGitHub {
31 owner = "wummel";
32 repo = pname;
33 rev = "upstream/${version}";
34 sha256 = "0v4r77sm3yzh7y1whfwxmp01cchd82jbhvbg9zsyd2yb944imzjy";
35 };
36
37 prePatch = ''
38 substituteInPlace patoolib/util.py \
39 --replace "path = None" 'path = append_to_path(os.environ["PATH"], "${lib.makeBinPath compression-utilities}")'
40 '';
41
42 checkInputs = [ pytestCheckHook ] ++ compression-utilities;
43
44 disabledTests = [
45 "test_unzip"
46 "test_unzip_file"
47 "test_zip"
48 "test_zip_file"
49 ];
50
51 meta = with lib; {
52 description = "portable archive file manager";
53 homepage = "https://wummel.github.io/patool/";
54 license = licenses.gpl3;
55 maintainers = with maintainers; [ marius851000 ];
56 };
57}