about summary refs log tree commit diff
path: root/pkgs/development/python-modules/oletools/default.nix
blob: f253c73d88990ce1e3b75994601f6948c77bdbe3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
  lib,
  buildPythonPackage,
  colorclass,
  easygui,
  fetchFromGitHub,
  msoffcrypto-tool,
  olefile,
  pcodedmp,
  pyparsing,
  pytestCheckHook,
  pythonOlder,
  setuptools,
}:

buildPythonPackage rec {
  pname = "oletools";
  version = "0.60.2";
  format = "setuptools";

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "decalage2";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-ons1VeWStxUZw2CPpnX9p5I3Q7cMhi34JU8TeuUDt+Y=";
  };

  propagatedBuildInputs = [
    colorclass
    easygui
    msoffcrypto-tool
    olefile
    pcodedmp
    pyparsing
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  postPatch = ''
    substituteInPlace setup.py \
      --replace "pyparsing>=2.1.0,<3" "pyparsing>=2.1.0"
  '';

  disabledTests = [
    # Test fails with AssertionError: Tuples differ: ('MS Word 2007+...
    "test_all"
    "test_xlm"
  ];

  pythonImportsCheck = [ "oletools" ];

  meta = with lib; {
    description = "Module to analyze MS OLE2 files and MS Office documents";
    homepage = "https://github.com/decalage2/oletools";
    license = with licenses; [
      bsd2 # and
      mit
    ];
    maintainers = with maintainers; [ fab ];
  };
}