From 069a988e65e28764b3cbab137aa7b1a90464d69f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o?= <jpsimas@gmail.com>
Date: Fri, 12 Mar 2021 19:42:02 -0300
Subject: [PATCH] gnu: gnuradio: Update to 3.9.0.0.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/radio.scm (gnuradio): Update to 3.9.0.0.
 - Replace swig with pybind11.
 - Remove sections related to removing/deleting the included copy of volk,
as it is not included anymore.
 - Add sdl as an input to prevent the test "qa_dtv" from failing.
 - Disable broken tests.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
 gnu/packages/radio.scm | 32 +++++++++++++++++++-------------
 1 file changed, 19 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/radio.scm b/gnu/packages/radio.scm
index 3378b36adb..df63ff6868 100644
--- a/gnu/packages/radio.scm
+++ b/gnu/packages/radio.scm
@@ -67,6 +67,7 @@
   #:use-module (gnu packages qt)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages ruby)
+  #:use-module (gnu packages sdl)
   #:use-module (gnu packages sphinx)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages tcl)
@@ -286,32 +287,26 @@ used by RDS Spy, and audio files containing @dfn{multiplex} signals (MPX).")
 (define-public gnuradio
   (package
     (name "gnuradio")
-    (version "3.8.0.0")
+    (version "3.9.0.0")
     (source
      (origin
        (method url-fetch)
        (uri (string-append "https://www.gnuradio.org/releases/gnuradio/"
                            "gnuradio-" version ".tar.xz"))
        (sha256
-        (base32 "0aw55gf5549b0fz2qdi7vplcmaf92bj34h40s34b2ycnqasv900r"))
-       (modules '((guix build utils)))
-       (snippet
-        '(begin
-           ;; Delete bundled volk to use the shared one.
-           (delete-file-recursively "volk")
-           #t))))
+        (base32 "1jvm9xd0l2pz1fww4zii6hl7ccnvy256nrf70ljb594n7j9j49ha"))))
     (build-system cmake-build-system)
     (native-inputs
      `(("doxygen" ,doxygen)
        ("ghostscript" ,ghostscript)
        ("orc" ,orc)
        ("pkg-config" ,pkg-config)
+       ("pybind11" ,pybind11)
        ("python-cheetah" ,python-cheetah)
        ("python-mako" ,python-mako)
        ("python-pyzmq" ,python-pyzmq)
        ("python-scipy" ,python-scipy)
        ("python-sphinx" ,python-sphinx)
-       ("swig" ,swig)
        ("texlive" ,(texlive-union (list texlive-amsfonts
                                         texlive-latex-amsmath
                                         ;; TODO: Add newunicodechar.
@@ -343,6 +338,7 @@ used by RDS Spy, and audio files containing @dfn{multiplex} signals (MPX).")
        ("python-pyyaml" ,python-pyyaml)
        ("qtbase" ,qtbase)
        ("qwt" ,qwt)
+       ("sdl" ,sdl)
        ("volk" ,volk)
        ("zeromq" ,zeromq)))
     (arguments
@@ -354,8 +350,6 @@ used by RDS Spy, and audio files containing @dfn{multiplex} signals (MPX).")
        #:imported-modules (,@%cmake-build-system-modules
                            (guix build glib-or-gtk-build-system)
                            (guix build python-build-system))
-       #:configure-flags
-       '("-DENABLE_INTERNAL_VOLK=OFF")
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'fix-paths
@@ -371,8 +365,7 @@ used by RDS Spy, and audio files containing @dfn{multiplex} signals (MPX).")
              (substitute* "cmake/Modules/GrPython.cmake"
                (("dist-packages")
                 "site-packages"))
-             (substitute* '("gr-vocoder/swig/vocoder_swig.i"
-                            "gr-vocoder/include/gnuradio/vocoder/codec2.h"
+             (substitute* '("gr-vocoder/include/gnuradio/vocoder/codec2.h"
                             "gr-vocoder/include/gnuradio/vocoder/freedv_api.h")
                (("<codec2/")
                 "<"))
@@ -384,6 +377,19 @@ used by RDS Spy, and audio files containing @dfn{multiplex} signals (MPX).")
                                     "/bin/Xvfb :1 &"))
              (setenv "DISPLAY" ":1")
              #t))
+         (replace 'check
+           (lambda* (#:key tests? parallel-tests? #:allow-other-keys)
+             (invoke "ctest" "-j" (if parallel-tests?
+                                      (number->string (parallel-job-count))
+                                      "1")
+                     "--output-on-failure"
+                     ;;disable broken tests
+                     "-E" (string-join
+                           '(;; https://github.com/gnuradio/gnuradio/issues/3871
+                             "qa_header_payload_demux"
+                             ;; https://github.com/gnuradio/gnuradio/issues/4348
+                             "qa_packet_headerparser_b")
+                           "|"))))
          (add-after 'install 'wrap-python
            (assoc-ref python:%standard-phases 'wrap))
          (add-after 'wrap-python 'wrap-glib-or-gtk
-- 
2.31.0

