From 2467e22bdfb80cb32eadb53541f28c2cf4672dff Mon Sep 17 00:00:00 2001 From: Marco Orovecchia Date: Fri, 10 Apr 2020 12:17:50 +0200 Subject: [PATCH] pythonPackages.HAP-python: init at 2.7.0 --- .../python-modules/HAP-python/default.nix | 46 +++++++++++++++++++ .../home-assistant/component-packages.nix | 2 +- pkgs/top-level/python-packages.nix | 2 + 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/python-modules/HAP-python/default.nix diff --git a/pkgs/development/python-modules/HAP-python/default.nix b/pkgs/development/python-modules/HAP-python/default.nix new file mode 100644 index 000000000000..4986c99c5a68 --- /dev/null +++ b/pkgs/development/python-modules/HAP-python/default.nix @@ -0,0 +1,46 @@ +{ lib, buildPythonPackage, fetchFromGitHub, isPy3k, curve25519-donna, ed25519 +, cryptography, ecdsa, zeroconf, pytest }: + +buildPythonPackage rec { + pname = "HAP-python"; + version = "2.8.1"; + + # pypi package does not include tests + src = fetchFromGitHub { + owner = "ikalchev"; + repo = pname; + rev = "v${version}"; + sha256 = "182s3dk7y29wql9bazlnw840xqgsbr44ad72m668qgxd82jl6y9c"; + }; + + disabled = !isPy3k; + + propagatedBuildInputs = [ + curve25519-donna + ed25519 + cryptography + ecdsa + zeroconf + ]; + + checkInputs = [ pytest ]; + + #disable tests needing network + checkPhase = '' + pytest -k 'not test_persist \ + and not test_setup_endpoints \ + and not test_auto_add_aid_mac \ + and not test_service_callbacks \ + and not test_send_events \ + and not test_not_standalone_aid \ + and not test_start_stop_async_acc \ + and not test_start_stop_sync_acc' + ''; + + meta = with lib; { + homepage = "https://github.com/ikalchev/HAP-python"; + description = "HomeKit Accessory Protocol implementation in python"; + license = licenses.asl20; + maintainers = with maintainers; [ oro ]; + }; +} diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 8b1988f549fd..d19b70c426ea 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -327,7 +327,7 @@ "hive" = ps: with ps; [ ]; # missing inputs: pyhiveapi "hlk_sw16" = ps: with ps; [ ]; # missing inputs: hlk-sw16 "homeassistant" = ps: with ps; [ ]; - "homekit" = ps: with ps; [ ]; # missing inputs: HAP-python + "homekit" = ps: with ps; [ HAP-python]; "homekit_controller" = ps: with ps; [ ]; # missing inputs: aiohomekit[IP] "homematic" = ps: with ps; [ pyhomematic]; "homematicip_cloud" = ps: with ps; [ ]; # missing inputs: homematicip diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 74cad29c8aa2..0f16f8c3afd0 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -795,6 +795,8 @@ in { handout = callPackage ../development/python-modules/handout { }; + HAP-python = callPackage ../development/python-modules/HAP-python { }; + helper = callPackage ../development/python-modules/helper { }; hdmedians = callPackage ../development/python-modules/hdmedians { };