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