2021-01-25 08:26:54 +00:00
|
|
|
{ lib, buildPythonPackage, isPy3k, fetchPypi, bluez, txdbus, pytest, pytestcov }:
|
2020-05-15 21:18:33 +01:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bleak";
|
2020-12-16 15:42:57 +00:00
|
|
|
version = "0.10.0";
|
2020-05-15 21:18:33 +01:00
|
|
|
|
|
|
|
disabled = !isPy3k;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-12-16 15:42:57 +00:00
|
|
|
sha256 = "5c3a873965f2910865895e572e7a4f10533d6e150e6ba17936397426bf8d1eee";
|
2020-05-15 21:18:33 +01: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\"
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ txdbus ];
|
|
|
|
checkInputs = [ pytest pytestcov ];
|
|
|
|
|
|
|
|
checkPhase = "AGENT_OS=linux py.test";
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-05-15 21:18:33 +01:00
|
|
|
description = "Bluetooth Low Energy platform Agnostic Klient for Python";
|
|
|
|
homepage = "https://github.com/hbldh/bleak";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
2020-08-15 14:25:59 +01:00
|
|
|
maintainers = with maintainers; [ oxzi ];
|
2020-05-15 21:18:33 +01:00
|
|
|
};
|
|
|
|
}
|