gnu: js8call: Improve package style.

* gnu/packages/radio.scm (js8call):
  Use Gexp and shift order of components.
  [tests]: Enable them.
  [arguments]<phases>: In fix-paths phase add more steps to modify test
  script. Replace check phase with in-project script.
  [native-inputs]: Remove labels.
  [inputs]: As above.

Signed-off-by: Guillaume Le Vaillant <glv@posteo.net>
This commit is contained in:
Sharlatan Hellseher 2023-04-13 23:27:14 +01:00 committed by Guillaume Le Vaillant
parent a6b3bdb7fc
commit d7a3b4008f
No known key found for this signature in database
GPG key ID: 6BE8208ADF21FE3F

View file

@ -12,6 +12,7 @@
;;; Copyright © 2022 Sheng Yang <styang@fastmail.com> ;;; Copyright © 2022 Sheng Yang <styang@fastmail.com>
;;; Copyright © 2022 Greg Hogan <code@greghogan.com> ;;; Copyright © 2022 Greg Hogan <code@greghogan.com>
;;; Copyright © 2022 Ryan Tolboom <ryan@using.tech> ;;; Copyright © 2022 Ryan Tolboom <ryan@using.tech>
;;; Copyright © 2023 Sharlatan Hellseher <sharlatanus@gmail.com>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -1603,49 +1604,63 @@ (define-public js8call
(base32 "149sjwc4zg6ckgq26af93p4fxappa4k9dh7rdy67g8ajfjad4cd8")) (base32 "149sjwc4zg6ckgq26af93p4fxappa4k9dh7rdy67g8ajfjad4cd8"))
(modules '((guix build utils))) (modules '((guix build utils)))
(snippet (snippet
'(begin #~(begin
;; Delete bundled boost to use the shared one. ;; Delete bundled boost to use the shared one.
(delete-file-recursively "boost") (delete-file-recursively "boost")))))
#t))))
(build-system qt-build-system) (build-system qt-build-system)
(native-inputs
(list asciidoc gfortran pkg-config qttools-5 ruby-asciidoctor))
(inputs
`(("boost" ,boost)
("fftw" ,fftw)
("fftwf" ,fftwf)
("hamlib" ,wsjtx-hamlib)
("libusb" ,libusb)
("qtbase" ,qtbase-5)
("qtmultimedia-5" ,qtmultimedia-5)
("qtserialport" ,qtserialport)))
(arguments (arguments
`(#:tests? #f ; No test suite (list
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-after 'unpack 'fix-paths (add-after 'unpack 'fix-paths
(lambda* (#:key outputs #:allow-other-keys) (lambda _
(substitute* "CMakeLists.txt" ;; XXX: How to get the /tmp/<build-name>.drv-<num> path? Use
(("DESTINATION /usr/share") ;; output path for after install check phase instead.
(string-append "DESTINATION " (substitute* "media/tests/test"
(assoc-ref outputs "out") (("~/js8call-prefix/build/js8")
"/share"))))) (string-append #$output "/bin/js8"))
(add-after 'unpack 'fix-hamlib (("/opt/js8call/bin/js8")
(lambda _ (string-append #$output "/bin/js8")))
(substitute* "CMake/Modules/Findhamlib.cmake" (substitute* "CMakeLists.txt"
(("set \\(ENV\\{PKG_CONFIG_PATH\\}.*\\)") (("DESTINATION /usr/share")
"set (__pc_path $ENV{PKG_CONFIG_PATH}) (string-append "DESTINATION " #$output "/share")))))
(add-after 'unpack 'fix-hamlib
(lambda _
(substitute* "CMake/Modules/Findhamlib.cmake"
(("set \\(ENV\\{PKG_CONFIG_PATH\\}.*\\)")
"set (__pc_path $ENV{PKG_CONFIG_PATH})
list (APPEND __pc_path \"${__hamlib_pc_path}\") list (APPEND __pc_path \"${__hamlib_pc_path}\")
set (ENV{PKG_CONFIG_PATH} \"${__pc_path}\")")) set (ENV{PKG_CONFIG_PATH} \"${__pc_path}\")"))
(substitute* "HamlibTransceiver.hpp" (substitute* "HamlibTransceiver.hpp"
(("#ifdef JS8_USE_LEGACY_HAMLIB") (("#ifdef JS8_USE_LEGACY_HAMLIB")
"#if 1"))))))) "#if 1"))))
(delete 'check)
(add-after 'install 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
(with-directory-excursion "../js8call/media/tests"
(invoke "./test"))))))))
(native-inputs
(list asciidoc
gfortran
pkg-config
qttools-5
ruby-asciidoctor))
(inputs
(list boost
fftw
fftwf
libusb
qtbase-5
qtmultimedia-5
qtserialport
wsjtx-hamlib))
(home-page "http://js8call.com/")
(synopsis "Weak-signal ham radio communication program") (synopsis "Weak-signal ham radio communication program")
(description (description
"JS8Call is a software using the JS8 digital mode (a derivative of the FT8 "JS8Call is a software using the JS8 digital mode (a derivative of the FT8
mode) providing weak signal keyboard to keyboard messaging to amateur radio mode) providing weak signal keyboard to keyboard messaging to amateur radio
operators.") operators.")
(home-page "http://js8call.com/")
(license license:gpl3))) (license license:gpl3)))
(define-public xnec2c (define-public xnec2c