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