From 2634268fa65a862f44bc9353e041bbcabebd01f4 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 21 Apr 2023 12:48:49 +0300 Subject: [PATCH] gnuradio: Define a common logLib attribute Use it in all gnuradio modules. --- pkgs/applications/radio/gnss-sdr/default.nix | 7 ++----- pkgs/applications/radio/gnuradio/3.8.nix | 4 +++- pkgs/applications/radio/gnuradio/3.9.nix | 4 +++- pkgs/applications/radio/gnuradio/default.nix | 4 +++- pkgs/applications/radio/gqrx/default.nix | 2 +- pkgs/applications/radio/qradiolink/default.nix | 2 +- pkgs/development/gnuradio-modules/ais/default.nix | 4 ++-- pkgs/development/gnuradio-modules/grnet/default.nix | 4 ++-- pkgs/development/gnuradio-modules/gsm/default.nix | 4 ++-- pkgs/development/gnuradio-modules/limesdr/default.nix | 4 ++-- pkgs/development/gnuradio-modules/nacl/default.nix | 4 ++-- pkgs/development/gnuradio-modules/osmosdr/default.nix | 4 ++-- pkgs/development/gnuradio-modules/rds/default.nix | 4 ++-- pkgs/top-level/gnuradio-packages.nix | 7 ++----- 14 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pkgs/applications/radio/gnss-sdr/default.nix b/pkgs/applications/radio/gnss-sdr/default.nix index 725f531dd072..c1d3950bed01 100644 --- a/pkgs/applications/radio/gnss-sdr/default.nix +++ b/pkgs/applications/radio/gnss-sdr/default.nix @@ -60,13 +60,10 @@ gnuradio.pkgs.mkDerivation rec { pugixml protobuf gnuradio.unwrapped.boost + gnuradio.unwrapped.logLib ] ++ lib.optionals (gnuradio.hasFeature "gr-uhd") [ gnuradio.unwrapped.uhd - ] ++ (if (lib.versionAtLeast gnuradio.unwrapped.versionAttr.major "3.10") then [ - gnuradio.unwrapped.spdlog - ] else [ - gnuradio.unwrapped.log4cpp - ]) ++ lib.optionals (enableRawUdp) [ + ] ++ lib.optionals (enableRawUdp) [ libpcap ] ++ lib.optionals (gnuradio.hasFeature "gr-ctrlport") [ thrift diff --git a/pkgs/applications/radio/gnuradio/3.8.nix b/pkgs/applications/radio/gnuradio/3.8.nix index d8c53d2badfe..e10d3df374e2 100644 --- a/pkgs/applications/radio/gnuradio/3.8.nix +++ b/pkgs/applications/radio/gnuradio/3.8.nix @@ -253,8 +253,10 @@ stdenv.mkDerivation { inherit boost volk - log4cpp ; + # Used by many gnuradio modules, the same attribute is present in + # gnuradio3.10 where there it's spdlog. + logLib = log4cpp; } // lib.optionalAttrs (hasFeature "gr-uhd") { inherit uhd; } // lib.optionalAttrs (hasFeature "gr-qtgui") { diff --git a/pkgs/applications/radio/gnuradio/3.9.nix b/pkgs/applications/radio/gnuradio/3.9.nix index 263440f79c4b..a393cd5528d5 100644 --- a/pkgs/applications/radio/gnuradio/3.9.nix +++ b/pkgs/applications/radio/gnuradio/3.9.nix @@ -285,8 +285,10 @@ stdenv.mkDerivation { inherit boost volk - log4cpp ; + # Used by many gnuradio modules, the same attribute is present in + # gnuradio3.10 where there it's spdlog. + logLib = log4cpp; } // lib.optionalAttrs (hasFeature "gr-uhd") { inherit uhd; } // lib.optionalAttrs (hasFeature "gr-qtgui") { diff --git a/pkgs/applications/radio/gnuradio/default.nix b/pkgs/applications/radio/gnuradio/default.nix index 1c12454e21a3..ca0f7fb97eac 100644 --- a/pkgs/applications/radio/gnuradio/default.nix +++ b/pkgs/applications/radio/gnuradio/default.nix @@ -305,8 +305,10 @@ stdenv.mkDerivation { inherit boost volk - spdlog ; + # Used by many gnuradio modules, the same attribute is present in + # previous gnuradio versions where there it's log4cpp. + logLib = spdlog; } // lib.optionalAttrs (hasFeature "gr-uhd") { inherit uhd; } // lib.optionalAttrs (hasFeature "gr-pdu") { diff --git a/pkgs/applications/radio/gqrx/default.nix b/pkgs/applications/radio/gqrx/default.nix index c011e5a4d0a7..3e3c3f6bef95 100644 --- a/pkgs/applications/radio/gqrx/default.nix +++ b/pkgs/applications/radio/gqrx/default.nix @@ -43,7 +43,7 @@ gnuradio3_8Minimal.pkgs.mkDerivation rec { wrapGAppsHook ]; buildInputs = [ - gnuradio3_8Minimal.unwrapped.log4cpp + gnuradio3_8Minimal.unwrapped.logLib mpir fftwFloat alsa-lib diff --git a/pkgs/applications/radio/qradiolink/default.nix b/pkgs/applications/radio/qradiolink/default.nix index 02542e503192..1bfb4c74f633 100644 --- a/pkgs/applications/radio/qradiolink/default.nix +++ b/pkgs/applications/radio/qradiolink/default.nix @@ -49,7 +49,7 @@ gnuradio3_8.pkgs.mkDerivation rec { buildInputs = [ gnuradio3_8.unwrapped.boost codec2 - gnuradio3_8.unwrapped.log4cpp + gnuradio3_8.unwrapped.logLib gmp libpulseaudio libconfig diff --git a/pkgs/development/gnuradio-modules/ais/default.nix b/pkgs/development/gnuradio-modules/ais/default.nix index 98b8229bc1ae..92abb23a5c57 100644 --- a/pkgs/development/gnuradio-modules/ais/default.nix +++ b/pkgs/development/gnuradio-modules/ais/default.nix @@ -6,7 +6,7 @@ , python , boost , cppunit -, log4cpp +, logLib , osmosdr , gmp , mpir @@ -41,7 +41,7 @@ mkDerivation rec { cppunit osmosdr boost - log4cpp + logLib gmp mpir fftwFloat diff --git a/pkgs/development/gnuradio-modules/grnet/default.nix b/pkgs/development/gnuradio-modules/grnet/default.nix index fc12abd8cfa5..817205cc0ca6 100644 --- a/pkgs/development/gnuradio-modules/grnet/default.nix +++ b/pkgs/development/gnuradio-modules/grnet/default.nix @@ -6,7 +6,7 @@ , cmake , pkg-config , boost -, log4cpp +, logLib , python , swig , mpir @@ -67,7 +67,7 @@ mkDerivation { buildInputs = [ boost - log4cpp + logLib doxygen mpir gmp diff --git a/pkgs/development/gnuradio-modules/gsm/default.nix b/pkgs/development/gnuradio-modules/gsm/default.nix index 835c5456668c..aef853943123 100644 --- a/pkgs/development/gnuradio-modules/gsm/default.nix +++ b/pkgs/development/gnuradio-modules/gsm/default.nix @@ -6,7 +6,7 @@ , cppunit , swig , boost -, log4cpp +, logLib , python , libosmocore , osmosdr @@ -32,7 +32,7 @@ mkDerivation { buildInputs = [ cppunit - log4cpp + logLib boost libosmocore osmosdr diff --git a/pkgs/development/gnuradio-modules/limesdr/default.nix b/pkgs/development/gnuradio-modules/limesdr/default.nix index 48bbc68c80a3..a9ed621cdf11 100644 --- a/pkgs/development/gnuradio-modules/limesdr/default.nix +++ b/pkgs/development/gnuradio-modules/limesdr/default.nix @@ -8,7 +8,7 @@ , doxygen , swig , python -, log4cpp +, logLib , mpir , boost , gmp @@ -42,7 +42,7 @@ in mkDerivation { python ]; buildInputs = [ - log4cpp + logLib mpir boost gmp diff --git a/pkgs/development/gnuradio-modules/nacl/default.nix b/pkgs/development/gnuradio-modules/nacl/default.nix index 1ffb0afee07e..9f9175eae058 100644 --- a/pkgs/development/gnuradio-modules/nacl/default.nix +++ b/pkgs/development/gnuradio-modules/nacl/default.nix @@ -6,7 +6,7 @@ , cppunit , swig , boost -, log4cpp +, logLib , python , libsodium }: @@ -31,7 +31,7 @@ mkDerivation { buildInputs = [ cppunit - log4cpp + logLib boost libsodium ]; diff --git a/pkgs/development/gnuradio-modules/osmosdr/default.nix b/pkgs/development/gnuradio-modules/osmosdr/default.nix index a9a47e4d50a4..07a353daa447 100644 --- a/pkgs/development/gnuradio-modules/osmosdr/default.nix +++ b/pkgs/development/gnuradio-modules/osmosdr/default.nix @@ -6,7 +6,7 @@ , gnuradio , cmake , pkg-config -, log4cpp +, logLib , mpir , boost , gmp @@ -44,7 +44,7 @@ in mkDerivation { outputs = [ "out" "dev" ]; buildInputs = [ - log4cpp + logLib mpir boost fftwFloat diff --git a/pkgs/development/gnuradio-modules/rds/default.nix b/pkgs/development/gnuradio-modules/rds/default.nix index 6e651cdd7e0c..7ffdd206474a 100644 --- a/pkgs/development/gnuradio-modules/rds/default.nix +++ b/pkgs/development/gnuradio-modules/rds/default.nix @@ -6,7 +6,7 @@ , pkg-config , swig , python -, log4cpp +, logLib , mpir , thrift , boost @@ -36,7 +36,7 @@ in mkDerivation { disabledForGRafter = "3.9"; buildInputs = [ - log4cpp + logLib mpir boost gmp diff --git a/pkgs/top-level/gnuradio-packages.nix b/pkgs/top-level/gnuradio-packages.nix index 7fc3c4860655..324a061c703e 100644 --- a/pkgs/top-level/gnuradio-packages.nix +++ b/pkgs/top-level/gnuradio-packages.nix @@ -19,15 +19,12 @@ let # Packages that are potentially overridden and used as deps here. boost volk + logLib ; inherit mkDerivationWith mkDerivation; } // lib.optionalAttrs (gnuradio.hasFeature "gr-uhd") { inherit (gnuradio) uhd; - } // (if (lib.versionAtLeast gnuradio.versionAttr.major "3.10") then { - inherit (gnuradio) spdlog; - } else { - inherit (gnuradio) log4cpp; - })); + }); in { inherit callPackage mkDerivation mkDerivationWith;