gnu: Add xnec2c.
[jackhill/guix/guix.git] / gnu / packages / radio.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017, 2018, 2019 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 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
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.
15 ;;;
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.
20 ;;;
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/>.
23
24 (define-module (gnu packages radio)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (gnu packages algebra)
30 #:use-module (gnu packages audio)
31 #:use-module (gnu packages autotools)
32 #:use-module (gnu packages base)
33 #:use-module (gnu packages bash)
34 #:use-module (gnu packages boost)
35 #:use-module (gnu packages check)
36 #:use-module (gnu packages documentation)
37 #:use-module (gnu packages engineering)
38 #:use-module (gnu packages fltk)
39 #:use-module (gnu packages gcc)
40 #:use-module (gnu packages gd)
41 #:use-module (gnu packages ghostscript)
42 #:use-module (gnu packages glib)
43 #:use-module (gnu packages gstreamer)
44 #:use-module (gnu packages gtk)
45 #:use-module (gnu packages image)
46 #:use-module (gnu packages libusb)
47 #:use-module (gnu packages linux)
48 #:use-module (gnu packages logging)
49 #:use-module (gnu packages lua)
50 #:use-module (gnu packages maths)
51 #:use-module (gnu packages multiprecision)
52 #:use-module (gnu packages networking)
53 #:use-module (gnu packages pkg-config)
54 #:use-module (gnu packages pulseaudio)
55 #:use-module (gnu packages python)
56 #:use-module (gnu packages python-science)
57 #:use-module (gnu packages python-xyz)
58 #:use-module (gnu packages qt)
59 #:use-module (gnu packages readline)
60 #:use-module (gnu packages ruby)
61 #:use-module (gnu packages sphinx)
62 #:use-module (gnu packages swig)
63 #:use-module (gnu packages tcl)
64 #:use-module (gnu packages tex)
65 #:use-module (gnu packages texinfo)
66 #:use-module (gnu packages version-control)
67 #:use-module (gnu packages xml)
68 #:use-module (gnu packages xorg)
69 #:use-module (guix build-system cmake)
70 #:use-module (guix build-system glib-or-gtk)
71 #:use-module (guix build-system gnu)
72 #:use-module (guix build-system python)
73 #:use-module (guix build-system qt))
74
75 (define-public liquid-dsp
76 (package
77 (name "liquid-dsp")
78 (version "1.3.2")
79 (source
80 (origin (method git-fetch)
81 (uri (git-reference
82 (url "https://github.com/jgaeddert/liquid-dsp.git")
83 (commit (string-append "v" version))))
84 (file-name (git-file-name name version))
85 (sha256
86 (base32 "1n6dbg13q8ga5qhg1yiszwly4jj0rxqr6f1xwm9waaly5z493xsd"))))
87 (build-system gnu-build-system)
88 (native-inputs
89 `(("autoconf" ,autoconf)))
90 (inputs
91 `(("fftw" ,fftw)
92 ("fftwf" ,fftwf)))
93 (home-page "https://liquidsdr.org")
94 (synopsis "Signal processing library for software-defined radios")
95 (description
96 "Liquid DSP is a @dfn{digital signal processing} (DSP) library designed
97 specifically for software-defined radios on embedded platforms. The aim is to
98 provide a lightweight DSP library that does not rely on a myriad of external
99 dependencies or proprietary and otherwise cumbersome frameworks. All signal
100 processing elements are designed to be flexible, scalable, and dynamic,
101 including filters, filter design, oscillators, modems, synchronizers, complex
102 mathematical operations, and much more.")
103 (license license:expat)))
104
105 (define-public rtl-sdr
106 (package
107 (name "rtl-sdr")
108 (version "0.6.0")
109 (source
110 (origin
111 (method git-fetch)
112 (uri (git-reference
113 (url "git://git.osmocom.org/rtl-sdr.git")
114 (commit version)))
115 (file-name (git-file-name name version))
116 (sha256
117 (base32
118 "0lmvsnb4xw4hmz6zs0z5ilsah5hjz29g1s0050n59fllskqr3b8k"))))
119 (build-system cmake-build-system)
120 (inputs
121 `(("libusb" ,libusb)))
122 (native-inputs
123 `(("pkg-config" ,pkg-config)))
124 (arguments
125 `(#:configure-flags '("-DDETACH_KERNEL_DRIVER=ON")
126 #:tests? #f)) ; No tests
127 (home-page "https://osmocom.org/projects/sdr/wiki/rtl-sdr")
128 (synopsis "Software defined radio driver for Realtek RTL2832U")
129 (description "DVB-T dongles based on the Realtek RTL2832U can be used as a
130 cheap software defined radio, since the chip allows transferring the raw I/Q
131 samples to the host. @code{rtl-sdr} provides drivers for this purpose.")
132 (license license:gpl2+)))
133
134 (define-public chirp
135 (package
136 (name "chirp")
137 (version "20181205")
138 (source
139 (origin
140 (method url-fetch)
141 (uri (string-append "https://trac.chirp.danplanet.com/chirp_daily/daily-"
142 version "/chirp-daily-" version ".tar.gz"))
143 (sha256
144 (base32
145 "1cp280b95j39xaxs50zn55jigg7pyfpm9n098hmsyxrplqn8z43c"))))
146 (build-system python-build-system)
147 (inputs
148 `(("python2-libxml2" ,python2-libxml2)
149 ("python2-pygtk" ,python2-pygtk)
150 ("python2-pyserial" ,python2-pyserial)))
151 (arguments
152 `(#:python ,python-2))
153 (home-page "https://chirp.danplanet.com")
154 (synopsis "Cross-radio programming tool")
155 (description "Chirp is a cross-radio programming tool. It supports a
156 growing list of radios across several manufacturers and allows transferring of
157 memory contents between them.")
158 (license (list license:gpl3+
159 license:lgpl3+)))) ; chirp/elib_intl.py
160
161 (define-public aptdec
162 (package
163 (name "aptdec")
164 (version "1.7")
165 (source
166 (origin
167 (method git-fetch)
168 (uri (git-reference
169 (url "https://github.com/csete/aptdec")
170 (commit (string-append "v" version))))
171 (file-name (git-file-name name version))
172 (sha256
173 (base32
174 "1hf0zb51qc6fyhdjxyij1n3vgwnw3cwksc3r11szbhkml14qjnzk"))))
175 (build-system gnu-build-system)
176 (inputs
177 `(("libpng" ,libpng)
178 ("libsndfile" ,libsndfile)))
179 (arguments
180 `(#:make-flags (list "CC=gcc")
181 #:tests? #f ; no tests
182 #:phases
183 (modify-phases %standard-phases
184 (delete 'configure)
185 (replace 'install
186 (lambda* (#:key outputs #:allow-other-keys)
187 (let ((out (assoc-ref outputs "out")))
188 (install-file "atpdec" (string-append out "/bin")))
189 #t)))))
190 (home-page "https://github.com/csete/aptdec")
191 (synopsis "NOAA Automatic Picture Transmission (APT) decoder")
192 (description "Aptdec decodes Automatic Picture Transmission (APT) images.
193 These are medium resolution images of the Earth transmitted by, among other
194 satellites, the POES NOAA weather satellite series. These transmissions are
195 on a frequency of 137 MHz. They can be received using an inexpensive antenna
196 and a dedicated receiver.")
197 (license license:gpl2+)))
198
199 (define-public redsea
200 (package
201 (name "redsea")
202 (version "0.18")
203 (source (origin
204 (method git-fetch)
205 (uri (git-reference
206 (url "https://github.com/windytan/redsea")
207 (commit (string-append "v" version))))
208 (file-name (git-file-name name version))
209 (sha256
210 (base32
211 "1y96g0ra2krjb2kypm8s5gdfia45yci4f36klsvyzg8d53v5cwhn"))))
212 (build-system gnu-build-system)
213 (arguments
214 `(#:phases
215 (modify-phases %standard-phases
216 ;; The configure.ac file does not explicitly link against libiconv
217 ;; except on Mac OS, causing the build to fail. This phase comments
218 ;; out the original AC_SUBST macro (located inside a conditional) and
219 ;; adds an explicit use of it underneath, so that libiconv is always
220 ;; linked against.
221 (add-after 'unpack 'patch-libiconv
222 (lambda _
223 (substitute* "configure.ac"
224 (("^ +AC_SUBST")
225 "# AC_SUBST")
226 (("esac")
227 "esac\nAC_SUBST([ICONV], [\"-liconv\"])"))
228 #t)))))
229 (inputs
230 `(("libiconv" ,libiconv)
231 ("libsndfile" ,libsndfile)
232 ("liquid-dsp" ,liquid-dsp)))
233 (native-inputs
234 `(("autoconf" ,autoconf)
235 ("automake" ,automake)))
236 (home-page "https://github.com/windytan/redsea")
237 (synopsis "Lightweight RDS to JSON decoder")
238 (description "redsea is a lightweight command-line @dfn{FM Radio Data
239 System} (FM-RDS) decoder. Redsea can be used with any RTL-SDR USB radio stick
240 with the rtl_fm tool, or any other @dfn{software-defined radio} (SDR) via
241 csdr, for example. It can also decode raw ASCII bitstream, the hex format
242 used by RDS Spy, and audio files containing @dfn{multiplex} signals (MPX).")
243 (license license:expat)))
244
245 (define-public gnuradio
246 (package
247 (name "gnuradio")
248 (version "3.8.0.0")
249 (source
250 (origin
251 (method url-fetch)
252 (uri (string-append "https://www.gnuradio.org/releases/gnuradio/"
253 "gnuradio-" version ".tar.xz"))
254 (sha256
255 (base32 "0aw55gf5549b0fz2qdi7vplcmaf92bj34h40s34b2ycnqasv900r"))
256 (modules '((guix build utils)))
257 (snippet
258 '(begin
259 ;; Delete bundled volk to use the shared one.
260 (delete-file-recursively "volk")
261 #t))))
262 (build-system cmake-build-system)
263 (native-inputs
264 `(("doxygen" ,doxygen)
265 ("git" ,git-minimal)
266 ("ghostscript" ,ghostscript)
267 ("orc" ,orc)
268 ("pkg-config" ,pkg-config)
269 ("python" ,python)
270 ("python-cheetah" ,python-cheetah)
271 ("python-mako" ,python-mako)
272 ("python-pyzmq" ,python-pyzmq)
273 ("python-scipy" ,python-scipy)
274 ("python-sphinx" ,python-sphinx)
275 ("swig" ,swig)
276 ("texlive" ,(texlive-union (list texlive-amsfonts
277 texlive-latex-amsmath
278 ;; TODO: Add newunicodechar.
279 texlive-latex-graphics)))
280 ("xorg-server" ,xorg-server-for-tests)))
281 (inputs
282 `(("alsa-lib" ,alsa-lib)
283 ("boost" ,boost)
284 ("cairo" ,cairo)
285 ("codec2" ,codec2)
286 ("cppzmq" ,cppzmq)
287 ("fftwf" ,fftwf)
288 ("gmp" ,gmp)
289 ("gsl" ,gsl)
290 ("gsm" ,gsm)
291 ("gtk+" ,gtk+)
292 ("jack" ,jack-1)
293 ("log4cpp" ,log4cpp)
294 ("pango" ,pango)
295 ("portaudio" ,portaudio)
296 ("python-click" ,python-click)
297 ("python-click-plugins" ,python-click-plugins)
298 ("python-lxml" ,python-lxml)
299 ("python-numpy" ,python-numpy)
300 ("python-pycairo" ,python-pycairo)
301 ("python-pygobject" ,python-pygobject)
302 ("python-pyqt" ,python-pyqt)
303 ("python-pyyaml" ,python-pyyaml)
304 ("qtbase" ,qtbase)
305 ("qwt" ,qwt)
306 ("volk" ,volk)
307 ("zeromq" ,zeromq)))
308 (arguments
309 `(#:modules ((guix build cmake-build-system)
310 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
311 ((guix build python-build-system) #:prefix python:)
312 (guix build utils)
313 (ice-9 match))
314 #:imported-modules (,@%cmake-build-system-modules
315 (guix build glib-or-gtk-build-system)
316 (guix build python-build-system))
317 #:configure-flags
318 '("-DENABLE_INTERNAL_VOLK=OFF")
319 #:phases
320 (modify-phases %standard-phases
321 (add-after 'unpack 'fix-paths
322 (lambda* (#:key inputs #:allow-other-keys)
323 (let ((qwt (assoc-ref inputs "qwt")))
324 (substitute* "cmake/Modules/FindQwt.cmake"
325 (("/usr/include")
326 (string-append qwt "/include"))
327 (("/usr/lib")
328 (string-append qwt "/lib"))
329 (("qwt6-\\$\\{QWT_QT_VERSION\\}")
330 "qwt")))
331 (substitute* "cmake/Modules/GrPython.cmake"
332 (("dist-packages")
333 "site-packages"))
334 (substitute* '("gr-vocoder/swig/vocoder_swig.i"
335 "gr-vocoder/include/gnuradio/vocoder/codec2.h"
336 "gr-vocoder/include/gnuradio/vocoder/freedv_api.h")
337 (("<codec2/")
338 "<"))
339 #t))
340 (add-before 'check 'set-test-environment
341 (lambda* (#:key inputs #:allow-other-keys)
342 (setenv "HOME" "/tmp")
343 (system (string-append (assoc-ref inputs "xorg-server")
344 "/bin/Xvfb :1 &"))
345 (setenv "DISPLAY" ":1")
346 #t))
347 (add-after 'install 'wrap-python
348 (assoc-ref python:%standard-phases 'wrap))
349 (add-after 'wrap-python 'wrap-glib-or-gtk
350 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
351 (add-after 'wrap-glib-or-gtk 'wrap-with-GI_TYPELIB_PATH
352 (lambda* (#:key inputs outputs #:allow-other-keys)
353 (let ((out (assoc-ref outputs "out"))
354 (paths (map (match-lambda
355 ((output . directory)
356 (let ((girepodir (string-append
357 directory
358 "/lib/girepository-1.0")))
359 (if (file-exists? girepodir)
360 girepodir
361 #f))))
362 inputs)))
363 (wrap-program (string-append out "/bin/gnuradio-companion")
364 `("GI_TYPELIB_PATH" ":" prefix ,(filter identity paths))))
365 #t)))))
366 (synopsis "Toolkit for software-defined radios")
367 (description
368 "GNU Radio is a development toolkit that provides signal processing blocks
369 to implement software radios. It can be used with external RF hardware to
370 create software-defined radios, or without hardware in a simulation-like
371 environment.")
372 (home-page "https://www.gnuradio.org")
373 (license license:gpl3+)))
374
375 (define-public gnuradio-osmosdr
376 (package
377 (name "gnuradio-osmosdr")
378 (version "0.2.0")
379 (source
380 (origin
381 (method git-fetch)
382 (uri (git-reference
383 (url "https://git.osmocom.org/gr-osmosdr")
384 (commit (string-append "v" version))))
385 (file-name (git-file-name name version))
386 (sha256
387 (base32 "1rdx7fa0xiq0qmgrrbby7z1bblmqhl9qh9jqpsznzxkx91f17ypd"))))
388 (build-system cmake-build-system)
389 (native-inputs
390 `(("doxygen" ,doxygen)
391 ("git" ,git-minimal)
392 ("pkg-config" ,pkg-config)
393 ("python" ,python)
394 ("python-mako" ,python-mako)
395 ("python-six" ,python-six)
396 ("swig" ,swig)))
397 (inputs
398 `(("boost" ,boost)
399 ("fftwf" ,fftwf)
400 ("gmp" ,gmp)
401 ("gnuradio" ,gnuradio)
402 ("hackrf" ,hackrf)
403 ("log4cpp" ,log4cpp)
404 ("rtl-sdr" ,rtl-sdr)
405 ("volk" ,volk)))
406 (synopsis "GNU Radio block for interfacing with various radio hardware")
407 (description "This is a block for GNU Radio allowing to use a common API
408 to access different radio hardware.")
409 (home-page "https://osmocom.org/projects/gr-osmosdr/wiki/GrOsmoSDR")
410 (license license:gpl3+)))
411
412 (define-public libosmo-dsp
413 (package
414 (name "libosmo-dsp")
415 (version "0.4.0")
416 (source
417 (origin
418 (method git-fetch)
419 (uri (git-reference
420 (url "https://git.osmocom.org/libosmo-dsp")
421 (commit version)))
422 (file-name (git-file-name name version))
423 (sha256
424 (base32 "00plihnpym1gkfpflah8il9463qxzm9kx2f07jyvbkszpj8viq5g"))))
425 (build-system gnu-build-system)
426 (native-inputs
427 `(("autoconf" ,autoconf)
428 ("automake" ,automake)
429 ("bash-minimal" ,bash-minimal)
430 ("doxygen" ,doxygen)
431 ("git" ,git-minimal)
432 ("libtool" ,libtool)
433 ("pkg-config" ,pkg-config)
434 ("texlive" ,(texlive-union (list texlive-amsfonts
435 texlive-latex-amsmath
436 ;; TODO: Add newunicodechar.
437 texlive-latex-graphics)))))
438 (inputs
439 `(("fftwf" ,fftwf)))
440 (arguments
441 `(#:phases
442 (modify-phases %standard-phases
443 (add-after 'unpack 'fix-paths
444 (lambda* (#:key inputs #:allow-other-keys)
445 (substitute* "git-version-gen"
446 (("/bin/sh")
447 (string-append (assoc-ref inputs "bash")
448 "/bin/bash")))
449 #t)))))
450 (synopsis "DSP primitives for SDR")
451 (description
452 "This a C-language library for common DSP (Digital Signal Processing)
453 primitives for SDR (Software Defined Radio).")
454 (home-page "https://osmocom.org/projects/libosmo-dsp")
455 (license license:gpl2+)))
456
457 (define-public gnuradio-iqbalance
458 (package
459 (name "gnuradio-iqbalance")
460 (version "0.38.1")
461 (source
462 (origin
463 (method git-fetch)
464 (uri (git-reference
465 (url "https://git.osmocom.org/gr-iqbal")
466 (commit (string-append "v" version))))
467 (file-name (git-file-name name version))
468 (sha256
469 (base32 "0ksagwz05p3b0702q7ljq7013xmp0ijp30my9z6s3p7ja8dj42s3"))))
470 (build-system cmake-build-system)
471 (native-inputs
472 `(("doxygen" ,doxygen)
473 ("pkg-config" ,pkg-config)
474 ("python" ,python)
475 ("python-numpy" ,python-numpy)
476 ("python-six" ,python-six)
477 ("swig" ,swig)))
478 (inputs
479 `(("boost" ,boost)
480 ("fftwf" ,fftwf)
481 ("gmp" ,gmp)
482 ("gnuradio" ,gnuradio)
483 ("libosmo-dsp" ,libosmo-dsp)
484 ("log4cpp" ,log4cpp)
485 ("volk" ,volk)))
486 (synopsis "GNU Radio block to correct IQ imbalance")
487 (description
488 "This is a GNU Radio block to correct IQ imbalance in quadrature
489 receivers. It's composed of two main block:
490 @itemize
491 @item Fix: Given a phase and amplitude error, it will correct a complex signal.
492 @item Optimize: Attempts to auto-detect the phase and amplitude error to feed
493 to the fix block above.
494 @end itemize")
495 (home-page "https://git.osmocom.org/gr-iqbal/")
496 (license license:gpl3+)))
497
498 (define-public gqrx
499 (package
500 (name "gqrx")
501 (version "2.12.1")
502 (source
503 (origin
504 (method git-fetch)
505 (uri (git-reference
506 (url "https://github.com/csete/gqrx.git")
507 (commit (string-append "v" version))))
508 (file-name (git-file-name name version))
509 (sha256
510 (base32 "00alf3q6y313xpx6p7v43vqsphd2x4am4q362lw21bcy9wc4jidw"))))
511 (build-system qt-build-system)
512 (native-inputs
513 `(("pkg-config" ,pkg-config)))
514 (inputs
515 `(("alsa-lib" ,alsa-lib)
516 ("boost" ,boost)
517 ("fftwf" ,fftwf)
518 ("gmp" ,gmp)
519 ("gnuradio" ,gnuradio)
520 ("gnuradio-iqbalance" ,gnuradio-iqbalance)
521 ("gnuradio-osmosdr" ,gnuradio-osmosdr)
522 ("jack" ,jack-1)
523 ("log4cpp" ,log4cpp)
524 ("portaudio" ,portaudio)
525 ("pulseaudio" ,pulseaudio)
526 ("qtbase" ,qtbase)
527 ("qtsvg" ,qtsvg)
528 ("volk" ,volk)))
529 (arguments
530 `(#:tests? #f)) ; No tests
531 (synopsis "Software defined radio receiver")
532 (description "Gqrx is a software defined radio (SDR) receiver implemented
533 using GNU Radio and the Qt GUI toolkit.")
534 (home-page "https://gqrx.dk/")
535 (license license:gpl3+)))
536
537 (define-public fldigi
538 (package
539 (name "fldigi")
540 (version "4.1.12")
541 (source
542 (origin
543 (method url-fetch)
544 (uri (string-append "http://www.w1hkj.com/files/fldigi/fldigi-"
545 version ".tar.gz"))
546 (sha256
547 (base32 "1yjjv2ss84xfiaidypp476mhrbpnw4zf7mb5cdqwhdh604x0svr1"))))
548 (build-system gnu-build-system)
549 (native-inputs
550 `(("pkg-config" ,pkg-config)))
551 (inputs
552 `(("alsa-lib" ,alsa-lib)
553 ("fltk" ,fltk)
554 ("hamlib" ,hamlib)
555 ("libpng" ,libpng)
556 ("libsamplerate" ,libsamplerate)
557 ("libusb" ,libusb)
558 ("libx11" ,libx11)
559 ("libxext" ,libxext)
560 ("libxfixes" ,libxfixes)
561 ("libxft" ,libxft)
562 ("portaudio" ,portaudio)
563 ("pulseaudio" ,pulseaudio)))
564 (synopsis "Software modem for amateur radio use")
565 (description
566 "Fldigi is a software modem for amateur radio use. It is a sound card
567 based program that is used for both transmitting and receiving data by
568 connecting the microphone and headphone connections of a computer to some radio
569 hardware.")
570 (home-page "http://www.w1hkj.com/")
571 (license license:gpl3+)))
572
573 (define-public flrig
574 (package
575 (name "flrig")
576 (version "1.3.50")
577 (source
578 (origin
579 (method url-fetch)
580 (uri (string-append "http://www.w1hkj.com/files/flrig/flrig-"
581 version ".tar.gz"))
582 (sha256
583 (base32 "0fzrknzzi8kmzmrcfpc8rxr7v4a4ny6z6z5q5qwh95sp2kn2qzp9"))))
584 (build-system gnu-build-system)
585 (native-inputs
586 `(("pkg-config" ,pkg-config)))
587 (inputs
588 `(("fltk" ,fltk)
589 ("libx11" ,libx11)
590 ("libxext" ,libxext)
591 ("libxfixes" ,libxfixes)
592 ("libxft" ,libxft)))
593 (synopsis "Radio transceiver control program")
594 (description
595 "Flrig is a transceiver control program for amateur radio use.
596 It provides computer aided control of various radios using a serial
597 or USB connection.")
598 (home-page "http://www.w1hkj.com/")
599 (license license:gpl3+)))
600
601 (define-public flamp
602 (package
603 (name "flamp")
604 (version "2.2.05")
605 (source
606 (origin
607 (method url-fetch)
608 (uri (string-append "http://www.w1hkj.com/files/flamp/flamp-"
609 version ".tar.gz"))
610 (sha256
611 (base32 "19z1kghhdf7bq6hi2j0mzlsn2nhpn3gl1a623x3inmsk80yw3ck4"))))
612 (build-system gnu-build-system)
613 (native-inputs
614 `(("pkg-config" ,pkg-config)))
615 (inputs
616 `(("fltk" ,fltk)
617 ("libx11" ,libx11)
618 ("libxext" ,libxext)
619 ("libxfixes" ,libxfixes)
620 ("libxft" ,libxft)))
621 (synopsis "Tool for AMP file transfer")
622 (description
623 "FLAMP is a program for transfering files by radio waves using AMP
624 (Amateur Multicast Protocol).")
625 (home-page "http://www.w1hkj.com/")
626 (license license:gpl3+)))
627
628 (define-public flwrap
629 (package
630 (name "flwrap")
631 (version "1.3.5")
632 (source
633 (origin
634 (method url-fetch)
635 (uri (string-append "http://www.w1hkj.com/files/flwrap/flwrap-"
636 version ".tar.gz"))
637 (sha256
638 (base32 "0qqivqkkravcg7j45740xfky2q3k7czqpkj6y364qff424q2pppg"))))
639 (build-system gnu-build-system)
640 (native-inputs
641 `(("pkg-config" ,pkg-config)))
642 (inputs
643 `(("fltk" ,fltk)
644 ("libx11" ,libx11)
645 ("libxext" ,libxext)
646 ("libxfixes" ,libxfixes)
647 ("libxft" ,libxft)))
648 (synopsis "File encapsulation program")
649 (description
650 "Flwrap is a software utility for amateur radio use. Its purpose is to
651 encapsulate both text and binary files in a way that allows them to be
652 transmitted over any of several digital modes and verified at the receipt end
653 for correctness.")
654 (home-page "http://www.w1hkj.com/")
655 (license license:gpl3+)))
656
657 (define-public hackrf
658 ;; Using a git commit because there have been many many commits
659 ;; since the relase two years ago, but no sign of a promised
660 ;; release for many months now.
661 (let ((commit "43e6f99fe8543094d18ff3a6550ed2066c398862")
662 (revision "0"))
663 (package
664 (name "hackrf")
665 (version (git-version "2018.01.1" revision commit))
666 (source
667 (origin
668 (method git-fetch)
669 (uri (git-reference
670 (url "https://github.com/mossmann/hackrf.git")
671 (commit commit)))
672 (file-name (git-file-name name version))
673 (sha256
674 (base32 "0avnv693xi0zsnrvkbfn0ln1r3s1iyj0bz7sc3gxay909av0pvbc"))))
675 (build-system cmake-build-system)
676 (arguments
677 '(#:configure-flags
678 (list "-DUDEV_RULES_GROUP=dialout"
679 (string-append "-DUDEV_RULES_PATH="
680 (assoc-ref %outputs "out")
681 "/lib/udev/rules.d"))
682 #:phases
683 (modify-phases %standard-phases
684 (add-before 'configure 'enter-source-directory
685 (lambda _
686 (chdir "host")
687 #t))
688 (add-after 'install 'delete-static-library
689 (lambda* (#:key outputs #:allow-other-keys)
690 (delete-file (string-append (assoc-ref outputs "out")
691 "/lib/libhackrf.a"))
692 #t))
693 (add-before 'install-license-files 'leave-source-directory
694 (lambda _
695 (chdir "..")
696 #t)))
697 #:tests? #f)) ; no test suite
698 (native-inputs
699 `(("pkg-config" ,pkg-config)))
700 (inputs
701 `(("fftw" ,fftw)
702 ("fftwf" ,fftwf)
703 ("libusb" ,libusb)))
704 (home-page "https://greatscottgadgets.com/hackrf/")
705 (synopsis "User-space library and utilities for HackRF SDR")
706 (description
707 "Command line utilities and a C library for controlling the HackRF
708 Software Defined Radio (SDR) over USB. Installing this package installs
709 the userspace hackrf utilities and C library. To install the hackrf
710 udev rules, you must add this package as a system service via
711 modify-services. E.g.:
712
713 @lisp
714 (services
715 (modify-services
716 %desktop-services
717 (udev-service-type config =>
718 (udev-configuration (inherit config)
719 (rules (cons hackrf
720 (udev-configuration-rules config)))))))
721 @end lisp")
722 (license license:gpl2))))
723
724 (define-public hamlib
725 (package
726 (name "hamlib")
727 (version "3.3")
728 (source
729 (origin
730 (method url-fetch)
731 (uri (string-append
732 "https://github.com/Hamlib/Hamlib/releases/download/"
733 version "/hamlib-" version ".tar.gz"))
734 (sha256
735 (base32 "10788mgrhbc57zpzakcxv5aqnr2819pcshml6fbh8zvnkja562y9"))))
736 (build-system gnu-build-system)
737 (native-inputs
738 `(("doxygen" ,doxygen)
739 ("lua" ,lua)
740 ("pkg-config" ,pkg-config)
741 ("python-wrapper" ,python-wrapper)
742 ("swig" ,swig)
743 ("tcl" ,tcl)))
744 (inputs
745 `(("gd" ,gd)
746 ("libusb" ,libusb)
747 ("libxml2" ,libxml2)
748 ("readline" ,readline)))
749 (arguments
750 `(#:configure-flags '("--disable-static"
751 "--with-lua-binding"
752 "--with-python-binding"
753 "--with-tcl-binding"
754 "--with-xml-support")))
755 (synopsis "Tools and API to control radios")
756 (description
757 "The Ham Radio Control Library (Hamlib) is a project to provide programs
758 with a consistent Application Programming Interface (API) for controlling the
759 myriad of radios and rotators available to amateur radio and communications
760 users.")
761 (home-page "https://hamlib.github.io/")
762 (license (list license:gpl2+ license:lgpl2.1+))))
763
764 (define wsjtx-hamlib
765 ;; Fork of hamlib with custom patches used by wsjtx.
766 (package
767 (inherit hamlib)
768 (name "wsjtx-hamlib")
769 (version "2.1.2")
770 (source
771 (origin
772 (method git-fetch)
773 (uri (git-reference
774 (url "https://git.code.sf.net/u/bsomervi/hamlib.git")
775 (commit (string-append "wsjtx-" version))))
776 (file-name (git-file-name name version))
777 (sha256
778 (base32 "1ksv3cmr1dl45p0pp1panyc9dngd158gvv9ysv25lq4nqv1wn87i"))))
779 (native-inputs
780 `(("autoconf" ,autoconf)
781 ("automake" ,automake)
782 ("libtool" ,libtool)
783 ("texinfo" ,texinfo)
784 ,@(package-native-inputs hamlib)))))
785
786 (define-public wsjtx
787 (package
788 (name "wsjtx")
789 (version "2.1.2")
790 (source
791 (origin
792 (method git-fetch)
793 (uri (git-reference
794 (url "https://git.code.sf.net/p/wsjt/wsjtx.git")
795 (commit (string-append "wsjtx-" version))))
796 (file-name (git-file-name name version))
797 (sha256
798 (base32 "1fnqzjd3dmxp3yjwjvwz2djk9gzb1y2cqfa188f3x8lynxhdhnfs"))
799 (modules '((guix build utils)))
800 (snippet
801 '(begin
802 ;; Delete bundled boost to use the shared one.
803 (delete-file-recursively "boost")
804 #t))))
805 (build-system qt-build-system)
806 (native-inputs
807 `(("asciidoc" ,asciidoc)
808 ("gfortran" ,gfortran)
809 ("pkg-config" ,pkg-config)
810 ("qttools" ,qttools)
811 ("ruby-asciidoctor" ,ruby-asciidoctor)))
812 (inputs
813 `(("boost" ,boost)
814 ("fftw" ,fftw)
815 ("fftwf" ,fftwf)
816 ("hamlib" ,wsjtx-hamlib)
817 ("libusb" ,libusb)
818 ("qtbase" ,qtbase)
819 ("qtmultimedia" ,qtmultimedia)
820 ("qtserialport" ,qtserialport)))
821 (arguments
822 `(#:tests? #f)) ; No test suite
823 (synopsis "Weak-signal ham radio communication program")
824 (description
825 "WSJT-X implements communication protocols or modes called FT4, FT8,
826 JT4, JT9, JT65, QRA64, ISCAT, MSK144, and WSPR, as well as one called Echo for
827 detecting and measuring your own radio signals reflected from the Moon. These
828 modes were all designed for making reliable, confirmed QSOs under extreme
829 weak-signal conditions.")
830 (home-page "https://www.physics.princeton.edu/pulsar/k1jt/wsjtx.html")
831 (license license:gpl3)))
832
833 (define-public xnec2c
834 (package
835 (name "xnec2c")
836 (version "4.1.1")
837 (source
838 (origin
839 (method url-fetch)
840 (uri (string-append "http://www.5b4az.org/pkg/nec2/xnec2c/xnec2c-"
841 version ".tar.bz2"))
842 (sha256
843 (base32 "1myvlkfybb2ha8l0h96ca3iz206zzy9z5iizm0sbab2zzp78n1r9"))))
844 (build-system gnu-build-system)
845 (native-inputs
846 `(("pkg-config" ,pkg-config)))
847 (inputs
848 `(("gtk+" ,gtk+)))
849 (arguments
850 `(#:phases
851 (modify-phases %standard-phases
852 (add-after 'unpack 'fix-makefile
853 (lambda* (#:key outputs #:allow-other-keys)
854 (substitute* '("Makefile.am" "Makefile.in")
855 ;; The DESTDIR variable does not get replaced the prefix
856 ;; in the final Makefile, so let's do here.
857 (("\\$\\(DESTDIR\\)/usr")
858 (assoc-ref outputs "out")))
859 #t))
860 (add-after 'fix-makefile 'fix-paths
861 (lambda* (#:key outputs #:allow-other-keys)
862 ;; Increase the max length of the path to the glade file,
863 ;; so that the '/gnu/store/...' path can fit in.
864 (substitute* '("src/shared.c" "src/shared.h")
865 (("char xnec2c_glade\\[64\\];")
866 "char xnec2c_glade[256];"))
867 ;; Fix hard coded references to '/usr/...'.
868 (substitute* '("src/geom_edit.c" "src/main.c")
869 (("\"/usr")
870 (string-append "\"" (assoc-ref outputs "out"))))
871 #t)))))
872 (synopsis "Antenna modeling software")
873 (description
874 "Xnec2c is a GTK3-based graphical version of nec2c, a translation to the
875 C language of NEC2, the FORTRAN Numerical Electromagnetics Code commonly used
876 for antenna simulation and analysis. It can be used to define the geometry of
877 an antenna, and then plot the radiation pattern or frequency-related data like
878 gain and standing wave ratio.")
879 (home-page "http://www.5b4az.org/")
880 (license license:gpl3+)))