Commit Graph

62 Commits

Author SHA1 Message Date
Joe Slater b5f5c8859c libgpiod: modify RDEPENDS for ptest
The current use of RDEPENDS to add a dependency on bats results
in the QA warning/error

 lib32-libgpiod package lib32-libgpiod-ptest-dev - suspicious values
  'bats-dev' in RRECOMMENDS [multilib]

when building lib32-libgpiod with ptest not enabled.  We add the
dependency only if ptest is enabled.

Signed-off-by: Joe Slater <joe.slater@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit 9904bd6a24)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
2023-07-25 07:12:13 -04:00
Joe Slater 6e9118383c libgpiod: modify test 'gpioset: toggle (continuous)'
Look for level transitions when testing toggling
values because using fixed delays to assume value
changes is not reliable.

Signed-off-by: Joe Slater <joe.slater@windriver.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>

cherry-pick from meta-oe/master 45a8bb2620...

Signed-off-by: Joe Slater <joe.slater@windriver.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
2023-06-17 13:15:52 -04:00
Bartosz Golaszewski 3db9f65bbd libgpiod: install the libgpiosim header
This header is used for building tests. While libgpiod can access it
from the source tree, the python bindings that live in a separate recipe
must be able to use it from its recipe sysroot.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit 62cd19e3f4)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
2023-05-07 12:23:00 -04:00
Bartosz Golaszewski dfcbbdfc48 libgpiod: update to v2.0
The final v2.0 release is out so update the recipe.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-03-02 17:45:37 -08:00
Bartosz Golaszewski 14c638320d libgpiod: bump version to v2.0-rc3
I decided to make one more RC before the final release as there was one
late minor change to C++ interface (marking public classes as final).
Next week libgpiod v2.0 should be finally carved in stone.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-02-24 08:45:44 -08:00
Bartosz Golaszewski cd26db61af libgpiod: add a recipe for libgpiod v2.0-rc2
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>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-02-18 13:19:36 -08:00
Bartosz Golaszewski 389ee7fe7d libgpiod: update to v1.6.4
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>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-02-08 08:51:44 -08:00
Bartosz Golaszewski 12cdd958ef libgpiod: fix python bindings build
It seems that automake's AM_PATH_PYTHON() macro no longer sets the
$PYTHON variable. This means the python bindings build for libgpiod has
been broken for some time. As we know which version we're using -
python3 - let's hardcode it in configure.ac. For now add a patch that's
been merged upstream and once a new bugfix release is out, we'll remove
it.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-01-25 08:57:42 -08:00
Alex Kiernan 62fd541101 libgpiod: Detect ptest using PTEST_ENABLED
Allow the ptest packages to be disabled even if ptest is enabled in
DISTRO_FEATURES.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-08-12 01:24:27 -07:00
Peter Marko 1de8b9c7e2 libgpiod: move test dependencies to ptest package
This reverts and reworks commit e75cc87c4f

These tools are needed by test-suites, not the package itself.
I do not want bash (gpl3) or python (big/lot of dependencies)
in my release image when I have ptest enabled in my distro for
sdk/testing image.

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-05-24 08:39:45 -07:00
Khem Raj 14c7d8a0d7 recipes: Update LICENSE variable to use SPDX license identifiers
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-03-04 17:41:45 -08:00
Bartosz Golaszewski ac67765cb0 libgpiod: ptest: redirect stderr to stdout for test executables
Catch2 (used by the C++ tests) prints its output to stderr instead of
stdout. Redirect stderr to stdout for all test executables.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-12-01 12:39:28 -08:00
Bartosz Golaszewski f065bcdee7 libgpiod: ptest: rrecommend coreutils
The bats test suite requires the 'timeout' and 'nl' commands to be
available. Busybox' default config doesn't include those. They are built
by default by coreutils though, so add it to RRECOMMENDS for ptest.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-11-19 08:37:31 -08:00
Bartosz Golaszewski 97771cd2f4 libgpiod: ptest: rrecommend python3-unittest when building python tests
The python test suite uses the unittest module. It's not built by
default in minimal images, so we need to add it RRECOMMENDS explicitly.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-11-19 08:37:31 -08:00
Khem Raj fb95946eb5 emacs,libgpiod,cockpit: Fix override syntax in using FILES_${PN}
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-08-06 20:38:40 -07:00
Martin Jansa c61dc077bb Convert to new override syntax
This is the result of automated script (0.9.1) conversion:

