All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH 0/3] libgpiod: add support for libgpiod v2
@ 2023-02-08 15:25 Bartosz Golaszewski
  2023-02-08 15:25 ` [meta-oe][PATCH 1/3] libgpiod: update to v1.6.4 Bartosz Golaszewski
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2023-02-08 15:25 UTC (permalink / raw)
  To: Khem Raj, Bruce Ashfield, openembedded-devel; +Cc: Bartosz Golaszewski

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

We've just tagged the release candidate for libgpiod v2. This is a major
release entirely overhauling the API in a backward incompatible way.

While this is not the final release yet, it's not likely to change much so
I'd like to make it available in meta-openembedded to give it exposure to
some testing. When we do release v2.0, it'll be just a matter of bumping the
version.

Currently no other package depends on libgpiod in meta-openembedded, so I'd
like to avoid having two packages (libgpiod and libgpiod2). Instead let's
provide recipes for both versions but keep them under the common libgpiod name
as it's unlikely anyone would need both versions in a single system. This is
after all a medium-sized project that shouldn't require too much work in order
to port a user to the new major release.

The first patch contains an update of libgpiod v1.6.x to the most recent
bug-fix release.

The second contains the recipe for libgpiod v2.0-rc1 while also moving the
bitbake code around in order to factor out common elements.

The third contains a recipe for the python bindings that are now in their own
project in meta-python.

The new recipes provide the same functionality - including ptest for the C
library, tools and language bindings.

Bartosz Golaszewski (3):
  libgpiod: update to v1.6.4
  libgpiod: add a recipe for libgpiod v2.0-rc1
  python3-gpiod: new package

 ...-don-t-expect-automake-to-set-PYTHON.patch | 37 ---------
 .../{files => libgpiod-1.6.4}/run-ptest       |  0
 .../libgpiod/libgpiod-2.0-rc1/run-ptest       | 24 ++++++
 .../recipes-support/libgpiod/libgpiod-src.inc |  1 +
 meta-oe/recipes-support/libgpiod/libgpiod.inc | 61 ++++++++++++++
 .../libgpiod/libgpiod_1.6.3.bb                | 82 -------------------
 .../libgpiod/libgpiod_1.6.4.bb                | 37 +++++++++
 .../libgpiod/libgpiod_2.0-rc1.bb              | 21 +++++
 .../packagegroups/packagegroup-meta-python.bb |  1 +
 .../python/python3-gpiod/run-ptest            | 15 ++++
 .../python/python3-gpiod_2.0-rc1.bb           | 45 ++++++++++
 11 files changed, 205 insertions(+), 119 deletions(-)
 delete mode 100644 meta-oe/recipes-support/libgpiod/files/0001-build-don-t-expect-automake-to-set-PYTHON.patch
 rename meta-oe/recipes-support/libgpiod/{files => libgpiod-1.6.4}/run-ptest (100%)
 create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc1/run-ptest
 create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod-src.inc
 create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod.inc
 delete mode 100644 meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
 create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb
 create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod_2.0-rc1.bb
 create mode 100644 meta-python/recipes-devtools/python/python3-gpiod/run-ptest
 create mode 100644 meta-python/recipes-devtools/python/python3-gpiod_2.0-rc1.bb

-- 
2.37.2



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [meta-oe][PATCH 1/3] libgpiod: update to v1.6.4
  2023-02-08 15:25 [meta-oe][PATCH 0/3] libgpiod: add support for libgpiod v2 Bartosz Golaszewski
@ 2023-02-08 15:25 ` Bartosz Golaszewski
  2023-02-08 15:25 ` [meta-oe][PATCH 2/3] libgpiod: add a recipe for libgpiod v2.0-rc1 Bartosz Golaszewski
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2023-02-08 15:25 UTC (permalink / raw)
  To: Khem Raj, Bruce Ashfield, openembedded-devel; +Cc: Bartosz Golaszewski

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

This is a bug-fix release bringing in several fixes for build and
testing issues.

Remove the patch that's already present in this release.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 ...-don-t-expect-automake-to-set-PYTHON.patch | 37 -------------------
 .../{libgpiod_1.6.3.bb => libgpiod_1.6.4.bb}  |  5 +--
 2 files changed, 2 insertions(+), 40 deletions(-)
 delete mode 100644 meta-oe/recipes-support/libgpiod/files/0001-build-don-t-expect-automake-to-set-PYTHON.patch
 rename meta-oe/recipes-support/libgpiod/{libgpiod_1.6.3.bb => libgpiod_1.6.4.bb} (93%)

diff --git a/meta-oe/recipes-support/libgpiod/files/0001-build-don-t-expect-automake-to-set-PYTHON.patch b/meta-oe/recipes-support/libgpiod/files/0001-build-don-t-expect-automake-to-set-PYTHON.patch
deleted file mode 100644
index a3dc38188..000000000
--- a/meta-oe/recipes-support/libgpiod/files/0001-build-don-t-expect-automake-to-set-PYTHON.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 3c461786feb1d5aa1ed2a911942a5f9fbc8b8086 Mon Sep 17 00:00:00 2001
-From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-Date: Tue, 24 Jan 2023 17:38:43 +0100
-Subject: [libgpiod v1.6.x][PATCH] build: don't expect automake to set $PYTHON
-
-It seems that the implementation of AM_PATH_PYTHON() changed in automake
-recently and no longer sets $PYTHON variable which breaks the build on
-some systems.
-
-We know we use python3 so use python3-config explicitly.
-
-Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
----
-Upstream-Status: Accepted
-
- configure.ac | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 3149384..0460810 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -204,9 +204,9 @@ then
- 		AC_MSG_ERROR([python3-config not found - needed for python bindings])
- 	fi
- 	AS_IF([test -z "$PYTHON_CPPFLAGS"],
--		[AC_SUBST(PYTHON_CPPFLAGS, [`$PYTHON-config --includes`])])
-+		[AC_SUBST(PYTHON_CPPFLAGS, [`python3-config --includes`])])
- 	AS_IF([test -z "$PYTHON_LIBS"],
--		[AC_SUBST(PYTHON_LIBS, [`$PYTHON-config --libs`])])
-+		[AC_SUBST(PYTHON_LIBS, [`python3-config --libs`])])
- fi
- 
- AC_CHECK_PROG([has_doxygen], [doxygen], [true], [false])
--- 
-2.37.2
-
diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb
similarity index 93%
rename from meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
rename to meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb
index 5164e7e02..70a77c883 100644
--- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
+++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb
@@ -7,11 +7,10 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=2caced0b25dfefd4c601d92bd15116de"
 SRC_URI = " \
     https://www.kernel.org/pub/software/libs/${BPN}/${BP}.tar.xz \
     file://run-ptest \
-    file://0001-build-don-t-expect-automake-to-set-PYTHON.patch \
 "
 
-SRC_URI[md5sum] = "28e79f6f70fee1da9079558d8b7b3736"
-SRC_URI[sha256sum] = "841be9d788f00bab08ef22c4be5c39866f0e46cb100a3ae49ed816ac9c5dddc7"
+SRC_URI[md5sum] = "7a2cca6ead9296c27e877070dd8853bc"
+SRC_URI[sha256sum] = "7b146e12f28fbca3df7557f176eb778c5ccf952ca464698dba8a61b2e1e3f9b5"
 
 inherit autotools pkgconfig python3native ptest
 
-- 
2.37.2



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [meta-oe][PATCH 2/3] libgpiod: add a recipe for libgpiod v2.0-rc1
  2023-02-08 15:25 [meta-oe][PATCH 0/3] libgpiod: add support for libgpiod v2 Bartosz Golaszewski
  2023-02-08 15:25 ` [meta-oe][PATCH 1/3] libgpiod: update to v1.6.4 Bartosz Golaszewski
