gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / electronics.scm
CommitLineData
03d0cc11 1;;; GNU Guix --- Functional package management for GNU
d109b1e8 2;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
1e4b80ad 3;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
79f0bd7f 4;;; Copyright © 2019 Clément Lassieur <clement@lassieur.org>
a481c55d 5;;; Copyright © 2021 Efraim Flashner <efraim@flashner.co.il>
c35157f7 6;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
03d0cc11
TF
7;;;
8;;; This file is part of GNU Guix.
9;;;
10;;; GNU Guix is free software; you can redistribute it and/or modify it
11;;; under the terms of the GNU General Public License as published by
12;;; the Free Software Foundation; either version 3 of the License, or (at
13;;; your option) any later version.
14;;;
15;;; GNU Guix is distributed in the hope that it will be useful, but
16;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;;; GNU General Public License for more details.
19;;;
20;;; You should have received a copy of the GNU General Public License
21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23(define-module (gnu packages electronics)
24 #:use-module (guix utils)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix build-system gnu)
6df20b5a 29 #:use-module (guix build-system cmake)
c0735802 30 #:use-module (gnu packages)
ffe4f87c 31 #:use-module (gnu packages algebra)
79f0bd7f
CL
32 #:use-module (gnu packages base)
33 #:use-module (gnu packages bash)
6df20b5a 34 #:use-module (gnu packages boost)
c0735802 35 #:use-module (gnu packages check)
1c12be96 36 #:use-module (gnu packages compression)
c0735802 37 #:use-module (gnu packages documentation)
c626e281 38 #:use-module (gnu packages embedded)
79f0bd7f 39 #:use-module (gnu packages gawk)
c0735802
TF
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages graphviz)
ffe4f87c 42 #:use-module (gnu packages gtk)
1c12be96
TF
43 #:use-module (gnu packages libftdi)
44 #:use-module (gnu packages libusb)
ffe4f87c 45 #:use-module (gnu packages linux)
a1017773 46 #:use-module (gnu packages m4)
c0735802 47 #:use-module (gnu packages pkg-config)
7a19de9c 48 #:use-module (gnu packages python)
c626e281 49 #:use-module (gnu packages qt))
03d0cc11
TF
50
51(define-public libserialport
52 (package
53 (name "libserialport")
54 (version "0.1.1")
55 (source (origin
56 (method url-fetch)
57 (uri (string-append
58 "http://sigrok.org/download/source/libserialport/libserialport-"
59 version ".tar.gz"))
60 (sha256
61 (base32
62 "17ajlwgvyyrap8z7f16zcs59pksvncwbmd3mzf98wj7zqgczjaja"))))
63 (build-system gnu-build-system)
01005901 64 (home-page "https://sigrok.org/wiki/Libserialport")
03d0cc11
TF
65 (synopsis "Library for using serial ports")
66 (description "Libserialport is a minimal shared library written in C that is intended
67to take care of the OS-specific details when writing software that uses serial ports.")
68 (license license:lgpl3+)))
c0735802
TF
69
70(define-public libsigrokdecode
71 (package
72 (name "libsigrokdecode")
afeecd92 73 (version "0.5.3")
c0735802
TF
74 (source (origin
75 (method url-fetch)
76 (uri (string-append
77 "http://sigrok.org/download/source/libsigrokdecode/libsigrokdecode-"
78 version ".tar.gz"))
79 (sha256
80 (base32
afeecd92 81 "1h1zi1kpsgf6j2z8j8hjpv1q7n49i3fhqjn8i178rka3cym18265"))))
c0735802
TF
82 (outputs '("out" "doc"))
83 (arguments
84 `(#:phases
85 (modify-phases %standard-phases
86 (add-after 'build 'build-doc
87 (lambda _
7aa6e29d
TGR
88 (invoke "doxygen")
89 #t))
c0735802
TF
90 (add-after 'install 'install-doc
91 (lambda* (#:key outputs #:allow-other-keys)
92 (copy-recursively "doxy/html-api"
93 (string-append (assoc-ref outputs "doc")
94 "/share/doc/libsigrokdecode"))
95 #t)))))
96 (native-inputs
e1409c76 97 `(("check" ,check-0.14)
c0735802
TF
98 ("doxygen" ,doxygen)
99 ("graphviz" ,graphviz)
100 ("pkg-config" ,pkg-config)))
101 ;; libsigrokdecode.pc lists "python" in Requires.private, and "glib" in Requires.
102 (propagated-inputs
103 `(("glib" ,glib)
104 ("python" ,python)))
105 (build-system gnu-build-system)
47800898 106 (home-page "https://www.sigrok.org/wiki/Libsigrokdecode")
c0735802
TF
107 (synopsis "Library providing (streaming) protocol decoding functionality")
108 (description "Libsigrokdecode is a shared library written in C, which provides
109(streaming) protocol decoding functionality.")
110 (license license:gpl3+)))
7a19de9c
TF
111
112(define-public sigrok-firmware-fx2lafw
113 (package
114 (name "sigrok-firmware-fx2lafw")
26efd031 115 (version "0.1.7")
7a19de9c
TF
116 (source (origin
117 (method url-fetch)
118 (uri (string-append
119 "http://sigrok.org/download/source/sigrok-firmware-fx2lafw/"
120 "sigrok-firmware-fx2lafw-" version ".tar.gz"))
121 (sha256
122 (base32
26efd031 123 "0fyfd82mvrcf55v5a3afq1mh1kfswk4c37qrbln6x92jm3b41x53"))))
79f0bd7f
CL
124 (arguments
125 `(#:implicit-inputs? #f))
7a19de9c 126 (native-inputs
79f0bd7f
CL
127 `(("awk" ,gawk)
128 ("bash" ,bash)
129 ("coreutils" ,coreutils)
130 ("grep" ,grep)
131 ("gzip" ,gzip)
132 ("make" ,gnu-make)
133 ("sdcc" ,sdcc)
134 ("sed" ,sed)
135 ("tar" ,tar)))
7a19de9c 136 (build-system gnu-build-system)
47800898 137 (home-page "https://www.sigrok.org/wiki/Fx2lafw")
7a19de9c
TF
138 (synopsis "Firmware for Cypress FX2 chips")
139 (description "Fx2lafw is free firmware for Cypress FX2 chips which makes them usable
140as simple logic analyzer and/or oscilloscope hardware.")
141 (license license:gpl2+)))
1c12be96
TF
142
143(define-public libsigrok
144 (package
145 (name "libsigrok")
4b492dcc 146 (version "0.5.2")
1c12be96
TF
147 (source (origin
148 (method url-fetch)
149 (uri (string-append
150 "http://sigrok.org/download/source/libsigrok/libsigrok-"
151 version ".tar.gz"))
152 (sha256
153 (base32
4b492dcc 154 "0g6fl684bpqm5p2z4j12c62m45j1dircznjina63w392ns81yd2d"))))
1c12be96
TF
155 (outputs '("out" "doc"))
156 (arguments
2fba511e 157 `(#:tests? #f ; tests need USB access
1c12be96
TF
158 #:phases
159 (modify-phases %standard-phases
160 (add-before 'configure 'change-udev-group
161 (lambda _
2fba511e
TGR
162 (substitute* (find-files "contrib" "\\.rules$")
163 (("plugdev") "dialout"))
164 #t))
1c12be96
TF
165 (add-after 'build 'build-doc
166 (lambda _
fbe4a5a2 167 (invoke "doxygen")))
1c12be96
TF
168 (add-after 'install 'install-doc
169 (lambda* (#:key outputs #:allow-other-keys)
170 (copy-recursively "doxy/html-api"
171 (string-append (assoc-ref outputs "doc")
172 "/share/doc/libsigrok"))
173 #t))
174 (add-after 'install-doc 'install-udev-rules
175 (lambda* (#:key outputs #:allow-other-keys)
2fba511e
TGR
176 (let* ((out (assoc-ref outputs "out"))
177 (rules (string-append out "/lib/udev/rules.d/")))
178 (for-each (lambda (file)
179 (install-file file rules))
180 (find-files "contrib" "\\.rules$"))
181 #t)))
1c12be96
TF
182 (add-after 'install-udev-rules 'install-fw
183 (lambda* (#:key inputs outputs #:allow-other-keys)
184 (let* ((fx2lafw (assoc-ref inputs "sigrok-firmware-fx2lafw"))
185 (out (assoc-ref outputs "out"))
186 (dir-suffix "/share/sigrok-firmware/")
187 (input-dir (string-append fx2lafw dir-suffix))
188 (output-dir (string-append out dir-suffix)))
1c12be96
TF
189 (for-each
190 (lambda (file)
191 (install-file file output-dir))
192 (find-files input-dir ".")))
193 #t)))))
194 (native-inputs
406f3f9b 195 `(("doxygen" ,doxygen)
1c12be96
TF
196 ("graphviz" ,graphviz)
197 ("sigrok-firmware-fx2lafw" ,sigrok-firmware-fx2lafw)
198 ("pkg-config" ,pkg-config)))
199 (inputs
200 `(("python" ,python)
201 ("zlib" ,zlib)))
202 ;; libsigrokcxx.pc lists "glibmm" in Requires
203 ;; libsigrok.pc lists "libserialport", "libusb", "libftdi" and "libzip" in
204 ;; Requires.private and "glib" in Requires
205 (propagated-inputs
206 `(("glib" ,glib)
207 ("glibmm" ,glibmm)
208 ("libserialport" ,libserialport)
209 ("libusb" ,libusb)
210 ("libftdi" ,libftdi)
211 ("libzip" ,libzip)))
212 (build-system gnu-build-system)
47800898 213 (home-page "https://www.sigrok.org/wiki/Libsigrok")
1c12be96
TF
214 (synopsis "Library which provides the basic hardware access drivers for logic
215analyzers")
216 (description "@code{libsigrok} is a shared library written in C which provides the basic hardware
217access drivers for logic analyzers and other supported devices, as well as input/output file
218format support.")
219 (license license:gpl3+)))
2dbad1dd
TF
220
221(define-public sigrok-cli
222 (package
223 (name "sigrok-cli")
1e4b80ad 224 (version "0.7.2")
2dbad1dd
TF
225 (source (origin
226 (method url-fetch)
227 (uri (string-append
228 "http://sigrok.org/download/source/sigrok-cli/sigrok-cli-"
229 version ".tar.gz"))
230 (sha256
231 (base32
1e4b80ad 232 "1f0a2k8qdcin0pqiqq5ni4khzsnv61l21v1dfdjzayw96qzl9l3i"))))
2dbad1dd
TF
233 (native-inputs
234 `(("pkg-config" ,pkg-config)))
235 (inputs
236 `(("glib" ,glib)
237 ("libsigrok" ,libsigrok)
238 ("libsigrokdecode" ,libsigrokdecode)))
239 (build-system gnu-build-system)
47800898 240 (home-page "https://sigrok.org/wiki/Sigrok-cli")
2dbad1dd
TF
241 (synopsis "Command-line frontend for sigrok")
242 (description "Sigrok-cli is a command-line frontend for sigrok.")
243 (license license:gpl3+)))
6df20b5a
TF
244
245(define-public pulseview
246 (package
247 (name "pulseview")
a481c55d 248 (version "0.4.2")
6df20b5a
TF
249 (source (origin
250 (method url-fetch)
251 (uri (string-append
a481c55d 252 "https://sigrok.org/download/source/pulseview/pulseview-"
6df20b5a
TF
253 version ".tar.gz"))
254 (sha256
255 (base32
d0fff8f8
EF
256 "1jxbpz1h3m1mgrxw74rnihj8vawgqdpf6c33cqqbyd8v7rxgfhph"))
257 (patches (search-patches "pulseview-qt515-compat.patch"))))
58cd3123 258 (build-system cmake-build-system)
6df20b5a 259 (arguments
58cd3123
TGR
260 `(#:configure-flags '("-DENABLE_TESTS=y")
261 #:phases
262 (modify-phases %standard-phases
263 (add-after 'install 'remove-empty-doc-directory
264 (lambda* (#:key outputs #:allow-other-keys)
265 (let ((out (assoc-ref outputs "out")))
266 (with-directory-excursion (string-append out "/share")
267 ;; Use RMDIR to never risk silently deleting files.
268 (rmdir "doc/pulseview")
269 (rmdir "doc"))
270 #t))))))
6df20b5a 271 (native-inputs
a481c55d
EF
272 `(("pkg-config" ,pkg-config)
273 ("qttools" ,qttools)))
6df20b5a
TF
274 (inputs
275 `(("boost" ,boost)
276 ("glib" ,glib)
277 ("glibmm" ,glibmm)
6df20b5a 278 ("libsigrok" ,libsigrok)
b1e4c0fa
MB
279 ("libsigrokdecode" ,libsigrokdecode)
280 ("qtbase" ,qtbase)
281 ("qtsvg" ,qtsvg)))
01005901 282 (home-page "https://www.sigrok.org/wiki/PulseView")
6df20b5a
TF
283 (synopsis "Qt based logic analyzer, oscilloscope and MSO GUI for sigrok")
284 (description "PulseView is a Qt based logic analyzer, oscilloscope and MSO GUI
285for sigrok.")
286 (license license:gpl3+)))
c35157f7
LF
287
288(define-public comedilib
289 (package
290 (name "comedilib")
291 (version "0.12.0")
292 (source (origin
293 (method url-fetch)
294 (uri (string-append "https://www.comedi.org/download/comedilib-"
295 version ".tar.gz"))
296 (sha256
297 (base32
298 "0wzh23iyix4xj211fsd8hwrdcjhg2w5jswk9kywb1gpd3h8afajj"))))
299 (build-system gnu-build-system)
300 (synopsis "Library for Comedi")
301 (description "Comedilib is a user-space library that provides a
302developer-friendly interface to Comedi devices. Comedi is a collection of
303drivers for a variety of common data acquisition plug-in boards. The drivers
304are implemented as a core Linux kernel module providing common functionality and
305individual low-level driver modules.")
306 (home-page "https://www.comedi.org/")
307 (license license:lgpl2.1)))
ffe4f87c
LF
308
309(define-public xoscope
310 (package
311 (name "xoscope")
a1017773 312 (version "2.3")
ffe4f87c
LF
313 (source (origin
314 (method url-fetch)
315 (uri (string-append "mirror://sourceforge/xoscope/xoscope/"
316 version "/xoscope-" version ".tar.gz"))
317 (sha256
318 (base32
a1017773 319 "0a5ycfc1qdmibvagc82r2mhv2i99m6pndy5i6ixas3j2297g6pgq"))))
ffe4f87c
LF
320 (build-system gnu-build-system)
321 (native-inputs
a1017773
TGR
322 `(("m4" ,m4)
323 ("pkg-config" ,pkg-config)))
ffe4f87c
LF
324 (inputs
325 `(("alsa-lib" ,alsa-lib)
326 ("comedilib" ,comedilib)
327 ("fftw" ,fftw)
a1017773 328 ("gtk+" ,gtk+)
ffe4f87c
LF
329 ("gtkdatabox" ,gtkdatabox)))
330 (synopsis "Digital oscilloscope")
331 (description "Xoscope is a digital oscilloscope that can acquire signals
332from ALSA, ESD, and COMEDI sources. This package currently does not include
333support for ESD sources.")
334 (home-page "http://xoscope.sourceforge.net/")
335 (license license:gpl2+)))