oe-core/scripts/contrib/convert-overrides.py .

converting the metadata to use ":" as the override character instead of "_".

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2021-08-03 10:21:25 -07:00
Signed-off-by: Bartosz Golaszewski 46eb101cf7 Revert "libgpiod: ptest: warn if the gpio-mockup kernel module is not selected"
This reverts commit 977c5f5619.

This recipe doesn't see the final value of KERNEL_FEATURES that the
linux-yocto recipe uses - that's why this warning was always triggered
if the gpio-mockup feature was not defined globally in this variable.
The linux-yocto recipe pulls in gpio-mockup automatically if ptest is
in DISTRO_FEATURES so we don't really needs thich check.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-06-09 12:53:53 -07:00
Bartosz Golaszewski 18960fe1c1 libgpiod: update my email address
I now maintain the project and this recipe in my own time. Update my
email address in the AUTHOR field.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-06-09 12:53:48 -07:00
Bartosz Golaszewski 4b16dedac6 libgpiod: add the python test-suite to the ptest package
One more follow-up to the ptest updates - the python test suite was
missed and is still in the main library package. Move it to
libgpiod-ptest.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-06-09 08:49:20 -07:00
Bartosz Golaszewski 3018b3af38 libgpiod: ptest: only rrecommend a single module that we need
We don't need to pull in all kernel modules. It's enough to just
rrecommend gpio-mockup.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-06-04 07:08:13 -07:00
Bartosz Golaszewski 657bbdf163 libgpiod: ptest: add kernel-modules to RRECOMMENDS
libgpiod needs the gpio-mockup kernel module to be loadable (not
built-in). Add kernel-modules to RRECOMMENDS.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-06-04 07:08:13 -07:00
Bartosz Golaszewski 977c5f5619 libgpiod: ptest: warn if the gpio-mockup kernel module is not selected
libgpiod test-suites work with the gpio-mockup kernel module. When using
linux-yocto, it's enabled using the gpio/mockup.scc kernel feature. Check
if this feature is present in KERNEL_FEATURE and warn if not.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-06-04 07:08:13 -07:00
Bartosz Golaszewski 2530ace540 libgpiod: ptest: run all test-suites if possible
We have four test-suites total in libgpiod: for the core C library,
gpio-tools and for C++ and Python bindings. Modify the recipe to install
all of them depending on build settings and make run-ptest execute them
if available.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-06-04 07:08:13 -07:00
Bartosz Golaszewski 66561c713e libgpiod: redirect stdout from the ptest executable to a file
Most tests redirect their standard output to a file. Let's make libgpiod
consistent with this pattern.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-06-04 07:08:13 -07:00
Bartosz Golaszewski e75cc87c4f libgpiod: add RDEPENDS for tests
The libgpiod-tools test-suite requires bats at run-time. The python
test-suite needs the packaging module. Add both to the RDEPENDS in the
tests PACKAGECONFIG option

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-06-04 07:08:13 -07:00
Bartosz Golaszewski 2d163d0e18 libgpiod: correctly split output files into packages
Currently, the files that should go into libgpiod-ptest are part of
either the main library package of libgpiod-tools. Use more fine-grained
values for package files variables.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-06-04 07:08:13 -07:00
Bartosz Golaszewski 1b26441296 libgpiod: fix RRECOMMENDS for python bindings
RRECOMMENDS for the python module doesn't work because it specifies
the module itself as its own RRECOMMENDS. Fix it to recommend the python
package if python3 is in PACKAGECONFIG for the main package.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-06-04 07:08:13 -07:00
Bartosz Golaszewski 187beae6bc libgpiod: list all packages in a single assignment
Don't have assignments to PACKAGES scattered across the recipe - use a
single place for that before assigning FILES.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-06-04 07:08:13 -07:00
Bartosz Golaszewski f3d670d9b3 libgpiod: coding style fixes
The recipe is getting bigger so try to keep a consistent coding style.
Use four spaces instead of tabs and use the common way of splitting
multi-line strings for minimum git diff lines at modification.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-06-04 07:08:13 -07:00
Bartosz Golaszewski d25fb9ee17 libgpiod: update v1.6.2 -> v1.6.3
This is a small bugfix release addressing some issues with C++ and
Python bindings.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-03-22 09:25:16 -07:00
Christian B. Sørensen 96db316f75 libgpiod: packageqa problem => static python lib to ${PN}-staticdev
Problem:
QA Issue: non -staticdev package contains static .a library

