1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, future
5, networkx
6, pygments
7, lxml
8, colorama
9, matplotlib
10, asn1crypto
11, click
12, pydot
13, ipython
14, packaging
15, pyqt5
16, pyperclip
17, nose
18, nose-timer
19, mock
20, python-magic
21, codecov
22, coverage
23, qt5
24# This is usually used as a library, and it'd be a shame to force the GUI
25# libraries to the closure if GUI is not desired.
26, withGui ? false
27# Tests take a very long time, and currently fail, but next release' tests
28# shouldn't fail
29, doCheck ? false
30}:
31
32buildPythonPackage rec {
33 pname = "androguard";
34 version = "3.4.0a1";
35
36 src = fetchFromGitHub {
37 repo = pname;
38 owner = pname;
39 rev = "v${version}";
40 sha256 = "1aparxiq11y0hbvkayp92w684nyxyyx7mi0n1x6x51g5z6c58vmy";
41 };
42
43 nativeBuildInputs = [
44 packaging
45 ] ++ lib.optionals withGui [
46 qt5.wrapQtAppsHook
47 ];
48
49 propagatedBuildInputs = [
50 asn1crypto
51 click
52 colorama
53 future
54 ipython
55 lxml
56 matplotlib
57 networkx
58 pydot
59 pygments
60 ] ++ lib.optionals withGui [
61 pyqt5
62 pyperclip
63 ];
64
65 nativeCheckInputs = [
66 codecov
67 coverage
68 mock
69 nose
70 nose-timer
71 pyperclip
72 pyqt5
73 python-magic
74 ];
75 inherit doCheck;
76
77 # If it won't be verbose, you'll see nothing going on for a long time.
78 checkPhase = ''
79 runHook preCheck
80 nosetests --verbosity=3
81 runHook postCheck
82 '';
83
84 preFixup = lib.optionalString withGui ''
85 makeWrapperArgs+=("''${qtWrapperArgs[@]}")
86 '';
87
88 meta = with lib; {
89 description = "Tool and Python library to interact with Android Files";
90 homepage = "https://github.com/androguard/androguard";
91 license = licenses.asl20;
92 maintainers = with maintainers; [ pmiddend ];
93 };
94}