at 23.05-pre 1.0 kB view raw
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 pyserial 26 ]; 27 28 passthru.optional-dependencies.GATTTOOL = [ 29 pexpect 30 ]; 31 32 checkInputs = [ 33 mock 34 nose 35 pytestCheckHook 36 ] 37 ++ passthru.optional-dependencies.GATTTOOL; 38 39 postPatch = '' 40 # Not support for Python < 3.4 41 substituteInPlace setup.py --replace "'enum-compat'" "" 42 ''; 43 44 pythonImportsCheck = [ "pygatt" ]; 45 46 meta = with lib; { 47 description = "Python wrapper the BGAPI for accessing Bluetooth LE Devices"; 48 homepage = "https://github.com/peplin/pygatt"; 49 license = with licenses; [ asl20 mit ]; 50 maintainers = with maintainers; [ fab ]; 51 }; 52}