Reason:
Both /usr/lib/python3.8/site-packages/gpiod.a and
/usr/lib/python3.8/site-packages/gpiod.so are in ${PN}-python.

Signed-off-by: Christian Bräuner Sørensen <yocto@bsorensen.net>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-02-23 11:08:21 -08:00
Sakib Sajal 43560d8e22 libgpiod: add ptest
Added ptest for libgpiod. Requires CONFIG_GPIO_MOCKUP
kernel config to be enabled.

Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-01-28 16:53:13 -08:00
Bartosz Golaszewski e1f6b98842 libgpiod: update v1.4.5 -> v1.6.2
We're now by default on linux v5.8 so the GPIO features supported by
libgpiod v1.6 are available. Bump the version to v1.6.2 and extend the
recipe to depend on additional testing packages if tests are being built.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-11-30 22:42:20 -08:00
Bartosz Golaszewski 5380eb42d6 libgpiod: update v1.4.4 -> v1.4.5
This bugfix release contains a couple fixes for C++ and Python bindings.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-11-02 09:00:52 -08:00
Bartosz Golaszewski 1ea3e2c4d2 libgpiod: consolidate the recipe files
After dropping the support for v0.3.x, we no longer need the split into
.bb and .inc files. Let's move the contents of libgpiod.inc into
libgpiod_1.4.4.bb.

While at it: do some refactoring: let's use ${BPN} in the URL, consolidate
certain variables and add some explanatory comments.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-10-05 10:47:38 -07:00
Bartosz Golaszewski 0ef9d45bda libgpiod: drop support for 0.3.3
I no longer support the v0.x.y series. Remove the recipe for v0.3.3.
While at it: the tests PACKAGECONFIG is duplicated so remove one
instance.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-09-17 08:57:11 -07:00
Bartosz Golaszewski 8340965ac6 libgpiod: update v1.4.3 -> v1.4.4
This is a bug-fix release fixing the issue with reading line values for
bulks of lineevents.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-08-26 19:20:40 -07:00
Rasmus Villemoes 533ad71725 libgpiod: split c++ library to its own package
I need (some of) the gpiod tools in my initramfs. That, of course,
pulls in the workhorse in the form of the libgpiod C library. But it
also pulls in the C++ library which is cobundled with libgpiod, which
in turn means that libstdc++ gets pulled in, adding about 2.5MB to the
initramfs.

