nixpkgs/pkgs/development/python-modules/bleak/default.nix

35 lines
1.0 KiB
Nix
Raw Normal View History

2020-05-15 20:18:33 +00:00
{ stdenv, buildPythonPackage, isPy3k, fetchPypi, bluez, txdbus, pytest, pytestcov }:
buildPythonPackage rec {
pname = "bleak";
2020-08-16 17:30:53 +00:00
version = "0.7.1";
2020-05-15 20:18:33 +00:00
disabled = !isPy3k;
src = fetchPypi {
inherit pname version;
2020-08-16 17:30:53 +00:00
sha256 = "25f630cf558efda5cbf620d921b85a80ae963c537feaa18cc934f7fa38dc482d";
2020-05-15 20:18:33 +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\"
'';
propagatedBuildInputs = [ txdbus ];
checkInputs = [ pytest pytestcov ];
checkPhase = "AGENT_OS=linux py.test";
meta = with stdenv.lib; {
description = "Bluetooth Low Energy platform Agnostic Klient for Python";
homepage = "https://github.com/hbldh/bleak";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ geistesk ];
};
}