2021-03-19 17:17:44 +00:00
|
|
|
{ lib, buildPythonPackage, isPy3k, fetchPypi
|
|
|
|
, bluez, dbus-next, pytestCheckHook, pytest-cov
|
|
|
|
}:
|
2020-05-29 06:06:01 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bleak";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "0.14.3";
|
2020-05-29 06:06:01 +00:00
|
|
|
|
|
|
|
disabled = !isPy3k;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-04-27 09:35:20 +00:00
|
|
|
sha256 = "sha256-dg5bsegECH92JXa5uVY9Y7R9UhsWUpiOKMPLXmS2GZA=";
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2021-12-06 16:07:01 +00:00
|
|
|
# bleak checks BlueZ's version with a call to `bluetoothctl --version`
|
|
|
|
substituteInPlace bleak/backends/bluezdbus/__init__.py \
|
2020-05-29 06:06:01 +00:00
|
|
|
--replace \"bluetoothctl\" \"${bluez}/bin/bluetoothctl\"
|
|
|
|
'';
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
propagatedBuildInputs = [ dbus-next ];
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
checkInputs = [ pytestCheckHook pytest-cov ];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "bleak" ];
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-05-29 06:06:01 +00:00
|
|
|
description = "Bluetooth Low Energy platform Agnostic Klient for Python";
|
|
|
|
homepage = "https://github.com/hbldh/bleak";
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|