blob: 488d4e3b0b72ad972c7e15c2a55784d33a8dce4a [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"
4LICENSE = "LGPLv2.1+"
5LIC_FILES_CHKSUM = "file://COPYING.txt;md5=7c13b3376cea0ce68d2d2da0a1b3a72c"
6
Andrew Geisslerd221e032020-07-10 16:13:21 -05007SRCREV = "565bf68eccfdbbf22cf5cb6d792e23de564665c7"
8PV = "0.21+git${SRCPV}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -05009
Andrew Geissler69721092021-07-23 12:57:00 -040010SRC_URI = "git://github.com/analogdevicesinc/libiio.git;protocol=https \
11 file://0001-python-Do-not-verify-whether-libiio-is-installed-whe.patch \
12"
Andrew Geissler82c905d2020-04-13 13:39:40 -050013UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050014
15S = "${WORKDIR}/git"
16
Andrew Geissler32b11992021-03-31 13:37:05 -050017DISTUTILS_SETUP_PATH ?= "${B}/bindings/python/"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050018
Brad Bishop316dfdd2018-06-25 12:45:53 -040019DEPENDS = " \
20 flex-native bison-native libaio \
Brad Bishop316dfdd2018-06-25 12:45:53 -040021"
22
Andrew Geissler32b11992021-03-31 13:37:05 -050023inherit cmake python3native systemd setuptools3
24
Brad Bishop316dfdd2018-06-25 12:45:53 -040025EXTRA_OECMAKE = " \
26 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
27 -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
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070031PACKAGECONFIG ??= "usb_backend network_backend serial_backend"
Brad Bishop316dfdd2018-06-25 12:45:53 -040032
Patrick Williams93c203f2021-10-06 16:15:23 -050033NETWORK_BACKEND_DEPENDENCIES = "\
34 libxml2 \
35 ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
36"
37
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070038PACKAGECONFIG[usb_backend] = "-DWITH_USB_BACKEND=ON,-DWITH_USB_BACKEND=OFF,libusb1 libxml2"
Patrick Williams93c203f2021-10-06 16:15:23 -050039PACKAGECONFIG[network_backend] = "-DWITH_NETWORK_BACKEND=ON,-DWITH_NETWORK_BACKEND=OFF, ${NETWORK_BACKEND_DEPENDENCIES}"
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070040PACKAGECONFIG[serial_backend] = "-DWITH_SERIAL_BACKEND=ON,-DWITH_SERIAL_BACKEND=off,libserialport libxml2"
Brad Bishop868407c2019-11-04 13:24:47 -050041PACKAGECONFIG[libiio-python3] = "-DPYTHON_BINDINGS=ON,-DPYTHON_BINDINGS=OFF"
42
Brad Bishop6a62e0e2019-10-21 08:11:42 -040043PACKAGES =+ "${PN}-iiod ${PN}-tests ${PN}-${PYTHON_PN}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050044
Andrew Geissler5199d832021-09-24 16:47:35 -050045# Inheriting setuptools3 incorrectly adds the dependency on ${PYTHON_PN}-core
46# to ${PN} instead of to ${PN}-${PYTHON_PN} where it belongs.
47RDEPENDS:${PN}:remove = "${PYTHON_PN}-core"
48RDEPENDS:${PN}-${PYTHON_PN} = "${PN} ${PYTHON_PN}-core ${PYTHON_PN}-ctypes ${PYTHON_PN}-stringold"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050049
Patrick Williams213cb262021-08-07 19:21:33 -050050FILES:${PN}-iiod = " \
Brad Bishop316dfdd2018-06-25 12:45:53 -040051 ${sbindir}/iiod \
52 ${systemd_system_unitdir}/iiod.service \
53"
Patrick Williams213cb262021-08-07 19:21:33 -050054FILES:${PN}-tests = "${bindir}"
55FILES:${PN}-${PYTHON_PN} = "${PYTHON_SITEPACKAGES_DIR}"
Brad Bishop316dfdd2018-06-25 12:45:53 -040056
57SYSTEMD_PACKAGES = "${PN}-iiod"
Patrick Williams213cb262021-08-07 19:21:33 -050058SYSTEMD_SERVICE:${PN}-iiod = "iiod.service"
Andrew Geissler32b11992021-03-31 13:37:05 -050059
60# Explicitly define do_configure, do_compile and do_install because both cmake and setuptools3 have
61# EXPORT_FUNCTIONS do_configure do_compile do_install
62do_configure() {
63 cmake_do_configure
64}
65
66do_compile() {
67 if ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'true', 'false', d)}; then
68 distutils3_do_compile
69 fi
70 cmake_do_compile
71}
72
73do_install() {
74 if ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'true', 'false', d)}; then
75 distutils3_do_install
76 fi
77 cmake_do_install
78}