unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#49014] [PATCH 0/2] Add tlf
@ 2021-06-14  4:12 Jack Hill
  2021-06-14  4:14 ` [bug#49014] [PATCH 1/2] gnu: hamlib: Make libusb a propagated input Jack Hill
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jack Hill @ 2021-06-14  4:12 UTC (permalink / raw)
  To: 49014

This series adds a package for Tlf, an amateur (ham) radio logging 
program. Some things to note:

Tlf depends on hamlib, which has `Requires.private: libusb-1.0` in its 
pkg-config file. Tlf fails to build if libusb is not present in its build 
environment. I saw two options for resolving this: 1) add libusb as an 
input for tlf or 2) propagate libusb from hamlib. I chose the latter, but 
I'm not sure if that's the right choice as hamlib also provides binaries, 
so folks might want to install it in their profiles in addition to using 
it as a library.

The released version of Tlf doesn't work with our packaged version of 
hamlib because hamlib made a breaking change in the name of one of their 
macros. I added a patch from newer Tlf commits that works around this by 
adding some indirection.

I tested that it builds reproducably on x86_64-linux, and that it builds 
emulated aarch64-linux and armhf-linux. I was happy to see, especially on 
armhf, that I didn't run into the problem that caused Debian to add a 
patch:

https://salsa.debian.org/debian-hamradio-team/tlf/-/blob/8a0cbff093ac8846aa73ff012668b55628056ef4/debian/patches/979377-test-cabrillo

Jack Hill (2):
   gnu: hamlib: Make libusb a propagated input.
   gnu: Add tlf.

  gnu/local.mk                                  |  1 +
  .../patches/tlf-support-hamlib-4.2+.patch     | 66 +++++++++++++++++++
  gnu/packages/radio.scm                        | 64 +++++++++++++++++-
  3 files changed, 130 insertions(+), 1 deletion(-)
  create mode 100644 gnu/packages/patches/tlf-support-hamlib-4.2+.patch

-- 
2.32.0





^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#49014] [PATCH 1/2] gnu: hamlib: Make libusb a propagated input.
  2021-06-14  4:12 [bug#49014] [PATCH 0/2] Add tlf Jack Hill
@ 2021-06-14  4:14 ` Jack Hill
  2021-06-14  4:14   ` [bug#49014] [PATCH 2/2] gnu: Add tlf Jack Hill
  2021-06-14  4:20 ` [bug#49014] [PATCH v2 1/2] gnu: hamlib: Make libusb a propagated input Jack Hill
  2021-06-18 16:15 ` [bug#49014] [PATCH v3] " Jack Hill
  2 siblings, 1 reply; 7+ messages in thread
From: Jack Hill @ 2021-06-14  4:14 UTC (permalink / raw)
  To: 49014

* gnu/packages/radio.scm (hamlib)[inputs]: Remove libusb.
[propagated-inputs]: Add libusb.
---
 gnu/packages/radio.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/radio.scm b/gnu/packages/radio.scm
index d0b7446c3c..96c94fa1ce 100644
--- a/gnu/packages/radio.scm
+++ b/gnu/packages/radio.scm
@@ -1019,9 +1019,10 @@ you must extend 'udev-service-type' with this package.  E.g.:
        ("tcl" ,tcl)))
     (inputs
      `(("gd" ,gd)
-       ("libusb" ,libusb)
        ("libxml2" ,libxml2)
        ("readline" ,readline)))
