16 Commits

Author SHA1 Message Date
Bartosz Golaszewski 5d0fd8cdd7 libgpiod: update to v2.3
Starting with this release, libgpiod now uses meson so the updates to
the recipe are quite extensive. There's a new shared library:
libgpiotools, that exports symbols previously only accessible to
gpio-tools that allow users to build their own high-level programs while
reusing the code doing GPIO line & chip lookup. While at it: move
libgpiodbus into its own package as well.

Full changelog:

New features:
- replace autotools with meson & ninja as the build system
- provide libgpiotools: a new shared library exposing a public API for
  line name lookup and other high-level helpers previously only available
  internally to gpio-tools
- add initial-state option to gpiomon to display line states before
  waiting for events
- provide comprehensive sphinx-based documentation for all components:
  core C API, C++ bindings, Python bindings, GLib bindings, D-Bus API,
  gpio-tools, and libgpiotools
- extend libgpiosim with new routines allowing to use the new functionality
  provided in more recent versions of the gpio-sim module in the kernel

Improvements:
- make tests work with newer coreutils by removing cases checking tools'
  behavior on SIGINT which stopped working due to changes in behavior of the
  timeout tool
- decouple the libgpiod core C library API version from the global libgpiod
  project version as the former is now quite stable and no longer changes
  with every release
- extend libgpiosim self-tests

Bug fixes:
- allow modifying settings for existing offsets in a full line-config
- fix signed/unsigned type mismatch in gpiod_line_request_get_value()
- add explicit NUL-termination after strncpy() calls in core library
- fix consumer string in line_info stream operator in C++ bindings
- use get_mapped_value() for all enum mappings in line_info in C++ bindings
- move g_tree_remove() out of g_assert() in gpiodbus_id_free() to avoid
  resource exhaustion when assertions are disabled
- return 0 when zero events are requested in edge-event API
- fix gpionotify watching lines on the wrong chip
- reject trailing garbage in parse_period() in gpio-tools
- store interactive sleep period in a long long in gpioset to avoid overflow
- use gpiod_line_settings_free() to release settings in line-config
- fix buffer over-read bugs when translating uAPI structs to library types
- fix variable and argument types where necessary
- sanitize values returned by the kernel to avoid potential buffer overflows
- fix memory leaks in gpio-tools
- add missing return value checks in gpio-tools
- fix period parsing in gpio-tools
- use correct loop counter in error path in gpio-manager
- don't try to export the same chip object twice in gpio-manager on duplicate
  uevents
- use the "add"/"remove" uevents when watching for GPIO chips in the system as
  the "bind"/"unbind" pair is only emitted by linux for controllers which don't
  have a firmware node attached
- don't allow clearing hogs on active devices in tests
- don't install uneeded files
- fix a pkgconfig check in configure
- fix a return type check in test harness
- don't implicity unquote unnamed lines in gpioinfo
- remove useless variable in reconfigure example
- don't let struct line_config balloon out of control and trigger an OOM
- drop python3-config check from configure.ac
- fix potential PyDict_Next() crash in python bindings
- disable the GPIO simulator before releasing it in C++, rust and python
  bindings tests
- fix the way we wait for simulated chips to appear in D-Bus command-line
  client tests
- make read_edge_events lifetimes more explicit in rust bindings
- make waiting for info events more reliable in GLib bindings tests
- defer removal of bank entries when device is not disabled in libgpiosim
- add missing LineInfo import to __init__.py in python bindings

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
2026-06-20 23:41:43 -07:00
Weisser, Pascal 97239b6235 libgpiod: Add HOMEPAGE variable
Add HOMEPAGE variable to libgpiod recipe.

Signed-off-by: Weisser, Pascal <pascal.weisser.ext@karlstorz.com>
Reviewed-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-12-10 08:58:47 -08:00
Bartosz Golaszewski ce1da22eff libgpiod: remove stray newline
There's an additional, unneeded newline at the end of libgpiod.inc.
Remove it.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2024-11-19 16:59:07 -08:00
Bartosz Golaszewski 1e477be454 libgpiod: disable C++ tests for libgpiod v1.6.x
Catch2 recipe is moving to version 3 of the Catch2 API which will make
the C++ tests in libgpiod uncompatible. libgpiod v2 as ported to the new
interface but v1.6.x will not be so just disable building the C++ tests.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2024-06-11 07:46:44 -07:00
Bartosz Golaszewski 44bb7f130f libgpiod: update to v2.1
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>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-11-03 15:07:16 -07:00
Michael Opdenacker 6b2b98e52d remove unused AUTHOR variable
No longer used in generating packages
Also creates a possible confusion with the recipe maintainer
name.

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-08-03 09:14:20 -07:00
Joe Slater 9904bd6a24 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>
2023-07-13 07:22:17 -07:00
Bartosz Golaszewski 110f60fff7 libgpiod: add myself as maintainer
While RECIPE_MAINTAINER doesn't seem to be used anywhere, let's add it
in hopes that it will at least make people Cc me on any recipe patches
in the future.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-06-04 22:29:45 -07:00
Bartosz Golaszewski afbc223489 libgpiod: remove test executables from ${bindir}
There's no need to put the test executables into ${bindir} as they're
already installed into ${PTEST_PATH}. This just pollutes $PATH.

Future libgpiod releases will not install test binaries at all, leaving
it to the library users. For now: remove them manually after
installation.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-04-20 07:46:21 -07:00
Bartosz Golaszewski c6243e1b6a libgpiod: fold libgpiod-src.inc into libgpiod.inc
Now that python3-gpiod fetches the sources from pypi, we no longer need
to provide the SRC_URI in a separate include. Fold it into the
libgpiod.inc used locally only.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-04-14 08:45:14 -07: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 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
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 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
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 266ccace9c libgpiod: split recipe into .inc and .bb files
The build works the same for v0.x and v1.x series - leave only the
hashes in the .bb file and put everything else into .inc.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
2018-05-01 18:15:44 -07:00