summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-support/libgpiod/libgpiod-1.6.4/run-ptest (renamed from meta-oe/recipes-support/libgpiod/files/run-ptest)0
-rw-r--r--meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc2/run-ptest24
-rw-r--r--meta-oe/recipes-support/libgpiod/libgpiod-src.inc1
-rw-r--r--meta-oe/recipes-support/libgpiod/libgpiod.inc61
-rw-r--r--meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb56
-rw-r--r--meta-oe/recipes-support/libgpiod/libgpiod_2.0-rc2.bb21
6 files changed, 113 insertions, 50 deletions
diff --git a/meta-oe/recipes-support/libgpiod/files/run-ptest b/meta-oe/recipes-support/libgpiod/libgpiod-1.6.4/run-ptest
index 61b9b69fc6..61b9b69fc6 100644
--- a/meta-oe/recipes-support/libgpiod/files/run-ptest
+++ b/meta-oe/recipes-support/libgpiod/libgpiod-1.6.4/run-ptest
diff --git a/meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc2/run-ptest b/meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc2/run-ptest
new file mode 100644
index 0000000000..9475f02535
--- /dev/null
+++ b/meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc2/run-ptest
@@ -0,0 +1,24 @@
1#!/bin/sh
2
3testbins="gpiod-test gpio-tools-test gpiod-cxx-test"
4
5ptestdir=$(dirname "$(readlink -f "$0")")
6cd $ptestdir/tests
7
8# libgpiod v2 uses gpio-sim - a configfs-based testing module. We need to
9# make sure configfs is mounted before running any tests.
10modprobe configfs
11mountpoint /sys/kernel/config > /dev/null || mount -t configfs configfs /sys/kernel/config
12
13for testbin in $testbins; do
14 if test -e ./$testbin; then
15 ./$testbin > ./$testbin.out 2>&1
16 if [ $? -ne 0 ]; then
17 echo "FAIL: $testbin"
18 else
19 echo "PASS: $testbin"
20 fi
21 else
22 echo "SKIP: $testbin"
23 fi
24done
diff --git a/meta-oe/recipes-support/libgpiod/libgpiod-src.inc b/meta-oe/recipes-support/libgpiod/libgpiod-src.inc
new file mode 100644
index 0000000000..6bab4c1f42
--- /dev/null
+++ b/meta-oe/recipes-support/libgpiod/libgpiod-src.inc
@@ -0,0 +1 @@
SRC_URI += "https://www.kernel.org/pub/software/libs/libgpiod/libgpiod-${PV}.tar.xz"
diff --git a/meta-oe/recipes-support/libgpiod/libgpiod.inc b/meta-oe/recipes-support/libgpiod/libgpiod.inc
new file mode 100644
index 0000000000..abb6544ec2
--- /dev/null
+++ b/meta-oe/recipes-support/libgpiod/libgpiod.inc
@@ -0,0 +1,61 @@
1SUMMARY = "C library and tools for interacting with the linux GPIO character device"
2AUTHOR = "Bartosz Golaszewski <brgl@bgdev.pl>"
3
4require libgpiod-src.inc
5
6inherit autotools pkgconfig ptest
7
8SRC_URI += "file://run-ptest"
9
10PACKAGECONFIG[cxx] = "--enable-bindings-cxx,--disable-bindings-cxx"
11
12# Enable cxx bindings by default.
13PACKAGECONFIG ?= " \
14 cxx \
15 ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \
16"
17
18# Always build tools - they don't have any additional
19# requirements over the library.
20EXTRA_OECONF = "--enable-tools"
21
22DEPENDS += "autoconf-archive-native"
23
24PACKAGES =+ "${PN}-tools libgpiodcxx"
25FILES:${PN}-tools += " \
26 ${bindir}/gpiodetect \
27 ${bindir}/gpioinfo \
28 ${bindir}/gpioget \
29 ${bindir}/gpioset \
30 ${bindir}/gpiomon \
31"
32FILES:${PN}-ptest += " \
33 ${bindir}/gpiod-test \
34 ${bindir}/gpio-tools-test \
35 ${bindir}/gpio-tools-test.bats \
36 ${bindir}/gpiod-cxx-test \
37"
38FILES:libgpiodcxx = "${libdir}/libgpiodcxx.so.*"
39
40RRECOMMENDS:${PN}-ptest += "coreutils"
41RDEPENDS:${PN}-ptest += "bats"
42
43do_install_ptest() {
44 install -d ${D}${PTEST_PATH}/tests/
45
46 # These are the core C library tests
47 install -m 0755 ${B}/tests/.libs/gpiod-test ${D}${PTEST_PATH}/tests/
48
49 # Tools are always built so let's always install them for ptest even if
50 # we're not selecting libgpiod-tools.
51 install -m 0755 ${S}/tools/gpio-tools-test ${D}${PTEST_PATH}/tests/
52 install -m 0755 ${S}/tools/gpio-tools-test.bats ${D}${PTEST_PATH}/tests/
53 for tool in ${FILES:${PN}-tools}; do
54 install ${B}/tools/.libs/$(basename $tool) ${D}${PTEST_PATH}/tests/
55 done
56
57 if ${@bb.utils.contains('PACKAGECONFIG', 'cxx', 'true', 'false', d)}; then
58 install -m 0755 ${B}/bindings/cxx/tests/.libs/gpiod-cxx-test ${D}${PTEST_PATH}/tests/
59 fi
60}
61
diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb
index 70a77c8834..df0e3f104a 100644
--- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb
+++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb
@@ -1,80 +1,36 @@
1SUMMARY = "C library and tools for interacting with the linux GPIO character device" 1require libgpiod.inc
2AUTHOR = "Bartosz Golaszewski <brgl@bgdev.pl>"
3 2
4LICENSE = "LGPL-2.1-or-later" 3LICENSE = "LGPL-2.1-or-later"
5LIC_FILES_CHKSUM = "file://COPYING;md5=2caced0b25dfefd4c601d92bd15116de" 4LIC_FILES_CHKSUM = "file://COPYING;md5=2caced0b25dfefd4c601d92bd15116de"
6 5
7SRC_URI = " \
8 https://www.kernel.org/pub/software/libs/${BPN}/${BP}.tar.xz \
9 file://run-ptest \
10"
11
12SRC_URI[md5sum] = "7a2cca6ead9296c27e877070dd8853bc"
13SRC_URI[sha256sum] = "7b146e12f28fbca3df7557f176eb778c5ccf952ca464698dba8a61b2e1e3f9b5" 6SRC_URI[sha256sum] = "7b146e12f28fbca3df7557f176eb778c5ccf952ca464698dba8a61b2e1e3f9b5"
14 7
15inherit autotools pkgconfig python3native ptest 8inherit python3native
16 9
17PACKAGECONFIG[tests] = "--enable-tests,--disable-tests,kmod udev glib-2.0 catch2" 10PACKAGECONFIG[tests] = "--enable-tests,--disable-tests,kmod udev glib-2.0 catch2"
18PACKAGECONFIG[cxx] = "--enable-bindings-cxx,--disable-bindings-cxx"
19PACKAGECONFIG[python3] = "--enable-bindings-python,--disable-bindings-python,python3" 11PACKAGECONFIG[python3] = "--enable-bindings-python,--disable-bindings-python,python3"
20 12
21# Enable cxx bindings by default.
22PACKAGECONFIG ?= "cxx \
23 ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}"
24
25# Always build tools - they don't have any additional 13# Always build tools - they don't have any additional
26# requirements over the library. 14# requirements over the library.
27EXTRA_OECONF = "--enable-tools" 15EXTRA_OECONF = "--enable-tools"
28 16
29DEPENDS += "autoconf-archive-native" 17PACKAGES =+ "${PN}-python"
30 18FILES:${PN}-tools += "${bindir}/gpiofind"
31PACKAGES =+ "${PN}-tools libgpiodcxx ${PN}-python"
32FILES:${PN}-tools = " \
33 ${bindir}/gpiodetect \
34 ${bindir}/gpioinfo \
35 ${bindir}/gpioget \
36 ${bindir}/gpioset \
37 ${bindir}/gpiofind \
38 ${bindir}/gpiomon \
39"
40FILES:${PN}-ptest += " \ 19FILES:${PN}-ptest += " \
41 ${bindir}/gpiod-test \
42 ${bindir}/gpio-tools-test \
43 ${bindir}/gpio-tools-test.bats \
44 ${bindir}/gpiod-cxx-test \
45 ${bindir}/gpiod_py_test.py \ 20 ${bindir}/gpiod_py_test.py \
46 ${libdir}/libgpiomockup.so.* \ 21 ${libdir}/libgpiomockup.so.* \
47" 22"
48FILES:libgpiodcxx = "${libdir}/libgpiodcxx.so.*"
49FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/*.so" 23FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/*.so"
50FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a" 24FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
51 25
52RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-python', '', d)}" 26RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-python', '', d)}"
53RRECOMMENDS:${PN}-ptest += " \ 27RRECOMMENDS:${PN}-ptest += " \
54 kernel-module-gpio-mockup \ 28 kernel-module-gpio-mockup \
55 coreutils \
56 ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-unittest', '', d)} \ 29 ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-unittest', '', d)} \
57" 30"
58RDEPENDS:${PN}-ptest += "bats python3-packaging" 31RDEPENDS:${PN}-ptest += "python3-packaging"
59
60do_install_ptest() {
61 install -d ${D}${PTEST_PATH}/tests
62
63 # These are the core C library tests
64 install -m 0755 ${B}/tests/.libs/gpiod-test ${D}${PTEST_PATH}/tests/
65
66 # Tools are always built so let's always install them for ptest even if
67 # we're not selecting libgpiod-tools.
68 install -m 0755 ${S}/tools/gpio-tools-test ${D}${PTEST_PATH}/tests/
69 install -m 0755 ${S}/tools/gpio-tools-test.bats ${D}${PTEST_PATH}/tests/
70 for tool in ${FILES:${PN}-tools}; do
71 install ${B}/tools/.libs/$(basename $tool) ${D}${PTEST_PATH}/tests/
72 done
73
74 if ${@bb.utils.contains('PACKAGECONFIG', 'cxx', 'true', 'false', d)}; then
75 install -m 0755 ${B}/bindings/cxx/tests/.libs/gpiod-cxx-test ${D}${PTEST_PATH}/tests/
76 fi
77 32
33do_install_ptest:append() {
78 if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then 34 if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then
79 install -m 0755 ${S}/bindings/python/tests/gpiod_py_test.py ${D}${PTEST_PATH}/tests/ 35 install -m 0755 ${S}/bindings/python/tests/gpiod_py_test.py ${D}${PTEST_PATH}/tests/
80 fi 36 fi
diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_2.0-rc2.bb b/meta-oe/recipes-support/libgpiod/libgpiod_2.0-rc2.bb
new file mode 100644
index 0000000000..158175cdbb
--- /dev/null
+++ b/meta-oe/recipes-support/libgpiod/libgpiod_2.0-rc2.bb
@@ -0,0 +1,21 @@
1require libgpiod.inc
2
3LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later & CC-BY-SA-4.0"
4LIC_FILES_CHKSUM = " \
5 file://LICENSES/GPL-2.0-or-later.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
6 file://LICENSES/LGPL-2.1-or-later.txt;md5=4b54a1fd55a448865a0b32d41598759d \
7 file://LICENSES/CC-BY-SA-4.0.txt;md5=fba3b94d88bfb9b81369b869a1e9a20f \
8"
9
10SRC_URI[sha256sum] = "1b931bfabef897911e59d45c80b8930c43fa72f08aab9c03e8dfd4005881c09e"
11
12S = "${WORKDIR}/libgpiod-2.0"
13
14# We must enable gpioset-interactive for all gpio-tools tests to pass
15PACKAGECONFIG[tests] = "--enable-tests --enable-gpioset-interactive,--disable-tests,kmod util-linux glib-2.0 catch2 libedit"
16PACKAGECONFIG[gpioset-interactive] = "--enable-gpioset-interactive,--disable-gpioset-interactive,libedit"
17
18FILES:${PN}-tools += "${bindir}/gpionotify"
19FILES:${PN}-ptest += "${libdir}/libgpiosim.so.*"
20
21RRECOMMENDS:${PN}-ptest += "kernel-module-gpio-sim"