From d075c6f0b1d8ac2e08b582f03731903defef8b32 Mon Sep 17 00:00:00 2001 From: Chuang Zhu Date: Wed, 17 Jan 2024 06:19:41 +0800 Subject: [PATCH] gnuradio: disabledForGRafter -> disabled --- pkgs/applications/radio/gnuradio/shared.nix | 2 ++ pkgs/development/gnuradio-modules/mkDerivation.nix | 10 ++++++++-- pkgs/top-level/gnuradio-packages.nix | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/radio/gnuradio/shared.nix b/pkgs/applications/radio/gnuradio/shared.nix index fbb4960dc8fa..cd674e41815e 100644 --- a/pkgs/applications/radio/gnuradio/shared.nix +++ b/pkgs/applications/radio/gnuradio/shared.nix @@ -104,6 +104,8 @@ in { featuresInfo python ; + gnuradioOlder = lib.versionOlder versionAttr.major; + gnuradioAtLeast = lib.versionAtLeast versionAttr.major; } // lib.optionalAttrs (hasFeature "gr-qtgui") { inherit qt; } // lib.optionalAttrs (hasFeature "gnuradio-companion") { diff --git a/pkgs/development/gnuradio-modules/mkDerivation.nix b/pkgs/development/gnuradio-modules/mkDerivation.nix index 014968f82cc6..b35c93f90abd 100644 --- a/pkgs/development/gnuradio-modules/mkDerivation.nix +++ b/pkgs/development/gnuradio-modules/mkDerivation.nix @@ -7,12 +7,18 @@ mkDerivation: args: # Check if it's supposed to not get built for the current gnuradio version -if (builtins.hasAttr "disabledForGRafter" args) && -(lib.versionAtLeast unwrapped.versionAttr.major args.disabledForGRafter) then +if (builtins.hasAttr "disabled" args) && args.disabled then let name = args.name or "${args.pname}"; in throw "Package ${name} is incompatible with GNURadio ${unwrapped.versionAttr.major}" else +if builtins.hasAttr "disabledForGRafter" args then +throw '' + `disabledForGRafter` is superseded by `disabled`. + Use `disabled = gnuradioAtLeast "${unwrapped.versionAttr.major}";` instead. +'' +else + let args_ = { enableParallelBuilding = args.enableParallelBuilding or true; diff --git a/pkgs/top-level/gnuradio-packages.nix b/pkgs/top-level/gnuradio-packages.nix index 08cc25980240..5adac2cf98e6 100644 --- a/pkgs/top-level/gnuradio-packages.nix +++ b/pkgs/top-level/gnuradio-packages.nix @@ -24,6 +24,7 @@ let ; inherit mkDerivationWith mkDerivation; inherit gnuradio; + inherit (gnuradio) gnuradioOlder gnuradioAtLeast; } // lib.optionalAttrs (gnuradio.hasFeature "gr-uhd") { inherit (gnuradio) uhd; });