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 ghostscript)
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages gstreamer)
42 #:use-module (gnu packages gtk)
43 #:use-module (gnu packages image)
44 #:use-module (gnu packages libusb)
45 #:use-module (gnu packages linux)
46 #:use-module (gnu packages logging)
47 #:use-module (gnu packages maths)
48 #:use-module (gnu packages multiprecision)
49 #:use-module (gnu packages networking)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages pulseaudio)
52 #:use-module (gnu packages python)
53 #:use-module (gnu packages python-science)
54 #:use-module (gnu packages python-xyz)
55 #:use-module (gnu packages qt)
56 #:use-module (gnu packages sphinx)
57 #:use-module (gnu packages swig)
58 #:use-module (gnu packages tex)
59 #:use-module (gnu packages version-control)
60 #:use-module (gnu packages xml)
61 #:use-module (gnu packages xorg)
62 #:use-module (guix build-system cmake)
63 #:use-module (guix build-system glib-or-gtk)
64 #:use-module (guix build-system gnu)
65 #:use-module (guix build-system python)
66 #:use-module (guix build-system qt))
68 (define-public liquid-dsp
73 (origin (method git-fetch)
75 (url "https://github.com/jgaeddert/liquid-dsp.git")
76 (commit (string-append "v" version))))
77 (file-name (git-file-name name version))
79 (base32 "1n6dbg13q8ga5qhg1yiszwly4jj0rxqr6f1xwm9waaly5z493xsd"))))
80 (build-system gnu-build-system)
82 `(("autoconf" ,autoconf)))
86 (home-page "https://liquidsdr.org")
87 (synopsis "Signal processing library for software-defined radios")
89 "Liquid DSP is a @dfn{digital signal processing} (DSP) library designed
90 specifically for software-defined radios on embedded platforms. The aim is to
91 provide a lightweight DSP library that does not rely on a myriad of external
92 dependencies or proprietary and otherwise cumbersome frameworks. All signal
93 processing elements are designed to be flexible, scalable, and dynamic,
94 including filters, filter design, oscillators, modems, synchronizers, complex
95 mathematical operations, and much more.")
96 (license license:expat)))
98 (define-public rtl-sdr
106 (url "git://git.osmocom.org/rtl-sdr.git")
108 (file-name (git-file-name name version))
111 "0lmvsnb4xw4hmz6zs0z5ilsah5hjz29g1s0050n59fllskqr3b8k"))))
112 (build-system cmake-build-system)
114 `(("libusb" ,libusb)))
116 `(("pkg-config" ,pkg-config)))
118 `(#:configure-flags '("-DDETACH_KERNEL_DRIVER=ON")
119 #:tests? #f)) ; No tests
120 (home-page "https://osmocom.org/projects/sdr/wiki/rtl-sdr")
121 (synopsis "Software defined radio driver for Realtek RTL2832U")
122 (description "DVB-T dongles based on the Realtek RTL2832U can be used as a
123 cheap software defined radio, since the chip allows transferring the raw I/Q
124 samples to the host. @code{rtl-sdr} provides drivers for this purpose.")
125 (license license:gpl2+)))
134 (uri (string-append "https://trac.chirp.danplanet.com/chirp_daily/daily-"
135 version "/chirp-daily-" version ".tar.gz"))
138 "1cp280b95j39xaxs50zn55jigg7pyfpm9n098hmsyxrplqn8z43c"))))
139 (build-system python-build-system)
141 `(("python2-libxml2" ,python2-libxml2)
142 ("python2-pygtk" ,python2-pygtk)
143 ("python2-pyserial" ,python2-pyserial)))
145 `(#:python ,python-2))
146 (home-page "https://chirp.danplanet.com")
147 (synopsis "Cross-radio programming tool")
148 (description "Chirp is a cross-radio programming tool. It supports a
149 growing list of radios across several manufacturers and allows transferring of
150 memory contents between them.")
151 (license (list license:gpl3+
152 license:lgpl3+)))) ; chirp/elib_intl.py
154 (define-public aptdec
162 (url "https://github.com/csete/aptdec")
163 (commit (string-append "v" version))))
164 (file-name (git-file-name name version))
167 "1hf0zb51qc6fyhdjxyij1n3vgwnw3cwksc3r11szbhkml14qjnzk"))))
168 (build-system gnu-build-system)
171 ("libsndfile" ,libsndfile)))
173 `(#:make-flags (list "CC=gcc")
174 #:tests? #f ; no tests
176 (modify-phases %standard-phases
179 (lambda* (#:key outputs #:allow-other-keys)
180 (let ((out (assoc-ref outputs "out")))
181 (install-file "atpdec" (string-append out "/bin")))
183 (home-page "https://github.com/csete/aptdec")
184 (synopsis "NOAA Automatic Picture Transmission (APT) decoder")
185 (description "Aptdec decodes Automatic Picture Transmission (APT) images.
186 These are medium resolution images of the Earth transmitted by, among other
187 satellites, the POES NOAA weather satellite series. These transmissions are
188 on a frequency of 137 MHz. They can be received using an inexpensive antenna
189 and a dedicated receiver.")
190 (license license:gpl2+)))
192 (define-public redsea
199 (url "https://github.com/windytan/redsea")
200 (commit (string-append "v" version))))
201 (file-name (git-file-name name version))
204 "1y96g0ra2krjb2kypm8s5gdfia45yci4f36klsvyzg8d53v5cwhn"))))
205 (build-system gnu-build-system)
208 (modify-phases %standard-phases
209 ;; The configure.ac file does not explicitly link against libiconv
210 ;; except on Mac OS, causing the build to fail. This phase comments
211 ;; out the original AC_SUBST macro (located inside a conditional) and
212 ;; adds an explicit use of it underneath, so that libiconv is always
214 (add-after 'unpack 'patch-libiconv
216 (substitute* "configure.ac"
220 "esac\nAC_SUBST([ICONV], [\"-liconv\"])"))
223 `(("libiconv" ,libiconv)
224 ("libsndfile" ,libsndfile)
225 ("liquid-dsp" ,liquid-dsp)))
227 `(("autoconf" ,autoconf)
228 ("automake" ,automake)))
229 (home-page "https://github.com/windytan/redsea")
230 (synopsis "Lightweight RDS to JSON decoder")
231 (description "redsea is a lightweight command-line @dfn{FM Radio Data
232 System} (FM-RDS) decoder. Redsea can be used with any RTL-SDR USB radio stick
233 with the rtl_fm tool, or any other @dfn{software-defined radio} (SDR) via
234 csdr, for example. It can also decode raw ASCII bitstream, the hex format
235 used by RDS Spy, and audio files containing @dfn{multiplex} signals (MPX).")
236 (license license:expat)))
238 (define-public gnuradio
245 (uri (string-append "https://www.gnuradio.org/releases/gnuradio/"
246 "gnuradio-" version ".tar.xz"))
248 (base32 "0aw55gf5549b0fz2qdi7vplcmaf92bj34h40s34b2ycnqasv900r"))
249 (modules '((guix build utils)))
252 ;; Delete bundled volk to use the shared one.
253 (delete-file-recursively "volk")
255 (build-system cmake-build-system)
257 `(("doxygen" ,doxygen)
259 ("ghostscript" ,ghostscript)
261 ("pkg-config" ,pkg-config)
263 ("python-cheetah" ,python-cheetah)
264 ("python-mako" ,python-mako)
265 ("python-pyzmq" ,python-pyzmq)
266 ("python-scipy" ,python-scipy)
267 ("python-sphinx" ,python-sphinx)
269 ("texlive" ,(texlive-union (list texlive-amsfonts
270 texlive-latex-amsmath
271 ;; TODO: Add newunicodechar.
272 texlive-latex-graphics)))
273 ("xorg-server" ,xorg-server-for-tests)))
275 `(("alsa-lib" ,alsa-lib)
288 ("portaudio" ,portaudio)
289 ("python-click" ,python-click)
290 ("python-click-plugins" ,python-click-plugins)
291 ("python-lxml" ,python-lxml)
292 ("python-numpy" ,python-numpy)
293 ("python-pycairo" ,python-pycairo)
294 ("python-pygobject" ,python-pygobject)
295 ("python-pyqt" ,python-pyqt)
296 ("python-pyyaml" ,python-pyyaml)
302 `(#:modules ((guix build cmake-build-system)
303 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
304 ((guix build python-build-system) #:prefix python:)
307 #:imported-modules (,@%cmake-build-system-modules
308 (guix build glib-or-gtk-build-system)
309 (guix build python-build-system))
311 '("-DENABLE_INTERNAL_VOLK=OFF")
313 (modify-phases %standard-phases
314 (add-after 'unpack 'fix-paths
315 (lambda* (#:key inputs #:allow-other-keys)
316 (let ((qwt (assoc-ref inputs "qwt")))
317 (substitute* "cmake/Modules/FindQwt.cmake"
319 (string-append qwt "/include"))
321 (string-append qwt "/lib"))
322 (("qwt6-\\$\\{QWT_QT_VERSION\\}")
324 (substitute* "cmake/Modules/GrPython.cmake"
327 (substitute* '("gr-vocoder/swig/vocoder_swig.i"
328 "gr-vocoder/include/gnuradio/vocoder/codec2.h"
329 "gr-vocoder/include/gnuradio/vocoder/freedv_api.h")
333 (add-before 'check 'set-test-environment
334 (lambda* (#:key inputs #:allow-other-keys)
335 (setenv "HOME" "/tmp")
336 (system (string-append (assoc-ref inputs "xorg-server")
338 (setenv "DISPLAY" ":1")
340 (add-after 'install 'wrap-python
341 (assoc-ref python:%standard-phases 'wrap))
342 (add-after 'wrap-python 'wrap-glib-or-gtk
343 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
344 (add-after 'wrap-glib-or-gtk 'wrap-with-GI_TYPELIB_PATH
345 (lambda* (#:key inputs outputs #:allow-other-keys)
346 (let ((out (assoc-ref outputs "out"))
347 (paths (map (match-lambda
348 ((output . directory)
349 (let ((girepodir (string-append
351 "/lib/girepository-1.0")))
352 (if (file-exists? girepodir)
356 (wrap-program (string-append out "/bin/gnuradio-companion")
357 `("GI_TYPELIB_PATH" ":" prefix ,(filter identity paths))))
359 (synopsis "Toolkit for software-defined radios")
361 "GNU Radio is a development toolkit that provides signal processing blocks
362 to implement software radios. It can be used with external RF hardware to
363 create software-defined radios, or without hardware in a simulation-like
365 (home-page "https://www.gnuradio.org")
366 (license license:gpl3+)))
368 (define-public gnuradio-osmosdr
370 (name "gnuradio-osmosdr")
376 (url "https://git.osmocom.org/gr-osmosdr")
377 (commit (string-append "v" version))))
378 (file-name (git-file-name name version))
380 (base32 "1rdx7fa0xiq0qmgrrbby7z1bblmqhl9qh9jqpsznzxkx91f17ypd"))))
381 (build-system cmake-build-system)
383 `(("doxygen" ,doxygen)
385 ("pkg-config" ,pkg-config)
387 ("python-mako" ,python-mako)
388 ("python-six" ,python-six)
394 ("gnuradio" ,gnuradio)
396 ;; TODO: Add more drivers.
399 (synopsis "GNU Radio block for interfacing with various radio hardware")
400 (description "This is a block for GNU Radio allowing to use a common API
401 to access different radio hardware.")
402 (home-page "https://osmocom.org/projects/gr-osmosdr/wiki/GrOsmoSDR")
403 (license license:gpl3+)))
405 (define-public libosmo-dsp
413 (url "https://git.osmocom.org/libosmo-dsp")
415 (file-name (git-file-name name version))
417 (base32 "00plihnpym1gkfpflah8il9463qxzm9kx2f07jyvbkszpj8viq5g"))))
418 (build-system gnu-build-system)
420 `(("autoconf" ,autoconf)
421 ("automake" ,automake)
422 ("bash-minimal" ,bash-minimal)
426 ("pkg-config" ,pkg-config)
427 ("texlive" ,(texlive-union (list texlive-amsfonts
428 texlive-latex-amsmath
429 ;; TODO: Add newunicodechar.
430 texlive-latex-graphics)))))
435 (modify-phases %standard-phases
436 (add-after 'unpack 'fix-paths
437 (lambda* (#:key inputs #:allow-other-keys)
438 (substitute* "git-version-gen"
440 (string-append (assoc-ref inputs "bash")
443 (synopsis "DSP primitives for SDR")
445 "This a C-language library for common DSP (Digital Signal Processing)
446 primitives for SDR (Software Defined Radio).")
447 (home-page "https://osmocom.org/projects/libosmo-dsp")
448 (license license:gpl2+)))
450 (define-public gnuradio-iqbalance
452 (name "gnuradio-iqbalance")
458 (url "https://git.osmocom.org/gr-iqbal")
459 (commit (string-append "v" version))))
460 (file-name (git-file-name name version))
462 (base32 "0ksagwz05p3b0702q7ljq7013xmp0ijp30my9z6s3p7ja8dj42s3"))))
463 (build-system cmake-build-system)
465 `(("doxygen" ,doxygen)
466 ("pkg-config" ,pkg-config)
468 ("python-numpy" ,python-numpy)
469 ("python-six" ,python-six)
475 ("gnuradio" ,gnuradio)
476 ("libosmo-dsp" ,libosmo-dsp)
479 (synopsis "GNU Radio block to correct IQ imbalance")
481 "This is a GNU Radio block to correct IQ imbalance in quadrature
482 receivers. It's composed of two main block:
484 @item Fix: Given a phase and amplitude error, it will correct a complex signal.
485 @item Optimize: Attempts to auto-detect the phase and amplitude error to feed
486 to the fix block above.
488 (home-page "https://git.osmocom.org/gr-iqbal/")
489 (license license:gpl3+)))
499 (url "https://github.com/csete/gqrx.git")
500 (commit (string-append "v" version))))
501 (file-name (git-file-name name version))
503 (base32 "00alf3q6y313xpx6p7v43vqsphd2x4am4q362lw21bcy9wc4jidw"))))
504 (build-system qt-build-system)
506 `(("pkg-config" ,pkg-config)))
508 `(("alsa-lib" ,alsa-lib)
512 ("gnuradio" ,gnuradio)
513 ("gnuradio-iqbalance" ,gnuradio-iqbalance)
514 ("gnuradio-osmosdr" ,gnuradio-osmosdr)
517 ("portaudio" ,portaudio)
518 ("pulseaudio" ,pulseaudio)
523 `(#:tests? #f)) ; No tests
524 (synopsis "Software defined radio receiver")
525 (description "Gqrx is a software defined radio (SDR) receiver implemented
526 using GNU Radio and the Qt GUI toolkit.")
527 (home-page "https://gqrx.dk/")
528 (license license:gpl3+)))
530 (define-public fldigi
537 (uri (string-append "http://www.w1hkj.com/files/fldigi/fldigi-"
540 (base32 "1y62xn1pim38ibaf2mbl8b7aq20jdaac6lgggb9r402w9bj5b196"))))
541 (build-system gnu-build-system)
543 `(("pkg-config" ,pkg-config)))
545 `(("alsa-lib" ,alsa-lib)
548 ("libsamplerate" ,libsamplerate)
551 ("libxfixes" ,libxfixes)
553 ("portaudio" ,portaudio)
554 ("pulseaudio" ,pulseaudio)))
555 (synopsis "Software modem for amateur radio use")
557 "Fldigi is a software modem for amateur radio use. It is a sound card
558 based program that is used for both transmitting and receiving data by
559 connecting the microphone and headphone connections of a computer to some radio
561 (home-page "http://www.w1hkj.com/")
562 (license license:gpl3+)))
571 (uri (string-append "http://www.w1hkj.com/files/flrig/flrig-"
574 (base32 "0fzrknzzi8kmzmrcfpc8rxr7v4a4ny6z6z5q5qwh95sp2kn2qzp9"))))
575 (build-system gnu-build-system)
577 `(("pkg-config" ,pkg-config)))
582 ("libxfixes" ,libxfixes)
584 (synopsis "Radio transceiver control program")
586 "Flrig is a transceiver control program for amateur radio use.
587 It provides computer aided control of various radios using a serial
589 (home-page "http://www.w1hkj.com/")
590 (license license:gpl3+)))
599 (uri (string-append "http://www.w1hkj.com/files/flamp/flamp-"
602 (base32 "19z1kghhdf7bq6hi2j0mzlsn2nhpn3gl1a623x3inmsk80yw3ck4"))))
603 (build-system gnu-build-system)
605 `(("pkg-config" ,pkg-config)))
610 ("libxfixes" ,libxfixes)
612 (synopsis "Tool for AMP file transfer")
614 "FLAMP is a program for transfering files by radio waves using AMP
615 (Amateur Multicast Protocol).")
616 (home-page "http://www.w1hkj.com/")
617 (license license:gpl3+)))