blob: 6af1542bfd76b1707abb7ae4300e2dab75b559d4 [file] [log] [blame]
Andrew Geissler6aa7eec2023-03-03 12:41:14 -06001SUMMARY = "Python bindings for libgpiod."
2AUTHOR = "Bartosz Golaszewski <brgl@bgdev.pl>"
3
4LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later & CC-BY-SA-4.0"
5LIC_FILES_CHKSUM = " \
6 file://../../LICENSES/GPL-2.0-or-later.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
7 file://../../LICENSES/LGPL-2.1-or-later.txt;md5=4b54a1fd55a448865a0b32d41598759d \
8 file://../../LICENSES/CC-BY-SA-4.0.txt;md5=fba3b94d88bfb9b81369b869a1e9a20f \
9"
10
11require recipes-support/libgpiod/libgpiod-src.inc
12
13SRC_URI += "file://run-ptest"
14
15SRC_URI[sha256sum] = "1d1756d465525deb668526571dc6ed7e08f7b8e7745b10fc028208a22fb7adf8"
16S = "${WORKDIR}/libgpiod-2.0/bindings/python"
17
18inherit setuptools3 ptest
19
20DEPENDS += "libgpiod"
21RDEPENDS:${PN} += "libgpiod (>= 2.0)"
22RDEPENDS:${PN}-ptest += "python3-setuptools"
23
24export GPIOD_WITH_TESTS = "${@bb.utils.contains("PTEST_ENABLED", "1", "1", "0", d)}"
25PTEST_CFLAGS = "${@bb.utils.contains("PTEST_ENABLED", "1", "-I../../tests/gpiosim", "", d)}"
26# Setuptools store full filesystem paths in DWARF files. Map them to './' to
27# avoid QA warnings.
28export CFLAGS = "${PTEST_CFLAGS} -fdebug-prefix-map=${B}=./"
29
30do_install:append() {
31 # Python setuptools have an issue where they install C extensions even if
32 # they're not in the list of packages to be packaged. This is how the test
33 # extensions end up being installed. Remove them here.
34 rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/tests/
35}
36
37do_install_ptest() {
38 install -d ${D}${PTEST_PATH}/gpiod-test/gpiosim
39 install -d ${D}${PTEST_PATH}/gpiod-test/procname
40 install -m 0644 ${B}/tests/*.py ${D}${PTEST_PATH}/gpiod-test/
41 install -m 0644 ${B}/build/lib*/tests/gpiosim/_ext* ${D}${PTEST_PATH}/gpiod-test/gpiosim
42 install -m 0644 ${B}/tests/gpiosim/*.py ${D}${PTEST_PATH}/gpiod-test/gpiosim
43 install -m 0644 ${B}/build/lib*/tests/procname/_ext* ${D}${PTEST_PATH}/gpiod-test/procname
44 install -m 0644 ${B}/tests/procname/*.py ${D}${PTEST_PATH}/gpiod-test/procname
45}