summary refs log tree commit diff
path: root/pkgs/applications/radio/gnuradio/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/radio/gnuradio/default.nix')
-rw-r--r--pkgs/applications/radio/gnuradio/default.nix26
1 files changed, 20 insertions, 6 deletions
diff --git a/pkgs/applications/radio/gnuradio/default.nix b/pkgs/applications/radio/gnuradio/default.nix
index 13b498e9c46..cb464bde16e 100644
--- a/pkgs/applications/radio/gnuradio/default.nix
+++ b/pkgs/applications/radio/gnuradio/default.nix
@@ -190,11 +190,10 @@ let
       runtime = [ SDL ];
       cmakeEnableFlag = "GR_VIDEO_SDL";
     };
-    # codec2 and gsm support is broken with gr3.9: https://github.com/gnuradio/gnuradio/issues/4278
-    # gr-vocoder = {
-      # runtime = [ codec2 gsm ];
-      # cmakeEnableFlag = "GR_VOCODER";
-    # };
+    gr-vocoder = {
+      runtime = [ codec2 gsm ];
+      cmakeEnableFlag = "GR_VOCODER";
+    };
     gr-wavelet = {
       cmakeEnableFlag = "GR_WAVELET";
       runtime = [ gsl libsodium ];
@@ -234,7 +233,6 @@ stdenv.mkDerivation rec {
     src
     nativeBuildInputs
     buildInputs
-    cmakeFlags
     disallowedReferences
     stripDebugList
     doCheck
@@ -250,6 +248,22 @@ stdenv.mkDerivation rec {
   } // lib.optionalAttrs (hasFeature "gr-qtgui" features) {
     inherit (libsForQt5) qwt;
   };
+  cmakeFlags = shared.cmakeFlags
+    # From some reason, if these are not set, libcodec2 and gsm are not
+    # detected properly.
+    ++ lib.optionals (hasFeature "gr-vocoder" features) [
+      "-DLIBCODEC2_FOUND=TRUE"
+      "-DLIBCODEC2_LIBRARIES=${codec2}/lib/libcodec2.so"
+      "-DLIBCODEC2_INCLUDE_DIRS=${codec2}/include"
+      "-DLIBCODEC2_HAS_FREEDV_API=ON"
+      "-DLIBGSM_FOUND=TRUE"
+      "-DLIBGSM_LIBRARIES=${gsm}/lib/libgsm.so"
+      "-DLIBGSM_INCLUDE_DIRS=${gsm}/include/gsm"
+    ]
+    ++ lib.optionals (hasFeature "volk" features && volk != null) [
+      "-DENABLE_INTERNAL_VOLK=OFF"
+    ]
+  ;
 
   postInstall = shared.postInstall
     # This is the only python reference worth removing, if needed.