From e2b7c5448a7431dbec5f783e8a073a74e0a31c3b Mon Sep 17 00:00:00 2001 From: BatteredBunny Date: Mon, 13 Apr 2026 13:20:42 +0300 Subject: [PATCH] mavproxy: Fix usage --- .../science/robotics/mavproxy/default.nix | 32 +++++++++++++++---- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/science/robotics/mavproxy/default.nix b/pkgs/applications/science/robotics/mavproxy/default.nix index cb459e8ef8c0..d7f077670950 100644 --- a/pkgs/applications/science/robotics/mavproxy/default.nix +++ b/pkgs/applications/science/robotics/mavproxy/default.nix @@ -1,24 +1,27 @@ { stdenv, lib, + billiard, buildPythonApplication, fetchFromGitHub, + fetchpatch, + gnureadline, lxml, matplotlib, numpy, opencv-python, pymavlink, + pynmeagps, pyserial, setuptools, + versionCheckHook, wxpython, - billiard, - gnureadline, }: buildPythonApplication rec { pname = "MAVProxy"; version = "1.8.74"; - format = "setuptools"; + pyproject = true; src = fetchFromGitHub { owner = "ArduPilot"; @@ -27,14 +30,25 @@ buildPythonApplication rec { hash = "sha256-1/bp3vlCXt4Hg36zwMKSzPSxW7xlxpfx2o+2uQixdos="; }; - propagatedBuildInputs = [ + patches = [ + # Remove python 2 future imports + (fetchpatch { + url = "https://github.com/ArduPilot/MAVProxy/commit/db52f3f5d1991942026c00b51a3ce1ce85998cbd.patch"; + hash = "sha256-mNhOfXJMiUihsso3fjzlbeXW/3ENvrdkFSLo23dMCY4="; + }) + ]; + + build-system = [ setuptools ]; + + dependencies = [ lxml matplotlib numpy opencv-python pymavlink + pynmeagps pyserial - setuptools + setuptools # Imports `pkg_resources` at runtime wxpython ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ @@ -42,12 +56,16 @@ buildPythonApplication rec { gnureadline ]; - # No tests - doCheck = false; + pythonImportsCheck = [ "MAVProxy" ]; + + # No tests, but we can check the version + nativeInstallCheckInputs = [ versionCheckHook ]; meta = { description = "MAVLink proxy and command line ground station"; + mainProgram = "mavproxy.py"; homepage = "https://github.com/ArduPilot/MAVProxy"; + changelog = "https://github.com/ArduPilot/MAVProxy/releases/tag/${src.tag}"; license = lib.licenses.gpl3Plus; maintainers = with lib.maintainers; [ lopsided98 ]; };