libiio: update to version 0.23
PATCH v2 1/1 libiio: update to version 0.23
- drop 0001-python-Do-not-verify-whether-libiio-is-installed-whe.patch (integrated upstream)
- new PACKAGECONFIG "xml_backend" (WITH_XML_BACKEND=off must be explicitly provided if libxml2 is not available)
- new PACKAGECONFIG "dnssd" (HAVE_DNS_SD=off must be explicitly provided if libavahi is not available)
- python library has been renamed (libiio --> pylibiio)
---
Changes in v2:
--------------
- added 0001-CMake-Move-include-CheckCSourceCompiles-before-its-m.patch (taken from upstream)
- PACKAGECONFIG: don't disable xml_backend if either network_backend, serial_backend or usb_backend is enabled.
Quoted 21 lines · Khem Raj
this fails to configure see
https://errors.yoctoproject.org/Errors/Details/651289/
I think you need a patch something on these lines
diff --git
a/CMakeLists.txtb/CMakeLists.txt
index91db382a..eed83a46100644
---a/CMakeLists.txt
+++b/CMakeLists.txt
@@ -291,7 +291,7 @@ if (WITH_ZSTD)
endif (WITH_ZSTD)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
-
+include(CheckCSourceCompiles)
if(WITH_NETWORK_BACKEND)
message(STATUS "Building with Network back end support")
if (WIN32)
Quoted 1 line
Try it out and test and resend if it fixes the problem.
Although I understand the problem, I am not able to reproduce it. So need please test again on your CI for this.
regards,
Christian
...rify-whether-libiio-is-installed-whe.patch | 34 ----------------- ...de-CheckCSourceCompiles-before-its-m.patch | 38 +++++++++++++++++++ meta-oe/recipes-support/libiio/libiio_git.bb | 26 +++++++------ 3 files changed, 53 insertions(+), 45 deletions(-) delete mode 100644 meta-oe/recipes-support/libiio/files/0001-python-Do-not-verify-whether-libiio-is-installed-whe.patch create mode 100644 meta-oe/recipes-support/libiio/libiio/0001-CMake-Move-include-CheckCSourceCompiles-before-its-m.patch
meta-oe/recipes-support/libiio/files/0001-python-Do-not-verify-whether-libiio-is-installed-whe.patch deleted +0 -34
@@ -1,34 +0,0 @@ -From 717b0f46b23ddc042da481d1d446bdd1c6c49142 Mon Sep 17 00:00:00 2001 -From: Julien Malik <[email protected]> -Date: Mon, 27 Jul 2020 14:34:44 +0200 -Subject: [PATCH] python: Do not verify whether libiio is installed when - cross-compiling - -This should fix #561 - -Signed-off-by: Julien Malik <[email protected]> ---- - bindings/python/setup.py.cmakein | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/bindings/python/setup.py.cmakein b/bindings/python/setup.py.cmakein -index cd14e2e..96d58a8 100644 ---- a/bindings/python/setup.py.cmakein -+++ b/bindings/python/setup.py.cmakein -@@ -54,6 +54,13 @@ class InstallWrapper(install): - install.run(self) - - def _check_libiio_installed(self): -+ cross_compiling = ("${CMAKE_CROSSCOMPILING}" == "TRUE") -+ if cross_compiling: -+ # When cross-compiling, we generally cannot dlopen -+ # the libiio shared lib from the build platform. -+ # Simply skip this check in that case. -+ return -+ - from platform import system as _system - from ctypes import CDLL as _cdll - from ctypes.util import find_library --- -2.25.1 -
meta-oe/recipes-support/libiio/libiio/0001-CMake-Move-include-CheckCSourceCompiles-before-its-m.patch new file +38 -0
@@ -0,0 +1,38 @@ +From 758ba58c81273d9075a539216f8a322935c2e434 Mon Sep 17 00:00:00 2001 +From: Paul Cercueil <[email protected]> +Date: Fri, 12 Nov 2021 16:49:21 +0000 +Subject: [PATCH] CMake: Move include(CheckCSourceCompiles) before its macros + are used + +Move include(CheckCSourceCompiles) before any of the +check_c_source_compiles() macros is called. + +This fixes a CMake error when compiling with WITH_NETWORK_GET_BUFFER +disabled. + +Upstream-Status: Accepted [https://github.com/analogdevicesinc/libiio/commit/758ba58c81273d9075a539216f8a322935c2e434] + +Signed-off-by: Paul Cercueil <[email protected]> +--- + CMakeLists.txt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7437136c8210..05b4feff233b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -296,9 +296,10 @@ if(WITH_NETWORK_BACKEND) + endif() + + if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") ++ include(CheckCSourceCompiles) ++ + option(WITH_NETWORK_GET_BUFFER "Enable experimental zero-copy transfers" OFF) + if (WITH_NETWORK_GET_BUFFER) +- include(CheckCSourceCompiles) + check_c_source_compiles("#define _GNU_SOURCE=1\n#include <fcntl.h>\nint main(void) { return O_TMPFILE; }" + HAS_O_TMPFILE) + +-- +2.34.1 +
meta-oe/recipes-support/libiio/libiio_git.bb +15 -11
@@ -4,11 +4,11 @@ SECTION = "libs" LICENSE = "LGPL-2.1-or-later" LIC_FILES_CHKSUM = "file://COPYING.txt;md5=7c13b3376cea0ce68d2d2da0a1b3a72c" -SRCREV = "565bf68eccfdbbf22cf5cb6d792e23de564665c7" -PV = "0.21+git${SRCPV}" +SRCREV = "92d6a35f3d8d721cda7d6fe664b435311dd368b4" +PV = "0.23" SRC_URI = "git://github.com/analogdevicesinc/libiio.git;protocol=https;branch=master \ - file://0001-python-Do-not-verify-whether-libiio-is-installed-whe.patch \ + file://0001-CMake-Move-include-CheckCSourceCompiles-before-its-m.patch \ " UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
@@ -28,16 +28,19 @@ EXTRA_OECMAKE = " \ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '-DWITH_SYSTEMD=ON -DSYSTEMD_UNIT_INSTALL_DIR=${systemd_system_unitdir}', '', d)} \ " -PACKAGECONFIG ??= "usb_backend network_backend serial_backend" - -NETWORK_BACKEND_DEPENDENCIES = "\ - libxml2 \ - ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \ +PACKAGECONFIG ??= " \ + usb_backend network_backend serial_backend xml_backend \ + ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'dnssd', '', d)} \ " -PACKAGECONFIG[usb_backend] = "-DWITH_USB_BACKEND=ON,-DWITH_USB_BACKEND=OFF,libusb1 libxml2" -PACKAGECONFIG[network_backend] = "-DWITH_NETWORK_BACKEND=ON,-DWITH_NETWORK_BACKEND=OFF, ${NETWORK_BACKEND_DEPENDENCIES}" -PACKAGECONFIG[serial_backend] = "-DWITH_SERIAL_BACKEND=ON,-DWITH_SERIAL_BACKEND=off,libserialport libxml2" +# network_backend, serial_backend and usb_backend depend on xml_backend, so don't switch it off +XML_BACKEND_DISABLE = "${@bb.utils.contains_any('PACKAGECONFIG', 'network_backend serial_backend usb_backend', '', '-DWITH_XML_BACKEND=off', d)}" + +PACKAGECONFIG[usb_backend] = "-DWITH_USB_BACKEND=ON -DWITH_XML_BACKEND=ON,-DWITH_USB_BACKEND=OFF,libusb1 libxml2" +PACKAGECONFIG[network_backend] = "-DWITH_NETWORK_BACKEND=ON -DWITH_XML_BACKEND=ON,-DWITH_NETWORK_BACKEND=OFF,libxml2" +PACKAGECONFIG[serial_backend] = "-DWITH_SERIAL_BACKEND=ON -DWITH_XML_BACKEND=ON,-DWITH_SERIAL_BACKEND=off,libserialport libxml2" +PACKAGECONFIG[xml_backend] = "-DWITH_XML_BACKEND=ON,${XML_BACKEND_DISABLE},libxml2" +PACKAGECONFIG[dnssd] = "-DHAVE_DNS_SD=ON,-DHAVE_DNS_SD=off,avahi" PACKAGECONFIG[libiio-python3] = "-DPYTHON_BINDINGS=ON,-DPYTHON_BINDINGS=OFF" PACKAGES =+ "${PN}-iiod ${PN}-tests ${PN}-${PYTHON_PN}"
@@ -70,6 +73,7 @@ do_compile() { cmake_do_compile } +PIP_INSTALL_PACKAGE = "pylibiio" do_install() { if ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'true', 'false', d)}; then setuptools3_do_install
Signature · 1 line
2.34.1