1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, mock
5, nose
6, pexpect
7, pyserial
8, pytestCheckHook
9, pythonOlder
10}:
11
12buildPythonPackage rec {
13 pname = "pygatt";
14 version = "4.0.5";
15 disabled = pythonOlder "3.5";
16
17 src = fetchFromGitHub {
18 owner = "peplin";
19 repo = pname;
20 rev = "v${version}";
21 sha256 = "1zdfxidiw0l8n498sy0l33n90lz49n25x889cx6jamjr7frlcihd";
22 };
23
24 propagatedBuildInputs = [
25 pexpect
26 pyserial
27 ];
28
29 checkInputs = [
30 mock
31 nose
32 pytestCheckHook
33 ];
34
35 postPatch = ''
36 # Not support for Python < 3.4
37 substituteInPlace setup.py --replace "'enum-compat'" ""
38 '';
39
40 pythonImportsCheck = [ "pygatt" ];
41
42 meta = with lib; {
43 description = "Python wrapper the BGAPI for accessing Bluetooth LE Devices";
44 homepage = "https://github.com/peplin/pygatt";
45 license = with licenses; [ asl20 mit ];
46 maintainers = with maintainers; [ fab ];
47 };
48}