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" |
| 4 | LICENSE = "LGPLv2.1+" |
| 5 | LIC_FILES_CHKSUM = "file://COPYING.txt;md5=7c13b3376cea0ce68d2d2da0a1b3a72c" |
| 6 | |
Andrew Geissler | d221e03 | 2020-07-10 16:13:21 -0500 | [diff] [blame] | 7 | SRCREV = "565bf68eccfdbbf22cf5cb6d792e23de564665c7" |
| 8 | PV = "0.21+git${SRCPV}" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 9 | |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 10 | SRC_URI = "git://github.com/analogdevicesinc/libiio.git;protocol=https \ |
| 11 | file://0001-python-Do-not-verify-whether-libiio-is-installed-whe.patch \ |
| 12 | " |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 13 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 14 | |
| 15 | S = "${WORKDIR}/git" |
| 16 | |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 17 | DISTUTILS_SETUP_PATH ?= "${B}/bindings/python/" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 18 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 19 | DEPENDS = " \ |
| 20 | flex-native bison-native libaio \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 21 | " |
| 22 | |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 23 | inherit cmake python3native systemd setuptools3 |
| 24 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 25 | EXTRA_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 III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 31 | PACKAGECONFIG ??= "usb_backend network_backend serial_backend" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 32 | |
Patrick Williams | 93c203f | 2021-10-06 16:15:23 -0500 | [diff] [blame] | 33 | NETWORK_BACKEND_DEPENDENCIES = "\ |
| 34 | libxml2 \ |
| 35 | ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \ |
| 36 | " |
| 37 | |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 38 | PACKAGECONFIG[usb_backend] = "-DWITH_USB_BACKEND=ON,-DWITH_USB_BACKEND=OFF,libusb1 libxml2" |
Patrick Williams | 93c203f | 2021-10-06 16:15:23 -0500 | [diff] [blame] | 39 | PACKAGECONFIG[network_backend] = "-DWITH_NETWORK_BACKEND=ON,-DWITH_NETWORK_BACKEND=OFF, ${NETWORK_BACKEND_DEPENDENCIES}" |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 40 | PACKAGECONFIG[serial_backend] = "-DWITH_SERIAL_BACKEND=ON,-DWITH_SERIAL_BACKEND=off,libserialport libxml2" |
Brad Bishop | 868407c | 2019-11-04 13:24:47 -0500 | [diff] [blame] | 41 | PACKAGECONFIG[libiio-python3] = "-DPYTHON_BINDINGS=ON,-DPYTHON_BINDINGS=OFF" |
| 42 | |
Brad Bishop | 6a62e0e | 2019-10-21 08:11:42 -0400 | [diff] [blame] | 43 | PACKAGES =+ "${PN}-iiod ${PN}-tests ${PN}-${PYTHON_PN}" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 44 | |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 45 | # Inheriting setuptools3 incorrectly adds the dependency on ${PYTHON_PN}-core |
| 46 | # to ${PN} instead of to ${PN}-${PYTHON_PN} where it belongs. |
| 47 | RDEPENDS:${PN}:remove = "${PYTHON_PN}-core" |
| 48 | 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] | 49 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 50 | FILES:${PN}-iiod = " \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 51 | ${sbindir}/iiod \ |
| 52 | ${systemd_system_unitdir}/iiod.service \ |
| 53 | " |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 54 | FILES:${PN}-tests = "${bindir}" |
| 55 | FILES:${PN}-${PYTHON_PN} = "${PYTHON_SITEPACKAGES_DIR}" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 56 | |
| 57 | SYSTEMD_PACKAGES = "${PN}-iiod" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 58 | SYSTEMD_SERVICE:${PN}-iiod = "iiod.service" |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 59 | |
| 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 |
| 62 | do_configure() { |
| 63 | cmake_do_configure |
| 64 | } |
| 65 | |
| 66 | do_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 | |
| 73 | do_install() { |
| 74 | if ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'true', 'false', d)}; then |
| 75 | distutils3_do_install |
| 76 | fi |
| 77 | cmake_do_install |
| 78 | } |