diff options
Diffstat (limited to 'meta-oe/recipes-support/libiio')
3 files changed, 81 insertions, 105 deletions
diff --git a/meta-oe/recipes-support/libiio/files/0001-python-Do-not-verify-whether-libiio-is-installed-whe.patch b/meta-oe/recipes-support/libiio/files/0001-python-Do-not-verify-whether-libiio-is-installed-whe.patch deleted file mode 100644 index 4d3dcd5ced..0000000000 --- a/meta-oe/recipes-support/libiio/files/0001-python-Do-not-verify-whether-libiio-is-installed-whe.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 717b0f46b23ddc042da481d1d446bdd1c6c49142 Mon Sep 17 00:00:00 2001 -From: Julien Malik <julien.malik@unseenlabs.fr> -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 <julien.malik@paraiso.me> ---- - 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 - diff --git a/meta-oe/recipes-support/libiio/libiio_0.25.bb b/meta-oe/recipes-support/libiio/libiio_0.25.bb new file mode 100644 index 0000000000..2c6d2b5145 --- /dev/null +++ b/meta-oe/recipes-support/libiio/libiio_0.25.bb @@ -0,0 +1,81 @@ +SUMMARY = "Library for interfacing with IIO devices" +HOMEPAGE = "https://wiki.analog.com/resources/tools-software/linux-software/libiio" +SECTION = "libs" +LICENSE = "LGPL-2.1-or-later" +LIC_FILES_CHKSUM = "file://COPYING.txt;md5=7c13b3376cea0ce68d2d2da0a1b3a72c" + +SRCREV = "b6028fdeef888ab45f7c1dd6e4ed9480ae4b55e3" + +SRC_URI = "git://github.com/analogdevicesinc/libiio.git;protocol=https;branch=main" +UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)" + +S = "${WORKDIR}/git" + +SETUPTOOLS_SETUP_PATH ?= "${B}/bindings/python/" + +DEPENDS = " \ + flex-native bison-native libaio \ +" + +inherit cmake python3native systemd setuptools3 pkgconfig + +EXTRA_OECMAKE = " \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCPP_BINDINGS=ON \ + -DFLEX_TARGET_ARG_COMPILE_FLAGS='--noline' \ + -DBISON_TARGET_ARG_COMPILE_FLAGS='--no-lines' \ + -DUDEV_RULES_INSTALL_DIR=${nonarch_base_libdir}/udev/rules.d \ + ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '-DWITH_SYSTEMD=ON -DSYSTEMD_UNIT_INSTALL_DIR=${systemd_system_unitdir}', '', d)} \ +" + +PACKAGECONFIG ??= " \ + usb_backend network_backend serial_backend xml_backend \ + ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'dnssd', '', d)} \ +" + +# 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}-python3" + +# Inheriting setuptools3 incorrectly adds the dependency on python3-core +# to ${PN} instead of to ${PN}-python3 where it belongs. +RDEPENDS:${PN}:remove = "python3-core" +RDEPENDS:${PN}-python3 = "${PN} python3-core python3-ctypes python3-stringold" + +FILES:${PN}-iiod = " \ + ${sbindir}/iiod \ + ${systemd_system_unitdir}/iiod.service \ +" +FILES:${PN}-tests = "${bindir}" +FILES:${PN}-python3 = "${PYTHON_SITEPACKAGES_DIR}" + +SYSTEMD_PACKAGES = "${PN}-iiod" +SYSTEMD_SERVICE:${PN}-iiod = "iiod.service" + +# Explicitly define do_configure, do_compile and do_install because both cmake and setuptools3 have +# EXPORT_FUNCTIONS do_configure do_compile do_install +do_configure() { + cmake_do_configure +} + +do_compile() { + if ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'true', 'false', d)}; then + setuptools3_do_compile + fi + cmake_do_compile +} + +do_install() { + if ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'true', 'false', d)}; then + setuptools3_do_install + fi + cmake_do_install +} diff --git a/meta-oe/recipes-support/libiio/libiio_git.bb b/meta-oe/recipes-support/libiio/libiio_git.bb deleted file mode 100644 index d2d6fd4751..0000000000 --- a/meta-oe/recipes-support/libiio/libiio_git.bb +++ /dev/null @@ -1,71 +0,0 @@ -SUMMARY = "Library for interfacing with IIO devices" -HOMEPAGE = "https://wiki.analog.com/resources/tools-software/linux-software/libiio" -SECTION = "libs" -LICENSE = "LGPLv2.1+" -LIC_FILES_CHKSUM = "file://COPYING.txt;md5=7c13b3376cea0ce68d2d2da0a1b3a72c" - -SRCREV = "565bf68eccfdbbf22cf5cb6d792e23de564665c7" -PV = "0.21+git${SRCPV}" - -SRC_URI = "git://github.com/analogdevicesinc/libiio.git;protocol=https \ - file://0001-python-Do-not-verify-whether-libiio-is-installed-whe.patch \ -" -UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)" - -S = "${WORKDIR}/git" - -DISTUTILS_SETUP_PATH ?= "${B}/bindings/python/" - -DEPENDS = " \ - flex-native bison-native libaio \ - ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \ -" - -inherit cmake python3native systemd setuptools3 - -EXTRA_OECMAKE = " \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DUDEV_RULES_INSTALL_DIR=${nonarch_base_libdir}/udev/rules.d \ - ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '-DWITH_SYSTEMD=ON -DSYSTEMD_UNIT_INSTALL_DIR=${systemd_system_unitdir}', '', d)} \ -" - -PACKAGECONFIG ??= "usb_backend network_backend serial_backend" - -PACKAGECONFIG[usb_backend] = "-DWITH_USB_BACKEND=ON,-DWITH_USB_BACKEND=OFF,libusb1 libxml2" -PACKAGECONFIG[network_backend] = "-DWITH_NETWORK_BACKEND=ON,-DWITH_NETWORK_BACKEND=OFF,libxml2" -PACKAGECONFIG[serial_backend] = "-DWITH_SERIAL_BACKEND=ON,-DWITH_SERIAL_BACKEND=off,libserialport libxml2" -PACKAGECONFIG[libiio-python3] = "-DPYTHON_BINDINGS=ON,-DPYTHON_BINDINGS=OFF" - -PACKAGES =+ "${PN}-iiod ${PN}-tests ${PN}-${PYTHON_PN}" - -RDEPENDS_${PN}-${PYTHON_PN} = "${PN} ${PYTHON_PN}-ctypes ${PYTHON_PN}-stringold" - -FILES_${PN}-iiod = " \ - ${sbindir}/iiod \ - ${systemd_system_unitdir}/iiod.service \ -" -FILES_${PN}-tests = "${bindir}" -FILES_${PN}-${PYTHON_PN} = "${PYTHON_SITEPACKAGES_DIR}" - -SYSTEMD_PACKAGES = "${PN}-iiod" -SYSTEMD_SERVICE_${PN}-iiod = "iiod.service" - -# Explicitly define do_configure, do_compile and do_install because both cmake and setuptools3 have -# EXPORT_FUNCTIONS do_configure do_compile do_install -do_configure() { - cmake_do_configure -} - -do_compile() { - if ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'true', 'false', d)}; then - distutils3_do_compile - fi - cmake_do_compile -} - -do_install() { - if ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'true', 'false', d)}; then - distutils3_do_install - fi - cmake_do_install -} |