diff mbox series

[meta-oe,2/2] libgpiod: update to v2.1

Message ID 20231103200406.338830-2-brgl@bgdev.pl
State Under Review
Headers show
Series [meta-oe,1/2] shunit2: new recipe | expand

Commit Message

Bartosz Golaszewski Nov. 3, 2023, 8:04 p.m. UTC
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

This is a small release bringing in a bunch of improvements and a couple
new interfaces. Details are available in NEWS.

We need to move the code in recipes around a bit as the tests now use
shunit2.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 meta-oe/recipes-support/libgpiod/libgpiod-2.x/run-ptest   | 2 +-
 meta-oe/recipes-support/libgpiod/libgpiod.inc             | 3 ---
 meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb        | 8 +++++++-
 .../libgpiod/{libgpiod_2.0.2.bb => libgpiod_2.1.bb}       | 7 ++++++-
 4 files changed, 14 insertions(+), 6 deletions(-)
 rename meta-oe/recipes-support/libgpiod/{libgpiod_2.0.2.bb => libgpiod_2.1.bb} (79%)
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/libgpiod/libgpiod-2.x/run-ptest b/meta-oe/recipes-support/libgpiod/libgpiod-2.x/run-ptest
index 9475f0253..29ec0d102 100644
--- a/meta-oe/recipes-support/libgpiod/libgpiod-2.x/run-ptest
+++ b/meta-oe/recipes-support/libgpiod/libgpiod-2.x/run-ptest
@@ -1,6 +1,6 @@ 
 #!/bin/sh
 
-testbins="gpiod-test gpio-tools-test gpiod-cxx-test"
+testbins="gpiod-test gpio-tools-test.bash gpiod-cxx-test"
 
 ptestdir=$(dirname "$(readlink -f "$0")")
 cd $ptestdir/tests
diff --git a/meta-oe/recipes-support/libgpiod/libgpiod.inc b/meta-oe/recipes-support/libgpiod/libgpiod.inc
index 0eda47bba..dc1fb4fe9 100644
--- a/meta-oe/recipes-support/libgpiod/libgpiod.inc
+++ b/meta-oe/recipes-support/libgpiod/libgpiod.inc
@@ -33,7 +33,6 @@  FILES:${PN}-tools += " \
 FILES:libgpiodcxx = "${libdir}/libgpiodcxx.so.*"
 
 RRECOMMENDS:${PN}-ptest += "coreutils"
-RDEPENDS:${PN}-ptest += "${@bb.utils.contains('PTEST_ENABLED', '1', 'bats', '', d)}"
 
 do_install:append() {
     rm -f ${D}${bindir}/gpiod-test
@@ -50,8 +49,6 @@  do_install_ptest() {
 
     # Tools are always built so let's always install them for ptest even if
     # we're not selecting libgpiod-tools.
-    install -m 0755 ${S}/tools/gpio-tools-test ${D}${PTEST_PATH}/tests/
-    install -m 0755 ${S}/tools/gpio-tools-test.bats ${D}${PTEST_PATH}/tests/
     for tool in ${FILES:${PN}-tools}; do
         install ${B}/tools/.libs/$(basename $tool) ${D}${PTEST_PATH}/tests/
     done
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 b28aa8e69..111a5727b 100644
--- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb
+++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb
@@ -30,9 +30,15 @@  RRECOMMENDS:${PN}-ptest += " \
     kernel-module-gpio-mockup \
     ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-unittest', '', d)} \
 "
-RDEPENDS:${PN}-ptest += "python3-packaging"
+RDEPENDS:${PN}-ptest += " \
+    python3-packaging \
+    ${@bb.utils.contains('PTEST_ENABLED', '1', 'bats', '', d)} \
+"
 
 do_install_ptest:append() {
+    install -m 0755 ${S}/tools/gpio-tools-test ${D}${PTEST_PATH}/tests/
+    install -m 0755 ${S}/tools/gpio-tools-test.bats ${D}${PTEST_PATH}/tests/
+
     if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then
         install -m 0755 ${S}/bindings/python/tests/gpiod_py_test.py ${D}${PTEST_PATH}/tests/
     fi
diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_2.0.2.bb b/meta-oe/recipes-support/libgpiod/libgpiod_2.1.bb
similarity index 79%
rename from meta-oe/recipes-support/libgpiod/libgpiod_2.0.2.bb
rename to meta-oe/recipes-support/libgpiod/libgpiod_2.1.bb
index 7533e0a25..1e92d0079 100644
--- a/meta-oe/recipes-support/libgpiod/libgpiod_2.0.2.bb
+++ b/meta-oe/recipes-support/libgpiod/libgpiod_2.1.bb
@@ -9,7 +9,7 @@  LIC_FILES_CHKSUM = " \
 
 FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-2.x:"
 
-SRC_URI[sha256sum] = "c3c923dc63b7b1b02639c9179c81e3d9febf0887bbaa59775990229cdbedb88b"
+SRC_URI[sha256sum] = "fa4024a080121c958502f9a46a5bda44bea85e7a4dd7fcb3dead463b6fc4261c"
 
 # Enable all project features for ptest
 PACKAGECONFIG[tests] = "--enable-tests --enable-tools --enable-bindings-cxx --enable-gpioset-interactive,--disable-tests,kmod util-linux glib-2.0 catch2 libedit"
@@ -20,8 +20,13 @@  FILES:${PN}-tools += "${bindir}/gpionotify"
 FILES:${PN}-ptest += "${libdir}/libgpiosim.so.*"
 FILES:${PN}-ptest-dev += "${includedir}/gpiosim.h"
 
+RDEPENDS:${PN}-ptest += " \
+    bash \
+    ${@bb.utils.contains('PTEST_ENABLED', '1', 'shunit2', '', d)} \
+"
 RRECOMMENDS:${PN}-ptest += "kernel-module-gpio-sim"
 
 do_install_ptest:append() {
+    install -m 0755 ${S}/tools/gpio-tools-test.bash ${D}${PTEST_PATH}/tests/
     install -m 0644 ${S}/tests/gpiosim/gpiosim.h ${D}${includedir}/gpiosim.h
 }