1{
2 lib,
3 aiofiles,
4 async-timeout,
5 buildPythonPackage,
6 cryptography,
7 fetchFromGitHub,
8 isPy3k,
9 libusb1,
10 mock,
11 pyasn1,
12 pythonAtLeast,
13 pycryptodome,
14 pytestCheckHook,
15 rsa,
16}:
17
18buildPythonPackage rec {
19 pname = "adb-shell";
20 version = "0.4.4";
21 format = "setuptools";
22
23 disabled = !isPy3k;
24
25 src = fetchFromGitHub {
26 owner = "JeffLIrion";
27 repo = "adb_shell";
28 rev = "v${version}";
29 hash = "sha256-pOkFUh3SEu/ch9R1lVoQn50nufQp8oI+D4/+Ybal5CA=";
30 };
31
32 propagatedBuildInputs = [
33 cryptography
34 pyasn1
35 rsa
36 ];
37
38 passthru.optional-dependencies = {
39 async = [
40 aiofiles
41 async-timeout
42 ];
43 usb = [ libusb1 ];
44 };
45
46 nativeCheckInputs = [
47 mock
48 pycryptodome
49 pytestCheckHook
50 ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
51
52 pythonImportsCheck = [ "adb_shell" ];
53
54 meta = with lib; {
55 description = "Python implementation of ADB with shell and FileSync functionality";
56 homepage = "https://github.com/JeffLIrion/adb_shell";
57 license = licenses.asl20;
58 maintainers = with maintainers; [ jamiemagee ];
59 };
60}