diff --git a/pkgs/by-name/bl/ble-serial/package.nix b/pkgs/by-name/bl/ble-serial/package.nix new file mode 100644 index 000000000000..0cfcce951911 --- /dev/null +++ b/pkgs/by-name/bl/ble-serial/package.nix @@ -0,0 +1 @@ +{ python3Packages }: with python3Packages; toPythonApplication ble-serial diff --git a/pkgs/by-name/li/libopaque/package.nix b/pkgs/by-name/li/libopaque/package.nix index 81ee5e4174c9..f348997dd8d3 100644 --- a/pkgs/by-name/li/libopaque/package.nix +++ b/pkgs/by-name/li/libopaque/package.nix @@ -28,6 +28,13 @@ stdenv.mkDerivation (finalAttrs: { liboprf ]; + # expand_message_xmd has been renamed to oprf_expand_message_xmd in liboprf + # TODO: remove in the next release + postPatch = '' + substituteInPlace opaque.c \ + --replace-fail 'expand_message_xmd' 'oprf_expand_message_xmd' + ''; + postInstall = '' mkdir -p ${placeholder "out"}/lib/pkgconfig cp ../libopaque.pc ${placeholder "out"}/lib/pkgconfig/ diff --git a/pkgs/by-name/li/liboprf/package.nix b/pkgs/by-name/li/liboprf/package.nix index 15a453da8eca..c936a121b585 100644 --- a/pkgs/by-name/li/liboprf/package.nix +++ b/pkgs/by-name/li/liboprf/package.nix @@ -9,13 +9,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "liboprf"; - version = "0.8.0"; + version = "0.9.2"; src = fetchFromGitHub { owner = "stef"; repo = "liboprf"; tag = "v${finalAttrs.version}"; - hash = "sha256-xDE9UkHDAaA7zC6IxxEIUG7ziS1yYNLJbmVJZLJyL7U="; + hash = "sha256-Toja0rR0321i7L1dsB9YxrwNJwKUzuSfK5LLR3tex7U="; }; sourceRoot = "${finalAttrs.src.name}/src"; diff --git a/pkgs/development/python-modules/ble-serial/default.nix b/pkgs/development/python-modules/ble-serial/default.nix new file mode 100644 index 000000000000..1e3c7315304d --- /dev/null +++ b/pkgs/development/python-modules/ble-serial/default.nix @@ -0,0 +1,57 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + hatchling, + bleak, + coloredlogs, + pyserial, + bless, +}: + +buildPythonPackage rec { + pname = "ble-serial"; + version = "3.0.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "Jakeler"; + repo = "ble-serial"; + tag = "v${version}"; + hash = "sha256-lbqu6VeE8XEIUvUILqKsTA+0/lxTr8GTbUBkSae/ruE="; + fetchSubmodules = true; + }; + + build-system = [ + hatchling + ]; + + dependencies = [ + bleak + coloredlogs + pyserial + ]; + + optional-dependencies = { + server = [ + bless + ]; + }; + + # Requires real hardware to test + # https://github.com/Jakeler/ble-serial/blob/3f1a619208a0eb372a0993aadc086c4842946f21/tests/test.py + doCheck = false; + + pythonImportsCheck = [ + "ble_serial.bluetooth.ble_client" + "ble_serial.scan" + ]; + + meta = { + description = "\"RFCOMM for BLE\" a Serial UART over Bluetooth low energy (4+) bridge"; + homepage = "https://github.com/Jakeler/ble-serial"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ eljamm ]; + platforms = lib.platforms.unix; + }; +} diff --git a/pkgs/development/python-modules/pyoprf/default.nix b/pkgs/development/python-modules/pyoprf/default.nix index 317533daa588..f7f525034e79 100644 --- a/pkgs/development/python-modules/pyoprf/default.nix +++ b/pkgs/development/python-modules/pyoprf/default.nix @@ -4,7 +4,11 @@ buildPythonPackage, liboprf, setuptools, + ble-serial, + pyserial, + pyserial-asyncio, pysodium, + pyudev, securestring, pytestCheckHook, }: @@ -32,7 +36,11 @@ buildPythonPackage rec { build-system = [ setuptools ]; dependencies = [ + ble-serial + pyserial + pyserial-asyncio pysodium + pyudev securestring ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f14f88370935..6d8c838dba4f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1971,6 +1971,8 @@ self: super: with self; { blake3 = callPackage ../development/python-modules/blake3 { }; + ble-serial = callPackage ../development/python-modules/ble-serial { }; + bleach = callPackage ../development/python-modules/bleach { }; bleach-allowlist = callPackage ../development/python-modules/bleach-allowlist { };