1require libgpiod.inc
2
3LICENSE = "LGPL-2.1-or-later"
4LIC_FILES_CHKSUM = "file://COPYING;md5=2caced0b25dfefd4c601d92bd15116de"
5
6SRC_URI[sha256sum] = "7b146e12f28fbca3df7557f176eb778c5ccf952ca464698dba8a61b2e1e3f9b5"
7
8FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-1.x:"
9
10inherit python3native
11
12PACKAGECONFIG[tests] = "--enable-tests,--disable-tests,kmod udev glib-2.0 catch2"
13PACKAGECONFIG[python3] = "--enable-bindings-python,--disable-bindings-python,python3"
14
15# Always build tools - they don't have any additional
16# requirements over the library.
17EXTRA_OECONF = "--enable-tools"
18
19PACKAGES =+ "${PN}-python"
20FILES:${PN}-tools += "${bindir}/gpiofind"
21FILES:${PN}-ptest += " \
22    ${bindir}/gpiod_py_test.py \
23    ${libdir}/libgpiomockup.so.* \
24"
25FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/*.so"
26FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
27
28RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-python', '', d)}"
29RRECOMMENDS:${PN}-ptest += " \
30    kernel-module-gpio-mockup \
31    ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-unittest', '', d)} \
32"
33RDEPENDS:${PN}-ptest += "python3-packaging"
34
35do_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}
40