diff --git a/pkgs/development/python-modules/bluetooth-auto-recovery/default.nix b/pkgs/development/python-modules/bluetooth-auto-recovery/default.nix new file mode 100644 index 00000000000..d6cc52d5d99 --- /dev/null +++ b/pkgs/development/python-modules/bluetooth-auto-recovery/default.nix @@ -0,0 +1,55 @@ +{ lib +, async-timeout +, btsocket +, buildPythonPackage +, fetchFromGitHub +, poetry-core +, pyric +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "bluetooth-auto-recovery"; + version = "0.2.2"; + format = "pyproject"; + + disabled = pythonOlder "3.9"; + + src = fetchFromGitHub { + owner = "Bluetooth-Devices"; + repo = pname; + rev = "v${version}"; + hash = "sha256-Td7LT5C7ho/fIT2gnkPA0LLXHtzDjbYAopE4ECTfFKQ="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + async-timeout + btsocket + pyric + ]; + + checkInputs = [ + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace " --cov=bluetooth_auto_recovery --cov-report=term-missing:skip-covered" "" + ''; + + pythonImportsCheck = [ + "bluetooth_auto_recovery" + ]; + + meta = with lib; { + description = "Library for recovering Bluetooth adapters"; + homepage = "https://github.com/Bluetooth-Devices/bluetooth-auto-recovery"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/btsocket/default.nix b/pkgs/development/python-modules/btsocket/default.nix new file mode 100644 index 00000000000..560707ce1cb --- /dev/null +++ b/pkgs/development/python-modules/btsocket/default.nix @@ -0,0 +1,36 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "btsocket"; + version = "0.2.0"; + format = "setuptools"; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "ukBaz"; + repo = "python-btsocket"; + rev = "v${version}"; + hash = "sha256-IqlbFYbEyJPlcmT3DIQIwsjQEAGeIGRtFNx4jWwNtjE="; + }; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "btsocket" + ]; + + meta = with lib; { + description = "Library to interact with the Bluez Bluetooth Management API"; + homepage = "https://github.com/ukBaz/python-btsocket"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/pyric/default.nix b/pkgs/development/python-modules/pyric/default.nix new file mode 100644 index 00000000000..8ee447f0f0c --- /dev/null +++ b/pkgs/development/python-modules/pyric/default.nix @@ -0,0 +1,38 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder +}: + +buildPythonPackage rec { + pname = "pyric"; + version = "0.1.6.3"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + + src = fetchPypi { + pname = "PyRIC"; + inherit version; + hash = "sha256-tTmwHK/r0kBsAAl/lFJeoPjs0d2S93MfQ+rA7xbCzMk="; + }; + + postPatch = '' + substituteInPlace setup.py \ + --replace "__version__ = '0.0.3'" "__version__ = '${version}'" + ''; + + # Tests are outdated + doCheck = false; + + pythonImportsCheck = [ + "pyric" + ]; + + meta = with lib; { + description = "Python Radio Interface Controller"; + homepage = "https://github.com/wraith-wireless/PyRIC"; + license = with licenses; [ gpl3Plus ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9ce3dca2f6d..e5b65cc2e96 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1403,6 +1403,8 @@ in { bluetooth-adapters = callPackage ../development/python-modules/bluetooth-adapters { }; + bluetooth-auto-recovery = callPackage ../development/python-modules/bluetooth-auto-recovery { }; + bluetooth-data-tools= callPackage ../development/python-modules/bluetooth-data-tools { }; bluetooth-sensor-state-data = callPackage ../development/python-modules/bluetooth-sensor-state-data { }; @@ -1516,6 +1518,8 @@ in { btrfsutil = toPythonModule (pkgs.btrfs-progs.override { python3 = self.python; }); + btsocket = callPackage ../development/python-modules/btsocket { }; + bucketstore = callPackage ../development/python-modules/bucketstore { }; bugsnag = callPackage ../development/python-modules/bugsnag { }; @@ -8228,6 +8232,8 @@ in { pyres = callPackage ../development/python-modules/pyres { }; + pyric = callPackage ../development/python-modules/pyric { }; + pyrisco = callPackage ../development/python-modules/pyrisco { }; pyrituals = callPackage ../development/python-modules/pyrituals { };