From 88519c6309d5d6833b3017168179e412beb781f2 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 18 Feb 2022 10:13:16 +0200 Subject: [PATCH] gnuradio: Inherit log dependencies in passthrus Inherit spdlog for GR 3.10 and log4cpp for lower GR versions. Inherit both of these in the scope of the GR packages attribute set. Also use the inherited log4cpp in qradiolink, gqrx & gnss-sdr. --- pkgs/applications/radio/gnss-sdr/default.nix | 4 +--- pkgs/applications/radio/gnuradio/3.8.nix | 6 +++++- pkgs/applications/radio/gnuradio/3.9.nix | 6 +++++- pkgs/applications/radio/gnuradio/default.nix | 8 +++++++- pkgs/applications/radio/gqrx/default.nix | 3 +-- pkgs/applications/radio/qradiolink/default.nix | 3 +-- pkgs/top-level/gnuradio-packages.nix | 12 ++++++++---- 7 files changed, 28 insertions(+), 14 deletions(-) diff --git a/pkgs/applications/radio/gnss-sdr/default.nix b/pkgs/applications/radio/gnss-sdr/default.nix index 479b3b641cd3..ec5ec5d4977b 100644 --- a/pkgs/applications/radio/gnss-sdr/default.nix +++ b/pkgs/applications/radio/gnss-sdr/default.nix @@ -12,8 +12,6 @@ , libpcap , orc , pkg-config -, uhd -, log4cpp , blas, lapack , matio , pugixml @@ -52,7 +50,7 @@ gnuradio3_8.pkgs.mkDerivation rec { # UHD support is optional, but gnuradio is built with it, so there's # nothing to be gained by leaving it out. gnuradio3_8.unwrapped.uhd - log4cpp + gnuradio3_8.unwrapped.log4cpp blas lapack matio pugixml diff --git a/pkgs/applications/radio/gnuradio/3.8.nix b/pkgs/applications/radio/gnuradio/3.8.nix index 63adbf04b0e4..f3a56cfdb055 100644 --- a/pkgs/applications/radio/gnuradio/3.8.nix +++ b/pkgs/applications/radio/gnuradio/3.8.nix @@ -251,7 +251,11 @@ stdenv.mkDerivation rec { ]; passthru = shared.passthru // { # Deps that are potentially overriden and are used inside GR plugins - the same version must - inherit boost volk; + inherit + boost + volk + 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 784ab7bd0fc2..638064bbd072 100644 --- a/pkgs/applications/radio/gnuradio/3.9.nix +++ b/pkgs/applications/radio/gnuradio/3.9.nix @@ -275,7 +275,11 @@ stdenv.mkDerivation rec { ]; passthru = shared.passthru // { # Deps that are potentially overriden and are used inside GR plugins - the same version must - inherit boost volk; + inherit + boost + volk + 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 22e4b5d2a1da..eef1960ae1f4 100644 --- a/pkgs/applications/radio/gnuradio/default.nix +++ b/pkgs/applications/radio/gnuradio/default.nix @@ -293,9 +293,15 @@ stdenv.mkDerivation rec { ]; passthru = shared.passthru // { # Deps that are potentially overriden and are used inside GR plugins - the same version must - inherit boost volk; + inherit + boost + volk + spdlog + ; } // lib.optionalAttrs (hasFeature "gr-uhd") { inherit uhd; + } // lib.optionalAttrs (hasFeature "gr-pdu") { + inherit libiio libad9361; } // lib.optionalAttrs (hasFeature "gr-qtgui") { inherit (libsForQt5) qwt; }; diff --git a/pkgs/applications/radio/gqrx/default.nix b/pkgs/applications/radio/gqrx/default.nix index 5fe7ddf813d6..28be25920a45 100644 --- a/pkgs/applications/radio/gqrx/default.nix +++ b/pkgs/applications/radio/gqrx/default.nix @@ -5,7 +5,6 @@ , qt5 , gnuradio3_8Minimal , thrift -, log4cpp , mpir , fftwFloat , alsa-lib @@ -39,7 +38,7 @@ gnuradio3_8Minimal.pkgs.mkDerivation rec { qt5.wrapQtAppsHook ]; buildInputs = [ - log4cpp + gnuradio3_8Minimal.unwrapped.log4cpp mpir fftwFloat alsa-lib diff --git a/pkgs/applications/radio/qradiolink/default.nix b/pkgs/applications/radio/qradiolink/default.nix index 6960eba6a57d..567a587e6d5b 100644 --- a/pkgs/applications/radio/qradiolink/default.nix +++ b/pkgs/applications/radio/qradiolink/default.nix @@ -7,7 +7,6 @@ , thrift # Not gnuradioPackages' , codec2 -, log4cpp , gmp , gsm , libopus @@ -48,7 +47,7 @@ gnuradio3_8.pkgs.mkDerivation rec { buildInputs = [ gnuradio3_8.unwrapped.boost codec2 - log4cpp + gnuradio3_8.unwrapped.log4cpp gmp libpulseaudio libconfig diff --git a/pkgs/top-level/gnuradio-packages.nix b/pkgs/top-level/gnuradio-packages.nix index d291c1e830cd..1cd2c93da773 100644 --- a/pkgs/top-level/gnuradio-packages.nix +++ b/pkgs/top-level/gnuradio-packages.nix @@ -14,16 +14,20 @@ let }; mkDerivation = mkDerivationWith stdenv.mkDerivation; - callPackage = self.newScope { + callPackage = self.newScope ({ inherit (gnuradio) # Packages that are potentially overriden and used as deps here. boost - uhd volk ; 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;