1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/development/python-modules/bleak/default.nix

35 lines
1,022 B
Nix
Raw Normal View History

2020-05-15 21:18:33 +01:00
{ stdenv, buildPythonPackage, isPy3k, fetchPypi, bluez, txdbus, pytest, pytestcov }:
buildPythonPackage rec {
pname = "bleak";
2020-06-05 18:44:33 +01:00
version = "0.6.4";
2020-05-15 21:18:33 +01:00
disabled = !isPy3k;
src = fetchPypi {
inherit pname version;
2020-06-05 18:44:33 +01:00
sha256 = "1dc32899d0700c5b5ed9abf642dfee28ac62b1fb5d7be5fa5a6db104dec9a03c";
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";
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; [ oxzi ];
2020-05-15 21:18:33 +01:00
};
}