1{ lib
2, buildPythonPackage
3, extractcode-7z
4, extractcode-libarchive
5, fetchPypi
6, patch
7, pytest-xdist
8, pytestCheckHook
9, pythonOlder
10, setuptools-scm
11, six
12, typecode
13}:
14
15buildPythonPackage rec {
16 pname = "extractcode";
17 version = "31.0.0";
18 format = "setuptools";
19
20 disabled = pythonOlder "3.6";
21
22 src = fetchPypi {
23 inherit pname version;
24 hash = "sha256-gIGTkum8+BKfdNiQT+ipjA3+0ngjVoQnNygsAoMRPYg=";
25 };
26
27 postPatch = ''
28 # PEP440 support was removed in newer setuptools, https://github.com/nexB/extractcode/pull/46
29 substituteInPlace setup.cfg \
30 --replace ">=3.6.*" ">=3.6"
31 '';
32
33 dontConfigure = true;
34
35 nativeBuildInputs = [
36 setuptools-scm
37 ];
38
39 propagatedBuildInputs = [
40 typecode
41 patch
42 extractcode-libarchive
43 extractcode-7z
44 six
45 ];
46
47 nativeCheckInputs = [
48 pytestCheckHook
49 pytest-xdist
50 ];
51
52 disabledTestPaths = [
53 # CLI test tests the CLI which we can't do until after install
54 "tests/test_extractcode_cli.py"
55 ];
56
57 disabledTests = [
58 # test_uncompress_* wants to use a binary to extract instead of the provided library
59 "test_uncompress_lz4_basic"
60 "test_extract_tarlz4_basic"
61 "test_extract_rar_with_trailing_data"
62 # Tries to parse /boot/vmlinuz-*, which is not available in the nix sandbox
63 "test_can_extract_qcow2_vm_image_as_tarball"
64 "test_can_extract_qcow2_vm_image_not_as_tarball"
65 "test_can_listfs_from_qcow2_image"
66 "test_get_extractor_qcow2"
67 # WARNING patch:patch.py:450 inconsistent line ends in patch hunks
68 "test_patch_info_patch_patches_windows_plugin_explorer_patch"
69 # AssertionError: assert [['linux-2.6...._end;', ...]]] == [['linux-2.6...._end;', ...]]]
70 "test_patch_info_patch_patches_misc_linux_st710x_patches_motorola_rootdisk_c_patch"
71 ];
72
73 pythonImportsCheck = [
74 "extractcode"
75 ];
76
77 meta = with lib; {
78 description = "Universal archive extractor using z7zip, libarchive, other libraries and the Python standard library";
79 homepage = "https://github.com/nexB/extractcode";
80 changelog = "https://github.com/nexB/extractcode/releases/tag/v${version}";
81 license = licenses.asl20;
82 maintainers = [ ];
83 };
84}