Commit | Line | Data |
---|---|---|
03d0cc11 | 1 | ;;; GNU Guix --- Functional package management for GNU |
d109b1e8 | 2 | ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org> |
afeecd92 | 3 | ;;; Copyright © 2018, 2019, 2020 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) |
c0735802 | 46 | #:use-module (gnu packages pkg-config) |
7a19de9c | 47 | #:use-module (gnu packages python) |
c626e281 | 48 | #:use-module (gnu packages qt)) |
03d0cc11 TF |
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) | |
01005901 | 63 | (home-page "https://sigrok.org/wiki/Libserialport") |
03d0cc11 TF |
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+))) | |
c0735802 TF |
68 | |
69 | (define-public libsigrokdecode | |
70 | (package | |
71 | (name "libsigrokdecode") | |
afeecd92 | 72 | (version "0.5.3") |
c0735802 TF |
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 | |
afeecd92 | 80 | "1h1zi1kpsgf6j2z8j8hjpv1q7n49i3fhqjn8i178rka3cym18265")))) |
c0735802 TF |
81 | (outputs '("out" "doc")) |
82 | (arguments | |
83 | `(#:phases | |
84 | (modify-phases %standard-phases | |
85 | (add-after 'build 'build-doc | |
86 | (lambda _ | |
7aa6e29d TGR |
87 | (invoke "doxygen") |
88 | #t)) | |
c0735802 TF |
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 | |
e1409c76 | 96 | `(("check" ,check-0.14) |
c0735802 TF |
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) | |
47800898 | 105 | (home-page "https://www.sigrok.org/wiki/Libsigrokdecode") |
c0735802 TF |
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+))) | |
7a19de9c TF |
110 | |
111 | (define-public sigrok-firmware-fx2lafw | |
112 | (package | |
113 | (name "sigrok-firmware-fx2lafw") | |
26efd031 | 114 | (version "0.1.7") |
7a19de9c TF |
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 | |
26efd031 | 122 | "0fyfd82mvrcf55v5a3afq1mh1kfswk4c37qrbln6x92jm3b41x53")))) |
79f0bd7f CL |
123 | (arguments |
124 | `(#:implicit-inputs? #f)) | |
7a19de9c | 125 | (native-inputs |
79f0bd7f CL |
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))) | |
7a19de9c | 135 | (build-system gnu-build-system) |
47800898 | 136 | (home-page "https://www.sigrok.org/wiki/Fx2lafw") |
7a19de9c TF |
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+))) | |
1c12be96 TF |
141 | |
142 | (define-public libsigrok | |
143 | (package | |
144 | (name "libsigrok") | |
4b492dcc | 145 | (version "0.5.2") |
1c12be96 TF |
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 | |
4b492dcc | 153 | "0g6fl684bpqm5p2z4j12c62m45j1dircznjina63w392ns81yd2d")))) |
1c12be96 TF |
154 | (outputs '("out" "doc")) |
155 | (arguments | |
2fba511e | 156 | `(#:tests? #f ; tests need USB access |
1c12be96 TF |
157 | #:phases |
158 | (modify-phases %standard-phases | |
159 | (add-before 'configure 'change-udev-group | |
160 | (lambda _ | |
2fba511e TGR |
161 | (substitute* (find-files "contrib" "\\.rules$") |
162 | (("plugdev") "dialout")) | |
163 | #t)) | |
1c12be96 TF |
164 | (add-after 'build 'build-doc |
165 | (lambda _ | |
fbe4a5a2 | 166 | (invoke "doxygen"))) |
1c12be96 TF |
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) | |
2fba511e TGR |
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))) | |
1c12be96 TF |
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))) | |
1c12be96 TF |
188 | (for-each |
189 | (lambda (file) | |
190 | (install-file file output-dir)) | |
191 | (find-files input-dir "."))) | |
192 | #t))))) | |
193 | (native-inputs | |
406f3f9b | 194 | `(("doxygen" ,doxygen) |
1c12be96 TF |
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) | |
47800898 | 212 | (home-page "https://www.sigrok.org/wiki/Libsigrok") |
1c12be96 TF |
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+))) | |
2dbad1dd TF |
219 | |
220 | (define-public sigrok-cli | |
221 | (package | |
222 | (name "sigrok-cli") | |
61c58b78 | 223 | (version "0.7.1") |
2dbad1dd TF |
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 | |
61c58b78 | 231 | "15vpn1psriadcbl6v9swwgws7dva85ld03yv6g1mgm27kx11697m")))) |
2dbad1dd TF |
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) | |
47800898 | 239 | (home-page "https://sigrok.org/wiki/Sigrok-cli") |
2dbad1dd TF |
240 | (synopsis "Command-line frontend for sigrok") |
241 | (description "Sigrok-cli is a command-line frontend for sigrok.") | |
242 | (license license:gpl3+))) | |
6df20b5a TF |
243 | |
244 | (define-public pulseview | |
245 | (package | |
246 | (name "pulseview") | |
a481c55d | 247 | (version "0.4.2") |
6df20b5a TF |
248 | (source (origin |
249 | (method url-fetch) | |
250 | (uri (string-append | |
a481c55d | 251 | "https://sigrok.org/download/source/pulseview/pulseview-" |
6df20b5a TF |
252 | version ".tar.gz")) |
253 | (sha256 | |
254 | (base32 | |
d0fff8f8 EF |
255 | "1jxbpz1h3m1mgrxw74rnihj8vawgqdpf6c33cqqbyd8v7rxgfhph")) |
256 | (patches (search-patches "pulseview-qt515-compat.patch")))) | |
58cd3123 | 257 | (build-system cmake-build-system) |
6df20b5a | 258 | (arguments |
58cd3123 TGR |
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)))))) | |
6df20b5a | 270 | (native-inputs |
a481c55d EF |
271 | `(("pkg-config" ,pkg-config) |
272 | ("qttools" ,qttools))) | |
6df20b5a TF |
273 | (inputs |
274 | `(("boost" ,boost) | |
275 | ("glib" ,glib) | |
276 | ("glibmm" ,glibmm) | |
6df20b5a | 277 | ("libsigrok" ,libsigrok) |
b1e4c0fa MB |
278 | ("libsigrokdecode" ,libsigrokdecode) |
279 | ("qtbase" ,qtbase) | |
280 | ("qtsvg" ,qtsvg))) | |
01005901 | 281 | (home-page "https://www.sigrok.org/wiki/PulseView") |
6df20b5a TF |
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+))) | |
c35157f7 LF |
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))) | |
ffe4f87c LF |
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+))) |