2022-07-28 18:38:51 +00:00
|
|
|
{ lib
|
2022-09-07 23:03:31 +00:00
|
|
|
, async-timeout
|
2022-07-28 18:38:51 +00:00
|
|
|
, bluez
|
|
|
|
, buildPythonPackage
|
2022-09-14 19:43:27 +00:00
|
|
|
, dbus-fast
|
|
|
|
, fetchFromGitHub
|
|
|
|
, poetry-core
|
2022-10-16 07:03:55 +00:00
|
|
|
, pytest-asyncio
|
2022-07-28 18:38:51 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, typing-extensions
|
2021-03-18 10:30:10 +00:00
|
|
|
}:
|
2020-05-15 20:18:33 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bleak";
|
2023-09-09 14:07:38 +00:00
|
|
|
version = "0.21.1";
|
2022-09-07 23:03:31 +00:00
|
|
|
format = "pyproject";
|
2020-05-15 20:18:33 +00:00
|
|
|
|
2022-10-16 07:03:55 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2020-05-15 20:18:33 +00:00
|
|
|
|
2022-09-14 19:43:27 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hbldh";
|
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/v${version}";
|
2023-09-09 14:07:38 +00:00
|
|
|
hash = "sha256-T0im8zKyNLbskAEDeUUFS/daJtvttlHlttjscqP8iSk=";
|
2020-05-15 20:18:33 +00:00
|
|
|
};
|
|
|
|
|
2022-09-16 08:36:01 +00:00
|
|
|
nativeBuildInputs = [
|
2022-09-14 19:43:27 +00:00
|
|
|
poetry-core
|
2022-09-16 08:36:01 +00:00
|
|
|
];
|
|
|
|
|
2022-07-28 18:38:51 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-09-07 23:03:31 +00:00
|
|
|
async-timeout
|
2022-09-14 19:43:27 +00:00
|
|
|
dbus-fast
|
2022-07-28 18:38:51 +00:00
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2022-10-16 07:03:55 +00:00
|
|
|
pytest-asyncio
|
2022-07-28 18:38:51 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2020-05-15 20:18:33 +00:00
|
|
|
postPatch = ''
|
2021-11-08 09:56:56 +00:00
|
|
|
# bleak checks BlueZ's version with a call to `bluetoothctl --version`
|
|
|
|
substituteInPlace bleak/backends/bluezdbus/__init__.py \
|
2020-05-15 20:18:33 +00:00
|
|
|
--replace \"bluetoothctl\" \"${bluez}/bin/bluetoothctl\"
|
|
|
|
'';
|
|
|
|
|
2022-07-28 18:38:51 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"bleak"
|
|
|
|
];
|
2020-05-15 20:18:33 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2022-07-28 18:38:51 +00:00
|
|
|
description = "Bluetooth Low Energy platform agnostic client";
|
2020-05-15 20:18:33 +00:00
|
|
|
homepage = "https://github.com/hbldh/bleak";
|
2023-01-05 21:17:36 +00:00
|
|
|
changelog = "https://github.com/hbldh/bleak/blob/v${version}/CHANGELOG.rst";
|
2020-05-15 20:18:33 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
2020-08-15 13:25:59 +00:00
|
|
|
maintainers = with maintainers; [ oxzi ];
|
2020-05-15 20:18:33 +00:00
|
|
|
};
|
|
|
|
}
|