2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
async-timeout,
|
|
|
|
bluez,
|
|
|
|
buildPythonPackage,
|
|
|
|
dbus-fast,
|
|
|
|
fetchFromGitHub,
|
|
|
|
poetry-core,
|
|
|
|
pytest-asyncio,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
typing-extensions,
|
2021-03-19 17:17:44 +00:00
|
|
|
}:
|
2020-05-29 06:06:01 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bleak";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.22.1";
|
2022-09-11 15:47:08 +00:00
|
|
|
format = "pyproject";
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hbldh";
|
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-kBKNBVbEq1xHLu/gKUL2SwlA2WKjzqFVC5o4N+qnqLM=";
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
postPatch = ''
|
|
|
|
# bleak checks BlueZ's version with a call to `bluetoothctl --version`
|
|
|
|
substituteInPlace bleak/backends/bluezdbus/version.py \
|
|
|
|
--replace \"bluetoothctl\" \"${bluez}/bin/bluetoothctl\"
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ poetry-core ];
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-09-11 15:47:08 +00:00
|
|
|
async-timeout
|
2022-09-30 11:47:45 +00:00
|
|
|
dbus-fast
|
2022-08-12 12:06:08 +00:00
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-11-04 12:27:35 +00:00
|
|
|
pytest-asyncio
|
2022-08-12 12:06:08 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "bleak" ];
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-08-12 12:06:08 +00:00
|
|
|
description = "Bluetooth Low Energy platform agnostic client";
|
2020-05-29 06:06:01 +00:00
|
|
|
homepage = "https://github.com/hbldh/bleak";
|
2023-01-11 07:51:40 +00:00
|
|
|
changelog = "https://github.com/hbldh/bleak/blob/v${version}/CHANGELOG.rst";
|
2020-05-29 06:06:01 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
2020-08-20 17:08:02 +00:00
|
|
|
maintainers = with maintainers; [ oxzi ];
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
|
|
|
}
|