aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRutherther <rutherther@ditigal.xyz>2025-04-20 18:47:18 +0200
committerGuillaume Le Vaillant <glv@posteo.net>2025-04-21 11:39:26 +0200
commit95ccd0ca005ac02125110664308fed1c0278f981 (patch)
tree70001cd1ea3a204a5b79ac229e7965e2d5edefab
parent9ecefea718b76e50cec8326009fbb71c650e3d41 (diff)
downloadguix-95ccd0ca005ac02125110664308fed1c0278f981.tar.gz
guix-95ccd0ca005ac02125110664308fed1c0278f981.zip
gnu: Add libiio.
* gnu/packages/radio.scm (libiio): New variable. Change-Id: Ic34895af35fa008923fed0de74ad12ffc75f2021 Signed-off-by: Guillaume Le Vaillant <glv@posteo.net>
-rw-r--r--gnu/packages/radio.scm74
1 files changed, 74 insertions, 0 deletions
diff --git a/gnu/packages/radio.scm b/gnu/packages/radio.scm
index 2752380a3a..6b3805201f 100644
--- a/gnu/packages/radio.scm
+++ b/gnu/packages/radio.scm
@@ -16,6 +16,7 @@
;;; Copyright © 2023, 2025 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2024 Andy Tai <atai@atai.org>
;;; Copyright © 2024 Noisytoot <ron@noisytoot.org>
+;;; Copyright © 2025 Rutherther <rutherther@ditigal.xyz>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -49,6 +50,7 @@
#:use-module (gnu packages autotools)
#:use-module (gnu packages base)
#:use-module (gnu packages bash)
+ #:use-module (gnu packages bison)
#:use-module (gnu packages boost)
#:use-module (gnu packages check)
#:use-module (gnu packages compression)
@@ -56,6 +58,7 @@
#:use-module (gnu packages databases)
#:use-module (gnu packages documentation)
#:use-module (gnu packages engineering)
+ #:use-module (gnu packages flex)
#:use-module (gnu packages fltk)
#:use-module (gnu packages gcc)
#:use-module (gnu packages gd)
@@ -190,6 +193,77 @@ error correction. It also includes a compatibility layer so that it can be
used as a drop-in substitute for @code{libfec}.")
(license license:bsd-3))))
+(define-public libiio
+ (package
+ (name "libiio")
+ (version "0.26")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/analogdevicesinc/libiio")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "18cmaszfmn6kaa9gi26kkgjk506xqb8zsd4bq6yp8hzxr1qldfly"))))
+ (arguments
+ (list
+ #:tests? #f
+ #:configure-flags
+ #~(list
+ (string-append "-DPKG_CONFIG_EXECUTABLE="
+ (search-input-file
+ %build-inputs
+ (string-append "/bin/" #$(pkg-config-for-target))))
+ (string-append "-DUDEV_RULES_INSTALL_DIR="
+ #$output "/lib/udev/rules.d")
+ "-DOSX_PACKAGE=off"
+ "-DOSX_FRAMEWORK=off"
+ (string-append "-DPython_EXECUTABLE="
+ (search-input-file %build-inputs "/bin/python3"))
+ "-DPYTHON_BINDINGS=on")
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'patch
+ (lambda _
+ (substitute* "bindings/python/iio.py"
+ (("_iiolib = \"iio\"")
+ (string-append "_iiolib = \"" #$output "/lib/libiio.so\""))
+ (("find_library\\(_iiolib\\)") "_iiolib"))
+ ;; Libiio is not installed at the time of the build. The check
+ ;; is unnecessary, to do it the upstream way, we would have to
+ ;; configure, build, install without the bindings first, and then
+ ;; second time with the bindings...
+ (substitute* "bindings/python/setup.py.cmakein"
+ (("self._check_libiio_installed()") "")))))))
+ (native-inputs
+ (list pkg-config
+ flex
+ bison
+ python))
+ (inputs
+ (list avahi
+ libaio
+ libxml2
+ libusb))
+ (build-system cmake-build-system)
+ (license (list license:lgpl2.1
+ license:gpl2))
+ (home-page "https://github.com/analogdevicesinc/libiio")
+ (synopsis "Library for interfacing with Linux IIO devices")
+ (description
+ "Libiio is used to interface to the Linux Industrial Input/Output (IIO)
+Subsystem. The Linux IIO subsystem is intended to provide support for devices
+that in some sense are analog to digital or digital to analog converters
+(ADCs, DACs). This includes, but is not limited to ADCs, Accelerometers,
+Gyros, IMUs, Capacitance to Digital Converters (CDCs), Pressure Sensors,
+Color, Light and Proximity Sensors, Temperature Sensors, Magnetometers, DACs,
+DDS (Direct Digital Synthesis), PLLs (Phase Locked Loops),
+Variable/Programmable Gain Amplifiers (VGA, PGA), and RF transceivers. You can
+use libiio natively on an embedded Linux target (local mode), or use libiio to
+communicate remotely to that same target from a host Linux, Windows or MAC
+over USB or Ethernet or Serial.")))
+
(define-public liquid-dsp
(package
(name "liquid-dsp")