nixpkgs/pkgs/development/python-modules/bleak/default.nix
2023-01-05 22:17:36 +01:00

62 lines
1.2 KiB
Nix

{ lib
, async-timeout
, bluez
, buildPythonPackage
, dbus-fast
, fetchFromGitHub
, poetry-core
, pytest-asyncio
, pytestCheckHook
, pythonOlder
, typing-extensions
}:
buildPythonPackage rec {
pname = "bleak";
version = "0.19.5";
format = "pyproject";
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "hbldh";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-KKZrp5yNuslEPn/TS4eAOMT48C4A5Da5/NhklyFcy7M=";
};
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
async-timeout
dbus-fast
typing-extensions
];
checkInputs = [
pytest-asyncio
pytestCheckHook
];
postPatch = ''
# bleak checks BlueZ's version with a call to `bluetoothctl --version`
substituteInPlace bleak/backends/bluezdbus/__init__.py \
--replace \"bluetoothctl\" \"${bluez}/bin/bluetoothctl\"
'';
pythonImportsCheck = [
"bleak"
];
meta = with lib; {
description = "Bluetooth Low Energy platform agnostic client";
homepage = "https://github.com/hbldh/bleak";
changelog = "https://github.com/hbldh/bleak/blob/v${version}/CHANGELOG.rst";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ oxzi ];
};
}