+    (propagated-inputs
+     `(("libusb" ,libusb)))
     (arguments
      `(#:configure-flags '("--disable-static"
                            "--with-lua-binding"
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#49014] [PATCH 2/2] gnu: Add tlf.
  2021-06-14  4:14 ` [bug#49014] [PATCH 1/2] gnu: hamlib: Make libusb a propagated input Jack Hill
@ 2021-06-14  4:14   ` Jack Hill
  0 siblings, 0 replies; 7+ messages in thread
From: Jack Hill @ 2021-06-14  4:14 UTC (permalink / raw)
  To: 49014

* gnu/packages/patches/tlf-support-hamlib-4.2+.patch: New file.
* gnu/local.mk: Add it.
* gnu/packages/radio.scm (tlf): New variable.
---
 gnu/local.mk                                  |  1 +
 .../patches/tlf-support-hamlib-4.2+.patch     | 66 +++++++++++++++++++
 gnu/packages/radio.scm                        | 61 +++++++++++++++++
 3 files changed, 128 insertions(+)
 create mode 100644 gnu/packages/patches/tlf-support-hamlib-4.2+.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index e889abb1a6..175d1a47b2 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1744,6 +1744,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/tipp10-qt5.patch			\
   %D%/packages/patches/tk-find-library.patch			\
   %D%/packages/patches/tla2tools-build-xml.patch		\
+  %D%/packages/patches/tlf-support-hamlib-4.2+.patch		\
   %D%/packages/patches/transcode-ffmpeg.patch	\
   %D%/packages/patches/transmission-honor-localedir.patch	\
   %D%/packages/patches/ttf2eot-cstddef.patch			\
diff --git a/gnu/packages/patches/tlf-support-hamlib-4.2+.patch b/gnu/packages/patches/tlf-support-hamlib-4.2+.patch
new file mode 100644
index 0000000000..3c5db10010
--- /dev/null
+++ b/gnu/packages/patches/tlf-support-hamlib-4.2+.patch
@@ -0,0 +1,66 @@
+From 295fa956f899af37acb6bda9c76ad77748eb9a4a Mon Sep 17 00:00:00 2001
+From: Ervin Hegedus <airween@gmail.com>
+Date: Sat, 5 Jun 2021 09:23:06 +0200
+Subject: [PATCH] Quick fix for changing of Hamlib's FILPATHLEN macro
+
+This patch was prepared for Guix by Jack Hill <jackhill@jackhill.us> by
+squashing together the changes from upstream #268
+<https://github.com/Tlf/tlf/pull/268>.
+
+It allows the released version of Tlf to build against the version 4.2 of
+hamlib in Guix.
+
+---
+ src/sendqrg.c |  6 +++---
+ src/sendqrg.h | 10 ++++++++++
+ 2 files changed, 13 insertions(+), 3 deletions(-)
+
+diff --git a/src/sendqrg.c b/src/sendqrg.c
+index ceeb356..5d4420e 100644
+--- a/src/sendqrg.c
++++ b/src/sendqrg.c
+@@ -87,7 +87,7 @@ int init_tlf_rig(void) {
+ 
+     rigportname[strlen(rigportname) - 1] = '\0';	// remove '\n'
+     strncpy(my_rig->state.rigport.pathname, rigportname,
+-	    FILPATHLEN - 1);
++	    TLFFILPATHLEN - 1);
+ 
+     caps = my_rig->caps;
+ 
+@@ -104,9 +104,9 @@ int init_tlf_rig(void) {
+     if (dcd_type != RIG_DCD_NONE)
+ 	my_rig->state.dcdport.type.dcd = dcd_type;
+     if (ptt_file)
+-	strncpy(my_rig->state.pttport.pathname, ptt_file, FILPATHLEN);
++	strncpy(my_rig->state.pttport.pathname, ptt_file, TLFFILPATHLEN);
+     if (dcd_file)
+-	strncpy(my_rig->state.dcdport.pathname, dcd_file, FILPATHLEN);
++	strncpy(my_rig->state.dcdport.pathname, dcd_file, TLFFILPATHLEN);
+ 
+     my_rig->state.rigport.parm.serial.rate = serial_rate;
+ 
+diff --git a/src/sendqrg.h b/src/sendqrg.h
+index 8c53f2e..1ef85a6 100644
+--- a/src/sendqrg.h
++++ b/src/sendqrg.h
+@@ -23,6 +23,16 @@
+ 
+ #include <hamlib/rig.h>
+ 
++#ifdef HAMLIB_FILPATHLEN
++  #define TLFFILPATHLEN HAMLIB_FILPATHLEN
++#else
++  #ifdef FILPATHLEN
++  #define TLFFILPATHLEN FILPATHLEN
++  #else
++  #error "(HAMLIB_)FILPATHLEN macro not found"
++  #endif
++#endif
++
+ int init_tlf_rig(void);
+ void close_tlf_rig(RIG *my_rig);
+ 
+-- 
+2.32.0
+
diff --git a/gnu/packages/radio.scm b/gnu/packages/radio.scm
index 96c94fa1ce..5e6c324e8c 100644
--- a/gnu/packages/radio.scm
+++ b/gnu/packages/radio.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2020 Charlie Ritter <chewzerita@posteo.net>
 ;;; Copyright © 2020, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2021 João Pedro Simas <jpsimas@gmail.com>
+;;; Copyright © 2021 Jack Hill <jackhill@jackhill.us>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,6 +30,7 @@
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils)
+  #:use-module (gnu packages)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages astronomy)
@@ -68,6 +70,7 @@
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages networking)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
@@ -1066,6 +1069,64 @@ users.")
                            "--with-tcl-binding"
                            "--with-xml-support")))))
 
