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