2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
extractcode-7z,
|
|
|
|
extractcode-libarchive,
|
|
|
|
fetchPypi,
|
|
|
|
patch,
|
|
|
|
pytest-xdist,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools-scm,
|
|
|
|
six,
|
|
|
|
typecode,
|
2021-04-25 03:57:28 +00:00
|
|
|
}:
|
2021-10-11 16:52:03 +00:00
|
|
|
|
2021-04-25 03:57:28 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "extractcode";
|
2022-05-18 14:49:53 +00:00
|
|
|
version = "31.0.0";
|
2022-07-14 12:49:19 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2021-04-25 03:57:28 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-07-14 12:49:19 +00:00
|
|
|
hash = "sha256-gIGTkum8+BKfdNiQT+ipjA3+0ngjVoQnNygsAoMRPYg=";
|
2021-04-25 03:57:28 +00:00
|
|
|
};
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
postPatch = ''
|
|
|
|
# PEP440 support was removed in newer setuptools, https://github.com/nexB/extractcode/pull/46
|
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace ">=3.6.*" ">=3.6"
|
|
|
|
'';
|
|
|
|
|
2021-04-25 03:57:28 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools-scm ];
|
2021-04-25 03:57:28 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
typecode
|
|
|
|
patch
|
|
|
|
extractcode-libarchive
|
|
|
|
extractcode-7z
|
2023-05-24 13:37:59 +00:00
|
|
|
six
|
2021-04-25 03:57:28 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-04-25 03:57:28 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-xdist
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
2022-08-12 12:06:08 +00:00
|
|
|
# CLI test tests the CLI which we can't do until after install
|
2021-04-25 03:57:28 +00:00
|
|
|
"tests/test_extractcode_cli.py"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
2022-08-12 12:06:08 +00:00
|
|
|
# test_uncompress_* wants to use a binary to extract instead of the provided library
|
2021-04-25 03:57:28 +00:00
|
|
|
"test_uncompress_lz4_basic"
|
|
|
|
"test_extract_tarlz4_basic"
|
2021-10-11 16:52:03 +00:00
|
|
|
"test_extract_rar_with_trailing_data"
|
2022-08-12 12:06:08 +00:00
|
|
|
# Tries to parse /boot/vmlinuz-*, which is not available in the nix sandbox
|
2021-06-28 23:13:55 +00:00
|
|
|
"test_can_extract_qcow2_vm_image_as_tarball"
|
|
|
|
"test_can_extract_qcow2_vm_image_not_as_tarball"
|
|
|
|
"test_can_listfs_from_qcow2_image"
|
2022-07-14 12:49:19 +00:00
|
|
|
"test_get_extractor_qcow2"
|
2022-08-12 12:06:08 +00:00
|
|
|
# WARNING patch:patch.py:450 inconsistent line ends in patch hunks
|
|
|
|
"test_patch_info_patch_patches_windows_plugin_explorer_patch"
|
2023-01-20 10:41:00 +00:00
|
|
|
# AssertionError: assert [['linux-2.6...._end;', ...]]] == [['linux-2.6...._end;', ...]]]
|
|
|
|
"test_patch_info_patch_patches_misc_linux_st710x_patches_motorola_rootdisk_c_patch"
|
2021-04-25 03:57:28 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "extractcode" ];
|
2021-04-25 03:57:28 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2023-05-24 13:37:59 +00:00
|
|
|
description = "Universal archive extractor using z7zip, libarchive, other libraries and the Python standard library";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "extractcode";
|
2021-04-25 03:57:28 +00:00
|
|
|
homepage = "https://github.com/nexB/extractcode";
|
2023-03-15 16:39:30 +00:00
|
|
|
changelog = "https://github.com/nexB/extractcode/releases/tag/v${version}";
|
2021-04-25 03:57:28 +00:00
|
|
|
license = licenses.asl20;
|
2023-03-24 00:07:29 +00:00
|
|
|
maintainers = [ ];
|
2021-04-25 03:57:28 +00:00
|
|
|
};
|
|
|
|
}
|