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