+(define-public tlf
+  (package
+    (name "tlf")
+    (version "1.4.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/airween/tlf")
+             (commit (string-append "tlf-" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1xpgs4k27pjd9mianfknknp6mf34365bcp96wrv5xh4dhph573rj"))
+       (patches
+        (search-patches "tlf-support-hamlib-4.2+.patch"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:configure-flags
+       (list "--enable-fldigi-xmlrpc")))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("cmocka" ,cmocka)
+       ("glib" ,glib)
+       ("hamlib" ,hamlib)
+       ("ncurses" ,ncurses)
+       ("xmlrpc-c" ,xmlrpc-c)))
+    (home-page "https://tlf.github.io/")
+    (synopsis "Amateur radio contest logging for the terminal")
+    (description "TLF is a @acronym{Text User Interface, TUI} amateur radio
+contest logging program.  It integrates with radios supported by hamlib and
+other ham radio programs like fldigi.  Many contests are supported including:
+
+@itemize
+@item CQWW (SO, M/S and M/M)
+@item WPX (SO, M/S and M/M)
+@item ARRL Sweepstakes (SO, M/S )
+@item EU SPRINT
+@item EUHFC
+@item ARRL-DX (both sides)
+@item ARRL-FD
+@item ARRL 10m
+@item ARRL 160m
+@item Region1 field day
+@item SP DX contest
+@item PACC (both sides)
+@item NRAU - scandinavian
+@item Wysiwyg mults mode (per band or per contest)
+@item WAEDX
+@end itemize
+
+It also supports connecting to DX clusters, log synchronization with other TLF
+instances over the network, and general QSO and DXpedition logging.")
+    (license license:gpl2+)))
+
 (define-public wsjtx
   (package
     (name "wsjtx")
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#49014] [PATCH v2 1/2] gnu: hamlib: Make libusb a propagated input.
  2021-06-14  4:12 [bug#49014] [PATCH 0/2] Add tlf Jack Hill
  2021-06-14  4:14 ` [bug#49014] [PATCH 1/2] gnu: hamlib: Make libusb a propagated input Jack Hill
@ 2021-06-14  4:20 ` Jack Hill
  2021-06-14  4:20   ` [bug#49014] [PATCH v2 2/2] gnu: Add tlf Jack Hill
  2021-06-18 16:15 ` [bug#49014] [PATCH v3] " Jack Hill
  2 siblings, 1 reply; 7+ messages in thread
From: Jack Hill @ 2021-06-14  4:20 UTC (permalink / raw)
  To: 49014

* gnu/packages/radio.scm (hamlib)[inputs]: Remove libusb.
[propagated-inputs]: Add libusb.
---
 gnu/packages/radio.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/radio.scm b/gnu/packages/radio.scm
index d0b7446c3c..96c94fa1ce 100644
--- a/gnu/packages/radio.scm
+++ b/gnu/packages/radio.scm
@@ -1019,9 +1019,10 @@ you must extend 'udev-service-type' with this package.  E.g.:
        ("tcl" ,tcl)))
     (inputs
      `(("gd" ,gd)
-       ("libusb" ,libusb)
        ("libxml2" ,libxml2)
        ("readline" ,readline)))
+    (propagated-inputs
+     `(("libusb" ,libusb)))
     (arguments
      `(#:configure-flags '("--disable-static"
                            "--with-lua-binding"
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#49014] [PATCH v2 2/2] gnu: Add tlf.
  2021-06-14  4:20 ` [bug#49014] [PATCH v2 1/2] gnu: hamlib: Make libusb a propagated input Jack Hill
@ 2021-06-14  4:20   ` Jack Hill
  0 siblings, 0 replies; 7+ messages in thread
From: Jack Hill @ 2021-06-14  4:20 UTC (permalink / raw)
  To: 49014

* gnu/packages/patches/tlf-support-hamlib-4.2+.patch: New file.
* gnu/local.mk: Add it.
* gnu/packages/radio.scm (tlf): New variable.
---

Fixed in version 2: fetch from the correct upstream git repository. I
had accidentally left the testing url in place in the previous patch
version.

 gnu/local.mk                                  |  1 +
 .../patches/tlf-support-hamlib-4.2+.patch     | 66 +++++++++++++++++++
 gnu/packages/radio.scm                        | 61 +++++++++++++++++
 3 files changed, 128 insertions(+)
 create mode 100644 gnu/packages/patches/tlf-support-hamlib-4.2+.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index e889abb1a6..175d1a47b2 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1744,6 +1744,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/tipp10-qt5.patch			\
   %D%/packages/patches/tk-find-library.patch			\
   %D%/packages/patches/tla2tools-build-xml.patch		\
+  %D%/packages/patches/tlf-support-hamlib-4.2+.patch		\
   %D%/packages/patches/transcode-ffmpeg.patch	\
   %D%/packages/patches/transmission-honor-localedir.patch	\
   %D%/packages/patches/ttf2eot-cstddef.patch			\
diff --git a/gnu/packages/patches/tlf-support-hamlib-4.2+.patch b/gnu/packages/patches/tlf-support-hamlib-4.2+.patch
new file mode 100644
index 0000000000..3c5db10010
--- /dev/null
+++ b/gnu/packages/patches/tlf-support-hamlib-4.2+.patch
@@ -0,0 +1,66 @@
+From 295fa956f899af37acb6bda9c76ad77748eb9a4a Mon Sep 17 00:00:00 2001
+From: Ervin Hegedus <airween@gmail.com>
+Date: Sat, 5 Jun 2021 09:23:06 +0200
+Subject: [PATCH] Quick fix for changing of Hamlib's FILPATHLEN macro
+
+This patch was prepared for Guix by Jack Hill <jackhill@jackhill.us> by
+squashing together the changes from upstream #268
+<https://github.com/Tlf/tlf/pull/268>.
+
+It allows the released version of Tlf to build against the version 4.2 of
+hamlib in Guix.
+
+---
+ src/sendqrg.c |  6 +++---
+ src/sendqrg.h | 10 ++++++++++
+ 2 files changed, 13 insertions(+), 3 deletions(-)
+
+diff --git a/src/sendqrg.c b/src/sendqrg.c
+index ceeb356..5d4420e 100644
+--- a/src/sendqrg.c
++++ b/src/sendqrg.c
+@@ -87,7 +87,7 @@ int init_tlf_rig(void) {
+ 
+     rigportname[strlen(rigportname) - 1] = '\0';	// remove '\n'
+     strncpy(my_rig->state.rigport.pathname, rigportname,
+-	    FILPATHLEN - 1);
++	    TLFFILPATHLEN - 1);
+ 
+     caps = my_rig->caps;
+ 
+@@ -104,9 +104,9 @@ int init_tlf_rig(void) {
+     if (dcd_type != RIG_DCD_NONE)
+ 	my_rig->state.dcdport.type.dcd = dcd_type;
+     if (ptt_file)
+-	strncpy(my_rig->state.pttport.pathname, ptt_file, FILPATHLEN);
++	strncpy(my_rig->state.pttport.pathname, ptt_file, TLFFILPATHLEN);
+     if (dcd_file)
+-	strncpy(my_rig->state.dcdport.pathname, dcd_file, FILPATHLEN);
++	strncpy(my_rig->state.dcdport.pathname, dcd_file, TLFFILPATHLEN);
+ 
+     my_rig->state.rigport.parm.serial.rate = serial_rate;
+ 
+diff --git a/src/sendqrg.h b/src/sendqrg.h
+index 8c53f2e..1ef85a6 100644
+--- a/src/sendqrg.h
++++ b/src/sendqrg.h
+@@ -23,6 +23,16 @@
+ 
+ #include <hamlib/rig.h>
+ 
++#ifdef HAMLIB_FILPATHLEN
++  #define TLFFILPATHLEN HAMLIB_FILPATHLEN
++#else
++  #ifdef FILPATHLEN
++  #define TLFFILPATHLEN FILPATHLEN
++  #else
++  #error "(HAMLIB_)FILPATHLEN macro not found"
++  #endif
++#endif
++
+ int init_tlf_rig(void);
+ void close_tlf_rig(RIG *my_rig);
+ 
+-- 
+2.32.0
+
diff --git a/gnu/packages/radio.scm b/gnu/packages/radio.scm
index 96c94fa1ce..523cf0c4d6 100644
--- a/gnu/packages/radio.scm
+++ b/gnu/packages/radio.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2020 Charlie Ritter <chewzerita@posteo.net>
 ;;; Copyright © 2020, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2021 João Pedro Simas <jpsimas@gmail.com>
+;;; Copyright © 2021 Jack Hill <jackhill@jackhill.us>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,6 +30,7 @@
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils)
+  #:use-module (gnu packages)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages astronomy)
@@ -68,6 +70,7 @@
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages networking)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
@@ -1066,6 +1069,64 @@ users.")
                            "--with-tcl-binding"
                            "--with-xml-support")))))
 
+(define-public tlf
+  (package
+    (name "tlf")
+    (version "1.4.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/tlf/tlf")
+             (commit (string-append "tlf-" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1xpgs4k27pjd9mianfknknp6mf34365bcp96wrv5xh4dhph573rj"))
+       (patches
+        (search-patches "tlf-support-hamlib-4.2+.patch"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:configure-flags
+       (list "--enable-fldigi-xmlrpc")))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("cmocka" ,cmocka)
+       ("glib" ,glib)
+       ("hamlib" ,hamlib)
+       ("ncurses" ,ncurses)
+       ("xmlrpc-c" ,xmlrpc-c)))
+    (home-page "https://tlf.github.io/")
+    (synopsis "Amateur radio contest logging for the terminal")
+    (description "TLF is a @acronym{Text User Interface, TUI} amateur radio
+contest logging program.  It integrates with radios supported by hamlib and
+other ham radio programs like fldigi.  Many contests are supported including:
+
+@itemize
+@item CQWW (SO, M/S and M/M)
+@item WPX (SO, M/S and M/M)
+@item ARRL Sweepstakes (SO, M/S )
+@item EU SPRINT
+@item EUHFC
+@item ARRL-DX (both sides)
+@item ARRL-FD
+@item ARRL 10m
+@item ARRL 160m
+@item Region1 field day
+@item SP DX contest
+@item PACC (both sides)
+@item NRAU - scandinavian
+@item Wysiwyg mults mode (per band or per contest)
+@item WAEDX
+@end itemize
+
+It also supports connecting to DX clusters, log synchronization with other TLF
+instances over the network, and general QSO and DXpedition logging.")
+    (license license:gpl2+)))
+
 (define-public wsjtx
   (package
     (name "wsjtx")
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#49014] [PATCH v3] gnu: Add tlf.
  2021-06-14  4:12 [bug#49014] [PATCH 0/2] Add tlf Jack Hill
  2021-06-14  4:14 ` [bug#49014] [PATCH 1/2] gnu: hamlib: Make libusb a propagated input Jack Hill
  2021-06-14  4:20 ` [bug#49014] [PATCH v2 1/2] gnu: hamlib: Make libusb a propagated input Jack Hill
@ 2021-06-18 16:15 ` Jack Hill
  2021-06-21  8:52   ` bug#49014: " Guillaume Le Vaillant
  2 siblings, 1 reply; 7+ messages in thread
From: Jack Hill @ 2021-06-18 16:15 UTC (permalink / raw)
  To: 49014

* gnu/packages/patches/tlf-support-hamlib-4.2+.patch: New file.
* gnu/local.mk: Add it.
* gnu/packages/radio.scm (tlf): New variable.
---

New in version 3: Now only one commit. No longer modify hamlib to
propagate libusb and instead add it to tlf's inputs. Thanks to
leoprikler on IRC for suggesting this improvement.

 gnu/local.mk                                  |  1 +
 .../patches/tlf-support-hamlib-4.2+.patch     | 66 +++++++++++++++++++
 gnu/packages/radio.scm                        | 62 +++++++++++++++++
 3 files changed, 129 insertions(+)
 create mode 100644 gnu/packages/patches/tlf-support-hamlib-4.2+.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index fd98bb899f..ef8f7b9b0c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1755,6 +1755,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/tipp10-qt5.patch			\
   %D%/packages/patches/tk-find-library.patch			\
   %D%/packages/patches/tla2tools-build-xml.patch		\
+  %D%/packages/patches/tlf-support-hamlib-4.2+.patch		\
   %D%/packages/patches/tor-fix-build-with-gcc-7.patch		\
   %D%/packages/patches/transcode-ffmpeg.patch	\
   %D%/packages/patches/transmission-honor-localedir.patch	\
diff --git a/gnu/packages/patches/tlf-support-hamlib-4.2+.patch b/gnu/packages/patches/tlf-support-hamlib-4.2+.patch
new file mode 100644
index 0000000000..3c5db10010
--- /dev/null
+++ b/gnu/packages/patches/tlf-support-hamlib-4.2+.patch
@@ -0,0 +1,66 @@
+From 295fa956f899af37acb6bda9c76ad77748eb9a4a Mon Sep 17 00:00:00 2001
+From: Ervin Hegedus <airween@gmail.com>
+Date: Sat, 5 Jun 2021 09:23:06 +0200
+Subject: [PATCH] Quick fix for changing of Hamlib's FILPATHLEN macro
+
+This patch was prepared for Guix by Jack Hill <jackhill@jackhill.us> by
+squashing together the changes from upstream #268
+<https://github.com/Tlf/tlf/pull/268>.
+
+It allows the released version of Tlf to build against the version 4.2 of
+hamlib in Guix.
+
+---
+ src/sendqrg.c |  6 +++---
+ src/sendqrg.h | 10 ++++++++++
+ 2 files changed, 13 insertions(+), 3 deletions(-)
+
+diff --git a/src/sendqrg.c b/src/sendqrg.c
+index ceeb356..5d4420e 100644
+--- a/src/sendqrg.c
++++ b/src/sendqrg.c
+@@ -87,7 +87,7 @@ int init_tlf_rig(void) {
+ 
+     rigportname[strlen(rigportname) - 1] = '\0';	// remove '\n'
+     strncpy(my_rig->state.rigport.pathname, rigportname,
+-	    FILPATHLEN - 1);
++	    TLFFILPATHLEN - 1);
+ 
+     caps = my_rig->caps;
+ 
+@@ -104,9 +104,9 @@ int init_tlf_rig(void) {
+     if (dcd_type != RIG_DCD_NONE)
+ 	my_rig->state.dcdport.type.dcd = dcd_type;
+     if (ptt_file)
+-	strncpy(my_rig->state.pttport.pathname, ptt_file, FILPATHLEN);
++	strncpy(my_rig->state.pttport.pathname, ptt_file, TLFFILPATHLEN);
+     if (dcd_file)
+-	strncpy(my_rig->state.dcdport.pathname, dcd_file, FILPATHLEN);
++	strncpy(my_rig->state.dcdport.pathname, dcd_file, TLFFILPATHLEN);
+ 
+     my_rig->state.rigport.parm.serial.rate = serial_rate;
+ 
+diff --git a/src/sendqrg.h b/src/sendqrg.h
+index 8c53f2e..1ef85a6 100644
+--- a/src/sendqrg.h
++++ b/src/sendqrg.h
+@@ -23,6 +23,16 @@
+ 
+ #include <hamlib/rig.h>
+ 
++#ifdef HAMLIB_FILPATHLEN
++  #define TLFFILPATHLEN HAMLIB_FILPATHLEN
++#else
++  #ifdef FILPATHLEN
++  #define TLFFILPATHLEN FILPATHLEN
++  #else
++  #error "(HAMLIB_)FILPATHLEN macro not found"
++  #endif
++#endif
++
+ int init_tlf_rig(void);
+ void close_tlf_rig(RIG *my_rig);
+ 
+-- 
+2.32.0
+
diff --git a/gnu/packages/radio.scm b/gnu/packages/radio.scm
index 618b2cfeaa..991d2e3a2e 100644
--- a/gnu/packages/radio.scm
+++ b/gnu/packages/radio.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2020 Charlie Ritter <chewzerita@posteo.net>
 ;;; Copyright © 2020, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2021 João Pedro Simas <jpsimas@gmail.com>
+;;; Copyright © 2021 Jack Hill <jackhill@jackhill.us>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,6 +30,7 @@
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils)
+  #:use-module (gnu packages)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages astronomy)
@@ -68,6 +70,7 @@
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages networking)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
@@ -1065,6 +1068,65 @@ users.")
                            "--with-tcl-binding"
                            "--with-xml-support")))))
 
+(define-public tlf
+  (package
+    (name "tlf")
+    (version "1.4.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/tlf/tlf")
+             (commit (string-append "tlf-" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1xpgs4k27pjd9mianfknknp6mf34365bcp96wrv5xh4dhph573rj"))
+       (patches
+        (search-patches "tlf-support-hamlib-4.2+.patch"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:configure-flags
+       (list "--enable-fldigi-xmlrpc")))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("cmocka" ,cmocka)
+       ("glib" ,glib)
+       ("hamlib" ,hamlib)
+       ("libusb" ,libusb) ;`Requires.private: libusb-1.0` in hamlib pkg-config
+       ("ncurses" ,ncurses)
+       ("xmlrpc-c" ,xmlrpc-c)))
+    (home-page "https://tlf.github.io/")
+    (synopsis "Amateur radio contest logging for the terminal")
+    (description "TLF is a @acronym{Text User Interface, TUI} amateur radio
+contest logging program.  It integrates with radios supported by hamlib and
+other ham radio programs like fldigi.  Many contests are supported including:
+
+@itemize
+@item CQWW (SO, M/S and M/M)
+@item WPX (SO, M/S and M/M)
+@item ARRL Sweepstakes (SO, M/S )
+@item EU SPRINT
+@item EUHFC
+@item ARRL-DX (both sides)
+@item ARRL-FD
+@item ARRL 10m
+@item ARRL 160m
+@item Region1 field day
+@item SP DX contest
+@item PACC (both sides)
+@item NRAU - scandinavian
+@item Wysiwyg mults mode (per band or per contest)
+@item WAEDX
+@end itemize
+
+It also supports connecting to DX clusters, log synchronization with other TLF
+instances over the network, and general QSO and DXpedition logging.")
+    (license license:gpl2+)))
+
 (define-public wsjtx
   (package
     (name "wsjtx")
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#49014: [PATCH v3] gnu: Add tlf.
  2021-06-18 16:15 ` [bug#49014] [PATCH v3] " Jack Hill
@ 2021-06-21  8:52   ` Guillaume Le Vaillant
  0 siblings, 0 replies; 7+ messages in thread
From: Guillaume Le Vaillant @ 2021-06-21  8:52 UTC (permalink / raw)
  To: Jack Hill; +Cc: 49014-done

[-- Attachment #1: Type: text/plain, Size: 66 bytes --]

Patch pushed as 30a04c00beb3b0bc3799f27caf05bedb5094c0c5.
Thanks.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-06-21  8:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-14  4:12 [bug#49014] [PATCH 0/2] Add tlf Jack Hill
2021-06-14  4:14 ` [bug#49014] [PATCH 1/2] gnu: hamlib: Make libusb a propagated input Jack Hill
2021-06-14  4:14   ` [bug#49014] [PATCH 2/2] gnu: Add tlf Jack Hill
2021-06-14  4:20 ` [bug#49014] [PATCH v2 1/2] gnu: hamlib: Make libusb a propagated input Jack Hill
2021-06-14  4:20   ` [bug#49014] [PATCH v2 2/2] gnu: Add tlf Jack Hill
2021-06-18 16:15 ` [bug#49014] [PATCH v3] " Jack Hill
2021-06-21  8:52   ` bug#49014: " Guillaume Le Vaillant

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).