diff options
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/python-modules/bleak/default.nix')
-rw-r--r-- | infra/libkookie/nixpkgs/pkgs/development/python-modules/bleak/default.nix | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/python-modules/bleak/default.nix b/infra/libkookie/nixpkgs/pkgs/development/python-modules/bleak/default.nix new file mode 100644 index 000000000000..09ba8f7b5f52 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/development/python-modules/bleak/default.nix @@ -0,0 +1,34 @@ +{ stdenv, buildPythonPackage, isPy3k, fetchPypi, bluez, txdbus, pytest, pytestcov }: + +buildPythonPackage rec { + pname = "bleak"; + version = "0.9.1"; + + disabled = !isPy3k; + + src = fetchPypi { + inherit pname version; + sha256 = "f81b0069e5c1570883144c1910b884e5cefe16d3c2ed09e579b6d8f853f08588"; + }; + + 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 ]; + }; +} |