Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 1 | require libgpiod.inc |
| 2 | |
| 3 | LICENSE = "LGPL-2.1-or-later" |
| 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=2caced0b25dfefd4c601d92bd15116de" |
| 5 | |
| 6 | SRC_URI[sha256sum] = "7b146e12f28fbca3df7557f176eb778c5ccf952ca464698dba8a61b2e1e3f9b5" |
| 7 | |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 8 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-1.x:" |
| 9 | |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 10 | inherit python3native |
| 11 | |
| 12 | PACKAGECONFIG[tests] = "--enable-tests,--disable-tests,kmod udev glib-2.0 catch2" |
| 13 | PACKAGECONFIG[python3] = "--enable-bindings-python,--disable-bindings-python,python3" |
| 14 | |
| 15 | # Always build tools - they don't have any additional |
| 16 | # requirements over the library. |
| 17 | EXTRA_OECONF = "--enable-tools" |
| 18 | |
| 19 | PACKAGES =+ "${PN}-python" |
| 20 | FILES:${PN}-tools += "${bindir}/gpiofind" |
| 21 | FILES:${PN}-ptest += " \ |
| 22 | ${bindir}/gpiod_py_test.py \ |
| 23 | ${libdir}/libgpiomockup.so.* \ |
| 24 | " |
| 25 | FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/*.so" |
| 26 | FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a" |
| 27 | |
| 28 | RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-python', '', d)}" |
| 29 | RRECOMMENDS:${PN}-ptest += " \ |
| 30 | kernel-module-gpio-mockup \ |
| 31 | ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-unittest', '', d)} \ |
| 32 | " |
| 33 | RDEPENDS:${PN}-ptest += "python3-packaging" |
| 34 | |
| 35 | do_install_ptest:append() { |
| 36 | if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then |
| 37 | install -m 0755 ${S}/bindings/python/tests/gpiod_py_test.py ${D}${PTEST_PATH}/tests/ |
| 38 | fi |
| 39 | } |