1{
2 lib,
3 buildPythonPackage,
4 colorclass,
5 easygui,
6 fetchFromGitHub,
7 msoffcrypto-tool,
8 olefile,
9 pcodedmp,
10 pyparsing,
11 pytestCheckHook,
12 pythonOlder,
13 setuptools,
14}:
15
16buildPythonPackage rec {
17 pname = "oletools";
18 version = "0.60.1";
19 format = "setuptools";
20
21 disabled = pythonOlder "3.8";
22
23 src = fetchFromGitHub {
24 owner = "decalage2";
25 repo = pname;
26 rev = "v${version}";
27 hash = "sha256-H3oL8sk2r267wV0hoHOq9r9DY2Atxs+hZUVb6tmHy0w=";
28 };
29
30 propagatedBuildInputs = [
31 colorclass
32 easygui
33 msoffcrypto-tool
34 olefile
35 pcodedmp
36 pyparsing
37 ];
38
39 nativeCheckInputs = [ pytestCheckHook ];
40
41 postPatch = ''
42 substituteInPlace setup.py \
43 --replace "pyparsing>=2.1.0,<3" "pyparsing>=2.1.0"
44 '';
45
46 disabledTests = [
47 # Test fails with AssertionError: Tuples differ: ('MS Word 2007+...
48 "test_all"
49 "test_xlm"
50 ];
51
52 pythonImportsCheck = [ "oletools" ];
53
54 meta = with lib; {
55 description = "Module to analyze MS OLE2 files and MS Office documents";
56 homepage = "https://github.com/decalage2/oletools";
57 license = with licenses; [
58 bsd2 # and
59 mit
60 ];
61 maintainers = with maintainers; [ fab ];
62 };
63}