Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1 | SUMMARY = "Library for interfacing with IIO devices" |
| 2 | HOMEPAGE = "https://wiki.analog.com/resources/tools-software/linux-software/libiio" |
| 3 | SECTION = "libs" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 4 | LICENSE = "LGPL-2.1-or-later" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 5 | LIC_FILES_CHKSUM = "file://COPYING.txt;md5=7c13b3376cea0ce68d2d2da0a1b3a72c" |
| 6 | |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 7 | SRCREV = "c4498c27761d04d4ac631ec59c1613bfed079da5" |
| 8 | PV = "0.24" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 9 | |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 10 | SRC_URI = "git://github.com/analogdevicesinc/libiio.git;protocol=https;branch=master" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 11 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 12 | |
| 13 | S = "${WORKDIR}/git" |
| 14 | |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 15 | SETUPTOOLS_SETUP_PATH ?= "${B}/bindings/python/" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 16 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 17 | DEPENDS = " \ |
| 18 | flex-native bison-native libaio \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 19 | " |
| 20 | |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 21 | inherit cmake python3native systemd setuptools3 pkgconfig |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 22 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 23 | EXTRA_OECMAKE = " \ |
| 24 | -DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
Andrew Geissler | 3eeda90 | 2023-05-19 10:14:02 -0500 | [diff] [blame] | 25 | -DFLEX_TARGET_ARG_COMPILE_FLAGS='--noline' \ |
| 26 | -DBISON_TARGET_ARG_COMPILE_FLAGS='--no-lines' \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 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 | |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 31 | PACKAGECONFIG ??= " \ |
| 32 | usb_backend network_backend serial_backend xml_backend \ |
| 33 | ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'dnssd', '', d)} \ |
Patrick Williams | 93c203f | 2021-10-06 16:15:23 -0500 | [diff] [blame] | 34 | " |
| 35 | |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 36 | # network_backend, serial_backend and usb_backend depend on xml_backend, so don't switch it off |
| 37 | XML_BACKEND_DISABLE = "${@bb.utils.contains_any('PACKAGECONFIG', 'network_backend serial_backend usb_backend', '', '-DWITH_XML_BACKEND=off', d)}" |
| 38 | |
| 39 | PACKAGECONFIG[usb_backend] = "-DWITH_USB_BACKEND=ON -DWITH_XML_BACKEND=ON,-DWITH_USB_BACKEND=OFF,libusb1 libxml2" |
| 40 | PACKAGECONFIG[network_backend] = "-DWITH_NETWORK_BACKEND=ON -DWITH_XML_BACKEND=ON,-DWITH_NETWORK_BACKEND=OFF,libxml2" |
| 41 | PACKAGECONFIG[serial_backend] = "-DWITH_SERIAL_BACKEND=ON -DWITH_XML_BACKEND=ON,-DWITH_SERIAL_BACKEND=off,libserialport libxml2" |
| 42 | PACKAGECONFIG[xml_backend] = "-DWITH_XML_BACKEND=ON,${XML_BACKEND_DISABLE},libxml2" |
| 43 | PACKAGECONFIG[dnssd] = "-DHAVE_DNS_SD=ON,-DHAVE_DNS_SD=off,avahi" |
Brad Bishop | 868407c | 2019-11-04 13:24:47 -0500 | [diff] [blame] | 44 | PACKAGECONFIG[libiio-python3] = "-DPYTHON_BINDINGS=ON,-DPYTHON_BINDINGS=OFF" |
| 45 | |
Brad Bishop | 6a62e0e | 2019-10-21 08:11:42 -0400 | [diff] [blame] | 46 | PACKAGES =+ "${PN}-iiod ${PN}-tests ${PN}-${PYTHON_PN}" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 47 | |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 48 | # Inheriting setuptools3 incorrectly adds the dependency on ${PYTHON_PN}-core |
| 49 | # to ${PN} instead of to ${PN}-${PYTHON_PN} where it belongs. |
| 50 | RDEPENDS:${PN}:remove = "${PYTHON_PN}-core" |
| 51 | RDEPENDS:${PN}-${PYTHON_PN} = "${PN} ${PYTHON_PN}-core ${PYTHON_PN}-ctypes ${PYTHON_PN}-stringold" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 52 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 53 | FILES:${PN}-iiod = " \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 54 | ${sbindir}/iiod \ |
| 55 | ${systemd_system_unitdir}/iiod.service \ |
| 56 | " |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 57 | FILES:${PN}-tests = "${bindir}" |
| 58 | FILES:${PN}-${PYTHON_PN} = "${PYTHON_SITEPACKAGES_DIR}" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 59 | |
| 60 | SYSTEMD_PACKAGES = "${PN}-iiod" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 61 | SYSTEMD_SERVICE:${PN}-iiod = "iiod.service" |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 62 | |
| 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 |
| 65 | do_configure() { |
| 66 | cmake_do_configure |
| 67 | } |
| 68 | |
| 69 | do_compile() { |
| 70 | if ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'true', 'false', d)}; then |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 71 | setuptools3_do_compile |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 72 | fi |
| 73 | cmake_do_compile |
| 74 | } |
| 75 | |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 76 | PIP_INSTALL_PACKAGE = "pylibiio" |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 77 | do_install() { |
| 78 | if ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'true', 'false', d)}; then |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 79 | setuptools3_do_install |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 80 | fi |
| 81 | cmake_do_install |
| 82 | } |