From 3cd940354369c253116bc73424a429a2aec0f58b Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Tue, 20 Jan 2026 13:42:16 +0200 Subject: [PATCH] gnuradio: (wrapper) add uhd Python modules only if needed --- pkgs/applications/radio/gnuradio/wrapper.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/radio/gnuradio/wrapper.nix b/pkgs/applications/radio/gnuradio/wrapper.nix index 10896f19f1c1..d555d23e2fc4 100644 --- a/pkgs/applications/radio/gnuradio/wrapper.nix +++ b/pkgs/applications/radio/gnuradio/wrapper.nix @@ -64,10 +64,14 @@ let pythonPkgs = extraPythonPackages ++ [ (unwrapped.python.pkgs.toPythonModule unwrapped) ] - ++ unwrapped.passthru.uhd.pythonPath - ++ lib.optionals (unwrapped.passthru.uhd.pythonPath != [ ]) [ - (unwrapped.python.pkgs.toPythonModule unwrapped.passthru.uhd) - ] + ++ lib.optionals (unwrapped.hasFeature "gr-uhd") ( + unwrapped.passthru.uhd.pythonPath + # Check if uhd was built with python support, which means it should + # be added as a python module too. + ++ lib.optionals (unwrapped.passthru.uhd.pythonPath != [ ]) [ + (unwrapped.python.pkgs.toPythonModule unwrapped.passthru.uhd) + ] + ) # Add the extraPackages as python modules as well ++ (map unwrapped.python.pkgs.toPythonModule extraPackages) ++ lib.flatten (