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";
|
2021-03-19 17:17:44 +00:00
|
|
|
version = "0.11.0";
|
2020-05-29 06:06:01 +00:00
|
|
|
|
|
|
|
disabled = !isPy3k;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-03-19 17:17:44 +00:00
|
|
|
sha256 = "1zs5lz3r17a2xn19i4na132iccyjsl9navj0d3v7gks7hlcad5kp";
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# bleak checks BlueZ's version with a call to `bluetoothctl -v` twice
|
|
|
|
substituteInPlace bleak/__init__.py \
|
|
|
|
--replace \"bluetoothctl\" \"${bluez}/bin/bluetoothctl\"
|
|
|
|
substituteInPlace bleak/backends/bluezdbus/client.py \
|
|
|
|
--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
|
|
|
};
|
|
|
|
}
|