blob: 00c016db446ccf1d0c4670469b421b3794b9f10b [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
Brad Bishop316dfdd2018-06-25 12:45:53 -040010SRC_URI = "git://github.com/analogdevicesinc/libiio.git;protocol=https"
Andrew Geissler82c905d2020-04-13 13:39:40 -050011UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050012
13S = "${WORKDIR}/git"
14
Andrew Geissler32b11992021-03-31 13:37:05 -050015DISTUTILS_SETUP_PATH ?= "${B}/bindings/python/"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050016
Brad Bishop316dfdd2018-06-25 12:45:53 -040017DEPENDS = " \
18 flex-native bison-native libaio \
19 ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
20"
21
Andrew Geissler32b11992021-03-31 13:37:05 -050022inherit cmake python3native systemd setuptools3
23
Brad Bishop316dfdd2018-06-25 12:45:53 -040024EXTRA_OECMAKE = " \
25 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
26 -DUDEV_RULES_INSTALL_DIR=${nonarch_base_libdir}/udev/rules.d \
27 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '-DWITH_SYSTEMD=ON -DSYSTEMD_UNIT_INSTALL_DIR=${systemd_system_unitdir}', '', d)} \
28"
29
Brad Bishop868407c2019-11-04 13:24:47 -050030PACKAGECONFIG ??= "usb_backend network_backend"
Brad Bishop316dfdd2018-06-25 12:45:53 -040031
Brad Bishop868407c2019-11-04 13:24:47 -050032PACKAGECONFIG[usb_backend] = "-DWITH_USB_BACKEND=ON,-DWITH_USB_BACKEND=OFF,libusb1,libxml2"
33PACKAGECONFIG[network_backend] = "-DWITH_NETWORK_BACKEND=ON,-DWITH_NETWORK_BACKEND=OFF,libxml2"
34PACKAGECONFIG[libiio-python3] = "-DPYTHON_BINDINGS=ON,-DPYTHON_BINDINGS=OFF"
35
Brad Bishop6a62e0e2019-10-21 08:11:42 -040036PACKAGES =+ "${PN}-iiod ${PN}-tests ${PN}-${PYTHON_PN}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050037
Brad Bishop6a62e0e2019-10-21 08:11:42 -040038RDEPENDS_${PN}-${PYTHON_PN} = "${PN} ${PYTHON_PN}-ctypes ${PYTHON_PN}-stringold"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050039
Brad Bishop316dfdd2018-06-25 12:45:53 -040040FILES_${PN}-iiod = " \
41 ${sbindir}/iiod \
42 ${systemd_system_unitdir}/iiod.service \
43"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050044FILES_${PN}-tests = "${bindir}"
Brad Bishop6a62e0e2019-10-21 08:11:42 -040045FILES_${PN}-${PYTHON_PN} = "${PYTHON_SITEPACKAGES_DIR}"
Brad Bishop316dfdd2018-06-25 12:45:53 -040046
47SYSTEMD_PACKAGES = "${PN}-iiod"
48SYSTEMD_SERVICE_${PN}-iiod = "iiod.service"
Andrew Geissler32b11992021-03-31 13:37:05 -050049
50# Explicitly define do_configure, do_compile and do_install because both cmake and setuptools3 have
51# EXPORT_FUNCTIONS do_configure do_compile do_install
52do_configure() {
53 cmake_do_configure
54}
55
56do_compile() {
57 if ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'true', 'false', d)}; then
58 distutils3_do_compile
59 fi
60 cmake_do_compile
61}
62
63do_install() {
64 if ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'true', 'false', d)}; then
65 distutils3_do_install
66 fi
67 cmake_do_install
68}