Subject: [bug#53820] [PATCH] gnu: Add jtdx

From: "Sheng Yang" <[email-masked]>
Date: Sun, 06 Feb 2022 08:14:26 -0600

JTDX is a popular fork of WSJT-X, commonly used by ham radio operators for FT8 and other modes.

This is the first time I am submitting a patch to Guix. I have tried my best to format and test it, with the help of a few friends familiar with Guix. Feel free to modify the patch if I did something incorrectly.

From 187f08de9656d4d0beb489585dcb8ec8323a3789 Mon Sep 17 00:00:00 2001
From: Sheng Yang <[email-masked]>
Date: Sun, 23 Jan 2022 21:46:27 -0600
Subject: [PATCH] gnu: Add jtdx

* gnu/packages/radio.scm (jtdx-hamlib): New variable.
  (jtdx): New variable.
---
 gnu/packages/radio.scm | 67 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 67 insertions(+)

diff --git a/gnu/packages/radio.scm b/gnu/packages/radio.scm
index e487987738..36bbe2c097 100644
--- a/gnu/packages/radio.scm
+++ b/gnu/packages/radio.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2020, 2021 Tobias Geerinckx-Rice <[email-masked]>
 ;;; Copyright © 2021 João Pedro Simas <[email-masked]>
 ;;; Copyright © 2021 Jack Hill <[email-masked]>
+;;; Copyright © 2022 Sheng Yang <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1113,6 +1114,31 @@ (define wsjtx-hamlib
                            "--with-tcl-binding"
                            "--with-xml-support")))))
 
+(define jtdx-hamlib
+  ;; Fork of hamlib with custom patches used by jtdx.
+  (package
+    (inherit hamlib)
+    (name "jtdx-hamlib")
+    (version "2.2.158")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/Hamlib/Hamlib.git")
+             (commit "954d70c143a9a0293371d8def3a7300ce3ca68c4")))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0z89krk2vnbm7narf9kkng5cxf6wqkijz06brzcg6vazf944x4ci"))))
+    (native-inputs
+     (modify-inputs (package-native-inputs hamlib)
+       (prepend autoconf automake libtool texinfo)))
+    (arguments
+     `(#:configure-flags '("--disable-static"
+                           "--with-lua-binding"
+                           "--with-python-binding"
+                           "--with-tcl-binding"
+                           "--with-xml-support")))))
+
 (define-public tlf
   (package
     (name "tlf")
@@ -1206,6 +1232,47 @@ (define-public wsjtx
     (home-page "https://www.physics.princeton.edu/pulsar/k1jt/wsjtx.html")
     (license license:gpl3)))
 
+(define-public jtdx
+  (package
+    (name "jtdx")
+    (version "2.2.158")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/jtdx-project/jtdx")
+             (commit "158")))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1lw9q7ggh2jlasipl3v5pkbabysjr6baw15lnmg664ah3fwdrvnx"))))
+    (build-system qt-build-system)
+    (native-inputs
+     (list asciidoc gfortran pkg-config qttools ruby-asciidoctor))
+    (inputs
+     (list
+      boost
+      fftw
+      fftwf
+      jtdx-hamlib
+      libusb
+      qtbase-5
+      qtwebsockets
+      qtmultimedia
+      qtserialport))
+    (arguments
+     `(#:tests? #f)) ; No test suite
+    (synopsis "Weak-signal ham radio communication program, forked from WSJTX")
+    (description
+     "JTDX means \"JT,T10 and FT8 and FT4 modes for DXing\", it is being
+developed with main focus on the sensitivity and decoding efficiency, both, in
+overcrowded and half empty HF band conditions.
+
+It is modified WSJT-X software forked from WSJT-X r6462.  JTDX supports JT9,
+JT65, T10, FT8 and FT4 © digital modes for HF amateur radio communication,
+focused on DXing and being shaped by community of DXers.JTDX")
+    (home-page "https://www.jtdx.tech/en/")
+    (license license:gpl3)))
+
 (define-public js8call
   (package
     (inherit wsjtx)
-- 
2.34.1