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