diff --git a/pkgs/by-name/sm/smpmgr/package.nix b/pkgs/by-name/sm/smpmgr/package.nix new file mode 100644 index 000000000000..a7c6be3a41f7 --- /dev/null +++ b/pkgs/by-name/sm/smpmgr/package.nix @@ -0,0 +1,56 @@ +{ + lib, + fetchFromGitHub, + python3Packages, + versionCheckHook, +}: + +python3Packages.buildPythonApplication rec { + pname = "smpmgr"; + version = "0.12.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "intercreate"; + repo = "smpmgr"; + tag = version; + hash = "sha256-HNL9e3D/uZwJI0d4escbhe51zKH7hBFAnCGZZuZdla4="; + }; + + build-system = with python3Packages; [ + poetry-core + poetry-dynamic-versioning + setuptools + ]; + + dependencies = with python3Packages; [ + readchar + smpclient + typer + ]; + + nativeCheckInputs = with python3Packages; [ + pytestCheckHook + versionCheckHook + ]; + + pythonRelaxDeps = [ + "typer" + "smpclient" + ]; + + versionCheckProgramArg = [ "--version" ]; + + pythonImportsCheck = [ + "smpmgr" + ]; + + meta = { + description = "Simple Management Protocol (SMP) Manager for remotely managing MCU firmware"; + homepage = "https://github.com/intercreate/smpmgr"; + changelog = "https://github.com/intercreate/smpmgr/releases/tag/${version}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ otavio ]; + mainProgram = "smpmgr"; + }; +} diff --git a/pkgs/development/python-modules/smp/default.nix b/pkgs/development/python-modules/smp/default.nix new file mode 100644 index 000000000000..8f4ec2f8fe41 --- /dev/null +++ b/pkgs/development/python-modules/smp/default.nix @@ -0,0 +1,51 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + poetry-core, + cbor2, + crcmod, + eval-type-backport, + pydantic, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "smp"; + version = "3.3.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "JPHutchins"; + repo = "smp"; + tag = version; + hash = "sha256-TjucQm07nbfuFrVOHGOVA/f1rQRQfU8ws8VVC+U/kp8="; + }; + + build-system = [ + poetry-core + ]; + + dependencies = [ + cbor2 + crcmod + eval-type-backport + pydantic + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "smp" + ]; + + meta = { + description = "Simple Management Protocol (SMP) for remotely managing MCU firmware"; + homepage = "https://github.com/JPHutchins/smp"; + changelog = "https://github.com/JPHutchins/smp/releases/tag/${version}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ otavio ]; + }; +} diff --git a/pkgs/development/python-modules/smpclient/default.nix b/pkgs/development/python-modules/smpclient/default.nix new file mode 100644 index 000000000000..7b51f0955b9d --- /dev/null +++ b/pkgs/development/python-modules/smpclient/default.nix @@ -0,0 +1,59 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + poetry-core, + async-timeout, + bleak, + intelhex, + pyserial, + smp, + pytest-asyncio, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "smpclient"; + version = "4.4.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "intercreate"; + repo = "smpclient"; + tag = version; + hash = "sha256-qbf0xGK1RYaeEIAsbkZ2cWj/MQrmVwm2IKmOkihxBDE="; + }; + + build-system = [ + poetry-core + ]; + + dependencies = [ + async-timeout + bleak + intelhex + pyserial + smp + ]; + + nativeCheckInputs = [ + pytest-asyncio + pytestCheckHook + ]; + + pythonRelaxDeps = [ + "smp" + ]; + + pythonImportsCheck = [ + "smpclient" + ]; + + meta = { + description = "Simple Management Protocol (SMP) Client for remotely managing MCU firmware"; + homepage = "https://github.com/intercreate/smpclient"; + changelog = "https://github.com/intercreate/smpclient/releases/tag/${version}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ otavio ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index fc62a956dcf1..9353b1c7e320 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15915,6 +15915,10 @@ self: super: with self; { smolagents = callPackage ../development/python-modules/smolagents { }; + smp = callPackage ../development/python-modules/smp { }; + + smpclient = callPackage ../development/python-modules/smpclient { }; + smpp-pdu = callPackage ../development/python-modules/smpp-pdu { }; smpplib = callPackage ../development/python-modules/smpplib { };