blob: 111a5727baa97f9dc0dcc3bc370bd572fffd239d [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"
Patrick Williamsac13d5f2023-11-24 18:59:46 -060033RDEPENDS:${PN}-ptest += " \
34 python3-packaging \
35 ${@bb.utils.contains('PTEST_ENABLED', '1', 'bats', '', d)} \
36"
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060037
38do_install_ptest:append() {
Patrick Williamsac13d5f2023-11-24 18:59:46 -060039 install -m 0755 ${S}/tools/gpio-tools-test ${D}${PTEST_PATH}/tests/
40 install -m 0755 ${S}/tools/gpio-tools-test.bats ${D}${PTEST_PATH}/tests/
41
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060042 if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then
43 install -m 0755 ${S}/bindings/python/tests/gpiod_py_test.py ${D}${PTEST_PATH}/tests/
44 fi
45}