From 4aef3e72981477f2521ac346d65f7d48c8210bf7 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sun, 20 Apr 2025 18:13:31 +0200 Subject: [PATCH] fix: libiio python bindings --- modules/ruther/packages/radio.scm | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/modules/ruther/packages/radio.scm b/modules/ruther/packages/radio.scm index b10ca8bd62100b3584c065535bd1010556274e42..455ed88df5e4bd33f8160570c996442e7addc5d8 100644 --- a/modules/ruther/packages/radio.scm +++ b/modules/ruther/packages/radio.scm @@ -18,7 +18,7 @@ (define-public libiio (package (name "libiio") - (version "0.24") + (version "0.26") (source (origin (method git-fetch) @@ -27,7 +27,7 @@ (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "136n22macjz70bgxd7ix77gkv7zhbk3zzl340kwwpmb94z2fr4bk")))) + (base32 "18cmaszfmn6kaa9gi26kkgjk506xqb8zsd4bq6yp8hzxr1qldfly")))) (arguments (list #:tests? #f @@ -37,7 +37,19 @@ "-DOSX_PACKAGE=off" "-DOSX_FRAMEWORK=off" (string-append "-DPython_EXECUTABLE=" (search-input-file %build-inputs "/bin/python3")) - "-DPYTHON_BINDINGS=on"))) + "-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