blob: 6ac534a28892e51ded924c43134ea528958099d9 [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 \
21 ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
22"
23
Andrew Geissler32b11992021-03-31 13:37:05 -050024inherit cmake python3native systemd setuptools3
25
Brad Bishop316dfdd2018-06-25 12:45:53 -040026EXTRA_OECMAKE = " \
27 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
28 -DUDEV_RULES_INSTALL_DIR=${nonarch_base_libdir}/udev/rules.d \
29 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '-DWITH_SYSTEMD=ON -DSYSTEMD_UNIT_INSTALL_DIR=${systemd_system_unitdir}', '', d)} \
30"
31
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070032PACKAGECONFIG ??= "usb_backend network_backend serial_backend"
Brad Bishop316dfdd2018-06-25 12:45:53 -040033
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070034PACKAGECONFIG[usb_backend] = "-DWITH_USB_BACKEND=ON,-DWITH_USB_BACKEND=OFF,libusb1 libxml2"
Brad Bishop868407c2019-11-04 13:24:47 -050035PACKAGECONFIG[network_backend] = "-DWITH_NETWORK_BACKEND=ON,-DWITH_NETWORK_BACKEND=OFF,libxml2"
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070036PACKAGECONFIG[serial_backend] = "-DWITH_SERIAL_BACKEND=ON,-DWITH_SERIAL_BACKEND=off,libserialport libxml2"
Brad Bishop868407c2019-11-04 13:24:47 -050037PACKAGECONFIG[libiio-python3] = "-DPYTHON_BINDINGS=ON,-DPYTHON_BINDINGS=OFF"
38
Brad Bishop6a62e0e2019-10-21 08:11:42 -040039PACKAGES =+ "${PN}-iiod ${PN}-tests ${PN}-${PYTHON_PN}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050040
Andrew Geissler5199d832021-09-24 16:47:35 -050041# Inheriting setuptools3 incorrectly adds the dependency on ${PYTHON_PN}-core
42# to ${PN} instead of to ${PN}-${PYTHON_PN} where it belongs.
43RDEPENDS:${PN}:remove = "${PYTHON_PN}-core"
44RDEPENDS:${PN}-${PYTHON_PN} = "${PN} ${PYTHON_PN}-core ${PYTHON_PN}-ctypes ${PYTHON_PN}-stringold"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050045
Patrick Williams213cb262021-08-07 19:21:33 -050046FILES:${PN}-iiod = " \
Brad Bishop316dfdd2018-06-25 12:45:53 -040047 ${sbindir}/iiod \
48 ${systemd_system_unitdir}/iiod.service \
49"
Patrick Williams213cb262021-08-07 19:21:33 -050050FILES:${PN}-tests = "${bindir}"
51FILES:${PN}-${PYTHON_PN} = "${PYTHON_SITEPACKAGES_DIR}"
Brad Bishop316dfdd2018-06-25 12:45:53 -040052
53SYSTEMD_PACKAGES = "${PN}-iiod"
Patrick Williams213cb262021-08-07 19:21:33 -050054SYSTEMD_SERVICE:${PN}-iiod = "iiod.service"
Andrew Geissler32b11992021-03-31 13:37:05 -050055
56# Explicitly define do_configure, do_compile and do_install because both cmake and setuptools3 have
57# EXPORT_FUNCTIONS do_configure do_compile do_install
58do_configure() {
59 cmake_do_configure
60}
61
62do_compile() {
63 if ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'true', 'false', d)}; then
64 distutils3_do_compile
65 fi
66 cmake_do_compile
67}
68
69do_install() {
70 if ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'true', 'false', d)}; then
71 distutils3_do_install
72 fi
73 cmake_do_install
74}