gnu: supercollider: Update to 3.11.2.
[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>
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)
c626e281 35 #:use-module (gnu packages embedded)
79f0bd7f 36 #:use-module (gnu packages gawk)
c0735802
TF
37 #:use-module (gnu packages glib)
38 #:use-module (gnu packages graphviz)
1c12be96
TF
39 #:use-module (gnu packages libftdi)
40 #:use-module (gnu packages libusb)
c0735802 41 #:use-module (gnu packages pkg-config)
7a19de9c 42 #:use-module (gnu packages python)
c626e281 43 #:use-module (gnu packages qt))
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
61to 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
e1409c76 91 `(("check" ,check-0.14)
c0735802
TF
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
134as 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
406f3f9b 189 `(("doxygen" ,doxygen)
1c12be96
TF
190 ("graphviz" ,graphviz)
191 ("sigrok-firmware-fx2lafw" ,sigrok-firmware-fx2lafw)
192 ("pkg-config" ,pkg-config)))
193 (inputs
194 `(("python" ,python)
195 ("zlib" ,zlib)))
196 ;; libsigrokcxx.pc lists "glibmm" in Requires
197 ;; libsigrok.pc lists "libserialport", "libusb", "libftdi" and "libzip" in
198 ;; Requires.private and "glib" in Requires
199 (propagated-inputs
200 `(("glib" ,glib)
201 ("glibmm" ,glibmm)
202 ("libserialport" ,libserialport)
203 ("libusb" ,libusb)
204 ("libftdi" ,libftdi)
205 ("libzip" ,libzip)))
206 (build-system gnu-build-system)
47800898 207 (home-page "https://www.sigrok.org/wiki/Libsigrok")
1c12be96
TF
208 (synopsis "Library which provides the basic hardware access drivers for logic
209analyzers")
210 (description "@code{libsigrok} is a shared library written in C which provides the basic hardware
211access drivers for logic analyzers and other supported devices, as well as input/output file
212format support.")
213 (license license:gpl3+)))
2dbad1dd
TF
214
215(define-public sigrok-cli
216 (package
217 (name "sigrok-cli")
61c58b78 218 (version "0.7.1")
2dbad1dd
TF
219 (source (origin
220 (method url-fetch)
221 (uri (string-append
222 "http://sigrok.org/download/source/sigrok-cli/sigrok-cli-"
223 version ".tar.gz"))
224 (sha256
225 (base32
61c58b78 226 "15vpn1psriadcbl6v9swwgws7dva85ld03yv6g1mgm27kx11697m"))))
2dbad1dd
TF
227 (native-inputs
228 `(("pkg-config" ,pkg-config)))
229 (inputs
230 `(("glib" ,glib)
231 ("libsigrok" ,libsigrok)
232 ("libsigrokdecode" ,libsigrokdecode)))
233 (build-system gnu-build-system)
47800898 234 (home-page "https://sigrok.org/wiki/Sigrok-cli")
2dbad1dd
TF
235 (synopsis "Command-line frontend for sigrok")
236 (description "Sigrok-cli is a command-line frontend for sigrok.")
237 (license license:gpl3+)))
6df20b5a
TF
238
239(define-public pulseview
240 (package
241 (name "pulseview")
58cd3123 242 (version "0.4.1")
6df20b5a
TF
243 (source (origin
244 (method url-fetch)
245 (uri (string-append
246 "http://sigrok.org/download/source/pulseview/pulseview-"
247 version ".tar.gz"))
248 (sha256
249 (base32
58cd3123
TGR
250 "0bvgmkgz37n2bi9niskpl05hf7rsj1lj972fbrgnlz25s4ywxrwy"))))
251 (build-system cmake-build-system)
6df20b5a 252 (arguments
58cd3123
TGR
253 `(#:configure-flags '("-DENABLE_TESTS=y")
254 #:phases
255 (modify-phases %standard-phases
256 (add-after 'install 'remove-empty-doc-directory
257 (lambda* (#:key outputs #:allow-other-keys)
258 (let ((out (assoc-ref outputs "out")))
259 (with-directory-excursion (string-append out "/share")
260 ;; Use RMDIR to never risk silently deleting files.
261 (rmdir "doc/pulseview")
262 (rmdir "doc"))
263 #t))))))
6df20b5a
TF
264 (native-inputs
265 `(("pkg-config" ,pkg-config)))
266 (inputs
267 `(("boost" ,boost)
268 ("glib" ,glib)
269 ("glibmm" ,glibmm)
6df20b5a 270 ("libsigrok" ,libsigrok)
b1e4c0fa
MB
271 ("libsigrokdecode" ,libsigrokdecode)
272 ("qtbase" ,qtbase)
273 ("qtsvg" ,qtsvg)))
01005901 274 (home-page "https://www.sigrok.org/wiki/PulseView")
6df20b5a
TF
275 (synopsis "Qt based logic analyzer, oscilloscope and MSO GUI for sigrok")
276 (description "PulseView is a Qt based logic analyzer, oscilloscope and MSO GUI
277for sigrok.")
278 (license license:gpl3+)))