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> |
03d0cc11 TF |
5 | ;;; |
6 | ;;; This file is part of GNU Guix. | |
7 | ;;; | |
8 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
9 | ;;; under the terms of the GNU General Public License as published by | |
10 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
11 | ;;; your option) any later version. | |
12 | ;;; | |
13 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
14 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | ;;; GNU General Public License for more details. | |
17 | ;;; | |
18 | ;;; You should have received a copy of the GNU General Public License | |
19 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
20 | ||
21 | (define-module (gnu packages electronics) | |
22 | #:use-module (guix utils) | |
23 | #:use-module (guix packages) | |
24 | #:use-module (guix download) | |
25 | #:use-module ((guix licenses) #:prefix license:) | |
26 | #:use-module (guix build-system gnu) | |
6df20b5a | 27 | #:use-module (guix build-system cmake) |
c0735802 | 28 | #:use-module (gnu packages) |
79f0bd7f CL |
29 | #:use-module (gnu packages base) |
30 | #:use-module (gnu packages bash) | |
6df20b5a | 31 | #:use-module (gnu packages boost) |
c0735802 | 32 | #:use-module (gnu packages check) |
1c12be96 | 33 | #:use-module (gnu packages compression) |
c0735802 | 34 | #:use-module (gnu packages documentation) |
79f0bd7f | 35 | #:use-module (gnu packages gawk) |
c0735802 TF |
36 | #:use-module (gnu packages glib) |
37 | #:use-module (gnu packages graphviz) | |
1c12be96 TF |
38 | #:use-module (gnu packages libftdi) |
39 | #:use-module (gnu packages libusb) | |
c0735802 | 40 | #:use-module (gnu packages pkg-config) |
7a19de9c | 41 | #:use-module (gnu packages python) |
6df20b5a | 42 | #:use-module (gnu packages qt) |
7a19de9c | 43 | #:use-module (gnu packages sdcc)) |
03d0cc11 TF |
44 | |
45 | (define-public libserialport | |
46 | (package | |
47 | (name "libserialport") | |
48 | (version "0.1.1") | |
49 | (source (origin | |
50 | (method url-fetch) | |
51 | (uri (string-append | |
52 | "http://sigrok.org/download/source/libserialport/libserialport-" | |
53 | version ".tar.gz")) | |
54 | (sha256 | |
55 | (base32 | |
56 | "17ajlwgvyyrap8z7f16zcs59pksvncwbmd3mzf98wj7zqgczjaja")))) | |
57 | (build-system gnu-build-system) | |
01005901 | 58 | (home-page "https://sigrok.org/wiki/Libserialport") |
03d0cc11 TF |
59 | (synopsis "Library for using serial ports") |
60 | (description "Libserialport is a minimal shared library written in C that is intended | |
61 | to take care of the OS-specific details when writing software that uses serial ports.") | |
62 | (license license:lgpl3+))) | |
c0735802 TF |
63 | |
64 | (define-public libsigrokdecode | |
65 | (package | |
66 | (name "libsigrokdecode") | |
afeecd92 | 67 | (version "0.5.3") |
c0735802 TF |
68 | (source (origin |
69 | (method url-fetch) | |
70 | (uri (string-append | |
71 | "http://sigrok.org/download/source/libsigrokdecode/libsigrokdecode-" | |
72 | version ".tar.gz")) | |
73 | (sha256 | |
74 | (base32 | |
afeecd92 | 75 | "1h1zi1kpsgf6j2z8j8hjpv1q7n49i3fhqjn8i178rka3cym18265")))) |
c0735802 TF |
76 | (outputs '("out" "doc")) |
77 | (arguments | |
78 | `(#:phases | |
79 | (modify-phases %standard-phases | |
80 | (add-after 'build 'build-doc | |
81 | (lambda _ | |
7aa6e29d TGR |
82 | (invoke "doxygen") |
83 | #t)) | |
c0735802 TF |
84 | (add-after 'install 'install-doc |
85 | (lambda* (#:key outputs #:allow-other-keys) | |
86 | (copy-recursively "doxy/html-api" | |
87 | (string-append (assoc-ref outputs "doc") | |
88 | "/share/doc/libsigrokdecode")) | |
89 | #t))))) | |
90 | (native-inputs | |
91 | `(("check" ,check) | |
92 | ("doxygen" ,doxygen) | |
93 | ("graphviz" ,graphviz) | |
94 | ("pkg-config" ,pkg-config))) | |
95 | ;; libsigrokdecode.pc lists "python" in Requires.private, and "glib" in Requires. | |
96 | (propagated-inputs | |
97 | `(("glib" ,glib) | |
98 | ("python" ,python))) | |
99 | (build-system gnu-build-system) | |
47800898 | 100 | (home-page "https://www.sigrok.org/wiki/Libsigrokdecode") |
c0735802 TF |
101 | (synopsis "Library providing (streaming) protocol decoding functionality") |
102 | (description "Libsigrokdecode is a shared library written in C, which provides | |
103 | (streaming) protocol decoding functionality.") | |
104 | (license license:gpl3+))) | |
7a19de9c TF |
105 | |
106 | (define-public sigrok-firmware-fx2lafw | |
107 | (package | |
108 | (name "sigrok-firmware-fx2lafw") | |
26efd031 | 109 | (version "0.1.7") |
7a19de9c TF |
110 | (source (origin |
111 | (method url-fetch) | |
112 | (uri (string-append | |
113 | "http://sigrok.org/download/source/sigrok-firmware-fx2lafw/" | |
114 | "sigrok-firmware-fx2lafw-" version ".tar.gz")) | |
115 | (sha256 | |
116 | (base32 | |
26efd031 | 117 | "0fyfd82mvrcf55v5a3afq1mh1kfswk4c37qrbln6x92jm3b41x53")))) |
79f0bd7f CL |
118 | (arguments |
119 | `(#:implicit-inputs? #f)) | |
7a19de9c | 120 | (native-inputs |
79f0bd7f CL |
121 | `(("awk" ,gawk) |
122 | ("bash" ,bash) | |
123 | ("coreutils" ,coreutils) | |
124 | ("grep" ,grep) | |
125 | ("gzip" ,gzip) | |
126 | ("make" ,gnu-make) | |
127 | ("sdcc" ,sdcc) | |
128 | ("sed" ,sed) | |
129 | ("tar" ,tar))) | |
7a19de9c | 130 | (build-system gnu-build-system) |
47800898 | 131 | (home-page "https://www.sigrok.org/wiki/Fx2lafw") |
7a19de9c TF |
132 | (synopsis "Firmware for Cypress FX2 chips") |
133 | (description "Fx2lafw is free firmware for Cypress FX2 chips which makes them usable | |
134 | as simple logic analyzer and/or oscilloscope hardware.") | |
135 | (license license:gpl2+))) | |
1c12be96 TF |
136 | |
137 | (define-public libsigrok | |
138 | (package | |
139 | (name "libsigrok") | |
4b492dcc | 140 | (version "0.5.2") |
1c12be96 TF |
141 | (source (origin |
142 | (method url-fetch) | |
143 | (uri (string-append | |
144 | "http://sigrok.org/download/source/libsigrok/libsigrok-" | |
145 | version ".tar.gz")) | |
146 | (sha256 | |
147 | (base32 | |
4b492dcc | 148 | "0g6fl684bpqm5p2z4j12c62m45j1dircznjina63w392ns81yd2d")))) |
1c12be96 TF |
149 | (outputs '("out" "doc")) |
150 | (arguments | |
2fba511e | 151 | `(#:tests? #f ; tests need USB access |
1c12be96 TF |
152 | #:phases |
153 | (modify-phases %standard-phases | |
154 | (add-before 'configure 'change-udev-group | |
155 | (lambda _ | |
2fba511e TGR |
156 | (substitute* (find-files "contrib" "\\.rules$") |
157 | (("plugdev") "dialout")) | |
158 | #t)) | |
1c12be96 TF |
159 | (add-after 'build 'build-doc |
160 | (lambda _ | |
fbe4a5a2 | 161 | (invoke "doxygen"))) |
1c12be96 TF |
162 | (add-after 'install 'install-doc |
163 | (lambda* (#:key outputs #:allow-other-keys) | |
164 | (copy-recursively "doxy/html-api" | |
165 | (string-append (assoc-ref outputs "doc") | |
166 | "/share/doc/libsigrok")) | |
167 | #t)) | |
168 | (add-after 'install-doc 'install-udev-rules | |
169 | (lambda* (#:key outputs #:allow-other-keys) | |
2fba511e TGR |
170 | (let* ((out (assoc-ref outputs "out")) |
171 | (rules (string-append out "/lib/udev/rules.d/"))) | |
172 | (for-each (lambda (file) | |
173 | (install-file file rules)) | |
174 | (find-files "contrib" "\\.rules$")) | |
175 | #t))) | |
1c12be96 TF |
176 | (add-after 'install-udev-rules 'install-fw |
177 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
178 | (let* ((fx2lafw (assoc-ref inputs "sigrok-firmware-fx2lafw")) | |
179 | (out (assoc-ref outputs "out")) | |
180 | (dir-suffix "/share/sigrok-firmware/") | |
181 | (input-dir (string-append fx2lafw dir-suffix)) | |
182 | (output-dir (string-append out dir-suffix))) | |
1c12be96 TF |
183 | (for-each |
184 | (lambda (file) | |
185 | (install-file file output-dir)) | |
186 | (find-files input-dir "."))) | |
187 | #t))))) | |
188 | (native-inputs | |
189 | `(("check" ,check) | |
190 | ("doxygen" ,doxygen) | |
191 | ("graphviz" ,graphviz) | |
192 | ("sigrok-firmware-fx2lafw" ,sigrok-firmware-fx2lafw) | |
193 | ("pkg-config" ,pkg-config))) | |
194 | (inputs | |
195 | `(("python" ,python) | |
196 | ("zlib" ,zlib))) | |
197 | ;; libsigrokcxx.pc lists "glibmm" in Requires | |
198 | ;; libsigrok.pc lists "libserialport", "libusb", "libftdi" and "libzip" in | |
199 | ;; Requires.private and "glib" in Requires | |
200 | (propagated-inputs | |
201 | `(("glib" ,glib) | |
202 | ("glibmm" ,glibmm) | |
203 | ("libserialport" ,libserialport) | |
204 | ("libusb" ,libusb) | |
205 | ("libftdi" ,libftdi) | |
206 | ("libzip" ,libzip))) | |
207 | (build-system gnu-build-system) | |
47800898 | 208 | (home-page "https://www.sigrok.org/wiki/Libsigrok") |
1c12be96 TF |
209 | (synopsis "Library which provides the basic hardware access drivers for logic |
210 | analyzers") | |
211 | (description "@code{libsigrok} is a shared library written in C which provides the basic hardware | |
212 | access drivers for logic analyzers and other supported devices, as well as input/output file | |
213 | format support.") | |
214 | (license license:gpl3+))) | |
2dbad1dd TF |
215 | |
216 | (define-public sigrok-cli | |
217 | (package | |
218 | (name "sigrok-cli") | |
61c58b78 | 219 | (version "0.7.1") |
2dbad1dd TF |
220 | (source (origin |
221 | (method url-fetch) | |
222 | (uri (string-append | |
223 | "http://sigrok.org/download/source/sigrok-cli/sigrok-cli-" | |
224 | version ".tar.gz")) | |
225 | (sha256 | |
226 | (base32 | |
61c58b78 | 227 | "15vpn1psriadcbl6v9swwgws7dva85ld03yv6g1mgm27kx11697m")))) |
2dbad1dd TF |
228 | (native-inputs |
229 | `(("pkg-config" ,pkg-config))) | |
230 | (inputs | |
231 | `(("glib" ,glib) | |
232 | ("libsigrok" ,libsigrok) | |
233 | ("libsigrokdecode" ,libsigrokdecode))) | |
234 | (build-system gnu-build-system) | |
47800898 | 235 | (home-page "https://sigrok.org/wiki/Sigrok-cli") |
2dbad1dd TF |
236 | (synopsis "Command-line frontend for sigrok") |
237 | (description "Sigrok-cli is a command-line frontend for sigrok.") | |
238 | (license license:gpl3+))) | |
6df20b5a TF |
239 | |
240 | (define-public pulseview | |
241 | (package | |
242 | (name "pulseview") | |
58cd3123 | 243 | (version "0.4.1") |
6df20b5a TF |
244 | (source (origin |
245 | (method url-fetch) | |
246 | (uri (string-append | |
247 | "http://sigrok.org/download/source/pulseview/pulseview-" | |
248 | version ".tar.gz")) | |
249 | (sha256 | |
250 | (base32 | |
58cd3123 TGR |
251 | "0bvgmkgz37n2bi9niskpl05hf7rsj1lj972fbrgnlz25s4ywxrwy")))) |
252 | (build-system cmake-build-system) | |
6df20b5a | 253 | (arguments |
58cd3123 TGR |
254 | `(#:configure-flags '("-DENABLE_TESTS=y") |
255 | #:phases | |
256 | (modify-phases %standard-phases | |
257 | (add-after 'install 'remove-empty-doc-directory | |
258 | (lambda* (#:key outputs #:allow-other-keys) | |
259 | (let ((out (assoc-ref outputs "out"))) | |
260 | (with-directory-excursion (string-append out "/share") | |
261 | ;; Use RMDIR to never risk silently deleting files. | |
262 | (rmdir "doc/pulseview") | |
263 | (rmdir "doc")) | |
264 | #t)))))) | |
6df20b5a TF |
265 | (native-inputs |
266 | `(("pkg-config" ,pkg-config))) | |
267 | (inputs | |
268 | `(("boost" ,boost) | |
269 | ("glib" ,glib) | |
270 | ("glibmm" ,glibmm) | |
6df20b5a | 271 | ("libsigrok" ,libsigrok) |
b1e4c0fa MB |
272 | ("libsigrokdecode" ,libsigrokdecode) |
273 | ("qtbase" ,qtbase) | |
274 | ("qtsvg" ,qtsvg))) | |
01005901 | 275 | (home-page "https://www.sigrok.org/wiki/PulseView") |
6df20b5a TF |
276 | (synopsis "Qt based logic analyzer, oscilloscope and MSO GUI for sigrok") |
277 | (description "PulseView is a Qt based logic analyzer, oscilloscope and MSO GUI | |
278 | for sigrok.") | |
279 | (license license:gpl3+))) |