1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs synced 2024-10-19 03:47:13 -04:00
nixpkgs/pkgs/development/python-modules/bleak/default.nix
2022-09-30 15:07:14 +02:00

59 lines
1.1 KiB
Nix

{ lib
, async-timeout
, bluez
, buildPythonPackage
, dbus-fast
, fetchFromGitHub
, poetry-core
, pytestCheckHook
, pythonOlder
, typing-extensions
}:
buildPythonPackage rec {
pname = "bleak";
version = "0.18.1";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "hbldh";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-2/jJ2C2TudwCAshDBLUQjNMbYa2j4XfW8bXmeWrAyrA=";
};
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
async-timeout
dbus-fast
typing-extensions
];
checkInputs = [
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";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ oxzi ];
};
}