about summary refs log tree commit diff
path: root/pkgs/applications/radio
diff options
context:
space:
mode:
authorDoron Behar <doron.behar@gmail.com>2023-10-03 15:29:19 +0300
committerDoron Behar <doron.behar@gmail.com>2023-10-05 11:53:09 +0300
commit937a6594cf76bdc1220e92af86ebb0d1342e4701 (patch)
tree9dfe3a4f428cc3afb6d981bf8d7a3abaf81e716f /pkgs/applications/radio
parentbfaf1e92d2b3609ece473e80725354083cce896f (diff)
downloadnixlib-937a6594cf76bdc1220e92af86ebb0d1342e4701.tar
nixlib-937a6594cf76bdc1220e92af86ebb0d1342e4701.tar.gz
nixlib-937a6594cf76bdc1220e92af86ebb0d1342e4701.tar.bz2
nixlib-937a6594cf76bdc1220e92af86ebb0d1342e4701.tar.lz
nixlib-937a6594cf76bdc1220e92af86ebb0d1342e4701.tar.xz
nixlib-937a6594cf76bdc1220e92af86ebb0d1342e4701.tar.zst
nixlib-937a6594cf76bdc1220e92af86ebb0d1342e4701.zip
gnuradio: enable tests on linux
Diffstat (limited to 'pkgs/applications/radio')
-rw-r--r--pkgs/applications/radio/gnuradio/3.8.nix19
-rw-r--r--pkgs/applications/radio/gnuradio/3.9.nix12
-rw-r--r--pkgs/applications/radio/gnuradio/default.nix5
-rw-r--r--pkgs/applications/radio/gnuradio/shared.nix11
4 files changed, 44 insertions, 3 deletions
diff --git a/pkgs/applications/radio/gnuradio/3.8.nix b/pkgs/applications/radio/gnuradio/3.8.nix
index 39ff6bb8917d..3113915bce8d 100644
--- a/pkgs/applications/radio/gnuradio/3.8.nix
+++ b/pkgs/applications/radio/gnuradio/3.8.nix
@@ -200,6 +200,11 @@ let
     gr-zeromq = {
       runtime = [ cppzmq ];
       cmakeEnableFlag = "GR_ZEROMQ";
+      pythonRuntime = [
+        # Will compile without this, but it is required by tests, and by some
+        # gr blocks.
+        python.pkgs.pyzmq
+      ];
     };
   };
   shared = (import ./shared.nix {
@@ -226,6 +231,20 @@ stdenv.mkDerivation (finalAttrs: (shared // {
   # Will still evaluate correctly if not used here. It only helps nix-update
   # find the right file in which version is defined.
   inherit (shared) src;
+  # Remove failing tests
+  preConfigure = (shared.preConfigure or "") + ''
+    # https://github.com/gnuradio/gnuradio/issues/3801
+    rm gr-blocks/python/blocks/qa_cpp_py_binding.py
+    rm gr-blocks/python/blocks/qa_cpp_py_binding_set.py
+    rm gr-blocks/python/blocks/qa_ctrlport_probes.py
+    # Tests that fail due to numpy deprecations upstream hasn't accomodated to yet.
+    rm gr-fec/python/fec/qa_polar_decoder_sc.py
+    rm gr-fec/python/fec/qa_polar_decoder_sc_list.py
+    rm gr-fec/python/fec/qa_polar_decoder_sc_systematic.py
+    rm gr-fec/python/fec/qa_polar_encoder.py
+    rm gr-fec/python/fec/qa_polar_encoder_systematic.py
+    rm gr-filter/python/filter/qa_freq_xlating_fft_filter.py
+  '';
   patches = [
     # Not accepted upstream, see https://github.com/gnuradio/gnuradio/pull/5227
     ./modtool-newmod-permissions.3_8.patch
diff --git a/pkgs/applications/radio/gnuradio/3.9.nix b/pkgs/applications/radio/gnuradio/3.9.nix
index 152ef5fbee2b..4d10851b7e13 100644
--- a/pkgs/applications/radio/gnuradio/3.9.nix
+++ b/pkgs/applications/radio/gnuradio/3.9.nix
@@ -227,6 +227,11 @@ let
     gr-zeromq = {
       runtime = [ cppzmq ];
       cmakeEnableFlag = "GR_ZEROMQ";
+      pythonRuntime = [
+        # Will compile without this, but it is required by tests, and by some
+        # gr blocks.
+        python.pkgs.pyzmq
+      ];
     };
     gr-network = {
       cmakeEnableFlag = "GR_NETWORK";
@@ -262,6 +267,13 @@ stdenv.mkDerivation (finalAttrs: (shared // {
   # Will still evaluate correctly if not used here. It only helps nix-update
   # find the right file in which version is defined.
   inherit (shared) src;
+  # Remove failing tests
+  preConfigure = (shared.preConfigure or "") + ''
+    # https://github.com/gnuradio/gnuradio/issues/3801
+    rm gr-blocks/python/blocks/qa_cpp_py_binding.py
+    rm gr-blocks/python/blocks/qa_cpp_py_binding_set.py
+    rm gr-blocks/python/blocks/qa_ctrlport_probes.py
+  '';
   patches = [
     # Not accepted upstream, see https://github.com/gnuradio/gnuradio/pull/5227
     ./modtool-newmod-permissions.patch
diff --git a/pkgs/applications/radio/gnuradio/default.nix b/pkgs/applications/radio/gnuradio/default.nix
index 2cef4f79dcd0..d1f0a3fd6fb6 100644
--- a/pkgs/applications/radio/gnuradio/default.nix
+++ b/pkgs/applications/radio/gnuradio/default.nix
@@ -248,6 +248,11 @@ let
     gr-zeromq = {
       runtime = [ cppzmq ];
       cmakeEnableFlag = "GR_ZEROMQ";
+      pythonRuntime = [
+        # Will compile without this, but it is required by tests, and by some
+        # gr blocks.
+        python.pkgs.pyzmq
+      ];
     };
     gr-network = {
       cmakeEnableFlag = "GR_NETWORK";
diff --git a/pkgs/applications/radio/gnuradio/shared.nix b/pkgs/applications/radio/gnuradio/shared.nix
index 0a905d8a5c5f..fbb4960dc8fa 100644
--- a/pkgs/applications/radio/gnuradio/shared.nix
+++ b/pkgs/applications/radio/gnuradio/shared.nix
@@ -112,9 +112,14 @@ in {
   # Wrapping is done with an external wrapper
   dontWrapPythonPrograms = true;
   dontWrapQtApps = true;
-  # Tests should succeed, but it's hard to get LD_LIBRARY_PATH right in order
-  # for it to happen.
-  doCheck = false;
+  # On darwin, it requires playing with DYLD_FALLBACK_LIBRARY_PATH to make if
+  # find libgnuradio-runtim.3.*.dylib .
+  doCheck = !stdenv.isDarwin;
+  preCheck = ''
+    export HOME=$(mktemp -d)
+    export QT_QPA_PLATFORM=offscreen
+    export QT_PLUGIN_PATH="${qt.qtbase.bin}/${qt.qtbase.qtPluginPrefix}"
+  '';
 
   meta = with lib; {
     description = "Software Defined Radio (SDR) software";