1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017, 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
3 ;;; Copyright © 2019 Christopher Howard <christopher@librehacker.com>
4 ;;; Copyright © 2019, 2020 Evan Straw <evan.straw99@gmail.com>
5 ;;; Copyright © 2020 Guillaume Le Vaillant <glv@posteo.net>
6 ;;; Copyright © 2020 Danny Milosavljevic <dannym@scratchpost.org>
7 ;;; Copyright © 2020 Charlie Ritter <chewzerita@posteo.net>
9 ;;; This file is part of GNU Guix.
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24 (define-module (gnu packages radio)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (gnu packages algebra)
30 #:use-module (gnu packages audio)
31 #:use-module (gnu packages autotools)
32 #:use-module (gnu packages base)
33 #:use-module (gnu packages bash)
34 #:use-module (gnu packages boost)
35 #:use-module (gnu packages check)
36 #:use-module (gnu packages documentation)
37 #:use-module (gnu packages engineering)
38 #:use-module (gnu packages fltk)
39 #:use-module (gnu packages gcc)
40 #:use-module (gnu packages gd)
41 #:use-module (gnu packages ghostscript)
42 #:use-module (gnu packages glib)
43 #:use-module (gnu packages gstreamer)
44 #:use-module (gnu packages gtk)
45 #:use-module (gnu packages image)
46 #:use-module (gnu packages libusb)
47 #:use-module (gnu packages linux)
48 #:use-module (gnu packages logging)
49 #:use-module (gnu packages lua)
50 #:use-module (gnu packages maths)
51 #:use-module (gnu packages multiprecision)
52 #:use-module (gnu packages networking)
53 #:use-module (gnu packages pkg-config)
54 #:use-module (gnu packages pulseaudio)
55 #:use-module (gnu packages python)
56 #:use-module (gnu packages python-science)
57 #:use-module (gnu packages python-xyz)
58 #:use-module (gnu packages qt)
59 #:use-module (gnu packages readline)
60 #:use-module (gnu packages ruby)
61 #:use-module (gnu packages sphinx)
62 #:use-module (gnu packages swig)
63 #:use-module (gnu packages tcl)
64 #:use-module (gnu packages tex)
65 #:use-module (gnu packages texinfo)
66 #:use-module (gnu packages version-control)
67 #:use-module (gnu packages xml)
68 #:use-module (gnu packages xorg)
69 #:use-module (guix build-system cmake)
70 #:use-module (guix build-system glib-or-gtk)
71 #:use-module (guix build-system gnu)
72 #:use-module (guix build-system python)
73 #:use-module (guix build-system qt))
75 (define-public liquid-dsp
80 (origin (method git-fetch)
82 (url "https://github.com/jgaeddert/liquid-dsp.git")
83 (commit (string-append "v" version))))
84 (file-name (git-file-name name version))
86 (base32 "1n6dbg13q8ga5qhg1yiszwly4jj0rxqr6f1xwm9waaly5z493xsd"))))
87 (build-system gnu-build-system)
89 `(("autoconf" ,autoconf)))
93 (home-page "https://liquidsdr.org")
94 (synopsis "Signal processing library for software-defined radios")
96 "Liquid DSP is a @dfn{digital signal processing} (DSP) library designed
97 specifically for software-defined radios on embedded platforms. The aim is to
98 provide a lightweight DSP library that does not rely on a myriad of external
99 dependencies or proprietary and otherwise cumbersome frameworks. All signal
100 processing elements are designed to be flexible, scalable, and dynamic,
101 including filters, filter design, oscillators, modems, synchronizers, complex
102 mathematical operations, and much more.")
103 (license license:expat)))
105 (define-public rtl-sdr
113 (url "git://git.osmocom.org/rtl-sdr.git")
115 (file-name (git-file-name name version))
118 "0lmvsnb4xw4hmz6zs0z5ilsah5hjz29g1s0050n59fllskqr3b8k"))))
119 (build-system cmake-build-system)
121 `(("libusb" ,libusb)))
123 `(("pkg-config" ,pkg-config)))
125 `(#:configure-flags '("-DDETACH_KERNEL_DRIVER=ON")
126 #:tests? #f)) ; No tests
127 (home-page "https://osmocom.org/projects/sdr/wiki/rtl-sdr")
128 (synopsis "Software defined radio driver for Realtek RTL2832U")
129 (description "DVB-T dongles based on the Realtek RTL2832U can be used as a
130 cheap software defined radio, since the chip allows transferring the raw I/Q
131 samples to the host. @code{rtl-sdr} provides drivers for this purpose.")
132 (license license:gpl2+)))
141 (uri (string-append "https://trac.chirp.danplanet.com/chirp_daily/daily-"
142 version "/chirp-daily-" version ".tar.gz"))
145 "1cp280b95j39xaxs50zn55jigg7pyfpm9n098hmsyxrplqn8z43c"))))
146 (build-system python-build-system)
148 `(("python2-libxml2" ,python2-libxml2)
149 ("python2-pygtk" ,python2-pygtk)
150 ("python2-pyserial" ,python2-pyserial)))
152 `(#:python ,python-2))
153 (home-page "https://chirp.danplanet.com")
154 (synopsis "Cross-radio programming tool")
155 (description "Chirp is a cross-radio programming tool. It supports a
156 growing list of radios across several manufacturers and allows transferring of
157 memory contents between them.")
158 (license (list license:gpl3+
159 license:lgpl3+)))) ; chirp/elib_intl.py
161 (define-public aptdec
169 (url "https://github.com/csete/aptdec")
170 (commit (string-append "v" version))))
171 (file-name (git-file-name name version))
174 "1hf0zb51qc6fyhdjxyij1n3vgwnw3cwksc3r11szbhkml14qjnzk"))))
175 (build-system gnu-build-system)
178 ("libsndfile" ,libsndfile)))
180 `(#:make-flags (list "CC=gcc")
181 #:tests? #f ; no tests
183 (modify-phases %standard-phases
186 (lambda* (#:key outputs #:allow-other-keys)
187 (let ((out (assoc-ref outputs "out")))
188 (install-file "atpdec" (string-append out "/bin")))
190 (home-page "https://github.com/csete/aptdec")
191 (synopsis "NOAA Automatic Picture Transmission (APT) decoder")
192 (description "Aptdec decodes Automatic Picture Transmission (APT) images.
193 These are medium resolution images of the Earth transmitted by, among other
194 satellites, the POES NOAA weather satellite series. These transmissions are
195 on a frequency of 137 MHz. They can be received using an inexpensive antenna
196 and a dedicated receiver.")
197 (license license:gpl2+)))
199 (define-public redsea
206 (url "https://github.com/windytan/redsea")
207 (commit (string-append "v" version))))
208 (file-name (git-file-name name version))
211 "1y96g0ra2krjb2kypm8s5gdfia45yci4f36klsvyzg8d53v5cwhn"))))
212 (build-system gnu-build-system)
215 (modify-phases %standard-phases
216 ;; The configure.ac file does not explicitly link against libiconv
217 ;; except on Mac OS, causing the build to fail. This phase comments
218 ;; out the original AC_SUBST macro (located inside a conditional) and
219 ;; adds an explicit use of it underneath, so that libiconv is always
221 (add-after 'unpack 'patch-libiconv
223 (substitute* "configure.ac"
227 "esac\nAC_SUBST([ICONV], [\"-liconv\"])"))
230 `(("libiconv" ,libiconv)
231 ("libsndfile" ,libsndfile)
232 ("liquid-dsp" ,liquid-dsp)))
234 `(("autoconf" ,autoconf)
235 ("automake" ,automake)))
236 (home-page "https://github.com/windytan/redsea")
237 (synopsis "Lightweight RDS to JSON decoder")
238 (description "redsea is a lightweight command-line @dfn{FM Radio Data
239 System} (FM-RDS) decoder. Redsea can be used with any RTL-SDR USB radio stick
240 with the rtl_fm tool, or any other @dfn{software-defined radio} (SDR) via
241 csdr, for example. It can also decode raw ASCII bitstream, the hex format
242 used by RDS Spy, and audio files containing @dfn{multiplex} signals (MPX).")
243 (license license:expat)))
245 (define-public gnuradio
252 (uri (string-append "https://www.gnuradio.org/releases/gnuradio/"
253 "gnuradio-" version ".tar.xz"))
255 (base32 "0aw55gf5549b0fz2qdi7vplcmaf92bj34h40s34b2ycnqasv900r"))
256 (modules '((guix build utils)))
259 ;; Delete bundled volk to use the shared one.
260 (delete-file-recursively "volk")
262 (build-system cmake-build-system)
264 `(("doxygen" ,doxygen)
266 ("ghostscript" ,ghostscript)
268 ("pkg-config" ,pkg-config)
270 ("python-cheetah" ,python-cheetah)
271 ("python-mako" ,python-mako)
272 ("python-pyzmq" ,python-pyzmq)
273 ("python-scipy" ,python-scipy)
274 ("python-sphinx" ,python-sphinx)
276 ("texlive" ,(texlive-union (list texlive-amsfonts
277 texlive-latex-amsmath
278 ;; TODO: Add newunicodechar.
279 texlive-latex-graphics)))
280 ("xorg-server" ,xorg-server-for-tests)))
282 `(("alsa-lib" ,alsa-lib)
295 ("portaudio" ,portaudio)
296 ("python-click" ,python-click)
297 ("python-click-plugins" ,python-click-plugins)
298 ("python-lxml" ,python-lxml)
299 ("python-numpy" ,python-numpy)
300 ("python-pycairo" ,python-pycairo)
301 ("python-pygobject" ,python-pygobject)
302 ("python-pyqt" ,python-pyqt)
303 ("python-pyyaml" ,python-pyyaml)
309 `(#:modules ((guix build cmake-build-system)
310 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
311 ((guix build python-build-system) #:prefix python:)
314 #:imported-modules (,@%cmake-build-system-modules
315 (guix build glib-or-gtk-build-system)
316 (guix build python-build-system))
318 '("-DENABLE_INTERNAL_VOLK=OFF")
320 (modify-phases %standard-phases
321 (add-after 'unpack 'fix-paths
322 (lambda* (#:key inputs #:allow-other-keys)
323 (let ((qwt (assoc-ref inputs "qwt")))
324 (substitute* "cmake/Modules/FindQwt.cmake"
326 (string-append qwt "/include"))
328 (string-append qwt "/lib"))
329 (("qwt6-\\$\\{QWT_QT_VERSION\\}")
331 (substitute* "cmake/Modules/GrPython.cmake"
334 (substitute* '("gr-vocoder/swig/vocoder_swig.i"
335 "gr-vocoder/include/gnuradio/vocoder/codec2.h"
336 "gr-vocoder/include/gnuradio/vocoder/freedv_api.h")
340 (add-before 'check 'set-test-environment
341 (lambda* (#:key inputs #:allow-other-keys)
342 (setenv "HOME" "/tmp")
343 (system (string-append (assoc-ref inputs "xorg-server")
345 (setenv "DISPLAY" ":1")
347 (add-after 'install 'wrap-python
348 (assoc-ref python:%standard-phases 'wrap))
349 (add-after 'wrap-python 'wrap-glib-or-gtk
350 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
351 (add-after 'wrap-glib-or-gtk 'wrap-with-GI_TYPELIB_PATH
352 (lambda* (#:key inputs outputs #:allow-other-keys)
353 (let ((out (assoc-ref outputs "out"))
354 (paths (map (match-lambda
355 ((output . directory)
356 (let ((girepodir (string-append
358 "/lib/girepository-1.0")))
359 (if (file-exists? girepodir)
363 (wrap-program (string-append out "/bin/gnuradio-companion")
364 `("GI_TYPELIB_PATH" ":" prefix ,(filter identity paths))))
366 (synopsis "Toolkit for software-defined radios")
368 "GNU Radio is a development toolkit that provides signal processing blocks
369 to implement software radios. It can be used with external RF hardware to
370 create software-defined radios, or without hardware in a simulation-like
372 (home-page "https://www.gnuradio.org")
373 (license license:gpl3+)))
375 (define-public gnuradio-osmosdr
377 (name "gnuradio-osmosdr")
383 (url "https://git.osmocom.org/gr-osmosdr")
384 (commit (string-append "v" version))))
385 (file-name (git-file-name name version))
387 (base32 "1rdx7fa0xiq0qmgrrbby7z1bblmqhl9qh9jqpsznzxkx91f17ypd"))))
388 (build-system cmake-build-system)
390 `(("doxygen" ,doxygen)
392 ("pkg-config" ,pkg-config)
394 ("python-mako" ,python-mako)
395 ("python-six" ,python-six)
401 ("gnuradio" ,gnuradio)
403 ;; TODO: Add more drivers.
406 (synopsis "GNU Radio block for interfacing with various radio hardware")
407 (description "This is a block for GNU Radio allowing to use a common API
408 to access different radio hardware.")
409 (home-page "https://osmocom.org/projects/gr-osmosdr/wiki/GrOsmoSDR")
410 (license license:gpl3+)))
412 (define-public libosmo-dsp
420 (url "https://git.osmocom.org/libosmo-dsp")
422 (file-name (git-file-name name version))
424 (base32 "00plihnpym1gkfpflah8il9463qxzm9kx2f07jyvbkszpj8viq5g"))))
425 (build-system gnu-build-system)
427 `(("autoconf" ,autoconf)
428 ("automake" ,automake)
429 ("bash-minimal" ,bash-minimal)
433 ("pkg-config" ,pkg-config)
434 ("texlive" ,(texlive-union (list texlive-amsfonts
435 texlive-latex-amsmath
436 ;; TODO: Add newunicodechar.
437 texlive-latex-graphics)))))
442 (modify-phases %standard-phases
443 (add-after 'unpack 'fix-paths
444 (lambda* (#:key inputs #:allow-other-keys)
445 (substitute* "git-version-gen"
447 (string-append (assoc-ref inputs "bash")
450 (synopsis "DSP primitives for SDR")
452 "This a C-language library for common DSP (Digital Signal Processing)
453 primitives for SDR (Software Defined Radio).")
454 (home-page "https://osmocom.org/projects/libosmo-dsp")
455 (license license:gpl2+)))
457 (define-public gnuradio-iqbalance
459 (name "gnuradio-iqbalance")
465 (url "https://git.osmocom.org/gr-iqbal")
466 (commit (string-append "v" version))))
467 (file-name (git-file-name name version))
469 (base32 "0ksagwz05p3b0702q7ljq7013xmp0ijp30my9z6s3p7ja8dj42s3"))))
470 (build-system cmake-build-system)
472 `(("doxygen" ,doxygen)
473 ("pkg-config" ,pkg-config)
475 ("python-numpy" ,python-numpy)
476 ("python-six" ,python-six)
482 ("gnuradio" ,gnuradio)
483 ("libosmo-dsp" ,libosmo-dsp)
486 (synopsis "GNU Radio block to correct IQ imbalance")
488 "This is a GNU Radio block to correct IQ imbalance in quadrature
489 receivers. It's composed of two main block:
491 @item Fix: Given a phase and amplitude error, it will correct a complex signal.
492 @item Optimize: Attempts to auto-detect the phase and amplitude error to feed
493 to the fix block above.
495 (home-page "https://git.osmocom.org/gr-iqbal/")
496 (license license:gpl3+)))
506 (url "https://github.com/csete/gqrx.git")
507 (commit (string-append "v" version))))
508 (file-name (git-file-name name version))
510 (base32 "00alf3q6y313xpx6p7v43vqsphd2x4am4q362lw21bcy9wc4jidw"))))
511 (build-system qt-build-system)
513 `(("pkg-config" ,pkg-config)))
515 `(("alsa-lib" ,alsa-lib)
519 ("gnuradio" ,gnuradio)
520 ("gnuradio-iqbalance" ,gnuradio-iqbalance)
521 ("gnuradio-osmosdr" ,gnuradio-osmosdr)
524 ("portaudio" ,portaudio)
525 ("pulseaudio" ,pulseaudio)
530 `(#:tests? #f)) ; No tests
531 (synopsis "Software defined radio receiver")
532 (description "Gqrx is a software defined radio (SDR) receiver implemented
533 using GNU Radio and the Qt GUI toolkit.")
534 (home-page "https://gqrx.dk/")
535 (license license:gpl3+)))
537 (define-public fldigi
544 (uri (string-append "http://www.w1hkj.com/files/fldigi/fldigi-"
547 (base32 "1y62xn1pim38ibaf2mbl8b7aq20jdaac6lgggb9r402w9bj5b196"))))
548 (build-system gnu-build-system)
550 `(("pkg-config" ,pkg-config)))
552 `(("alsa-lib" ,alsa-lib)
556 ("libsamplerate" ,libsamplerate)
560 ("libxfixes" ,libxfixes)
562 ("portaudio" ,portaudio)
563 ("pulseaudio" ,pulseaudio)))
564 (synopsis "Software modem for amateur radio use")
566 "Fldigi is a software modem for amateur radio use. It is a sound card
567 based program that is used for both transmitting and receiving data by
568 connecting the microphone and headphone connections of a computer to some radio
570 (home-page "http://www.w1hkj.com/")
571 (license license:gpl3+)))
580 (uri (string-append "http://www.w1hkj.com/files/flrig/flrig-"
583 (base32 "0fzrknzzi8kmzmrcfpc8rxr7v4a4ny6z6z5q5qwh95sp2kn2qzp9"))))
584 (build-system gnu-build-system)
586 `(("pkg-config" ,pkg-config)))
591 ("libxfixes" ,libxfixes)
593 (synopsis "Radio transceiver control program")
595 "Flrig is a transceiver control program for amateur radio use.
596 It provides computer aided control of various radios using a serial
598 (home-page "http://www.w1hkj.com/")
599 (license license:gpl3+)))
608 (uri (string-append "http://www.w1hkj.com/files/flamp/flamp-"
611 (base32 "19z1kghhdf7bq6hi2j0mzlsn2nhpn3gl1a623x3inmsk80yw3ck4"))))
612 (build-system gnu-build-system)
614 `(("pkg-config" ,pkg-config)))
619 ("libxfixes" ,libxfixes)
621 (synopsis "Tool for AMP file transfer")
623 "FLAMP is a program for transfering files by radio waves using AMP
624 (Amateur Multicast Protocol).")
625 (home-page "http://www.w1hkj.com/")
626 (license license:gpl3+)))
628 (define-public flwrap
635 (uri (string-append "http://www.w1hkj.com/files/flwrap/flwrap-"
638 (base32 "0qqivqkkravcg7j45740xfky2q3k7czqpkj6y364qff424q2pppg"))))
639 (build-system gnu-build-system)
641 `(("pkg-config" ,pkg-config)))
646 ("libxfixes" ,libxfixes)
648 (synopsis "File encapsulation program")
650 "Flwrap is a software utility for amateur radio use. Its purpose is to
651 encapsulate both text and binary files in a way that allows them to be
652 transmitted over any of several digital modes and verified at the receipt end
654 (home-page "http://www.w1hkj.com/")
655 (license license:gpl3+)))
657 (define-public hamlib
665 "https://github.com/Hamlib/Hamlib/releases/download/"
666 version "/hamlib-" version ".tar.gz"))
668 (base32 "10788mgrhbc57zpzakcxv5aqnr2819pcshml6fbh8zvnkja562y9"))))
669 (build-system gnu-build-system)
671 `(("doxygen" ,doxygen)
673 ("pkg-config" ,pkg-config)
674 ("python-wrapper" ,python-wrapper)
681 ("readline" ,readline)))
683 `(#:configure-flags '("--disable-static"
685 "--with-python-binding"
687 "--with-xml-support")))
688 (synopsis "Tools and API to control radios")
690 "The Ham Radio Control Library (Hamlib) is a project to provide programs
691 with a consistent Application Programming Interface (API) for controlling the
692 myriad of radios and rotators available to amateur radio and communications
694 (home-page "https://hamlib.github.io/")
695 (license (list license:gpl2+ license:lgpl2.1+))))
698 ;; Fork of hamlib with custom patches used by wsjtx.
701 (name "wsjtx-hamlib")
707 (url "https://git.code.sf.net/u/bsomervi/hamlib.git")
708 (commit (string-append "wsjtx-" version))))
709 (file-name (git-file-name name version))
711 (base32 "1ksv3cmr1dl45p0pp1panyc9dngd158gvv9ysv25lq4nqv1wn87i"))))
713 `(("autoconf" ,autoconf)
714 ("automake" ,automake)
717 ,@(package-native-inputs hamlib)))))
727 (url "https://git.code.sf.net/p/wsjt/wsjtx.git")
728 (commit (string-append "wsjtx-" version))))
729 (file-name (git-file-name name version))
731 (base32 "1fnqzjd3dmxp3yjwjvwz2djk9gzb1y2cqfa188f3x8lynxhdhnfs"))
732 (modules '((guix build utils)))
735 ;; Delete bundled boost to use the shared one.
736 (delete-file-recursively "boost")
738 (build-system qt-build-system)
740 `(("asciidoc" ,asciidoc)
741 ("gfortran" ,gfortran)
742 ("pkg-config" ,pkg-config)
744 ("ruby-asciidoctor" ,ruby-asciidoctor)))
749 ("hamlib" ,wsjtx-hamlib)
752 ("qtmultimedia" ,qtmultimedia)
753 ("qtserialport" ,qtserialport)))
755 `(#:tests? #f)) ; No test suite
756 (synopsis "Weak-signal ham radio communication program")
758 "WSJT-X implements communication protocols or modes called FT4, FT8,
759 JT4, JT9, JT65, QRA64, ISCAT, MSK144, and WSPR, as well as one called Echo for
760 detecting and measuring your own radio signals reflected from the Moon. These
761 modes were all designed for making reliable, confirmed QSOs under extreme
762 weak-signal conditions.")
763 (home-page "https://www.physics.princeton.edu/pulsar/k1jt/wsjtx.html")
764 (license license:gpl3)))