Fix that by splitting the C++ library to its own package.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-05-06 23:20:29 -07:00
Bartosz Golaszewski a6e846dadc libgpiod: update v1.4.2 -> v1.4.3
This contains a bugfix for gpiod_chip_open() failing for symbolic links
to devices.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-03-31 07:03:29 -07:00
Bartosz Golaszewski 3b3de3fc6b libgpiod: update v1.4.1 -> v1.4.2
While the v1.5 version of libgpiod has already been released - we can't
integrate it in yocto yet as it requires v5.5 linux kernel headers to
build. In the meantime - update the recipe to build the latest bug-fix
release from the v1.4.x branch.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-01-31 07:13:55 -08:00
Bartosz Golaszewski 4339c28ff4 libgpiod: put gpio utils into an actual separate package
Currently tools are built conditionally depending on whether the
corresponding PACKAGECONFIG option has been set and, although they
live in a separate libgpiod-tools package, the user cannot simply
select it - he has to additionally extend PACKAGECONFIG. While this
makes sense for python and C++ bindings, the tools don't have any
dependencies other the libgpiod. Make libgpiod-tools an actual
stand-alone package: always build them but install them only if
user selected libgpiod-tools.

Disable setting tools in default PACKAGECONFIGS

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>

s
2019-11-17 12:34:21 -08:00
Khem Raj 98625eb6c5 libgpiod: nherit python3native unconditionally
this recipe inherits python3native class conditionally, this condition
depends on a given packageconfig, however inherit ${VAR} syntax requires
VAR to be evaluated before inheriting it, therefore if someone appends
python3 to packageconfig via a bbappend, then the packageconfig will
become effective and add --enable-bindings-python to configure but
inherit wont evaluate correctly since the expression adding to
packageconfig

PACKAGECONFIG_append = " python3"

will be coming _after_ the inherit, and the builds will fail e.g.

| ../../../libgpiod-1.3/bindings/python/gpiodmodule.c:8:10: fatal error: Python.h: No such file or directory
|  #include <Python.h>

This will still mean that python3native is always inherited but the
effective configure option will be --disable-bindings-python and that
will do the right thing

See. https://github.com/openembedded/meta-openembedded/issues/140

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-08-28 07:13:20 -07:00
Bartosz Golaszewski c79bce945c libgpiod: bump version to v1.4.1
This is a bug-fix release addressing the following issues:

- fix GCC8 warnings when building python bindings
- fix a bug in gpioinfo where lines used by the kernel without any
  consumer string were reported as unused
- fix a bug in line::event_get_fd() in C++ bindings where the exception
  wouldn't be thrown in error cases due to a missing 'throw' keyword
- fix a couple issues with the test-suite

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-08-08 10:04:23 -07:00
Bartosz Golaszewski d7a9d70898 libgpiod: upgrade to v1.4
This release contains a couple fixes for C++ bindings and testing framework
refactoring. The --enable-install-tests option has been removed as it was
redundant. More info in NEWS.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-06-16 22:52:36 -07:00
James Feist 9c4cfa8905 libgpiod: Enable cxx bindings by default
If we move the packageconfig settings from the shared
inc file into the individual version recipes, we can
enable the cxx bindings by default for the newer version
of libgpiod.

Signed-off-by: James Feist <james.feist@linux.intel.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-06-15 16:45:33 -07:00
Bartosz Golaszewski b19957052e libgpiod: bump version to v1.3
There are several new features in this release. The one that impacts
the recipe is the option to install the test executable to bindir using
the new options (--enable-install-tests). This requires separate
PACKAGECONFIG entries for 0.x and 1.x series.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-03-26 09:43:57 -07:00
Bartosz Golaszewski 2032f0f4d5 libgpiod: bump version to v1.2.1
This is a bugfix release fixing two problems in C++ bindings.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-02-17 12:21:27 -08:00
Ferry c44679b494 libgpiod_1.2: add dependency on python when building python bindings
Commit ab54dd75 "libgpiod: Rrecommend python3 only for PN-python package" also removes the build dependency
on python3 however this results in fatal error: Python.h: No such file or directory #include <Python.h>

Signed-off-by: Ferry Toth <ftoth@exalondelft.nl>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-01-10 09:05:36 -08:00
Khem Raj 56fe916ab5 libgpiod: Rrecommend python3 only for PN-python package
Fixes overdependency on PN

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2018-12-23 13:29:20 -08:00
Bartosz Golaszewski 016b243f10 libgpiod: bump version to v1.2
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2018-11-09 07:29:59 -08:00