about summary refs log tree commit diff
path: root/pkgs/development/python-modules/androguard/default.nix
blob: cc1789963e617628d3d026b0a2348b600d0963a9 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  future,
  networkx,
  pygments,
  lxml,
  colorama,
  matplotlib,
  asn1crypto,
  click,
  pydot,
  ipython,
  packaging,
  pyqt5,
  pyperclip,
  nose,
  nose-timer,
  mock,
  python-magic,
  codecov,
  coverage,
  qt5,
  # This is usually used as a library, and it'd be a shame to force the GUI
  # libraries to the closure if GUI is not desired.
  withGui ? false,
  # Tests take a very long time, and currently fail, but next release' tests
  # shouldn't fail
  doCheck ? false,
}:

buildPythonPackage rec {
  pname = "androguard";
  version = "3.4.0a1";
  format = "setuptools";

  src = fetchFromGitHub {
    repo = pname;
    owner = pname;
    rev = "v${version}";
    sha256 = "1aparxiq11y0hbvkayp92w684nyxyyx7mi0n1x6x51g5z6c58vmy";
  };

  nativeBuildInputs = [ packaging ] ++ lib.optionals withGui [ qt5.wrapQtAppsHook ];

  propagatedBuildInputs =
    [
      asn1crypto
      click
      colorama
      future
      ipython
      lxml
      matplotlib
      networkx
      pydot
      pygments
    ]
    ++ lib.optionals withGui [
      pyqt5
      pyperclip
    ];

  nativeCheckInputs = [
    codecov
    coverage
    mock
    nose
    nose-timer
    pyperclip
    pyqt5
    python-magic
  ];
  inherit doCheck;

  # If it won't be verbose, you'll see nothing going on for a long time.
  checkPhase = ''
    runHook preCheck
    nosetests --verbosity=3
    runHook postCheck
  '';

  preFixup = lib.optionalString withGui ''
    makeWrapperArgs+=("''${qtWrapperArgs[@]}")
  '';

  meta = with lib; {
    description = "Tool and Python library to interact with Android Files";
    homepage = "https://github.com/androguard/androguard";
    license = licenses.asl20;
    maintainers = with maintainers; [ pmiddend ];
  };
}