1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 future, 6 networkx, 7 pygments, 8 lxml, 9 colorama, 10 matplotlib, 11 asn1crypto, 12 click, 13 pydot, 14 ipython, 15 packaging, 16 pyqt5, 17 pyperclip, 18 nose, 19 nose-timer, 20 mock, 21 python-magic, 22 codecov, 23 coverage, 24 qt5, 25 # This is usually used as a library, and it'd be a shame to force the GUI 26 # libraries to the closure if GUI is not desired. 27 withGui ? false, 28 # Tests take a very long time, and currently fail, but next release' tests 29 # shouldn't fail 30 doCheck ? false, 31}: 32 33buildPythonPackage rec { 34 pname = "androguard"; 35 version = "3.4.0a1"; 36 format = "setuptools"; 37 38 src = fetchFromGitHub { 39 repo = pname; 40 owner = pname; 41 rev = "v${version}"; 42 sha256 = "1aparxiq11y0hbvkayp92w684nyxyyx7mi0n1x6x51g5z6c58vmy"; 43 }; 44 45 nativeBuildInputs = [ packaging ] ++ lib.optionals withGui [ qt5.wrapQtAppsHook ]; 46 47 propagatedBuildInputs = 48 [ 49 asn1crypto 50 click 51 colorama 52 future 53 ipython 54 lxml 55 matplotlib 56 networkx 57 pydot 58 pygments 59 ] 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}