gnu: Add sigrok-firmware-fx2lafw.
[jackhill/guix/guix.git] / gnu / packages / electronics.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017 Theodoros Foradis <theodoros.for@openmailbox.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 (gnu packages)
26 #:use-module (gnu packages check)
27 #:use-module (gnu packages documentation)
28 #:use-module (gnu packages glib)
29 #:use-module (gnu packages graphviz)
30 #:use-module (gnu packages pkg-config)
31 #:use-module (gnu packages python)
32 #:use-module (gnu packages sdcc))
33
34 (define-public libserialport
35 (package
36 (name "libserialport")
37 (version "0.1.1")
38 (source (origin
39 (method url-fetch)
40 (uri (string-append
41 "http://sigrok.org/download/source/libserialport/libserialport-"
42 version ".tar.gz"))
43 (sha256
44 (base32
45 "17ajlwgvyyrap8z7f16zcs59pksvncwbmd3mzf98wj7zqgczjaja"))))
46 (build-system gnu-build-system)
47 (home-page "http://sigrok.org/wiki/Libserialport")
48 (synopsis "Library for using serial ports")
49 (description "Libserialport is a minimal shared library written in C that is intended
50 to take care of the OS-specific details when writing software that uses serial ports.")
51 (license license:lgpl3+)))
52
53 (define-public libsigrokdecode
54 (package
55 (name "libsigrokdecode")
56 (version "0.5.0")
57 (source (origin
58 (method url-fetch)
59 (uri (string-append
60 "http://sigrok.org/download/source/libsigrokdecode/libsigrokdecode-"
61 version ".tar.gz"))
62 (sha256
63 (base32
64 "1hfigfj1976qk11kfsgj75l20qvyq8c9p2h4mjw23d59rsg5ga2a"))))
65 (outputs '("out" "doc"))
66 (arguments
67 `(#:phases
68 (modify-phases %standard-phases
69 (add-after 'build 'build-doc
70 (lambda _
71 (zero? (system* "doxygen"))))
72 (add-after 'install 'install-doc
73 (lambda* (#:key outputs #:allow-other-keys)
74 (copy-recursively "doxy/html-api"
75 (string-append (assoc-ref outputs "doc")
76 "/share/doc/libsigrokdecode"))
77 #t)))))
78 (native-inputs
79 `(("check" ,check)
80 ("doxygen" ,doxygen)
81 ("graphviz" ,graphviz)
82 ("pkg-config" ,pkg-config)))
83 ;; libsigrokdecode.pc lists "python" in Requires.private, and "glib" in Requires.
84 (propagated-inputs
85 `(("glib" ,glib)
86 ("python" ,python)))
87 (build-system gnu-build-system)
88 (home-page "http://www.sigrok.org/wiki/Libsigrokdecode")
89 (synopsis "Library providing (streaming) protocol decoding functionality")
90 (description "Libsigrokdecode is a shared library written in C, which provides
91 (streaming) protocol decoding functionality.")
92 (license license:gpl3+)))
93
94 (define-public sigrok-firmware-fx2lafw
95 (package
96 (name "sigrok-firmware-fx2lafw")
97 (version "0.1.5")
98 (source (origin
99 (method url-fetch)
100 (uri (string-append
101 "http://sigrok.org/download/source/sigrok-firmware-fx2lafw/"
102 "sigrok-firmware-fx2lafw-" version ".tar.gz"))
103 (sha256
104 (base32
105 "0bbdgy4rpc00jl0l0744m2ibjlqi26bhrkjr7vplivdsjdmhjx6a"))))
106 (native-inputs
107 `(("sdcc" ,sdcc)))
108 (build-system gnu-build-system)
109 (home-page "http://www.sigrok.org/wiki/Fx2lafw")
110 (synopsis "Firmware for Cypress FX2 chips")
111 (description "Fx2lafw is free firmware for Cypress FX2 chips which makes them usable
112 as simple logic analyzer and/or oscilloscope hardware.")
113 (license license:gpl2+)))