123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434 |
- (define-module (gnu packages electronics)
- #:use-module (guix download)
- #:use-module (guix gexp)
- #:use-module (guix git-download)
- #:use-module ((guix licenses) #:prefix license:)
- #:use-module (guix packages)
- #:use-module (guix utils)
- #:use-module (guix build-system gnu)
- #:use-module (guix build-system cmake)
- #:use-module (gnu packages)
- #:use-module (gnu packages algebra)
- #:use-module (gnu packages autotools)
- #:use-module (gnu packages base)
- #:use-module (gnu packages bash)
- #:use-module (gnu packages boost)
- #:use-module (gnu packages c)
- #:use-module (gnu packages check)
- #:use-module (gnu packages compression)
- #:use-module (gnu packages documentation)
- #:use-module (gnu packages embedded)
- #:use-module (gnu packages fontutils)
- #:use-module (gnu packages gawk)
- #:use-module (gnu packages gl)
- #:use-module (gnu packages glib)
- #:use-module (gnu packages graphviz)
- #:use-module (gnu packages gtk)
- #:use-module (gnu packages libftdi)
- #:use-module (gnu packages libusb)
- #:use-module (gnu packages linux)
- #:use-module (gnu packages m4)
- #:use-module (gnu packages pkg-config)
- #:use-module (gnu packages python)
- #:use-module (gnu packages qt)
- #:use-module (gnu packages sdl)
- #:use-module (gnu packages sqlite)
- #:use-module (gnu packages stb)
- #:use-module (gnu packages toolkits))
- (define-public libserialport
- (package
- (name "libserialport")
- (version "0.1.1")
- (source (origin
- (method url-fetch)
- (uri (string-append
- "http://sigrok.org/download/source/libserialport/libserialport-"
- version ".tar.gz"))
- (sha256
- (base32
- "17ajlwgvyyrap8z7f16zcs59pksvncwbmd3mzf98wj7zqgczjaja"))))
- (build-system gnu-build-system)
- (home-page "https://sigrok.org/wiki/Libserialport")
- (synopsis "Library for using serial ports")
- (description "Libserialport is a minimal shared library written in C that is intended
- to take care of the OS-specific details when writing software that uses serial ports.")
- (license license:lgpl3+)))
- (define-public libsigrokdecode
- (package
- (name "libsigrokdecode")
- (version "0.5.3")
- (source (origin
- (method url-fetch)
- (uri (string-append
- "http://sigrok.org/download/source/libsigrokdecode/libsigrokdecode-"
- version ".tar.gz"))
- (sha256
- (base32
- "1h1zi1kpsgf6j2z8j8hjpv1q7n49i3fhqjn8i178rka3cym18265"))
- (patches
- (search-patches "libsigrokdecode-python3.9-fix.patch"))))
- (outputs '("out" "doc"))
- (arguments
- `(#:phases
- (modify-phases %standard-phases
- (replace 'bootstrap
- (lambda _
- (invoke "autoconf")
- (invoke "aclocal")
- (invoke "automake" "-ac")))
- (add-after 'build 'build-doc
- (lambda _
- (invoke "doxygen")
- #t))
- (add-after 'install 'install-doc
- (lambda* (#:key outputs #:allow-other-keys)
- (copy-recursively "doxy/html-api"
- (string-append (assoc-ref outputs "doc")
- "/share/doc/libsigrokdecode"))
- #t)))))
- (native-inputs
- (list check-0.14 doxygen graphviz pkg-config automake autoconf))
-
- (propagated-inputs
- (list glib python))
- (build-system gnu-build-system)
- (home-page "https://www.sigrok.org/wiki/Libsigrokdecode")
- (synopsis "Library providing (streaming) protocol decoding functionality")
- (description "Libsigrokdecode is a shared library written in C, which provides
- (streaming) protocol decoding functionality.")
- (license license:gpl3+)))
- (define-public sigrok-firmware-fx2lafw
- (package
- (name "sigrok-firmware-fx2lafw")
- (version "0.1.7")
- (source (origin
- (method url-fetch)
- (uri (string-append
- "http://sigrok.org/download/source/sigrok-firmware-fx2lafw/"
- "sigrok-firmware-fx2lafw-" version ".tar.gz"))
- (sha256
- (base32
- "0fyfd82mvrcf55v5a3afq1mh1kfswk4c37qrbln6x92jm3b41x53"))))
- (arguments
- `(#:implicit-inputs? #f))
- (native-inputs
- `(("awk" ,gawk)
- ("bash" ,bash)
- ("coreutils" ,coreutils)
- ("grep" ,grep)
- ("gzip" ,gzip)
- ("make" ,gnu-make)
- ("sdcc" ,sdcc)
- ("sed" ,sed)
- ("tar" ,tar)))
- (build-system gnu-build-system)
- (home-page "https://www.sigrok.org/wiki/Fx2lafw")
- (synopsis "Firmware for Cypress FX2 chips")
- (description "Fx2lafw is free firmware for Cypress FX2 chips which makes them usable
- as simple logic analyzer and/or oscilloscope hardware.")
- (license license:gpl2+)))
- (define-public libsigrok
- (let ((commit "a7e919a3a6b7fd511acbe1a280536b76c70c28d2")
- (revision "1"))
- (package
- (name "libsigrok")
- (version (git-version "0.5.2" revision commit))
- (source
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "git://sigrok.org/libsigrok")
- (commit commit)))
- (sha256
- (base32 "0km3fyv5s2byrm4zpbss2527ynhw4nb67imnbawwic2a6zh9jiyc"))
- (file-name (git-file-name name version))))
- (outputs '("out" "doc"))
- (arguments
- `(#:tests? #f
- #:phases
- (modify-phases %standard-phases
- (add-before 'configure 'change-udev-group
- (lambda _
- (substitute* (find-files "contrib" "\\.rules$")
- (("plugdev") "dialout"))))
- (add-after 'build 'build-doc
- (lambda _
- (invoke "doxygen")))
- (add-after 'install 'install-doc
- (lambda* (#:key outputs #:allow-other-keys)
- (copy-recursively "doxy/html-api"
- (string-append (assoc-ref outputs "doc")
- "/share/doc/libsigrok"))))
- (add-after 'install-doc 'install-udev-rules
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (rules (string-append out "/lib/udev/rules.d/")))
- (for-each (lambda (file)
- (install-file file rules))
- (find-files "contrib" "\\.rules$")))))
- (add-after 'install-udev-rules 'install-fw
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (let* ((fx2lafw (assoc-ref inputs "sigrok-firmware-fx2lafw"))
- (out (assoc-ref outputs "out"))
- (dir-suffix "/share/sigrok-firmware/")
- (input-dir (string-append fx2lafw dir-suffix))
- (output-dir (string-append out dir-suffix)))
- (for-each
- (lambda (file)
- (install-file file output-dir))
- (find-files input-dir "."))))))))
- (native-inputs
- (list autoconf automake doxygen graphviz libtool
- sigrok-firmware-fx2lafw pkg-config))
- (inputs
- (list python zlib))
-
-
-
- (propagated-inputs
- (list glib
- glibmm-2.64
- libserialport
- libusb
- libftdi
- libzip))
- (build-system gnu-build-system)
- (home-page "https://www.sigrok.org/wiki/Libsigrok")
- (synopsis "Basic hardware access drivers for logic analyzers")
- (description "@code{libsigrok} is a shared library written in C which
- provides the basic hardware access drivers for logic analyzers and other
- supported devices, as well as input/output file format support.")
- (license license:gpl3+))))
- (define-public sigrok-cli
- (package
- (name "sigrok-cli")
- (version "0.7.2")
- (source (origin
- (method url-fetch)
- (uri (string-append
- "http://sigrok.org/download/source/sigrok-cli/sigrok-cli-"
- version ".tar.gz"))
- (sha256
- (base32
- "1f0a2k8qdcin0pqiqq5ni4khzsnv61l21v1dfdjzayw96qzl9l3i"))))
- (native-inputs
- (list pkg-config))
- (inputs
- (list glib libsigrok libsigrokdecode))
- (build-system gnu-build-system)
- (home-page "https://sigrok.org/wiki/Sigrok-cli")
- (synopsis "Command-line frontend for sigrok")
- (description "Sigrok-cli is a command-line frontend for sigrok.")
- (license license:gpl3+)))
- (define-public openboardview
- (package
- (name "openboardview")
- (version "8.95.2")
- (source (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/OpenBoardView/OpenBoardView")
- (commit version)))
- (file-name (git-file-name name version))
- (modules '((ice-9 ftw)
- (srfi srfi-26)
- (guix build utils)))
- (snippet
- '(with-directory-excursion "src"
- (define keep (list "." ".." "openboardview"))
- (for-each (lambda (f)
- (when (eq? 'directory (stat:type (lstat f)))
- (delete-file-recursively f)))
- (scandir "." (negate (cut member <> keep))))))
- (patches
- (search-patches "openboardview-use-system-imgui.patch"
- "openboardview-use-system-utf8.patch"))
- (sha256
- (base32
- "1n2yfi8wpky0y231kq2zdgwn7f7kff8m53m904hxi5ppmwhx1d6q"))))
- (build-system cmake-build-system)
- (arguments
- (list
- #:tests? #f
- #:imported-modules `((guix build glib-or-gtk-build-system)
- ,@%cmake-build-system-modules)
- #:modules '((guix build cmake-build-system)
- (guix build utils)
- ((guix build glib-or-gtk-build-system) #:prefix gtk:))
- #:phases
- #~(modify-phases %standard-phases
- (add-before 'configure 'configure-glad
- (lambda* (#:key inputs #:allow-other-keys)
- (substitute* "src/CMakeLists.txt"
- (("add_subdirectory\\(glad\\)")
- (string-append
-
-
- "option(GLAD_REPRODUCIBLE \"Reproducible build\" ON)\n"
-
- "add_subdirectory("
- (search-input-directory inputs "share/glad")
- " src/glad)\n")))))
- (add-before 'configure 'fix-utf8-include-directive
-
-
- (lambda _
- (substitute* '("src/openboardview/FileFormats/BRDFile.cpp"
- "src/openboardview/BoardView.cpp")
- (("utf8/utf8.h") "utf8.h"))))
- (add-before 'configure 'dynamically-load-gtk-via-absolute-path
-
-
-
- (lambda* (#:key inputs #:allow-other-keys)
- (substitute* "src/openboardview/unix.cpp"
- (("libgtk-3.so")
- (search-input-file inputs "lib/libgtk-3.so")))))
-
- (add-after 'install 'glib-or-gtk-compile-schemas
- (assoc-ref gtk:%standard-phases 'glib-or-gtk-compile-schemas))
- (add-after 'install 'glib-or-gtk-wrap
- (assoc-ref gtk:%standard-phases 'glib-or-gtk-wrap)))))
- (native-inputs
- (list pkg-config
- python
- glad
- stb-image
- utf8-h))
- (inputs
- (list fontconfig
- gtk+
- imgui
- sdl2
- sqlite
- zlib))
- (home-page "https://openboardview.org/")
- (synopsis "Viewer for BoardView files")
- (description "OpenBoardView is a viewer for BoardView files, which present
- the details of a printed circuit board (PCB). It comes with features
- such as:
- @itemize
- @item Dynamic part outline rendering, including complex connectors
- @item Annotations, for leaving notes about parts, nets, pins or location
- @item Configurable colour themes
- @item Configurable DPI to facilitate usage on 4K monitors
- @item Configurable for running on slower systems
- @item Reads FZ (with key), BRD, BRD2, BDV and BV* formats.
- @end itemize")
- (license license:expat)))
- (define-public pulseview
- (package
- (name "pulseview")
- (version "0.4.2")
- (source (origin
- (method url-fetch)
- (uri (string-append
- "https://sigrok.org/download/source/pulseview/pulseview-"
- version ".tar.gz"))
- (sha256
- (base32
- "1jxbpz1h3m1mgrxw74rnihj8vawgqdpf6c33cqqbyd8v7rxgfhph"))
- (patches (search-patches "pulseview-qt515-compat.patch"
- "pulseview-glib-2.68.patch"))))
- (build-system cmake-build-system)
- (arguments
- `(#:tests? #f
- #:phases
- (modify-phases %standard-phases
- (add-after 'install 'remove-empty-doc-directory
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out")))
- (with-directory-excursion (string-append out "/share")
-
- (rmdir "doc/pulseview")
- (rmdir "doc"))))))))
- (native-inputs
- (list pkg-config qttools))
- (inputs
- (list boost
- glib
- glibmm
- libsigrok
- libsigrokdecode
- qtbase-5
- qtsvg))
- (home-page "https://www.sigrok.org/wiki/PulseView")
- (synopsis "Qt based logic analyzer, oscilloscope and MSO GUI for sigrok")
- (description "PulseView is a Qt based logic analyzer, oscilloscope and MSO GUI
- for sigrok.")
- (license license:gpl3+)))
- (define-public comedilib
- (package
- (name "comedilib")
- (version "0.12.0")
- (source (origin
- (method url-fetch)
- (uri (string-append "https://www.comedi.org/download/comedilib-"
- version ".tar.gz"))
- (sha256
- (base32
- "0wzh23iyix4xj211fsd8hwrdcjhg2w5jswk9kywb1gpd3h8afajj"))))
- (build-system gnu-build-system)
- (synopsis "Library for Comedi")
- (description "Comedilib is a user-space library that provides a
- developer-friendly interface to Comedi devices. Comedi is a collection of
- drivers for a variety of common data acquisition plug-in boards. The drivers
- are implemented as a core Linux kernel module providing common functionality and
- individual low-level driver modules.")
- (home-page "https://www.comedi.org/")
- (license license:lgpl2.1)))
- (define-public xoscope
- (package
- (name "xoscope")
- (version "2.3")
- (source (origin
- (method url-fetch)
- (uri (string-append "mirror://sourceforge/xoscope/xoscope/"
- version "/xoscope-" version ".tar.gz"))
- (sha256
- (base32
- "0a5ycfc1qdmibvagc82r2mhv2i99m6pndy5i6ixas3j2297g6pgq"))))
- (build-system gnu-build-system)
- (native-inputs
- (list m4 pkg-config))
- (inputs
- (list alsa-lib comedilib fftw gtk+ gtkdatabox))
- (synopsis "Digital oscilloscope")
- (description "Xoscope is a digital oscilloscope that can acquire signals
- from ALSA, ESD, and COMEDI sources. This package currently does not include
- support for ESD sources.")
- (home-page "http://xoscope.sourceforge.net/")
- (license license:gpl2+)))
|