2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pytestCheckHook,
|
|
|
|
p7zip,
|
|
|
|
cabextract,
|
|
|
|
zip,
|
|
|
|
lzip,
|
|
|
|
zpaq,
|
|
|
|
gnutar,
|
|
|
|
unar, # Free alternative to unrar
|
|
|
|
gnugrep,
|
|
|
|
diffutils,
|
|
|
|
file,
|
|
|
|
gzip,
|
|
|
|
bzip2,
|
|
|
|
xz,
|
2023-10-09 19:29:22 +00:00
|
|
|
}:
|
2020-10-27 00:29:36 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
compression-utilities = [
|
|
|
|
p7zip
|
|
|
|
gnutar
|
2024-01-02 11:29:13 +00:00
|
|
|
unar
|
2020-10-27 00:29:36 +00:00
|
|
|
cabextract
|
|
|
|
zip
|
|
|
|
lzip
|
|
|
|
zpaq
|
|
|
|
gzip
|
|
|
|
gnugrep
|
|
|
|
diffutils
|
|
|
|
bzip2
|
2023-03-04 12:14:45 +00:00
|
|
|
file
|
2020-10-27 00:29:36 +00:00
|
|
|
xz
|
|
|
|
];
|
|
|
|
in
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "patool";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "2.1.1";
|
2023-10-09 19:29:22 +00:00
|
|
|
format = "setuptools";
|
2020-10-27 00:29:36 +00:00
|
|
|
|
|
|
|
#pypi doesn't have test data
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wummel";
|
|
|
|
repo = pname;
|
|
|
|
rev = "upstream/${version}";
|
2024-02-07 01:22:34 +00:00
|
|
|
hash = "sha256-B2P6JldMOAxr4WS+wST+kRVvEm41zH3Nh5LLKoFOws4=";
|
2020-10-27 00:29:36 +00:00
|
|
|
};
|
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
postPatch = ''
|
2020-10-27 00:29:36 +00:00
|
|
|
substituteInPlace patoolib/util.py \
|
2022-07-18 16:21:45 +00:00
|
|
|
--replace "path = None" 'path = os.environ["PATH"] + ":${lib.makeBinPath compression-utilities}"'
|
2020-10-27 00:29:36 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ] ++ compression-utilities;
|
2020-10-27 00:29:36 +00:00
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
"test_unzip"
|
|
|
|
"test_unzip_file"
|
|
|
|
"test_zip"
|
|
|
|
"test_zip_file"
|
2024-09-26 11:04:55 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_ar" ];
|
2020-10-27 00:29:36 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "portable archive file manager";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "patool";
|
2020-10-27 00:29:36 +00:00
|
|
|
homepage = "https://wummel.github.io/patool/";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ marius851000 ];
|
|
|
|
};
|
|
|
|
}
|