about summary refs log tree commit diff
path: root/pkgs/development/python-modules/bleak
diff options
context:
space:
mode:
authorgeistesk <github.jyf300hj@0x21.biz>2020-05-15 22:18:33 +0200
committerJon <jonringer@users.noreply.github.com>2020-05-18 18:06:30 -0700
commit738df6f54f5f664d1c90e70baac8b7aab2ef7524 (patch)
treef93d1c0c20bd392a1cb97c583541eadd641aa56a /pkgs/development/python-modules/bleak
parentfe7d3db9c6de37e9a3a8f39a47361445f6cd6f78 (diff)
downloadnixlib-738df6f54f5f664d1c90e70baac8b7aab2ef7524.tar
nixlib-738df6f54f5f664d1c90e70baac8b7aab2ef7524.tar.gz
nixlib-738df6f54f5f664d1c90e70baac8b7aab2ef7524.tar.bz2
nixlib-738df6f54f5f664d1c90e70baac8b7aab2ef7524.tar.lz
nixlib-738df6f54f5f664d1c90e70baac8b7aab2ef7524.tar.xz
nixlib-738df6f54f5f664d1c90e70baac8b7aab2ef7524.tar.zst
nixlib-738df6f54f5f664d1c90e70baac8b7aab2ef7524.zip
pythonPackage.bleak: init at 0.6.2
Diffstat (limited to 'pkgs/development/python-modules/bleak')
-rw-r--r--pkgs/development/python-modules/bleak/default.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/bleak/default.nix b/pkgs/development/python-modules/bleak/default.nix
new file mode 100644
index 000000000000..559fd33e8eb0
--- /dev/null
+++ b/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.6.2";
+
+  disabled = !isPy3k;
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1kmq2z3dhq6dd20i5w71gshjrfvyw0pkpnld8iib9ai2rz6a8aj0";
+  };
+
+  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 ];
+  };
+}