From 0a9719675a78c12d1cd1c3ae08d2cbc01cd7dd5d Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 8 Feb 2021 17:10:25 +0100 Subject: [PATCH] python3Packages.libpurecool: init at 0.6.4 --- .../python-modules/libpurecool/default.nix | 47 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 49 insertions(+) create mode 100644 pkgs/development/python-modules/libpurecool/default.nix diff --git a/pkgs/development/python-modules/libpurecool/default.nix b/pkgs/development/python-modules/libpurecool/default.nix new file mode 100644 index 000000000000..aa523d9a98bf --- /dev/null +++ b/pkgs/development/python-modules/libpurecool/default.nix @@ -0,0 +1,47 @@ +{ lib +, buildPythonPackage +, fetchPypi +, netifaces +, paho-mqtt +, pycryptodome +, requests +, six +, zeroconf +}: + +buildPythonPackage rec { + pname = "libpurecool"; + version = "0.6.4"; + + src = fetchPypi { + inherit pname version; + sha256 = "1kwbinbg0i4fca1bpx6jwa1fiw71vg0xa89jhq4pmnl5cn9c8kqx"; + }; + + # Remove vendorized zeroconf, https://github.com/etheralm/libpurecool/issues/33 + postPatch = '' + rm libpurecool/zeroconf.py + substituteInPlace libpurecool/dyson_pure_cool_link.py \ + --replace "from .zeroconf import ServiceBrowser, Zeroconf" "from zeroconf import ServiceBrowser, Zeroconf" + ''; + + propagatedBuildInputs = [ + netifaces + paho-mqtt + pycryptodome + requests + six + zeroconf + ]; + + # Tests are only present in repo, https://github.com/etheralm/libpurecool/issues/36 + doCheck = false; + pythonImportsCheck = [ "libpurecool" ]; + + meta = with lib; { + description = "Python library for Dyson devices"; + homepage = "http://libpurecool.readthedocs.io"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f14264d6efc9..ed52284ad51f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3660,6 +3660,8 @@ in { inherit python; })).py; + libpurecool = callPackage ../development/python-modules/libpurecool { }; + libredwg = toPythonModule (pkgs.libredwg.override { enablePython = true; inherit (self) python libxml2;