gnu: Add Cantata.
[jackhill/guix/guix.git] / gnu / packages / radio.scm
CommitLineData
c5361b7c 1;;; GNU Guix --- Functional package management for GNU
ac2fc134 2;;; Copyright © 2017, 2018, 2019, 2020 Arun Isaac <arunisaac@systemreboot.net>
79c4fb4f 3;;; Copyright © 2019, 2020 Christopher Howard <christopher@librehacker.com>
c4f96706 4;;; Copyright © 2019, 2020 Evan Straw <evan.straw99@gmail.com>
d042caf6
GLV
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>
3059e120 8;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
c5361b7c
AI
9;;;
10;;; This file is part of GNU Guix.
11;;;
12;;; GNU Guix is free software; you can redistribute it and/or modify it
13;;; under the terms of the GNU General Public License as published by
14;;; the Free Software Foundation; either version 3 of the License, or (at
15;;; your option) any later version.
16;;;
17;;; GNU Guix is distributed in the hope that it will be useful, but
18;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;;; GNU General Public License for more details.
21;;;
22;;; You should have received a copy of the GNU General Public License
23;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
0493ead6 25(define-module (gnu packages radio)
c5361b7c
AI
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix packages)
28 #:use-module (guix download)
7f1c69f5 29 #:use-module (guix git-download)
f03e5ca5 30 #:use-module (guix utils)
d042caf6
GLV
31 #:use-module (gnu packages algebra)
32 #:use-module (gnu packages audio)
c4f96706
ES
33 #:use-module (gnu packages autotools)
34 #:use-module (gnu packages base)
bc94b75d 35 #:use-module (gnu packages bash)
d042caf6
GLV
36 #:use-module (gnu packages boost)
37 #:use-module (gnu packages check)
38 #:use-module (gnu packages documentation)
8e1e86b0 39 #:use-module (gnu packages engineering)
72f6ee0e 40 #:use-module (gnu packages fltk)
5a915632 41 #:use-module (gnu packages gcc)
409dfdf0 42 #:use-module (gnu packages gd)
d042caf6
GLV
43 #:use-module (gnu packages ghostscript)
44 #:use-module (gnu packages glib)
45 #:use-module (gnu packages gstreamer)
e200de54 46 #:use-module (gnu packages gtk)
7f1c69f5 47 #:use-module (gnu packages image)
c5361b7c 48 #:use-module (gnu packages libusb)
d042caf6
GLV
49 #:use-module (gnu packages linux)
50 #:use-module (gnu packages logging)
409dfdf0 51 #:use-module (gnu packages lua)
d042caf6
GLV
52 #:use-module (gnu packages maths)
53 #:use-module (gnu packages multiprecision)
4fca1bc5 54 #:use-module (gnu packages ncurses)
d042caf6 55 #:use-module (gnu packages networking)
c5361b7c 56 #:use-module (gnu packages pkg-config)
7f1c69f5 57 #:use-module (gnu packages pulseaudio)
e200de54 58 #:use-module (gnu packages python)
d042caf6 59 #:use-module (gnu packages python-science)
44d10b1f 60 #:use-module (gnu packages python-xyz)
d042caf6 61 #:use-module (gnu packages qt)
409dfdf0 62 #:use-module (gnu packages readline)
5a915632 63 #:use-module (gnu packages ruby)
d042caf6
GLV
64 #:use-module (gnu packages sphinx)
65 #:use-module (gnu packages swig)
409dfdf0 66 #:use-module (gnu packages tcl)
d042caf6 67 #:use-module (gnu packages tex)
5a915632 68 #:use-module (gnu packages texinfo)
e200de54 69 #:use-module (gnu packages xml)
d042caf6 70 #:use-module (gnu packages xorg)
e200de54 71 #:use-module (guix build-system cmake)
93299e61 72 #:use-module (guix build-system glib-or-gtk)
7f1c69f5 73 #:use-module (guix build-system gnu)
aa862c2c
GLV
74 #:use-module (guix build-system python)
75 #:use-module (guix build-system qt))
c5361b7c 76
0493ead6
GLV
77(define-public liquid-dsp
78 (package
79 (name "liquid-dsp")
80 (version "1.3.2")
81 (source
82 (origin (method git-fetch)
83 (uri (git-reference
b0e7b699 84 (url "https://github.com/jgaeddert/liquid-dsp")
0493ead6
GLV
85 (commit (string-append "v" version))))
86 (file-name (git-file-name name version))
87 (sha256
88 (base32 "1n6dbg13q8ga5qhg1yiszwly4jj0rxqr6f1xwm9waaly5z493xsd"))))
89 (build-system gnu-build-system)
90 (native-inputs
91 `(("autoconf" ,autoconf)))
92 (inputs
93 `(("fftw" ,fftw)
94 ("fftwf" ,fftwf)))
95 (home-page "https://liquidsdr.org")
96 (synopsis "Signal processing library for software-defined radios")
97 (description
98 "Liquid DSP is a @dfn{digital signal processing} (DSP) library designed
99specifically for software-defined radios on embedded platforms. The aim is to
100provide a lightweight DSP library that does not rely on a myriad of external
101dependencies or proprietary and otherwise cumbersome frameworks. All signal
102processing elements are designed to be flexible, scalable, and dynamic,
103including filters, filter design, oscillators, modems, synchronizers, complex
104mathematical operations, and much more.")
105 (license license:expat)))
106
c5361b7c
AI
107(define-public rtl-sdr
108 (package
109 (name "rtl-sdr")
d7cefb0b 110 (version "0.6.0")
c5361b7c
AI
111 (source
112 (origin
d7cefb0b
ES
113 (method git-fetch)
114 (uri (git-reference
3e26bec0 115 (url "https://git.osmocom.org/rtl-sdr/")
d7cefb0b
ES
116 (commit version)))
117 (file-name (git-file-name name version))
c5361b7c
AI
118 (sha256
119 (base32
d7cefb0b 120 "0lmvsnb4xw4hmz6zs0z5ilsah5hjz29g1s0050n59fllskqr3b8k"))))
c5361b7c
AI
121 (build-system cmake-build-system)
122 (inputs
123 `(("libusb" ,libusb)))
124 (native-inputs
125 `(("pkg-config" ,pkg-config)))
126 (arguments
2bee789a
GLV
127 `(#:configure-flags '("-DDETACH_KERNEL_DRIVER=ON"
128 "-DINSTALL_UDEV_RULES=ON")
129 #:tests? #f ; No tests
130 #:phases
131 (modify-phases %standard-phases
132 (add-after 'unpack 'fix-paths
133 (lambda* (#:key outputs #:allow-other-keys)
134 (substitute* "CMakeLists.txt"
503447ad 135 (("DESTINATION \"/etc/udev/")
2bee789a
GLV
136 (string-append "DESTINATION \""
137 (assoc-ref outputs "out")
503447ad 138 "/lib/udev/")))
2bee789a 139 #t)))))
c5361b7c
AI
140 (home-page "https://osmocom.org/projects/sdr/wiki/rtl-sdr")
141 (synopsis "Software defined radio driver for Realtek RTL2832U")
142 (description "DVB-T dongles based on the Realtek RTL2832U can be used as a
143cheap software defined radio, since the chip allows transferring the raw I/Q
2bee789a
GLV
144samples to the host. @code{rtl-sdr} provides drivers for this purpose.
145
95ffdfe8
GLV
146The default Linux driver managing DVB-T dongles as TV devices doesn't work for
147SDR purposes and clashes with this package. Therefore you must prevent the
148kernel from loading it automatically by adding the following line to your
149system configuration:
150
151@lisp
152(kernel-arguments '(\"modprobe.blacklist=dvb_usb_rtl28xxu\"))
153@end lisp
154
aee7d000
BW
155To install the rtl-sdr udev rules, you must extend 'udev-service-type' with
156this package. E.g.: @code{(udev-rules-service 'rtl-sdr rtl-sdr)}")
c5361b7c 157 (license license:gpl2+)))
e200de54
AI
158
159(define-public chirp
160 (package
161 (name "chirp")
6688aed4 162 (version "20201014")
e200de54
AI
163 (source
164 (origin
165 (method url-fetch)
166 (uri (string-append "https://trac.chirp.danplanet.com/chirp_daily/daily-"
167 version "/chirp-daily-" version ".tar.gz"))
168 (sha256
6688aed4 169 (base32 "16x3ix2n7a9l7lln2pri1xfmhyfvvzxb0nr3h33iajqimbwckxj0"))))
e200de54
AI
170 (build-system python-build-system)
171 (inputs
172 `(("python2-libxml2" ,python2-libxml2)
173 ("python2-pygtk" ,python2-pygtk)
174 ("python2-pyserial" ,python2-pyserial)))
175 (arguments
176 `(#:python ,python-2))
177 (home-page "https://chirp.danplanet.com")
178 (synopsis "Cross-radio programming tool")
179 (description "Chirp is a cross-radio programming tool. It supports a
180growing list of radios across several manufacturers and allows transferring of
181memory contents between them.")
182 (license (list license:gpl3+
183 license:lgpl3+)))) ; chirp/elib_intl.py
7f1c69f5
AI
184
185(define-public aptdec
186 (package
187 (name "aptdec")
188 (version "1.7")
189 (source
190 (origin
191 (method git-fetch)
192 (uri (git-reference
ac2fc134 193 (url "https://github.com/Xerbo/aptdec")
7f1c69f5
AI
194 (commit (string-append "v" version))))
195 (file-name (git-file-name name version))
196 (sha256
197 (base32
198 "1hf0zb51qc6fyhdjxyij1n3vgwnw3cwksc3r11szbhkml14qjnzk"))))
199 (build-system gnu-build-system)
200 (inputs
201 `(("libpng" ,libpng)
202 ("libsndfile" ,libsndfile)))
203 (arguments
319a73e7
AI
204 `(#:make-flags
205 (list
206 (string-append "CC="
207 (if ,(%current-target-system)
208 (string-append (assoc-ref %build-inputs "cross-gcc")
209 "/bin/" ,(%current-target-system) "-gcc")
210 "gcc"))
211 (string-append "PREFIX=" %output)
212 (string-append "RPM_BUILD_ROOT=" %output))
7f1c69f5
AI
213 #:tests? #f ; no tests
214 #:phases
215 (modify-phases %standard-phases
216 (delete 'configure)
217 (replace 'install
218 (lambda* (#:key outputs #:allow-other-keys)
219 (let ((out (assoc-ref outputs "out")))
220 (install-file "atpdec" (string-append out "/bin")))
221 #t)))))
ac2fc134 222 (home-page "https://github.com/Xerbo/aptdec")
7f1c69f5
AI
223 (synopsis "NOAA Automatic Picture Transmission (APT) decoder")
224 (description "Aptdec decodes Automatic Picture Transmission (APT) images.
225These are medium resolution images of the Earth transmitted by, among other
226satellites, the POES NOAA weather satellite series. These transmissions are
227on a frequency of 137 MHz. They can be received using an inexpensive antenna
228and a dedicated receiver.")
229 (license license:gpl2+)))
c4f96706
ES
230
231(define-public redsea
232 (package
233 (name "redsea")
234 (version "0.18")
235 (source (origin
236 (method git-fetch)
237 (uri (git-reference
238 (url "https://github.com/windytan/redsea")
239 (commit (string-append "v" version))))
240 (file-name (git-file-name name version))
241 (sha256
242 (base32
243 "1y96g0ra2krjb2kypm8s5gdfia45yci4f36klsvyzg8d53v5cwhn"))))
244 (build-system gnu-build-system)
245 (arguments
246 `(#:phases
247 (modify-phases %standard-phases
248 ;; The configure.ac file does not explicitly link against libiconv
249 ;; except on Mac OS, causing the build to fail. This phase comments
250 ;; out the original AC_SUBST macro (located inside a conditional) and
251 ;; adds an explicit use of it underneath, so that libiconv is always
252 ;; linked against.
253 (add-after 'unpack 'patch-libiconv
254 (lambda _
255 (substitute* "configure.ac"
256 (("^ +AC_SUBST")
257 "# AC_SUBST")
258 (("esac")
259 "esac\nAC_SUBST([ICONV], [\"-liconv\"])"))
260 #t)))))
261 (inputs
262 `(("libiconv" ,libiconv)
263 ("libsndfile" ,libsndfile)
264 ("liquid-dsp" ,liquid-dsp)))
265 (native-inputs
266 `(("autoconf" ,autoconf)
267 ("automake" ,automake)))
268 (home-page "https://github.com/windytan/redsea")
269 (synopsis "Lightweight RDS to JSON decoder")
270 (description "redsea is a lightweight command-line @dfn{FM Radio Data
271System} (FM-RDS) decoder. Redsea can be used with any RTL-SDR USB radio stick
272with the rtl_fm tool, or any other @dfn{software-defined radio} (SDR) via
273csdr, for example. It can also decode raw ASCII bitstream, the hex format
274used by RDS Spy, and audio files containing @dfn{multiplex} signals (MPX).")
275 (license license:expat)))
d042caf6
GLV
276
277(define-public gnuradio
278 (package
279 (name "gnuradio")
280 (version "3.8.0.0")
281 (source
282 (origin
283 (method url-fetch)
284 (uri (string-append "https://www.gnuradio.org/releases/gnuradio/"
285 "gnuradio-" version ".tar.xz"))
286 (sha256
8e1e86b0
GLV
287 (base32 "0aw55gf5549b0fz2qdi7vplcmaf92bj34h40s34b2ycnqasv900r"))
288 (modules '((guix build utils)))
289 (snippet
290 '(begin
291 ;; Delete bundled volk to use the shared one.
292 (delete-file-recursively "volk")
293 #t))))
d042caf6
GLV
294 (build-system cmake-build-system)
295 (native-inputs
296 `(("doxygen" ,doxygen)
d042caf6
GLV
297 ("ghostscript" ,ghostscript)
298 ("orc" ,orc)
299 ("pkg-config" ,pkg-config)
d042caf6
GLV
300 ("python-cheetah" ,python-cheetah)
301 ("python-mako" ,python-mako)
302 ("python-pyzmq" ,python-pyzmq)
303 ("python-scipy" ,python-scipy)
304 ("python-sphinx" ,python-sphinx)
305 ("swig" ,swig)
306 ("texlive" ,(texlive-union (list texlive-amsfonts
307 texlive-latex-amsmath
308 ;; TODO: Add newunicodechar.
309 texlive-latex-graphics)))
310 ("xorg-server" ,xorg-server-for-tests)))
311 (inputs
312 `(("alsa-lib" ,alsa-lib)
313 ("boost" ,boost)
314 ("cairo" ,cairo)
315 ("codec2" ,codec2)
316 ("cppzmq" ,cppzmq)
317 ("fftwf" ,fftwf)
318 ("gmp" ,gmp)
319 ("gsl" ,gsl)
320 ("gsm" ,gsm)
321 ("gtk+" ,gtk+)
322 ("jack" ,jack-1)
323 ("log4cpp" ,log4cpp)
324 ("pango" ,pango)
325 ("portaudio" ,portaudio)
f03e5ca5 326 ("python" ,python)
d042caf6
GLV
327 ("python-click" ,python-click)
328 ("python-click-plugins" ,python-click-plugins)
329 ("python-lxml" ,python-lxml)
330 ("python-numpy" ,python-numpy)
331 ("python-pycairo" ,python-pycairo)
332 ("python-pygobject" ,python-pygobject)
333 ("python-pyqt" ,python-pyqt)
334 ("python-pyyaml" ,python-pyyaml)
335 ("qtbase" ,qtbase)
336 ("qwt" ,qwt)
8e1e86b0 337 ("volk" ,volk)
d042caf6
GLV
338 ("zeromq" ,zeromq)))
339 (arguments
340 `(#:modules ((guix build cmake-build-system)
93299e61 341 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
d042caf6 342 ((guix build python-build-system) #:prefix python:)
93299e61
GLV
343 (guix build utils)
344 (ice-9 match))
d042caf6 345 #:imported-modules (,@%cmake-build-system-modules
93299e61 346 (guix build glib-or-gtk-build-system)
d042caf6 347 (guix build python-build-system))
8e1e86b0
GLV
348 #:configure-flags
349 '("-DENABLE_INTERNAL_VOLK=OFF")
d042caf6
GLV
350 #:phases
351 (modify-phases %standard-phases
352 (add-after 'unpack 'fix-paths
353 (lambda* (#:key inputs #:allow-other-keys)
354 (let ((qwt (assoc-ref inputs "qwt")))
355 (substitute* "cmake/Modules/FindQwt.cmake"
356 (("/usr/include")
357 (string-append qwt "/include"))
358 (("/usr/lib")
359 (string-append qwt "/lib"))
360 (("qwt6-\\$\\{QWT_QT_VERSION\\}")
361 "qwt")))
362 (substitute* "cmake/Modules/GrPython.cmake"
363 (("dist-packages")
364 "site-packages"))
365 (substitute* '("gr-vocoder/swig/vocoder_swig.i"
366 "gr-vocoder/include/gnuradio/vocoder/codec2.h"
367 "gr-vocoder/include/gnuradio/vocoder/freedv_api.h")
368 (("<codec2/")
369 "<"))
370 #t))
371 (add-before 'check 'set-test-environment
372 (lambda* (#:key inputs #:allow-other-keys)
373 (setenv "HOME" "/tmp")
374 (system (string-append (assoc-ref inputs "xorg-server")
375 "/bin/Xvfb :1 &"))
376 (setenv "DISPLAY" ":1")
377 #t))
378 (add-after 'install 'wrap-python
93299e61
GLV
379 (assoc-ref python:%standard-phases 'wrap))
380 (add-after 'wrap-python 'wrap-glib-or-gtk
381 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
382 (add-after 'wrap-glib-or-gtk 'wrap-with-GI_TYPELIB_PATH
383 (lambda* (#:key inputs outputs #:allow-other-keys)
384 (let ((out (assoc-ref outputs "out"))
385 (paths (map (match-lambda
386 ((output . directory)
387 (let ((girepodir (string-append
388 directory
389 "/lib/girepository-1.0")))
390 (if (file-exists? girepodir)
391 girepodir
392 #f))))
393 inputs)))
394 (wrap-program (string-append out "/bin/gnuradio-companion")
395 `("GI_TYPELIB_PATH" ":" prefix ,(filter identity paths))))
396 #t)))))
cf480830 397 (native-search-paths
f03e5ca5 398 ;; Variables required to find third-party plugins at runtime.
cf480830
GLV
399 (list (search-path-specification
400 (variable "GRC_BLOCKS_PATH")
f03e5ca5
GLV
401 (files '("share/gnuradio/grc/blocks")))
402 (search-path-specification
403 (variable "PYTHONPATH")
404 (files (list (string-append "lib/python"
405 (version-major+minor
406 (package-version python))
407 "/site-packages"))))))
d042caf6
GLV
408 (synopsis "Toolkit for software-defined radios")
409 (description
410 "GNU Radio is a development toolkit that provides signal processing blocks
411to implement software radios. It can be used with external RF hardware to
412create software-defined radios, or without hardware in a simulation-like
413environment.")
414 (home-page "https://www.gnuradio.org")
415 (license license:gpl3+)))
aa862c2c
GLV
416
417(define-public gnuradio-osmosdr
418 (package
419 (name "gnuradio-osmosdr")
4b582791 420 (version "0.2.2")
aa862c2c
GLV
421 (source
422 (origin
423 (method git-fetch)
424 (uri (git-reference
425 (url "https://git.osmocom.org/gr-osmosdr")
426 (commit (string-append "v" version))))
427 (file-name (git-file-name name version))
428 (sha256
4b582791 429 (base32 "1aqj5cylipmmjh1x1kb2j8262hxq6mi86dgb2zphj94wvsab2ghx"))))
aa862c2c
GLV
430 (build-system cmake-build-system)
431 (native-inputs
432 `(("doxygen" ,doxygen)
aa862c2c
GLV
433 ("pkg-config" ,pkg-config)
434 ("python" ,python)
435 ("python-mako" ,python-mako)
436 ("python-six" ,python-six)
437 ("swig" ,swig)))
438 (inputs
439 `(("boost" ,boost)
440 ("fftwf" ,fftwf)
441 ("gmp" ,gmp)
442 ("gnuradio" ,gnuradio)
62d45e46 443 ("hackrf" ,hackrf)
aa862c2c 444 ("log4cpp" ,log4cpp)
b3926202
GLV
445 ("rtl-sdr" ,rtl-sdr)
446 ("volk" ,volk)))
aa862c2c
GLV
447 (synopsis "GNU Radio block for interfacing with various radio hardware")
448 (description "This is a block for GNU Radio allowing to use a common API
449to access different radio hardware.")
450 (home-page "https://osmocom.org/projects/gr-osmosdr/wiki/GrOsmoSDR")
451 (license license:gpl3+)))
bc94b75d
GLV
452
453(define-public libosmo-dsp
454 (package
455 (name "libosmo-dsp")
456 (version "0.4.0")
457 (source
458 (origin
459 (method git-fetch)
460 (uri (git-reference
461 (url "https://git.osmocom.org/libosmo-dsp")
462 (commit version)))
463 (file-name (git-file-name name version))
464 (sha256
465 (base32 "00plihnpym1gkfpflah8il9463qxzm9kx2f07jyvbkszpj8viq5g"))))
466 (build-system gnu-build-system)
467 (native-inputs
468 `(("autoconf" ,autoconf)
469 ("automake" ,automake)
470 ("bash-minimal" ,bash-minimal)
471 ("doxygen" ,doxygen)
bc94b75d
GLV
472 ("libtool" ,libtool)
473 ("pkg-config" ,pkg-config)
474 ("texlive" ,(texlive-union (list texlive-amsfonts
475 texlive-latex-amsmath
476 ;; TODO: Add newunicodechar.
477 texlive-latex-graphics)))))
478 (inputs
479 `(("fftwf" ,fftwf)))
480 (arguments
481 `(#:phases
482 (modify-phases %standard-phases
483 (add-after 'unpack 'fix-paths
484 (lambda* (#:key inputs #:allow-other-keys)
485 (substitute* "git-version-gen"
486 (("/bin/sh")
487 (string-append (assoc-ref inputs "bash")
488 "/bin/bash")))
489 #t)))))
490 (synopsis "DSP primitives for SDR")
491 (description
492 "This a C-language library for common DSP (Digital Signal Processing)
493primitives for SDR (Software Defined Radio).")
494 (home-page "https://osmocom.org/projects/libosmo-dsp")
495 (license license:gpl2+)))
77dc12a8
GLV
496
497(define-public gnuradio-iqbalance
498 (package
499 (name "gnuradio-iqbalance")
500 (version "0.38.1")
501 (source
502 (origin
503 (method git-fetch)
504 (uri (git-reference
505 (url "https://git.osmocom.org/gr-iqbal")
506 (commit (string-append "v" version))))
507 (file-name (git-file-name name version))
508 (sha256
509 (base32 "0ksagwz05p3b0702q7ljq7013xmp0ijp30my9z6s3p7ja8dj42s3"))))
510 (build-system cmake-build-system)
511 (native-inputs
512 `(("doxygen" ,doxygen)
513 ("pkg-config" ,pkg-config)
514 ("python" ,python)
515 ("python-numpy" ,python-numpy)
516 ("python-six" ,python-six)
517 ("swig" ,swig)))
518 (inputs
519 `(("boost" ,boost)
520 ("fftwf" ,fftwf)
521 ("gmp" ,gmp)
522 ("gnuradio" ,gnuradio)
523 ("libosmo-dsp" ,libosmo-dsp)
29cab668
GLV
524 ("log4cpp" ,log4cpp)
525 ("volk" ,volk)))
77dc12a8
GLV
526 (synopsis "GNU Radio block to correct IQ imbalance")
527 (description
528 "This is a GNU Radio block to correct IQ imbalance in quadrature
529receivers. It's composed of two main block:
530@itemize
531@item Fix: Given a phase and amplitude error, it will correct a complex signal.
532@item Optimize: Attempts to auto-detect the phase and amplitude error to feed
533to the fix block above.
534@end itemize")
535 (home-page "https://git.osmocom.org/gr-iqbal/")
536 (license license:gpl3+)))
f76ac21c
GLV
537
538(define-public gqrx
539 (package
540 (name "gqrx")
541 (version "2.12.1")
542 (source
543 (origin
544 (method git-fetch)
545 (uri (git-reference
b0e7b699 546 (url "https://github.com/csete/gqrx")
f76ac21c
GLV
547 (commit (string-append "v" version))))
548 (file-name (git-file-name name version))
549 (sha256
550 (base32 "00alf3q6y313xpx6p7v43vqsphd2x4am4q362lw21bcy9wc4jidw"))))
551 (build-system qt-build-system)
552 (native-inputs
553 `(("pkg-config" ,pkg-config)))
554 (inputs
555 `(("alsa-lib" ,alsa-lib)
556 ("boost" ,boost)
557 ("fftwf" ,fftwf)
558 ("gmp" ,gmp)
559 ("gnuradio" ,gnuradio)
560 ("gnuradio-iqbalance" ,gnuradio-iqbalance)
561 ("gnuradio-osmosdr" ,gnuradio-osmosdr)
562 ("jack" ,jack-1)
563 ("log4cpp" ,log4cpp)
564 ("portaudio" ,portaudio)
565 ("pulseaudio" ,pulseaudio)
566 ("qtbase" ,qtbase)
01e62a02
GLV
567 ("qtsvg" ,qtsvg)
568 ("volk" ,volk)))
f76ac21c
GLV
569 (arguments
570 `(#:tests? #f)) ; No tests
571 (synopsis "Software defined radio receiver")
572 (description "Gqrx is a software defined radio (SDR) receiver implemented
573using GNU Radio and the Qt GUI toolkit.")
574 (home-page "https://gqrx.dk/")
575 (license license:gpl3+)))
72f6ee0e
GLV
576
577(define-public fldigi
578 (package
579 (name "fldigi")
0e590740 580 (version "4.1.14")
72f6ee0e
GLV
581 (source
582 (origin
583 (method url-fetch)
584 (uri (string-append "http://www.w1hkj.com/files/fldigi/fldigi-"
585 version ".tar.gz"))
586 (sha256
0e590740 587 (base32 "0hr6xbv01xf7z4r2jxxhn8xjdmca2198q4m9glh4877dllvfq6xj"))))
72f6ee0e
GLV
588 (build-system gnu-build-system)
589 (native-inputs
590 `(("pkg-config" ,pkg-config)))
591 (inputs
592 `(("alsa-lib" ,alsa-lib)
593 ("fltk" ,fltk)
e6d14165 594 ("hamlib" ,hamlib)
72f6ee0e
GLV
595 ("libpng" ,libpng)
596 ("libsamplerate" ,libsamplerate)
e6d14165 597 ("libusb" ,libusb)
72f6ee0e
GLV
598 ("libx11" ,libx11)
599 ("libxext" ,libxext)
600 ("libxfixes" ,libxfixes)
601 ("libxft" ,libxft)
602 ("portaudio" ,portaudio)
603 ("pulseaudio" ,pulseaudio)))
604 (synopsis "Software modem for amateur radio use")
605 (description
606 "Fldigi is a software modem for amateur radio use. It is a sound card
607based program that is used for both transmitting and receiving data by
608connecting the microphone and headphone connections of a computer to some radio
609hardware.")
610 (home-page "http://www.w1hkj.com/")
611 (license license:gpl3+)))
8080c03d
GLV
612
613(define-public flrig
614 (package
615 (name "flrig")
131cc178 616 (version "1.3.51")
8080c03d
GLV
617 (source
618 (origin
619 (method url-fetch)
620 (uri (string-append "http://www.w1hkj.com/files/flrig/flrig-"
621 version ".tar.gz"))
622 (sha256
131cc178 623 (base32 "0aq4x0ai9q08ypfhzfj2inc4z3q39zq1l6h9as1kil9yn4zbay61"))))
8080c03d
GLV
624 (build-system gnu-build-system)
625 (native-inputs
626 `(("pkg-config" ,pkg-config)))
627 (inputs
628 `(("fltk" ,fltk)
629 ("libx11" ,libx11)
630 ("libxext" ,libxext)
631 ("libxfixes" ,libxfixes)
632 ("libxft" ,libxft)))
633 (synopsis "Radio transceiver control program")
634 (description
635 "Flrig is a transceiver control program for amateur radio use.
636It provides computer aided control of various radios using a serial
637or USB connection.")
638 (home-page "http://www.w1hkj.com/")
639 (license license:gpl3+)))
660912a4
GLV
640
641(define-public flamp
642 (package
643 (name "flamp")
644 (version "2.2.05")
645 (source
646 (origin
647 (method url-fetch)
648 (uri (string-append "http://www.w1hkj.com/files/flamp/flamp-"
649 version ".tar.gz"))
650 (sha256
651 (base32 "19z1kghhdf7bq6hi2j0mzlsn2nhpn3gl1a623x3inmsk80yw3ck4"))))
652 (build-system gnu-build-system)
653 (native-inputs
654 `(("pkg-config" ,pkg-config)))
655 (inputs
656 `(("fltk" ,fltk)
657 ("libx11" ,libx11)
658 ("libxext" ,libxext)
659 ("libxfixes" ,libxfixes)
660 ("libxft" ,libxft)))
661 (synopsis "Tool for AMP file transfer")
662 (description
3a888b41 663 "FLAMP is a program for transferring files by radio waves using AMP
660912a4
GLV
664(Amateur Multicast Protocol).")
665 (home-page "http://www.w1hkj.com/")
666 (license license:gpl3+)))
90ec7085
GLV
667
668(define-public flwrap
669 (package
670 (name "flwrap")
671 (version "1.3.5")
672 (source
673 (origin
674 (method url-fetch)
675 (uri (string-append "http://www.w1hkj.com/files/flwrap/flwrap-"
676 version ".tar.gz"))
677 (sha256
678 (base32 "0qqivqkkravcg7j45740xfky2q3k7czqpkj6y364qff424q2pppg"))))
679 (build-system gnu-build-system)
680 (native-inputs
681 `(("pkg-config" ,pkg-config)))
682 (inputs
683 `(("fltk" ,fltk)
684 ("libx11" ,libx11)
685 ("libxext" ,libxext)
686 ("libxfixes" ,libxfixes)
687 ("libxft" ,libxft)))
688 (synopsis "File encapsulation program")
689 (description
690 "Flwrap is a software utility for amateur radio use. Its purpose is to
691encapsulate both text and binary files in a way that allows them to be
692transmitted over any of several digital modes and verified at the receipt end
693for correctness.")
694 (home-page "http://www.w1hkj.com/")
695 (license license:gpl3+)))
409dfdf0 696
79c4fb4f
CH
697(define-public hackrf
698 ;; Using a git commit because there have been many many commits
699 ;; since the relase two years ago, but no sign of a promised
700 ;; release for many months now.
701 (let ((commit "43e6f99fe8543094d18ff3a6550ed2066c398862")
702 (revision "0"))
703 (package
704 (name "hackrf")
705 (version (git-version "2018.01.1" revision commit))
706 (source
707 (origin
708 (method git-fetch)
709 (uri (git-reference
b0e7b699 710 (url "https://github.com/mossmann/hackrf")
79c4fb4f
CH
711 (commit commit)))
712 (file-name (git-file-name name version))
713 (sha256
714 (base32 "0avnv693xi0zsnrvkbfn0ln1r3s1iyj0bz7sc3gxay909av0pvbc"))))
715 (build-system cmake-build-system)
716 (arguments
717 '(#:configure-flags
718 (list "-DUDEV_RULES_GROUP=dialout"
719 (string-append "-DUDEV_RULES_PATH="
720 (assoc-ref %outputs "out")
721 "/lib/udev/rules.d"))
722 #:phases
723 (modify-phases %standard-phases
724 (add-before 'configure 'enter-source-directory
725 (lambda _
726 (chdir "host")
727 #t))
728 (add-after 'install 'delete-static-library
729 (lambda* (#:key outputs #:allow-other-keys)
730 (delete-file (string-append (assoc-ref outputs "out")
731 "/lib/libhackrf.a"))
732 #t))
733 (add-before 'install-license-files 'leave-source-directory
734 (lambda _
735 (chdir "..")
736 #t)))
737 #:tests? #f)) ; no test suite
738 (native-inputs
739 `(("pkg-config" ,pkg-config)))
740 (inputs
741 `(("fftw" ,fftw)
742 ("fftwf" ,fftwf)
743 ("libusb" ,libusb)))
744 (home-page "https://greatscottgadgets.com/hackrf/")
745 (synopsis "User-space library and utilities for HackRF SDR")
746 (description
747 "Command line utilities and a C library for controlling the HackRF
32290b2c
BW
748Software Defined Radio (SDR) over USB. Installing this package installs the
749userspace hackrf utilities and C library. To install the hackrf udev rules,
750you must extend 'udev-service-type' with this package. E.g.:
751@code{(udev-rules-service 'hackrf hackrf #:groups '(\"dialout\"))}.")
79c4fb4f
CH
752 (license license:gpl2))))
753
409dfdf0
GLV
754(define-public hamlib
755 (package
756 (name "hamlib")
757 (version "3.3")
758 (source
759 (origin
760 (method url-fetch)
761 (uri (string-append
762 "https://github.com/Hamlib/Hamlib/releases/download/"
763 version "/hamlib-" version ".tar.gz"))
764 (sha256
765 (base32 "10788mgrhbc57zpzakcxv5aqnr2819pcshml6fbh8zvnkja562y9"))))
766 (build-system gnu-build-system)
767 (native-inputs
768 `(("doxygen" ,doxygen)
769 ("lua" ,lua)
770 ("pkg-config" ,pkg-config)
771 ("python-wrapper" ,python-wrapper)
772 ("swig" ,swig)
773 ("tcl" ,tcl)))
774 (inputs
775 `(("gd" ,gd)
776 ("libusb" ,libusb)
777 ("libxml2" ,libxml2)
778 ("readline" ,readline)))
779 (arguments
780 `(#:configure-flags '("--disable-static"
781 "--with-lua-binding"
782 "--with-python-binding"
783 "--with-tcl-binding"
784 "--with-xml-support")))
785 (synopsis "Tools and API to control radios")
786 (description
787 "The Ham Radio Control Library (Hamlib) is a project to provide programs
788with a consistent Application Programming Interface (API) for controlling the
789myriad of radios and rotators available to amateur radio and communications
790users.")
791 (home-page "https://hamlib.github.io/")
792 (license (list license:gpl2+ license:lgpl2.1+))))
5a915632
GLV
793
794(define wsjtx-hamlib
795 ;; Fork of hamlib with custom patches used by wsjtx.
796 (package
797 (inherit hamlib)
798 (name "wsjtx-hamlib")
183f0698 799 (version "2.2.2")
5a915632
GLV
800 (source
801 (origin
802 (method git-fetch)
803 (uri (git-reference
804 (url "https://git.code.sf.net/u/bsomervi/hamlib.git")
805 (commit (string-append "wsjtx-" version))))
806 (file-name (git-file-name name version))
807 (sha256
09e27115 808 (base32 "01h5ps0yq5vi1x9rkw742gx6a5fj02zhbpi89i412qdfbnyk35cv"))))
5a915632
GLV
809 (native-inputs
810 `(("autoconf" ,autoconf)
811 ("automake" ,automake)
812 ("libtool" ,libtool)
813 ("texinfo" ,texinfo)
09e27115
GLV
814 ,@(package-native-inputs hamlib)))
815 (arguments
816 `(#:configure-flags '("--disable-static"
817 "--with-lua-binding"
818 "--with-python-binding"
819 "--with-tcl-binding"
820 "--with-xml-support")
821 #:phases
822 (modify-phases %standard-phases
823 (add-after 'unpack 'fix-tests
824 (lambda _
825 (substitute* "tests/testloc.c"
826 (("dmmm2dec\\(deg, mmm, nesw\\);")
827 "dmmm2dec(deg, mmm, 0, nesw);"))
828 #t)))))))
5a915632
GLV
829
830(define-public wsjtx
831 (package
832 (name "wsjtx")
183f0698 833 (version "2.2.2")
5a915632
GLV
834 (source
835 (origin
836 (method git-fetch)
837 (uri (git-reference
838 (url "https://git.code.sf.net/p/wsjt/wsjtx.git")
839 (commit (string-append "wsjtx-" version))))
840 (file-name (git-file-name name version))
841 (sha256
183f0698 842 (base32 "0fhws44gg05d9y2al0pcdnxwxwh4bazcfl0g5mq2ks1r7w23wi5x"))
5a915632
GLV
843 (modules '((guix build utils)))
844 (snippet
845 '(begin
846 ;; Delete bundled boost to use the shared one.
847 (delete-file-recursively "boost")
848 #t))))
849 (build-system qt-build-system)
850 (native-inputs
851 `(("asciidoc" ,asciidoc)
852 ("gfortran" ,gfortran)
853 ("pkg-config" ,pkg-config)
854 ("qttools" ,qttools)
855 ("ruby-asciidoctor" ,ruby-asciidoctor)))
856 (inputs
857 `(("boost" ,boost)
858 ("fftw" ,fftw)
859 ("fftwf" ,fftwf)
860 ("hamlib" ,wsjtx-hamlib)
861 ("libusb" ,libusb)
862 ("qtbase" ,qtbase)
863 ("qtmultimedia" ,qtmultimedia)
864 ("qtserialport" ,qtserialport)))
865 (arguments
b79794a7
GLV
866 `(#:tests? #f ; No test suite
867 #:phases
868 (modify-phases %standard-phases
869 (add-after 'unpack 'work-around-runtime-bug
870 (lambda _
871 ;; Some of the programs in this package fail to find symbols
872 ;; in libm at runtime. Adding libm manually at the end of the
873 ;; library lists when linking the programs seems to help.
874 ;; TODO: find exactly what is wrong in the way the programs
875 ;; are built.
876 (substitute* "CMakeLists.txt"
877 (("target_link_libraries \\((.*)\\)" all libs)
878 (string-append "target_link_libraries (" libs " m)")))
879 #t)))))
5a915632
GLV
880 (synopsis "Weak-signal ham radio communication program")
881 (description
882 "WSJT-X implements communication protocols or modes called FT4, FT8,
883JT4, JT9, JT65, QRA64, ISCAT, MSK144, and WSPR, as well as one called Echo for
884detecting and measuring your own radio signals reflected from the Moon. These
885modes were all designed for making reliable, confirmed QSOs under extreme
886weak-signal conditions.")
887 (home-page "https://www.physics.princeton.edu/pulsar/k1jt/wsjtx.html")
888 (license license:gpl3)))
f93eebbf 889
8a294ece
GLV
890(define-public js8call
891 (package
892 (inherit wsjtx)
893 (name "js8call")
b8fe812f 894 (version "2.2.0")
8a294ece
GLV
895 (source
896 (origin
897 (method url-fetch)
898 (uri (string-append "http://files.js8call.com/" version
899 "/js8call-" version ".tgz"))
900 (sha256
b8fe812f 901 (base32 "149sjwc4zg6ckgq26af93p4fxappa4k9dh7rdy67g8ajfjad4cd8"))
8a294ece
GLV
902 (modules '((guix build utils)))
903 (snippet
904 '(begin
905 ;; Delete bundled boost to use the shared one.
906 (delete-file-recursively "boost")
907 #t))))
908 (build-system qt-build-system)
909 (native-inputs
910 `(("asciidoc" ,asciidoc)
911 ("gfortran" ,gfortran)
912 ("pkg-config" ,pkg-config)
913 ("qttools" ,qttools)
914 ("ruby-asciidoctor" ,ruby-asciidoctor)))
915 (inputs
916 `(("boost" ,boost)
917 ("fftw" ,fftw)
918 ("fftwf" ,fftwf)
b8fe812f 919 ("hamlib" ,wsjtx-hamlib)
8a294ece
GLV
920 ("libusb" ,libusb)
921 ("qtbase" ,qtbase)
922 ("qtmultimedia" ,qtmultimedia)
923 ("qtserialport" ,qtserialport)))
924 (arguments
925 `(#:tests? #f ; No test suite
926 #:phases
927 (modify-phases %standard-phases
928 (add-after 'unpack 'fix-paths
929 (lambda* (#:key outputs #:allow-other-keys)
930 (substitute* "CMakeLists.txt"
931 (("DESTINATION /usr/share")
932 (string-append "DESTINATION "
933 (assoc-ref outputs "out")
934 "/share")))
935 #t))
ac4847eb
GLV
936 (add-after 'fix-paths 'work-around-runtime-bug
937 (lambda _
938 ;; Some of the programs in this package fail to find symbols
939 ;; in libm at runtime. Adding libm manually at the end of the
940 ;; library lists when linking the programs seems to help.
941 ;; TODO: find exactly what is wrong in the way the programs
942 ;; are built.
943 (substitute* "CMakeLists.txt"
944 (("target_link_libraries \\((.*)\\)" all libs)
945 (string-append "target_link_libraries (" libs " m)")))
946 #t))
8a294ece
GLV
947 (add-after 'unpack 'fix-hamlib
948 (lambda _
949 (substitute* "CMake/Modules/Findhamlib.cmake"
950 (("set \\(ENV\\{PKG_CONFIG_PATH\\}.*\\)")
951 "set (__pc_path $ENV{PKG_CONFIG_PATH})
952 list (APPEND __pc_path \"${__hamlib_pc_path}\")
953 set (ENV{PKG_CONFIG_PATH} \"${__pc_path}\")"))
954 (substitute* "HamlibTransceiver.hpp"
955 (("#ifdef JS8_USE_LEGACY_HAMLIB")
956 "#if 1"))
957 #t)))))
958 (synopsis "Weak-signal ham radio communication program")
959 (description
960 "JS8Call is a software using the JS8 digital mode (a derivative of the FT8
961mode) providing weak signal keyboard to keyboard messaging to amateur radio
962operators.")
963 (home-page "http://js8call.com/")
964 (license license:gpl3)))
965
f93eebbf
GLV
966(define-public xnec2c
967 (package
968 (name "xnec2c")
969 (version "4.1.1")
970 (source
971 (origin
972 (method url-fetch)
973 (uri (string-append "http://www.5b4az.org/pkg/nec2/xnec2c/xnec2c-"
974 version ".tar.bz2"))
975 (sha256
976 (base32 "1myvlkfybb2ha8l0h96ca3iz206zzy9z5iizm0sbab2zzp78n1r9"))))
977 (build-system gnu-build-system)
978 (native-inputs
979 `(("pkg-config" ,pkg-config)))
980 (inputs
981 `(("gtk+" ,gtk+)))
982 (arguments
983 `(#:phases
984 (modify-phases %standard-phases
985 (add-after 'unpack 'fix-makefile
986 (lambda* (#:key outputs #:allow-other-keys)
987 (substitute* '("Makefile.am" "Makefile.in")
988 ;; The DESTDIR variable does not get replaced the prefix
989 ;; in the final Makefile, so let's do here.
990 (("\\$\\(DESTDIR\\)/usr")
991 (assoc-ref outputs "out")))
992 #t))
993 (add-after 'fix-makefile 'fix-paths
994 (lambda* (#:key outputs #:allow-other-keys)
995 ;; Increase the max length of the path to the glade file,
996 ;; so that the '/gnu/store/...' path can fit in.
997 (substitute* '("src/shared.c" "src/shared.h")
998 (("char xnec2c_glade\\[64\\];")
999 "char xnec2c_glade[256];"))
1000 ;; Fix hard coded references to '/usr/...'.
1001 (substitute* '("src/geom_edit.c" "src/main.c")
1002 (("\"/usr")
1003 (string-append "\"" (assoc-ref outputs "out"))))
1004 #t)))))
1005 (synopsis "Antenna modeling software")
1006 (description
1007 "Xnec2c is a GTK3-based graphical version of nec2c, a translation to the
1008C language of NEC2, the FORTRAN Numerical Electromagnetics Code commonly used
1009for antenna simulation and analysis. It can be used to define the geometry of
1010an antenna, and then plot the radiation pattern or frequency-related data like
1011gain and standing wave ratio.")
1012 (home-page "http://www.5b4az.org/")
1013 (license license:gpl3+)))
4fca1bc5
GLV
1014
1015(define-public dump1090
1016 (package
1017 (name "dump1090")
1018 (version "3.8.1")
1019 (source
1020 (origin
1021 (method git-fetch)
1022 (uri (git-reference
b0e7b699 1023 (url "https://github.com/flightaware/dump1090")
4fca1bc5
GLV
1024 (commit (string-append "v" version))))
1025 (file-name (git-file-name name version))
1026 (sha256
1027 (base32 "0xg8rzrxqklx1m9ncxsd96dlkbjcsxfi2mrb859v50f07xysdyd8"))))
1028 (build-system gnu-build-system)
1029 (native-inputs
1030 `(("pkg-config" ,pkg-config)))
1031 (inputs
1032 `(("libusb" ,libusb)
1033 ("ncurses" ,ncurses)
1034 ("rtl-sdr" ,rtl-sdr)))
1035 (arguments
1036 `(#:test-target "test"
19e8a754 1037 #:make-flags
1ca44ae3
MB
1038 (list (string-append "CC=" ,(cc-for-target))
1039 "BLADERF=no")
4fca1bc5
GLV
1040 #:phases
1041 (modify-phases %standard-phases
19e8a754 1042 (delete 'configure)
4fca1bc5
GLV
1043 (replace 'install
1044 (lambda* (#:key outputs #:allow-other-keys)
1045 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
1046 (install-file "dump1090" bin)
1047 (install-file "view1090" bin)
1048 #t))))))
1049 (synopsis "Mode S decoder for rtl-sdr devices")
1050 (description
1051 "Dump1090 is a Mode S decoder specifically designed for rtl-sdr devices.
1052It can be used to decode the ADS-B signals that planes emit to indicate
1053their position, altitude, speed, etc.")
1054 (home-page "https://github.com/flightaware/dump1090")
1055 (license license:bsd-3)))
232f2d26
GLV
1056
1057(define-public rtl-433
1058 (package
1059 (name "rtl-433")
1060 (version "20.02")
1061 (source
1062 (origin
1063 (method git-fetch)
1064 (uri (git-reference
b0e7b699 1065 (url "https://github.com/merbanan/rtl_433")
232f2d26
GLV
1066 (commit version)))
1067 (file-name (git-file-name name version))
1068 (sha256
1069 (base32 "11991xky9gawkragdyg27qsf7kw5bhlg7ygvf3fn7ng00x4xbh1z"))))
1070 (build-system cmake-build-system)
1071 (native-inputs
1072 `(("pkg-config" ,pkg-config)))
1073 (inputs
1074 `(("libusb" ,libusb)
1075 ("rtl-sdr" ,rtl-sdr)))
1076 (synopsis "Decoder for radio transmissions in ISM bands")
1077 (description
1078 "This is a generic data receiver, mainly for decoding radio transmissions
1079from devices on the 433 MHz, 868 MHz, 315 MHz, 345 MHz and 915 MHz ISM bands.")
1080 (home-page "https://github.com/merbanan/rtl_433")
1081 (license license:gpl2+)))
8fdd0da4
GLV
1082
1083(define-public multimon-ng
1084 (package
1085 (name "multimon-ng")
2606d947 1086 (version "1.1.9")
8fdd0da4
GLV
1087 (source
1088 (origin
1089 (method git-fetch)
1090 (uri (git-reference
b0e7b699 1091 (url "https://github.com/EliasOenal/multimon-ng")
8fdd0da4
GLV
1092 (commit version)))
1093 (file-name (git-file-name name version))
1094 (sha256
2606d947 1095 (base32 "01716cfhxfzsab9zjply9giaa4nn4b7rm3p3vizrwi7n253yiwm2"))))
8fdd0da4
GLV
1096 (build-system cmake-build-system)
1097 (inputs
1098 `(("libx11" ,libx11)
1099 ("pulseaudio" ,pulseaudio)))
1100 (arguments
2606d947 1101 '(#:tests? #f)) ; no test suite
8fdd0da4
GLV
1102 (home-page "https://github.com/EliasOenal/multimon-ng")
1103 (synopsis "Decoder for digital radio transmission modes")
1104 (description "Multimon-ng can decode several digital radio transmission
1105modes:
1106@itemize
1107@item POCSAG512, POCSAG1200, POCSAG2400
1108@item FLEX
1109@item EAS
1110@item UFSK1200, CLIPFSK, AFSK1200, AFSK2400, AFSK2400_2, AFSK2400_3
1111@item HAPN4800
1112@item FSK9600
1113@item DTMF
1114@item ZVEI1, ZVEI2, ZVEI3, DZVEI, PZVEI
1115@item EEA, EIA, CCIR
1116@item MORSE CW
1117@item X10
1118@end itemize")
1119 (license license:gpl2+)))