1{ lib, buildPythonPackage, isPy3k, fetchPypi
2, bluez, dbus-next, pytestCheckHook, pytest-cov
3}:
4
5buildPythonPackage rec {
6 pname = "bleak";
7 version = "0.11.0";
8
9 disabled = !isPy3k;
10
11 src = fetchPypi {
12 inherit pname version;
13 sha256 = "1zs5lz3r17a2xn19i4na132iccyjsl9navj0d3v7gks7hlcad5kp";
14 };
15
16 postPatch = ''
17 # bleak checks BlueZ's version with a call to `bluetoothctl -v` twice
18 substituteInPlace bleak/__init__.py \
19 --replace \"bluetoothctl\" \"${bluez}/bin/bluetoothctl\"
20 substituteInPlace bleak/backends/bluezdbus/client.py \
21 --replace \"bluetoothctl\" \"${bluez}/bin/bluetoothctl\"
22 '';
23
24 propagatedBuildInputs = [ dbus-next ];
25
26 checkInputs = [ pytestCheckHook pytest-cov ];
27
28 pythonImportsCheck = [ "bleak" ];
29
30 meta = with lib; {
31 description = "Bluetooth Low Energy platform Agnostic Klient for Python";
32 homepage = "https://github.com/hbldh/bleak";
33 license = licenses.mit;
34 platforms = platforms.linux;
35 maintainers = with maintainers; [ oxzi ];
36 };
37}