@ 2023-02-08 15:25 ` Bartosz Golaszewski
  2023-02-09 15:50   ` Khem Raj
  2023-02-08 15:25 ` [meta-python][PATCH 3/3] python3-gpiod: new package Bartosz Golaszewski
  2023-02-09 19:25 ` [oe] [meta-oe][PATCH 0/3] libgpiod: add support for libgpiod v2 Ferry Toth
  3 siblings, 1 reply; 13+ messages in thread
From: Bartosz Golaszewski @ 2023-02-08 15:25 UTC (permalink / raw)
  To: Khem Raj, Bruce Ashfield, openembedded-devel; +Cc: Bartosz Golaszewski

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

This is a recipe for libgpiod v2 release candidate. Let's put common
bits and pieces into an .inc file and the source fetching into a
separate include that will be later reused by the python bindings that
for v2 will be moved into a separate recipe in meta-python.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 .../{files => libgpiod-1.6.4}/run-ptest       |  0
 .../libgpiod/libgpiod-2.0-rc1/run-ptest       | 24 ++++++++
 .../recipes-support/libgpiod/libgpiod-src.inc |  1 +
 meta-oe/recipes-support/libgpiod/libgpiod.inc | 61 +++++++++++++++++++
 .../libgpiod/libgpiod_1.6.4.bb                | 56 ++---------------
 .../libgpiod/libgpiod_2.0-rc1.bb              | 21 +++++++
 6 files changed, 113 insertions(+), 50 deletions(-)
 rename meta-oe/recipes-support/libgpiod/{files => libgpiod-1.6.4}/run-ptest (100%)
 create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc1/run-ptest
 create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod-src.inc
 create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod.inc
 create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod_2.0-rc1.bb

diff --git a/meta-oe/recipes-support/libgpiod/files/run-ptest b/meta-oe/recipes-support/libgpiod/libgpiod-1.6.4/run-ptest
similarity index 100%
rename from meta-oe/recipes-support/libgpiod/files/run-ptest
rename to meta-oe/recipes-support/libgpiod/libgpiod-1.6.4/run-ptest
diff --git a/meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc1/run-ptest b/meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc1/run-ptest
new file mode 100644
index 000000000..9475f0253
--- /dev/null
+++ b/meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc1/run-ptest
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+testbins="gpiod-test gpio-tools-test gpiod-cxx-test"
+
+ptestdir=$(dirname "$(readlink -f "$0")")
+cd $ptestdir/tests
+
+# libgpiod v2 uses gpio-sim - a configfs-based testing module. We need to
+# make sure configfs is mounted before running any tests.
+modprobe configfs
+mountpoint /sys/kernel/config > /dev/null || mount -t configfs configfs /sys/kernel/config
+
+for testbin in $testbins; do
+	if test -e ./$testbin; then
+		./$testbin > ./$testbin.out 2>&1
+		if [ $? -ne 0 ]; then
+			echo "FAIL: $testbin"
+		else
+			echo "PASS: $testbin"
+		fi
+	else
+		echo "SKIP: $testbin"
+	fi
+done
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 000000000..6bab4c1f4
--- /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 000000000..abb6544ec
--- /dev/null
+++ b/meta-oe/recipes-support/libgpiod/libgpiod.inc
@@ -0,0 +1,61 @@
+SUMMARY = "C library and tools for interacting with the linux GPIO character device"
+AUTHOR = "Bartosz Golaszewski <brgl@bgdev.pl>"
+
+require libgpiod-src.inc
+
+inherit autotools pkgconfig ptest
+
+SRC_URI += "file://run-ptest"
+
+PACKAGECONFIG[cxx] = "--enable-bindings-cxx,--disable-bindings-cxx"
+
+# Enable cxx bindings by default.
+PACKAGECONFIG ?= " \
+    cxx \
+    ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \
+"
+
+# Always build tools - they don't have any additional
+# requirements over the library.
+EXTRA_OECONF = "--enable-tools"
+
+DEPENDS += "autoconf-archive-native"
+
+PACKAGES =+ "${PN}-tools libgpiodcxx"
+FILES:${PN}-tools += " \
+    ${bindir}/gpiodetect \
+    ${bindir}/gpioinfo \
+    ${bindir}/gpioget \
+    ${bindir}/gpioset \
+    ${bindir}/gpiomon \
+"
+FILES:${PN}-ptest += " \
+    ${bindir}/gpiod-test \
+    ${bindir}/gpio-tools-test \
+    ${bindir}/gpio-tools-test.bats \
+    ${bindir}/gpiod-cxx-test \
+"
+FILES:libgpiodcxx = "${libdir}/libgpiodcxx.so.*"
+
+RRECOMMENDS:${PN}-ptest += "coreutils"
+RDEPENDS:${PN}-ptest += "bats"
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests/
+
+    # These are the core C library tests
+    install -m 0755 ${B}/tests/.libs/gpiod-test ${D}${PTEST_PATH}/tests/
+
+    # 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
+
+    if ${@bb.utils.contains('PACKAGECONFIG', 'cxx', 'true', 'false', d)}; then
+        install -m 0755 ${B}/bindings/cxx/tests/.libs/gpiod-cxx-test ${D}${PTEST_PATH}/tests/
+    fi
+}
+
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 70a77c883..df0e3f104 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 @@
-SUMMARY = "C library and tools for interacting with the linux GPIO character device"
-AUTHOR = "Bartosz Golaszewski <brgl@bgdev.pl>"
+require libgpiod.inc
 
 LICENSE = "LGPL-2.1-or-later"
 LIC_FILES_CHKSUM = "file://COPYING;md5=2caced0b25dfefd4c601d92bd15116de"
 
-SRC_URI = " \
-    https://www.kernel.org/pub/software/libs/${BPN}/${BP}.tar.xz \
-    file://run-ptest \
-"
-
-SRC_URI[md5sum] = "7a2cca6ead9296c27e877070dd8853bc"
 SRC_URI[sha256sum] = "7b146e12f28fbca3df7557f176eb778c5ccf952ca464698dba8a61b2e1e3f9b5"
 
-inherit autotools pkgconfig python3native ptest
+inherit python3native
 
 PACKAGECONFIG[tests] = "--enable-tests,--disable-tests,kmod udev glib-2.0 catch2"
-PACKAGECONFIG[cxx] = "--enable-bindings-cxx,--disable-bindings-cxx"
 PACKAGECONFIG[python3] = "--enable-bindings-python,--disable-bindings-python,python3"
 
-# Enable cxx bindings by default.
-PACKAGECONFIG ?= "cxx \
-		  ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}"
-
 # Always build tools - they don't have any additional
 # requirements over the library.
 EXTRA_OECONF = "--enable-tools"
 
-DEPENDS += "autoconf-archive-native"
-
-PACKAGES =+ "${PN}-tools libgpiodcxx ${PN}-python"
-FILES:${PN}-tools = " \
-    ${bindir}/gpiodetect \
-    ${bindir}/gpioinfo \
-    ${bindir}/gpioget \
-    ${bindir}/gpioset \
-    ${bindir}/gpiofind \
-    ${bindir}/gpiomon \
-"
+PACKAGES =+ "${PN}-python"
+FILES:${PN}-tools += "${bindir}/gpiofind"
 FILES:${PN}-ptest += " \
-    ${bindir}/gpiod-test \
-    ${bindir}/gpio-tools-test \
-    ${bindir}/gpio-tools-test.bats \
-    ${bindir}/gpiod-cxx-test \
     ${bindir}/gpiod_py_test.py \
     ${libdir}/libgpiomockup.so.* \
 "
