From 2c9957e42f2e451612119a1b03216578d639e754 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sat, 7 Oct 2023 13:13:21 +0300 Subject: [PATCH] uhd: build with utils by default Build the uhd package with utils enabled by default, and disallow it to retain python references if these features are disabled. Add a new package uhdMinimal which does not build with these features. Modify the gnuradio{,3_{8,9}}Minimal packages so that they use the uhd package without python references. --- pkgs/applications/radio/uhd/default.nix | 6 +++++- pkgs/top-level/all-packages.nix | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/radio/uhd/default.nix b/pkgs/applications/radio/uhd/default.nix index e85000d4f9d2..5dbed65484de 100644 --- a/pkgs/applications/radio/uhd/default.nix +++ b/pkgs/applications/radio/uhd/default.nix @@ -18,7 +18,7 @@ , python3 , buildPackages , enableExamples ? false -, enableUtils ? false +, enableUtils ? true , libusb1 # Disable dpdk for now due to compilation issues. , enableDpdk ? false @@ -150,6 +150,10 @@ stdenv.mkDerivation (finalAttrs: { mv $out/lib/uhd/utils/uhd-usrp.rules $out/lib/udev/rules.d/ ''; + disallowedReferences = optionals (!enablePythonApi && !enableUtils) [ + python3 + ]; + meta = with lib; { description = "USRP Hardware Driver (for Software Defined Radio)"; longDescription = '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c8cc1eda9dc8..7f2141e89aa0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20509,6 +20509,10 @@ with pkgs; uefi-firmware-parser = callPackage ../development/tools/analysis/uefi-firmware-parser { }; uhd = callPackage ../applications/radio/uhd { }; + uhdMinimal = uhd.override { + enableUtils = false; + enablePythonApi = false; + }; uisp = callPackage ../development/embedded/uisp { }; @@ -31843,6 +31847,7 @@ with pkgs; # So it will not reference python enableModTool = false; }; + uhd = uhdMinimal; features = { gnuradio-companion = false; python-support = false; @@ -31875,6 +31880,7 @@ with pkgs; # So it will not reference python enableModTool = false; }; + uhd = uhdMinimal; features = { gnuradio-companion = false; python-support = false; @@ -31906,6 +31912,7 @@ with pkgs; volk = volk.override { enableModTool = false; }; + uhd = uhdMinimal; features = { gnuradio-companion = false; python-support = false;