blob: b28aa8e698fa1bfe96a13786745d27d846744fe6 [file] [log] [blame]
Andrew Geissler6aa7eec2023-03-03 12:41:14 -06001require libgpiod.inc
2
3LICENSE = "LGPL-2.1-or-later"
4LIC_FILES_CHKSUM = "file://COPYING;md5=2caced0b25dfefd4c601d92bd15116de"
5
6SRC_URI[sha256sum] = "7b146e12f28fbca3df7557f176eb778c5ccf952ca464698dba8a61b2e1e3f9b5"
7
Patrick Williams8e7b46e2023-05-01 14:19:06 -05008FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-1.x:"
9
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060010inherit 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}