-FILES:libgpiodcxx = "${libdir}/libgpiodcxx.so.*"
 FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/*.so"
 FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
 
 RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-python', '', d)}"
 RRECOMMENDS:${PN}-ptest += " \
     kernel-module-gpio-mockup \
-    coreutils \
     ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-unittest', '', d)} \
 "
-RDEPENDS:${PN}-ptest += "bats python3-packaging"
-
-do_install_ptest() {
-    install -d ${D}${PTEST_PATH}/tests
-
-    # These are the core C library tests
-    install -m 0755 ${B}/tests/.libs/gpiod-test ${D}${PTEST_PATH}/tests/
-
-    # 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
-
-    if ${@bb.utils.contains('PACKAGECONFIG', 'cxx', 'true', 'false', d)}; then
-        install -m 0755 ${B}/bindings/cxx/tests/.libs/gpiod-cxx-test ${D}${PTEST_PATH}/tests/
-    fi
+RDEPENDS:${PN}-ptest += "python3-packaging"
 
+do_install_ptest:append() {
     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-rc1.bb b/meta-oe/recipes-support/libgpiod/libgpiod_2.0-rc1.bb
new file mode 100644
index 000000000..6894932ee
--- /dev/null
+++ b/meta-oe/recipes-support/libgpiod/libgpiod_2.0-rc1.bb
@@ -0,0 +1,21 @@
+require libgpiod.inc
+
+LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later & CC-BY-SA-4.0"
+LIC_FILES_CHKSUM = " \
+    file://LICENSES/GPL-2.0-or-later.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+    file://LICENSES/LGPL-2.1-or-later.txt;md5=4b54a1fd55a448865a0b32d41598759d \
+    file://LICENSES/CC-BY-SA-4.0.txt;md5=fba3b94d88bfb9b81369b869a1e9a20f \
+"
+
+SRC_URI[sha256sum] = "64a718e8f8e022afc1880bae0b6ddc874fca1ce1bf8a2ac88bab4ccca6b66a1e"
+
+S = "${WORKDIR}/libgpiod-2.0"
+
+# We must enable gpioset-interactive for all gpio-tools tests to pass
+PACKAGECONFIG[tests] = "--enable-tests --enable-gpioset-interactive,--disable-tests,kmod util-linux glib-2.0 catch2 libedit"
+PACKAGECONFIG[gpioset-interactive] = "--enable-gpioset-interactive,--disable-gpioset-interactive,libedit"
+
+FILES:${PN}-tools += "${bindir}/gpionotify"
+FILES:${PN}-ptest += "${libdir}/libgpiosim.so.*"
+
+RRECOMMENDS:${PN}-ptest += "kernel-module-gpio-sim"
-- 
2.37.2



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [meta-python][PATCH 3/3] python3-gpiod: new package
  2023-02-08 15:25 [meta-oe][PATCH 0/3] libgpiod: add support for libgpiod v2 Bartosz Golaszewski
  2023-02-08 15:25 ` [meta-oe][PATCH 1/3] libgpiod: update to v1.6.4 Bartosz Golaszewski
  2023-02-08 15:25 ` [meta-oe][PATCH 2/3] libgpiod: add a recipe for libgpiod v2.0-rc1 Bartosz Golaszewski
@ 2023-02-08 15:25 ` Bartosz Golaszewski
  2023-02-09 19:25 ` [oe] [meta-oe][PATCH 0/3] libgpiod: add support for libgpiod v2 Ferry Toth
  3 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2023-02-08 15:25 UTC (permalink / raw)
  To: Khem Raj, Bruce Ashfield, openembedded-devel; +Cc: Bartosz Golaszewski

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Add a recipe for libgpiod v2 python bindings. This is a release
candidate but once the proper v2.0 is released, it will be made public
on pypi and the recipe modified accordingly.

As libgpiod python bindings now use setuptools and not make, we can
separate the recipe from the rest of the library.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 .../packagegroups/packagegroup-meta-python.bb |  1 +
 .../python/python3-gpiod/run-ptest            | 15 +++++++
 .../python/python3-gpiod_2.0-rc1.bb           | 45 +++++++++++++++++++
 3 files changed, 61 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-gpiod/run-ptest
 create mode 100644 meta-python/recipes-devtools/python/python3-gpiod_2.0-rc1.bb

diff --git a/meta-python/recipes-core/packagegroups/packagegroup-meta-python.bb b/meta-python/recipes-core/packagegroups/packagegroup-meta-python.bb
index 2275ccd6c..2428674c4 100644
--- a/meta-python/recipes-core/packagegroups/packagegroup-meta-python.bb
+++ b/meta-python/recipes-core/packagegroups/packagegroup-meta-python.bb
@@ -157,6 +157,7 @@ RDEPENDS:packagegroup-meta-python3 = "\
     python3-gmqtt \
     python3-gnupg \
     python3-google-api-python-client \
+    python3-gpiod \
     python3-gpsd-py3 \
     python3-graphviz \
     python3-greenlet \
diff --git a/meta-python/recipes-devtools/python/python3-gpiod/run-ptest b/meta-python/recipes-devtools/python/python3-gpiod/run-ptest
new file mode 100644
index 000000000..bf1244b07
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-gpiod/run-ptest
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+cd $(dirname "$(readlink -f "$0")")
+
+# python3-gpiod uses gpio-sim - a configfs-based testing module. We need to
+# make sure configfs is mounted before running any tests.
+modprobe configfs
+mountpoint /sys/kernel/config > /dev/null || mount -t configfs configfs /sys/kernel/config
+
+python3 -m gpiod-test -v > ./python3-gpiod.out 2>&1
+if [ $? -ne 0 ]; then
+	echo "FAIL: python3-gpiod"
+else
+	echo "PASS: python3-gpiod"
+fi
diff --git a/meta-python/recipes-devtools/python/python3-gpiod_2.0-rc1.bb b/meta-python/recipes-devtools/python/python3-gpiod_2.0-rc1.bb
new file mode 100644
index 000000000..a05cc3619
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-gpiod_2.0-rc1.bb
@@ -0,0 +1,45 @@
+SUMMARY = "Python bindings for libgpiod."
+AUTHOR = "Bartosz Golaszewski <brgl@bgdev.pl>"
+
+LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later & CC-BY-SA-4.0"
+LIC_FILES_CHKSUM = " \
+    file://../../LICENSES/GPL-2.0-or-later.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+    file://../../LICENSES/LGPL-2.1-or-later.txt;md5=4b54a1fd55a448865a0b32d41598759d \
+    file://../../LICENSES/CC-BY-SA-4.0.txt;md5=fba3b94d88bfb9b81369b869a1e9a20f \
+"
+
+require recipes-support/libgpiod/libgpiod-src.inc
+
+SRC_URI += "file://run-ptest"
+
+SRC_URI[sha256sum] = "64a718e8f8e022afc1880bae0b6ddc874fca1ce1bf8a2ac88bab4ccca6b66a1e"
+S = "${WORKDIR}/libgpiod-2.0/bindings/python"
+
+inherit setuptools3 ptest
+
+DEPENDS += "libgpiod"
+RDEPENDS:${PN} += "libgpiod (>= 2.0)"
+RDEPENDS:${PN}-ptest += "python3-setuptools"
+
+export GPIOD_WITH_TESTS = "${@bb.utils.contains("PTEST_ENABLED", "1", "1", "0", d)}"
+PTEST_CFLAGS = "${@bb.utils.contains("PTEST_ENABLED", "1", "-I../../tests/gpiosim", "", d)}"
+# Setuptools store full filesystem paths in DWARF files. Map them to './' to
+# avoid QA warnings.
+export CFLAGS = "${PTEST_CFLAGS} -fdebug-prefix-map=${B}=./"
+
+do_install:append() {
+    # Python setuptools have an issue where they install C extensions even if
+    # they're not in the list of packages to be packaged. This is how the test
+    # extensions end up being installed. Remove them here.
+    rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/tests/
+}
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/gpiod-test/gpiosim
+    install -d ${D}${PTEST_PATH}/gpiod-test/procname
+    install -m 0644 ${B}/tests/*.py ${D}${PTEST_PATH}/gpiod-test/
+    install -m 0644 ${B}/build/lib*/tests/gpiosim/_ext* ${D}${PTEST_PATH}/gpiod-test/gpiosim
+    install -m 0644 ${B}/tests/gpiosim/*.py ${D}${PTEST_PATH}/gpiod-test/gpiosim
+    install -m 0644 ${B}/build/lib*/tests/procname/_ext* ${D}${PTEST_PATH}/gpiod-test/procname
+    install -m 0644 ${B}/tests/procname/*.py ${D}${PTEST_PATH}/gpiod-test/procname
+}
-- 
2.37.2



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [meta-oe][PATCH 2/3] libgpiod: add a recipe for libgpiod v2.0-rc1
  2023-02-08 15:25 ` [meta-oe][PATCH 2/3] libgpiod: add a recipe for libgpiod v2.0-rc1 Bartosz Golaszewski
@ 2023-02-09 15:50   ` Khem Raj
  2023-02-09 19:59     ` Bartosz Golaszewski
  0 siblings, 1 reply; 13+ messages in thread
From: Khem Raj @ 2023-02-09 15:50 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Bruce Ashfield, openembedded-devel, Bartosz Golaszewski

fails to build with clang

https://errors.yoctoproject.org/Errors/Details/689563/

On Wed, Feb 8, 2023 at 7:25 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> This is a recipe for libgpiod v2 release candidate. Let's put common
> bits and pieces into an .inc file and the source fetching into a
> separate include that will be later reused by the python bindings that
> for v2 will be moved into a separate recipe in meta-python.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
>  .../{files => libgpiod-1.6.4}/run-ptest       |  0
>  .../libgpiod/libgpiod-2.0-rc1/run-ptest       | 24 ++++++++
>  .../recipes-support/libgpiod/libgpiod-src.inc |  1 +
>  meta-oe/recipes-support/libgpiod/libgpiod.inc | 61 +++++++++++++++++++
>  .../libgpiod/libgpiod_1.6.4.bb                | 56 ++---------------
>  .../libgpiod/libgpiod_2.0-rc1.bb              | 21 +++++++
>  6 files changed, 113 insertions(+), 50 deletions(-)
>  rename meta-oe/recipes-support/libgpiod/{files => libgpiod-1.6.4}/run-ptest (100%)
>  create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc1/run-ptest
>  create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod-src.inc
>  create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod.inc
>  create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod_2.0-rc1.bb
>
> diff --git a/meta-oe/recipes-support/libgpiod/files/run-ptest b/meta-oe/recipes-support/libgpiod/libgpiod-1.6.4/run-ptest
> similarity index 100%
> rename from meta-oe/recipes-support/libgpiod/files/run-ptest
> rename to meta-oe/recipes-support/libgpiod/libgpiod-1.6.4/run-ptest
> diff --git a/meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc1/run-ptest b/meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc1/run-ptest
> new file mode 100644
> index 000000000..9475f0253
> --- /dev/null
> +++ b/meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc1/run-ptest
> @@ -0,0 +1,24 @@
> +#!/bin/sh
> +
> +testbins="gpiod-test gpio-tools-test gpiod-cxx-test"
> +
> +ptestdir=$(dirname "$(readlink -f "$0")")
> +cd $ptestdir/tests
> +
> +# libgpiod v2 uses gpio-sim - a configfs-based testing module. We need to
> +# make sure configfs is mounted before running any tests.
> +modprobe configfs
> +mountpoint /sys/kernel/config > /dev/null || mount -t configfs configfs /sys/kernel/config
> +
> +for testbin in $testbins; do
> +       if test -e ./$testbin; then
> +               ./$testbin > ./$testbin.out 2>&1
> +               if [ $? -ne 0 ]; then
> +                       echo "FAIL: $testbin"
> +               else
> +                       echo "PASS: $testbin"
> +               fi
> +       else
> +               echo "SKIP: $testbin"
> +       fi
> +done
> 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 000000000..6bab4c1f4
> --- /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 000000000..abb6544ec
> --- /dev/null
> +++ b/meta-oe/recipes-support/libgpiod/libgpiod.inc
> @@ -0,0 +1,61 @@
> +SUMMARY = "C library and tools for interacting with the linux GPIO character device"
> +AUTHOR = "Bartosz Golaszewski <brgl@bgdev.pl>"
> +
> +require libgpiod-src.inc
> +
> +inherit autotools pkgconfig ptest
> +
> +SRC_URI += "file://run-ptest"
> +
> +PACKAGECONFIG[cxx] = "--enable-bindings-cxx,--disable-bindings-cxx"
> +
> +# Enable cxx bindings by default.
> +PACKAGECONFIG ?= " \
> +    cxx \
> +    ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \
> +"
> +
> +# Always build tools - they don't have any additional
> +# requirements over the library.
> +EXTRA_OECONF = "--enable-tools"
> +
> +DEPENDS += "autoconf-archive-native"
> +
> +PACKAGES =+ "${PN}-tools libgpiodcxx"
> +FILES:${PN}-tools += " \
> +    ${bindir}/gpiodetect \
> +    ${bindir}/gpioinfo \
> +    ${bindir}/gpioget \
> +    ${bindir}/gpioset \
> +    ${bindir}/gpiomon \
> +"
> +FILES:${PN}-ptest += " \
> +    ${bindir}/gpiod-test \
> +    ${bindir}/gpio-tools-test \
> +    ${bindir}/gpio-tools-test.bats \
> +    ${bindir}/gpiod-cxx-test \
> +"
> +FILES:libgpiodcxx = "${libdir}/libgpiodcxx.so.*"
> +
> +RRECOMMENDS:${PN}-ptest += "coreutils"
> +RDEPENDS:${PN}-ptest += "bats"
> +
> +do_install_ptest() {
> +    install -d ${D}${PTEST_PATH}/tests/
> +
> +    # These are the core C library tests
> +    install -m 0755 ${B}/tests/.libs/gpiod-test ${D}${PTEST_PATH}/tests/
> +
> +    # 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
> +
> +    if ${@bb.utils.contains('PACKAGECONFIG', 'cxx', 'true', 'false', d)}; then
> +        install -m 0755 ${B}/bindings/cxx/tests/.libs/gpiod-cxx-test ${D}${PTEST_PATH}/tests/
> +    fi
> +}
> +
> 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 70a77c883..df0e3f104 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 @@
> -SUMMARY = "C library and tools for interacting with the linux GPIO character device"
> -AUTHOR = "Bartosz Golaszewski <brgl@bgdev.pl>"
> +require libgpiod.inc
>
>  LICENSE = "LGPL-2.1-or-later"
>  LIC_FILES_CHKSUM = "file://COPYING;md5=2caced0b25dfefd4c601d92bd15116de"
>
> -SRC_URI = " \
> -    https://www.kernel.org/pub/software/libs/${BPN}/${BP}.tar.xz \
> -    file://run-ptest \
> -"
> -
> -SRC_URI[md5sum] = "7a2cca6ead9296c27e877070dd8853bc"
>  SRC_URI[sha256sum] = "7b146e12f28fbca3df7557f176eb778c5ccf952ca464698dba8a61b2e1e3f9b5"
>
> -inherit autotools pkgconfig python3native ptest
> +inherit python3native
>
>  PACKAGECONFIG[tests] = "--enable-tests,--disable-tests,kmod udev glib-2.0 catch2"
> -PACKAGECONFIG[cxx] = "--enable-bindings-cxx,--disable-bindings-cxx"
>  PACKAGECONFIG[python3] = "--enable-bindings-python,--disable-bindings-python,python3"
>
> -# Enable cxx bindings by default.
> -PACKAGECONFIG ?= "cxx \
> -                 ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}"
> -
>  # Always build tools - they don't have any additional
>  # requirements over the library.
>  EXTRA_OECONF = "--enable-tools"
>
> -DEPENDS += "autoconf-archive-native"
> -
> -PACKAGES =+ "${PN}-tools libgpiodcxx ${PN}-python"
> -FILES:${PN}-tools = " \
> -    ${bindir}/gpiodetect \
> -    ${bindir}/gpioinfo \
> -    ${bindir}/gpioget \
> -    ${bindir}/gpioset \
> -    ${bindir}/gpiofind \
> -    ${bindir}/gpiomon \
> -"
> +PACKAGES =+ "${PN}-python"
> +FILES:${PN}-tools += "${bindir}/gpiofind"
>  FILES:${PN}-ptest += " \
> -    ${bindir}/gpiod-test \
> -    ${bindir}/gpio-tools-test \
> -    ${bindir}/gpio-tools-test.bats \
> -    ${bindir}/gpiod-cxx-test \
>      ${bindir}/gpiod_py_test.py \
>      ${libdir}/libgpiomockup.so.* \
>  "
> -FILES:libgpiodcxx = "${libdir}/libgpiodcxx.so.*"
>  FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/*.so"
>  FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
>
>  RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-python', '', d)}"
>  RRECOMMENDS:${PN}-ptest += " \
>      kernel-module-gpio-mockup \
> -    coreutils \
>      ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-unittest', '', d)} \
>  "
> -RDEPENDS:${PN}-ptest += "bats python3-packaging"
> -
> -do_install_ptest() {
> -    install -d ${D}${PTEST_PATH}/tests
> -
> -    # These are the core C library tests
> -    install -m 0755 ${B}/tests/.libs/gpiod-test ${D}${PTEST_PATH}/tests/
> -
> -    # 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
> -
> -    if ${@bb.utils.contains('PACKAGECONFIG', 'cxx', 'true', 'false', d)}; then
> -        install -m 0755 ${B}/bindings/cxx/tests/.libs/gpiod-cxx-test ${D}${PTEST_PATH}/tests/
> -    fi
> +RDEPENDS:${PN}-ptest += "python3-packaging"
>
> +do_install_ptest:append() {
>      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-rc1.bb b/meta-oe/recipes-support/libgpiod/libgpiod_2.0-rc1.bb
> new file mode 100644
> index 000000000..6894932ee
> --- /dev/null
> +++ b/meta-oe/recipes-support/libgpiod/libgpiod_2.0-rc1.bb
> @@ -0,0 +1,21 @@
> +require libgpiod.inc
> +
> +LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later & CC-BY-SA-4.0"
> +LIC_FILES_CHKSUM = " \
> +    file://LICENSES/GPL-2.0-or-later.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
> +    file://LICENSES/LGPL-2.1-or-later.txt;md5=4b54a1fd55a448865a0b32d41598759d \
> +    file://LICENSES/CC-BY-SA-4.0.txt;md5=fba3b94d88bfb9b81369b869a1e9a20f \
> +"
> +
> +SRC_URI[sha256sum] = "64a718e8f8e022afc1880bae0b6ddc874fca1ce1bf8a2ac88bab4ccca6b66a1e"
> +
> +S = "${WORKDIR}/libgpiod-2.0"
> +
> +# We must enable gpioset-interactive for all gpio-tools tests to pass
> +PACKAGECONFIG[tests] = "--enable-tests --enable-gpioset-interactive,--disable-tests,kmod util-linux glib-2.0 catch2 libedit"
> +PACKAGECONFIG[gpioset-interactive] = "--enable-gpioset-interactive,--disable-gpioset-interactive,libedit"
> +
> +FILES:${PN}-tools += "${bindir}/gpionotify"
> +FILES:${PN}-ptest += "${libdir}/libgpiosim.so.*"
> +
> +RRECOMMENDS:${PN}-ptest += "kernel-module-gpio-sim"
> --
> 2.37.2
>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [oe] [meta-oe][PATCH 0/3] libgpiod: add support for libgpiod v2
  2023-02-08 15:25 [meta-oe][PATCH 0/3] libgpiod: add support for libgpiod v2 Bartosz Golaszewski
                   ` (2 preceding siblings ...)
  2023-02-08 15:25 ` [meta-python][PATCH 3/3] python3-gpiod: new package Bartosz Golaszewski
@ 2023-02-09 19:25 ` Ferry Toth
  2023-02-09 19:57   ` Bartosz Golaszewski
  3 siblings, 1 reply; 13+ messages in thread
From: Ferry Toth @ 2023-02-09 19:25 UTC (permalink / raw)
  To: Bartosz Golaszewski, Khem Raj, Bruce Ashfield, openembedded-devel
  Cc: Bartosz Golaszewski

Hi,

Op 08-02-2023 om 16:25 schreef Bartosz Golaszewski:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> 
> We've just tagged the release candidate for libgpiod v2. This is a major
> release entirely overhauling the API in a backward incompatible way.

Thanks for creating this!

> While this is not the final release yet, it's not likely to change much so
> I'd like to make it available in meta-openembedded to give it exposure to
> some testing. When we do release v2.0, it'll be just a matter of bumping the
> version.
> 
> Currently no other package depends on libgpiod in meta-openembedded, so I'd
> like to avoid having two packages (libgpiod and libgpiod2). Instead let's
> provide recipes for both versions but keep them under the common libgpiod name
> as it's unlikely anyone would need both versions in a single system. This is
> after all a medium-sized project that shouldn't require too much work in order
> to port a user to the new major release.

Nevertheless there may be packages in other layers using it (meta-acpi, 
meta-intel-edison). I think there will be a period where both may need 
to coexist.

> The first patch contains an update of libgpiod v1.6.x to the most recent
> bug-fix release.
> 
> The second contains the recipe for libgpiod v2.0-rc1 while also moving the
> bitbake code around in order to factor out common elements.
> 
> The third contains a recipe for the python bindings that are now in their own
> project in meta-python.
> 
> The new recipes provide the same functionality - including ptest for the C
> library, tools and language bindings.
> 
> Bartosz Golaszewski (3):
>    libgpiod: update to v1.6.4
>    libgpiod: add a recipe for libgpiod v2.0-rc1
>    python3-gpiod: new package
> 
>   ...-don-t-expect-automake-to-set-PYTHON.patch | 37 ---------
>   .../{files => libgpiod-1.6.4}/run-ptest       |  0
>   .../libgpiod/libgpiod-2.0-rc1/run-ptest       | 24 ++++++
>   .../recipes-support/libgpiod/libgpiod-src.inc |  1 +
>   meta-oe/recipes-support/libgpiod/libgpiod.inc | 61 ++++++++++++++
>   .../libgpiod/libgpiod_1.6.3.bb                | 82 -------------------
>   .../libgpiod/libgpiod_1.6.4.bb                | 37 +++++++++
>   .../libgpiod/libgpiod_2.0-rc1.bb              | 21 +++++
>   .../packagegroups/packagegroup-meta-python.bb |  1 +
>   .../python/python3-gpiod/run-ptest            | 15 ++++
>   .../python/python3-gpiod_2.0-rc1.bb           | 45 ++++++++++
>   11 files changed, 205 insertions(+), 119 deletions(-)
>   delete mode 100644 meta-oe/recipes-support/libgpiod/files/0001-build-don-t-expect-automake-to-set-PYTHON.patch
>   rename meta-oe/recipes-support/libgpiod/{files => libgpiod-1.6.4}/run-ptest (100%)
>   create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc1/run-ptest
>   create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod-src.inc
>   create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod.inc
>   delete mode 100644 meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb
>   create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb
>   create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod_2.0-rc1.bb
>   create mode 100644 meta-python/recipes-devtools/python/python3-gpiod/run-ptest
>   create mode 100644 meta-python/recipes-devtools/python/python3-gpiod_2.0-rc1.bb
> 
> 
> 
> 
> 



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [oe] [meta-oe][PATCH 0/3] libgpiod: add support for libgpiod v2
  2023-02-09 19:25 ` [oe] [meta-oe][PATCH 0/3] libgpiod: add support for libgpiod v2 Ferry Toth
@ 2023-02-09 19:57   ` Bartosz Golaszewski
  2023-02-13 22:15     ` Ferry Toth
  0 siblings, 1 reply; 13+ messages in thread
From: Bartosz Golaszewski @ 2023-02-09 19:57 UTC (permalink / raw)
  To: Ferry Toth
  Cc: Khem Raj, Bruce Ashfield, openembedded-devel, Bartosz Golaszewski

On Thu, Feb 9, 2023 at 8:26 PM Ferry Toth <fntoth@gmail.com> wrote:
>
> Hi,
>
> Op 08-02-2023 om 16:25 schreef Bartosz Golaszewski:
> > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >
> > We've just tagged the release candidate for libgpiod v2. This is a major
> > release entirely overhauling the API in a backward incompatible way.
>
> Thanks for creating this!
>
> > While this is not the final release yet, it's not likely to change much so
> > I'd like to make it available in meta-openembedded to give it exposure to
> > some testing. When we do release v2.0, it'll be just a matter of bumping the
> > version.
> >
> > Currently no other package depends on libgpiod in meta-openembedded, so I'd
> > like to avoid having two packages (libgpiod and libgpiod2). Instead let's
> > provide recipes for both versions but keep them under the common libgpiod name
> > as it's unlikely anyone would need both versions in a single system. This is
> > after all a medium-sized project that shouldn't require too much work in order
> > to port a user to the new major release.
>
> Nevertheless there may be packages in other layers using it (meta-acpi,
> meta-intel-edison). I think there will be a period where both may need
> to coexist.
>

Can those layers just set the PREFERRED_VERSION?

Bart


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [meta-oe][PATCH 2/3] libgpiod: add a recipe for libgpiod v2.0-rc1
  2023-02-09 15:50   ` Khem Raj
@ 2023-02-09 19:59     ` Bartosz Golaszewski
  0 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2023-02-09 19:59 UTC (permalink / raw)
  To: Khem Raj; +Cc: Bruce Ashfield, openembedded-devel, Bartosz Golaszewski

On Thu, Feb 9, 2023 at 4:50 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> fails to build with clang
>
> https://errors.yoctoproject.org/Errors/Details/689563/
>

Thanks for the report. I fixed this one but it seems like there are
more issues with clang and musl. For instance musl doesn't have
twalk_r() which libgpiod uses in tests. I need to spend some time on
it.

Bart


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [oe] [meta-oe][PATCH 0/3] libgpiod: add support for libgpiod v2
  2023-02-09 19:57   ` Bartosz Golaszewski
@ 2023-02-13 22:15     ` Ferry Toth
  2023-02-14 14:05       ` Bartosz Golaszewski
  0 siblings, 1 reply; 13+ messages in thread
From: Ferry Toth @ 2023-02-13 22:15 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Khem Raj, Bruce Ashfield, openembedded-devel, Bartosz Golaszewski

Op 09-02-2023 om 20:57 schreef Bartosz Golaszewski:
> On Thu, Feb 9, 2023 at 8:26 PM Ferry Toth <fntoth@gmail.com> wrote:
>>
>> Hi,
>>
>> Op 08-02-2023 om 16:25 schreef Bartosz Golaszewski:
>>> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>>>
>>> We've just tagged the release candidate for libgpiod v2. This is a major
>>> release entirely overhauling the API in a backward incompatible way.
>>
>> Thanks for creating this!
>>
>>> While this is not the final release yet, it's not likely to change much so
>>> I'd like to make it available in meta-openembedded to give it exposure to
>>> some testing. When we do release v2.0, it'll be just a matter of bumping the
>>> version.
>>>
>>> Currently no other package depends on libgpiod in meta-openembedded, so I'd
>>> like to avoid having two packages (libgpiod and libgpiod2). Instead let's
>>> provide recipes for both versions but keep them under the common libgpiod name
>>> as it's unlikely anyone would need both versions in a single system. This is
>>> after all a medium-sized project that shouldn't require too much work in order
>>> to port a user to the new major release.
>>
>> Nevertheless there may be packages in other layers using it (meta-acpi,
>> meta-intel-edison). I think there will be a period where both may need
>> to coexist.
>>
> 
> Can those layers just set the PREFERRED_VERSION?

Yes, but it doesn't the problem when one app needs v1 and the other 
needs v2.

> Bart
> 
> 
> 
> 
> 



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [oe] [meta-oe][PATCH 0/3] libgpiod: add support for libgpiod v2
  2023-02-13 22:15     ` Ferry Toth
@ 2023-02-14 14:05       ` Bartosz Golaszewski
  2023-02-14 17:21         ` Ferry Toth
  0 siblings, 1 reply; 13+ messages in thread
From: Bartosz Golaszewski @ 2023-02-14 14:05 UTC (permalink / raw)
  To: Ferry Toth
  Cc: Khem Raj, Bruce Ashfield, openembedded-devel, Bartosz Golaszewski

On Mon, Feb 13, 2023 at 11:15 PM Ferry Toth <fntoth@gmail.com> wrote:
>
> Op 09-02-2023 om 20:57 schreef Bartosz Golaszewski:
> > On Thu, Feb 9, 2023 at 8:26 PM Ferry Toth <fntoth@gmail.com> wrote:
> >>
> >> Hi,
> >>
> >> Op 08-02-2023 om 16:25 schreef Bartosz Golaszewski:
> >>> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >>>
> >>> We've just tagged the release candidate for libgpiod v2. This is a major
> >>> release entirely overhauling the API in a backward incompatible way.
> >>
> >> Thanks for creating this!
> >>
> >>> While this is not the final release yet, it's not likely to change much so
> >>> I'd like to make it available in meta-openembedded to give it exposure to
> >>> some testing. When we do release v2.0, it'll be just a matter of bumping the
> >>> version.
> >>>
> >>> Currently no other package depends on libgpiod in meta-openembedded, so I'd
> >>> like to avoid having two packages (libgpiod and libgpiod2). Instead let's
> >>> provide recipes for both versions but keep them under the common libgpiod name
> >>> as it's unlikely anyone would need both versions in a single system. This is
> >>> after all a medium-sized project that shouldn't require too much work in order
> >>> to port a user to the new major release.
> >>
> >> Nevertheless there may be packages in other layers using it (meta-acpi,
> >> meta-intel-edison). I think there will be a period where both may need
> >> to coexist.
> >>
> >
> > Can those layers just set the PREFERRED_VERSION?
>
> Yes, but it doesn't the problem when one app needs v1 and the other
> needs v2.
>

Yeah, this is what I'm trying to explain. How likely is it that the
same system will use two versions of libgpiod at the same time? IMO
highly unlikely because this is not gstreamer or some other huge
project, it's a small-to-middle-sized library that's most likely ever
only used by a single program or script on a given system.

I'd prefer to not provide libgpiod and libgpiod2 packages but instead
allow to alternate between them using PREFERRED_VERSION. If anyone
complains, then we can rethink it.

It's not like we're changing the default version in any of the stable
branches anyway.

Bart


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [oe] [meta-oe][PATCH 0/3] libgpiod: add support for libgpiod v2
  2023-02-14 14:05       ` Bartosz Golaszewski
@ 2023-02-14 17:21         ` Ferry Toth
       [not found]           ` <CACMJSevdEqhyyV1mDjA2xt5nm28T996aPjyOa69uy8Z-GsuckA@mail.gmail.com>
  0 siblings, 1 reply; 13+ messages in thread
From: Ferry Toth @ 2023-02-14 17:21 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Khem Raj, Bruce Ashfield, openembedded-devel, Bartosz Golaszewski

Op 14-02-2023 om 15:05 schreef Bartosz Golaszewski:
> On Mon, Feb 13, 2023 at 11:15 PM Ferry Toth <fntoth@gmail.com> wrote:
>>
>> Op 09-02-2023 om 20:57 schreef Bartosz Golaszewski:
>>> On Thu, Feb 9, 2023 at 8:26 PM Ferry Toth <fntoth@gmail.com> wrote:
>>>>
>>>> Hi,
>>>>
>>>> Op 08-02-2023 om 16:25 schreef Bartosz Golaszewski:
>>>>> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>>>>>
>>>>> We've just tagged the release candidate for libgpiod v2. This is a major
>>>>> release entirely overhauling the API in a backward incompatible way.
>>>>
>>>> Thanks for creating this!
>>>>
>>>>> While this is not the final release yet, it's not likely to change much so
>>>>> I'd like to make it available in meta-openembedded to give it exposure to
>>>>> some testing. When we do release v2.0, it'll be just a matter of bumping the
>>>>> version.
>>>>>
>>>>> Currently no other package depends on libgpiod in meta-openembedded, so I'd
>>>>> like to avoid having two packages (libgpiod and libgpiod2). Instead let's
>>>>> provide recipes for both versions but keep them under the common libgpiod name
>>>>> as it's unlikely anyone would need both versions in a single system. This is
>>>>> after all a medium-sized project that shouldn't require too much work in order
>>>>> to port a user to the new major release.
>>>>
>>>> Nevertheless there may be packages in other layers using it (meta-acpi,
>>>> meta-intel-edison). I think there will be a period where both may need
>>>> to coexist.
>>>>
>>>
>>> Can those layers just set the PREFERRED_VERSION?
>>
>> Yes, but it doesn't the problem when one app needs v1 and the other
>> needs v2.
>>
> 
> Yeah, this is what I'm trying to explain. How likely is it that the
> same system will use two versions of libgpiod at the same time? IMO
> highly unlikely because this is not gstreamer or some other huge
> project, it's a small-to-middle-sized library that's most likely ever
> only used by a single program or script on a given system.
> 
> I'd prefer to not provide libgpiod and libgpiod2 packages but instea
> allow to alternate between them using PREFERRED_VERSION. If anyone
> complains, then we can rethink it.


libgpiod2 is in Ubuntu Kinetic and is a dependency of openocd (> 1,1) 
and eg25-amanager.

Those packages will block libgpiod v2 from going in (that would be a 
pity) until they are ported, or until they are dropped (a pity to have 
your dependents dropped too).

On a smaller scale, Intel Edison Arduino uses libgpiod in 2 apps. To 
port them I need to figure what changed and how to fix them. Try some 
example etc. because at this point in time there is not much example 
code. But installing libgpiod v2 breaks some systemd services because v1 
gets uninstalled. Luckily in my case it does not break boot.
> It's not like we're changing the default version in any of the stable
> branches anyway.

True. I just like libs to change version when they have compatibility 
breaks. But maybe that's just me.

> Bart
> 
> 
> 
> 
> 



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [oe] [meta-oe][PATCH 0/3] libgpiod: add support for libgpiod v2
       [not found]           ` <CACMJSevdEqhyyV1mDjA2xt5nm28T996aPjyOa69uy8Z-GsuckA@mail.gmail.com>
@ 2023-02-14 18:16             ` Ferry Toth
  2023-02-14 18:32               ` Bartosz Golaszewski
  0 siblings, 1 reply; 13+ messages in thread
From: Ferry Toth @ 2023-02-14 18:16 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Bartosz Golaszewski, Khem Raj, Bruce Ashfield, openembedded-devel

Hi

Op 14-02-2023 om 19:10 schreef Bartosz Golaszewski:
> On Tue, 14 Feb 2023 at 18:21, Ferry Toth <fntoth@gmail.com> wrote:
>> Op 14-02-2023 om 15:05 schreef Bartosz Golaszewski:
>>> On Mon, Feb 13, 2023 at 11:15 PM Ferry Toth <fntoth@gmail.com> wrote:
>>>> Op 09-02-2023 om 20:57 schreef Bartosz Golaszewski:
>>>>> On Thu, Feb 9, 2023 at 8:26 PM Ferry Toth <fntoth@gmail.com> wrote:
>>>>>> Hi,
>>>>>>
>>>>>> Op 08-02-2023 om 16:25 schreef Bartosz Golaszewski:
>>>>>>> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>>>>>>>
>>>>>>> We've just tagged the release candidate for libgpiod v2. This is a major
>>>>>>> release entirely overhauling the API in a backward incompatible way.
>>>>>> Thanks for creating this!
>>>>>>
>>>>>>> While this is not the final release yet, it's not likely to change much so
>>>>>>> I'd like to make it available in meta-openembedded to give it exposure to
>>>>>>> some testing. When we do release v2.0, it'll be just a matter of bumping the
>>>>>>> version.
>>>>>>>
>>>>>>> Currently no other package depends on libgpiod in meta-openembedded, so I'd
>>>>>>> like to avoid having two packages (libgpiod and libgpiod2). Instead let's
>>>>>>> provide recipes for both versions but keep them under the common libgpiod name
>>>>>>> as it's unlikely anyone would need both versions in a single system. This is
>>>>>>> after all a medium-sized project that shouldn't require too much work in order
>>>>>>> to port a user to the new major release.
>>>>>> Nevertheless there may be packages in other layers using it (meta-acpi,
>>>>>> meta-intel-edison). I think there will be a period where both may need
>>>>>> to coexist.
>>>>>>
>>>>> Can those layers just set the PREFERRED_VERSION?
>>>> Yes, but it doesn't the problem when one app needs v1 and the other
>>>> needs v2.
>>>>
>>> Yeah, this is what I'm trying to explain. How likely is it that the
>>> same system will use two versions of libgpiod at the same time? IMO
>>> highly unlikely because this is not gstreamer or some other huge
>>> project, it's a small-to-middle-sized library that's most likely ever
>>> only used by a single program or script on a given system.
>>>
>>> I'd prefer to not provide libgpiod and libgpiod2 packages but instea
>>> allow to alternate between them using PREFERRED_VERSION. If anyone
>>> complains, then we can rethink it.
>>
>> libgpiod2 is in Ubuntu Kinetic and is a dependency of openocd (> 1,1)
>> and eg25-amanager.
>>
> Wait what? libgpiod v2 is not out yet, what's up with ubuntu?
libgpiod2 (the package) is based on libgpiod 1.6.3 (the source)
>> Those packages will block libgpiod v2 from going in (that would be a
>> pity) until they are ported, or until they are dropped (a pity to have
>> your dependents dropped too).
>>
>> On a smaller scale, Intel Edison Arduino uses libgpiod in 2 apps. To
>> port them I need to figure what changed and how to fix them. Try some
>> example etc. because at this point in time there is not much example
>> code. But installing libgpiod v2 breaks some systemd services because v1
>> gets uninstalled. Luckily in my case it does not break boot.
> I will be more than happy to assist with porting! In fact I will look
> at porting openocd myself.
Thanks, I start a new thread if I get stuck
>>> It's not like we're changing the default version in any of the stable
>>> branches anyway.
>> True. I just like libs to change version when they have compatibility
>> breaks. But maybe that's just me.
>>
> I don't really care what distros do. I maintain the meta-openembedded
> recipe and only have interest in its versioning. Ubuntu can call it
> libgpiod2137 for what I care.

Of course. That was just an example, I didn't mean to hijack the discussion.

I just seems libgpiod 1.6.3 and 2.0-rc1 can not currently coexist (i.e. 
the packages can not be installed simultaneously). Or I tried (to modify 
the recipe) and did something wrong.

> Bart
>
>>> Bart
>>>
>>>
>>>
>>> 
>>>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [oe] [meta-oe][PATCH 0/3] libgpiod: add support for libgpiod v2
  2023-02-14 18:16             ` Ferry Toth
@ 2023-02-14 18:32               ` Bartosz Golaszewski
  0 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2023-02-14 18:32 UTC (permalink / raw)
  To: Ferry Toth
  Cc: Bartosz Golaszewski, Khem Raj, Bruce Ashfield, openembedded-devel

On Tue, Feb 14, 2023 at 7:16 PM Ferry Toth <fntoth@gmail.com> wrote:
>
> Hi
>
> Op 14-02-2023 om 19:10 schreef Bartosz Golaszewski:
> > On Tue, 14 Feb 2023 at 18:21, Ferry Toth <fntoth@gmail.com> wrote:
> >> Op 14-02-2023 om 15:05 schreef Bartosz Golaszewski:
> >>> On Mon, Feb 13, 2023 at 11:15 PM Ferry Toth <fntoth@gmail.com> wrote:
> >>>> Op 09-02-2023 om 20:57 schreef Bartosz Golaszewski:
> >>>>> On Thu, Feb 9, 2023 at 8:26 PM Ferry Toth <fntoth@gmail.com> wrote:
> >>>>>> Hi,
> >>>>>>
> >>>>>> Op 08-02-2023 om 16:25 schreef Bartosz Golaszewski:
> >>>>>>> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >>>>>>>
> >>>>>>> We've just tagged the release candidate for libgpiod v2. This is a major
> >>>>>>> release entirely overhauling the API in a backward incompatible way.
> >>>>>> Thanks for creating this!
> >>>>>>
> >>>>>>> While this is not the final release yet, it's not likely to change much so
> >>>>>>> I'd like to make it available in meta-openembedded to give it exposure to
> >>>>>>> some testing. When we do release v2.0, it'll be just a matter of bumping the
> >>>>>>> version.
> >>>>>>>
> >>>>>>> Currently no other package depends on libgpiod in meta-openembedded, so I'd
> >>>>>>> like to avoid having two packages (libgpiod and libgpiod2). Instead let's
> >>>>>>> provide recipes for both versions but keep them under the common libgpiod name
> >>>>>>> as it's unlikely anyone would need both versions in a single system. This is
> >>>>>>> after all a medium-sized project that shouldn't require too much work in order
> >>>>>>> to port a user to the new major release.
> >>>>>> Nevertheless there may be packages in other layers using it (meta-acpi,
> >>>>>> meta-intel-edison). I think there will be a period where both may need
> >>>>>> to coexist.
> >>>>>>
> >>>>> Can those layers just set the PREFERRED_VERSION?
> >>>> Yes, but it doesn't the problem when one app needs v1 and the other
> >>>> needs v2.
> >>>>
> >>> Yeah, this is what I'm trying to explain. How likely is it that the
> >>> same system will use two versions of libgpiod at the same time? IMO
> >>> highly unlikely because this is not gstreamer or some other huge
> >>> project, it's a small-to-middle-sized library that's most likely ever
> >>> only used by a single program or script on a given system.
> >>>
> >>> I'd prefer to not provide libgpiod and libgpiod2 packages but instea
> >>> allow to alternate between them using PREFERRED_VERSION. If anyone
> >>> complains, then we can rethink it.
> >>
> >> libgpiod2 is in Ubuntu Kinetic and is a dependency of openocd (> 1,1)
> >> and eg25-amanager.
> >>
> > Wait what? libgpiod v2 is not out yet, what's up with ubuntu?
> libgpiod2 (the package) is based on libgpiod 1.6.3 (the source)
> >> Those packages will block libgpiod v2 from going in (that would be a
> >> pity) until they are ported, or until they are dropped (a pity to have
> >> your dependents dropped too).
> >>
> >> On a smaller scale, Intel Edison Arduino uses libgpiod in 2 apps. To
> >> port them I need to figure what changed and how to fix them. Try some
> >> example etc. because at this point in time there is not much example
> >> code. But installing libgpiod v2 breaks some systemd services because v1
> >> gets uninstalled. Luckily in my case it does not break boot.
> > I will be more than happy to assist with porting! In fact I will look
> > at porting openocd myself.
> Thanks, I start a new thread if I get stuck

Feel free to post on the linux-gpio mailing list.

> >>> It's not like we're changing the default version in any of the stable
> >>> branches anyway.
> >> True. I just like libs to change version when they have compatibility
> >> breaks. But maybe that's just me.
> >>
> > I don't really care what distros do. I maintain the meta-openembedded
> > recipe and only have interest in its versioning. Ubuntu can call it
> > libgpiod2137 for what I care.
>
> Of course. That was just an example, I didn't mean to hijack the discussion.
>
> I just seems libgpiod 1.6.3 and 2.0-rc1 can not currently coexist (i.e.
> the packages can not be installed simultaneously). Or I tried (to modify
> the recipe) and did something wrong.
>

No, you're right. Shared objects have different ABI versions but other
than that many files share names: the header, pkgconfig manpages etc.

I have no intention of changing this honestly - better just port the apps.

Bart


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-02-14 18:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-08 15:25 [meta-oe][PATCH 0/3] libgpiod: add support for libgpiod v2 Bartosz Golaszewski
2023-02-08 15:25 ` [meta-oe][PATCH 1/3] libgpiod: update to v1.6.4 Bartosz Golaszewski
2023-02-08 15:25 ` [meta-oe][PATCH 2/3] libgpiod: add a recipe for libgpiod v2.0-rc1 Bartosz Golaszewski
2023-02-09 15:50   ` Khem Raj
2023-02-09 19:59     ` Bartosz Golaszewski
2023-02-08 15:25 ` [meta-python][PATCH 3/3] python3-gpiod: new package Bartosz Golaszewski
2023-02-09 19:25 ` [oe] [meta-oe][PATCH 0/3] libgpiod: add support for libgpiod v2 Ferry Toth
2023-02-09 19:57   ` Bartosz Golaszewski
2023-02-13 22:15     ` Ferry Toth
2023-02-14 14:05       ` Bartosz Golaszewski
2023-02-14 17:21         ` Ferry Toth
     [not found]           ` <CACMJSevdEqhyyV1mDjA2xt5nm28T996aPjyOa69uy8Z-GsuckA@mail.gmail.com>
2023-02-14 18:16             ` Ferry Toth
2023-02-14 18:32               ` Bartosz Golaszewski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.