blob: 2c6d2b5145a36f234034012083a4224c764b840a [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001SUMMARY = "Library for interfacing with IIO devices"
2HOMEPAGE = "https://wiki.analog.com/resources/tools-software/linux-software/libiio"
3SECTION = "libs"
Andrew Geissler9aee5002022-03-30 16:27:02 +00004LICENSE = "LGPL-2.1-or-later"
Brad Bishop6e60e8b2018-02-01 10:27:11 -05005LIC_FILES_CHKSUM = "file://COPYING.txt;md5=7c13b3376cea0ce68d2d2da0a1b3a72c"
6
Andrew Geissler5082cc72023-09-11 08:41:39 -04007SRCREV = "b6028fdeef888ab45f7c1dd6e4ed9480ae4b55e3"
Brad Bishop6e60e8b2018-02-01 10:27:11 -05008
Andrew Geissler5082cc72023-09-11 08:41:39 -04009SRC_URI = "git://github.com/analogdevicesinc/libiio.git;protocol=https;branch=main"
Andrew Geissler82c905d2020-04-13 13:39:40 -050010UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050011
12S = "${WORKDIR}/git"
13
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000014SETUPTOOLS_SETUP_PATH ?= "${B}/bindings/python/"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050015
Brad Bishop316dfdd2018-06-25 12:45:53 -040016DEPENDS = " \
17 flex-native bison-native libaio \
Brad Bishop316dfdd2018-06-25 12:45:53 -040018"
19
Patrick Williamse760df82023-05-26 11:10:49 -050020inherit cmake python3native systemd setuptools3 pkgconfig
Andrew Geissler32b11992021-03-31 13:37:05 -050021
Brad Bishop316dfdd2018-06-25 12:45:53 -040022EXTRA_OECMAKE = " \
23 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
Andrew Geissler8f840682023-07-21 09:09:43 -050024 -DCPP_BINDINGS=ON \
Andrew Geissler3eeda902023-05-19 10:14:02 -050025 -DFLEX_TARGET_ARG_COMPILE_FLAGS='--noline' \
26 -DBISON_TARGET_ARG_COMPILE_FLAGS='--no-lines' \
Brad Bishop316dfdd2018-06-25 12:45:53 -040027 -DUDEV_RULES_INSTALL_DIR=${nonarch_base_libdir}/udev/rules.d \
28 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '-DWITH_SYSTEMD=ON -DSYSTEMD_UNIT_INSTALL_DIR=${systemd_system_unitdir}', '', d)} \
29"
30
Andrew Geissler9aee5002022-03-30 16:27:02 +000031PACKAGECONFIG ??= " \
32 usb_backend network_backend serial_backend xml_backend \
33 ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'dnssd', '', d)} \
Patrick Williams93c203f2021-10-06 16:15:23 -050034"
35
Andrew Geissler9aee5002022-03-30 16:27:02 +000036# network_backend, serial_backend and usb_backend depend on xml_backend, so don't switch it off
37XML_BACKEND_DISABLE = "${@bb.utils.contains_any('PACKAGECONFIG', 'network_backend serial_backend usb_backend', '', '-DWITH_XML_BACKEND=off', d)}"
38
39PACKAGECONFIG[usb_backend] = "-DWITH_USB_BACKEND=ON -DWITH_XML_BACKEND=ON,-DWITH_USB_BACKEND=OFF,libusb1 libxml2"
40PACKAGECONFIG[network_backend] = "-DWITH_NETWORK_BACKEND=ON -DWITH_XML_BACKEND=ON,-DWITH_NETWORK_BACKEND=OFF,libxml2"
41PACKAGECONFIG[serial_backend] = "-DWITH_SERIAL_BACKEND=ON -DWITH_XML_BACKEND=ON,-DWITH_SERIAL_BACKEND=off,libserialport libxml2"
42PACKAGECONFIG[xml_backend] = "-DWITH_XML_BACKEND=ON,${XML_BACKEND_DISABLE},libxml2"
43PACKAGECONFIG[dnssd] = "-DHAVE_DNS_SD=ON,-DHAVE_DNS_SD=off,avahi"
Brad Bishop868407c2019-11-04 13:24:47 -050044PACKAGECONFIG[libiio-python3] = "-DPYTHON_BINDINGS=ON,-DPYTHON_BINDINGS=OFF"
45
Patrick Williams39653562024-03-01 08:54:02 -060046PACKAGES =+ "${PN}-iiod ${PN}-tests ${PN}-python3"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050047
Patrick Williams39653562024-03-01 08:54:02 -060048# Inheriting setuptools3 incorrectly adds the dependency on python3-core
49# to ${PN} instead of to ${PN}-python3 where it belongs.
50RDEPENDS:${PN}:remove = "python3-core"
51RDEPENDS:${PN}-python3 = "${PN} python3-core python3-ctypes python3-stringold"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050052
Patrick Williams213cb262021-08-07 19:21:33 -050053FILES:${PN}-iiod = " \
Brad Bishop316dfdd2018-06-25 12:45:53 -040054 ${sbindir}/iiod \
55 ${systemd_system_unitdir}/iiod.service \
56"
Patrick Williams213cb262021-08-07 19:21:33 -050057FILES:${PN}-tests = "${bindir}"
Patrick Williams39653562024-03-01 08:54:02 -060058FILES:${PN}-python3 = "${PYTHON_SITEPACKAGES_DIR}"
Brad Bishop316dfdd2018-06-25 12:45:53 -040059
60SYSTEMD_PACKAGES = "${PN}-iiod"
Patrick Williams213cb262021-08-07 19:21:33 -050061SYSTEMD_SERVICE:${PN}-iiod = "iiod.service"
Andrew Geissler32b11992021-03-31 13:37:05 -050062
63# Explicitly define do_configure, do_compile and do_install because both cmake and setuptools3 have
64# EXPORT_FUNCTIONS do_configure do_compile do_install
65do_configure() {
66 cmake_do_configure
67}
68
69do_compile() {
70 if ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'true', 'false', d)}; then
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000071 setuptools3_do_compile
Andrew Geissler32b11992021-03-31 13:37:05 -050072 fi
73 cmake_do_compile
74}
75
76do_install() {
77 if ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'true', 'false', d)}; then
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000078 setuptools3_do_install
Andrew Geissler32b11992021-03-31 13:37:05 -050079 fi
80 cmake_do_install
81}