gnu: libretro-lowresnx: Update to 1.2.
[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 m4)
47 #:use-module (gnu packages pkg-config)
48 #:use-module (gnu packages python)
49 #:use-module (gnu packages qt))
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)
64 (home-page "https://sigrok.org/wiki/Libserialport")
65 (synopsis "Library for using serial ports")
66 (description "Libserialport is a minimal shared library written in C that is intended
67 to take care of the OS-specific details when writing software that uses serial ports.")
68 (license license:lgpl3+)))
69
70 (define-public libsigrokdecode
71 (package
72 (name "libsigrokdecode")
73 (version "0.5.3")
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
81 "1h1zi1kpsgf6j2z8j8hjpv1q7n49i3fhqjn8i178rka3cym18265"))))
82 (outputs '("out" "doc"))
83 (arguments
84 `(#:phases
85 (modify-phases %standard-phases
86 (add-after 'build 'build-doc
87 (lambda _
88 (invoke "doxygen")
89 #t))
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
97 `(("check" ,check-0.14)
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)
106 (home-page "https://www.sigrok.org/wiki/Libsigrokdecode")
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+)))
111
112 (define-public sigrok-firmware-fx2lafw
113 (package
114 (name "sigrok-firmware-fx2lafw")
115 (version "0.1.7")
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
123 "0fyfd82mvrcf55v5a3afq1mh1kfswk4c37qrbln6x92jm3b41x53"))))
124 (arguments
125 `(#:implicit-inputs? #f))
126 (native-inputs
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)))
136 (build-system gnu-build-system)
137 (home-page "https://www.sigrok.org/wiki/Fx2lafw")
138 (synopsis "Firmware for Cypress FX2 chips")
139 (description "Fx2lafw is free firmware for Cypress FX2 chips which makes them usable
140 as simple logic analyzer and/or oscilloscope hardware.")
141 (license license:gpl2+)))
142
143 (define-public libsigrok
144 (package
145 (name "libsigrok")
146 (version "0.5.2")
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
154 "0g6fl684bpqm5p2z4j12c62m45j1dircznjina63w392ns81yd2d"))))
155 (outputs '("out" "doc"))
156 (arguments
157 `(#:tests? #f ; tests need USB access
158 #:phases
159 (modify-phases %standard-phases
160 (add-before 'configure 'change-udev-group
161 (lambda _
162 (substitute* (find-files "contrib" "\\.rules$")
163 (("plugdev") "dialout"))
164 #t))
165 (add-after 'build 'build-doc
166 (lambda _
167 (invoke "doxygen")))
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)
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)))
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)))
189 (for-each
190 (lambda (file)
191 (install-file file output-dir))
192 (find-files input-dir ".")))
193 #t)))))
194 (native-inputs
195 `(("doxygen" ,doxygen)
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)
213 (home-page "https://www.sigrok.org/wiki/Libsigrok")
214 (synopsis "Library which provides the basic hardware access drivers for logic
215 analyzers")
216 (description "@code{libsigrok} is a shared library written in C which provides the basic hardware
217 access drivers for logic analyzers and other supported devices, as well as input/output file
218 format support.")
219 (license license:gpl3+)))
220
221 (define-public sigrok-cli
222 (package
223 (name "sigrok-cli")
224 (version "0.7.2")
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
232 "1f0a2k8qdcin0pqiqq5ni4khzsnv61l21v1dfdjzayw96qzl9l3i"))))
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)
240 (home-page "https://sigrok.org/wiki/Sigrok-cli")
241 (synopsis "Command-line frontend for sigrok")
242 (description "Sigrok-cli is a command-line frontend for sigrok.")
243 (license license:gpl3+)))
244
245 (define-public pulseview
246 (package
247 (name "pulseview")
248 (version "0.4.2")
249 (source (origin
250 (method url-fetch)
251 (uri (string-append
252 "https://sigrok.org/download/source/pulseview/pulseview-"
253 version ".tar.gz"))
254 (sha256
255 (base32
256 "1jxbpz1h3m1mgrxw74rnihj8vawgqdpf6c33cqqbyd8v7rxgfhph"))
257 (patches (search-patches "pulseview-qt515-compat.patch"))))
258 (build-system cmake-build-system)
259 (arguments
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))))))
271 (native-inputs
272 `(("pkg-config" ,pkg-config)
273 ("qttools" ,qttools)))
274 (inputs
275 `(("boost" ,boost)
276 ("glib" ,glib)
277 ("glibmm" ,glibmm)
278 ("libsigrok" ,libsigrok)
279 ("libsigrokdecode" ,libsigrokdecode)
280 ("qtbase" ,qtbase)
281 ("qtsvg" ,qtsvg)))
282 (home-page "https://www.sigrok.org/wiki/PulseView")
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
285 for sigrok.")
286 (license license:gpl3+)))
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
302 developer-friendly interface to Comedi devices. Comedi is a collection of
303 drivers for a variety of common data acquisition plug-in boards. The drivers
304 are implemented as a core Linux kernel module providing common functionality and
305 individual low-level driver modules.")
306 (home-page "https://www.comedi.org/")
307 (license license:lgpl2.1)))
308
309 (define-public xoscope
310 (package
311 (name "xoscope")
312 (version "2.3")
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
319 "0a5ycfc1qdmibvagc82r2mhv2i99m6pndy5i6ixas3j2297g6pgq"))))
320 (build-system gnu-build-system)
321 (native-inputs
322 `(("m4" ,m4)
323 ("pkg-config" ,pkg-config)))
324 (inputs
325 `(("alsa-lib" ,alsa-lib)
326 ("comedilib" ,comedilib)
327 ("fftw" ,fftw)
328 ("gtk+" ,gtk+)
329 ("gtkdatabox" ,gtkdatabox)))
330 (synopsis "Digital oscilloscope")
331 (description "Xoscope is a digital oscilloscope that can acquire signals
332 from ALSA, ESD, and COMEDI sources. This package currently does not include
333 support for ESD sources.")
334 (home-page "http://xoscope.sourceforge.net/")
335 (license license:gpl2+)))