2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, mock
|
|
|
|
, nose
|
|
|
|
, pexpect
|
|
|
|
, pyserial
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pygatt";
|
|
|
|
version = "4.0.5";
|
|
|
|
disabled = pythonOlder "3.5";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "peplin";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1zdfxidiw0l8n498sy0l33n90lz49n25x889cx6jamjr7frlcihd";
|
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
pyserial
|
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
passthru.optional-dependencies.GATTTOOL = [
|
2022-04-15 01:41:22 +00:00
|
|
|
pexpect
|
|
|
|
];
|
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
# For cross compilation the doCheck is false and therefor the
|
|
|
|
# nativeCheckInputs not included. We have to include nose here, since
|
|
|
|
# setup.py requires nose unconditionally.
|
|
|
|
nose
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-05-20 23:08:51 +00:00
|
|
|
mock
|
|
|
|
pytestCheckHook
|
2022-04-15 01:41:22 +00:00
|
|
|
]
|
2022-06-16 17:23:12 +00:00
|
|
|
++ passthru.optional-dependencies.GATTTOOL;
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Not support for Python < 3.4
|
|
|
|
substituteInPlace setup.py --replace "'enum-compat'" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "pygatt" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python wrapper the BGAPI for accessing Bluetooth LE Devices";
|
|
|
|
homepage = "https://github.com/peplin/pygatt";
|
|
|
|
license = with licenses; [ asl20 mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|