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