Drop the 'sources' argument from meson's declare_dependency() for
libgpiodbus as this causes the build system to include the source files
in the source list of the targets using the dependency rather than link
against the libgpiodbus shared library.
Fixes: 97bab4cc87 ("build: replace autotools with meson & ninja")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Port the project from autotools to meson. All build options are
preserved with the same semantics.
The goal of this change is to produce the same set of files as the
current autotools approach: libraries with correct SONAME/version,
headers, pkg-config files, GObject introspection data, Python extension
modules, D-Bus interface and configuration files. This is done to enable
a one-liner test command running all available test suites.
The only thing we drop is the `make docs` target as it's rarely used and
docs can be generated easily with sphinx directly. They are also not
required for testing.
The Rust workspace is built via a custom target that invokes cargo and
uses SYSTEM_DEPS_* environment variables to point the libgpiod-sys and
gpiosim-sys crates at the locally built C libraries.
In addition to porting the build files to meson, update the docs, remove
unneded items from .gitignore files (or remove them entirely if they're
no longer needed) and update the shunit2 test scripts to no longer care
about source directories.
Tested-by: Erik Wierich <erik@riscstar.com>
Tested-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://patch.msgid.link/20260428-meson-build-v3-1-8da6976fb0a2@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Linux has a stub driver for GPIO devices (the ones on the GPIO bus, not
their parent devices!) but it only actually *binds* to it those devices
that don't have a firmware node attached. This means that in some cases,
a "dynamic" GPIO controller can remain unnoticed by gpio-manager.
This behavior is related to fw_devlink handling and - even if we changed
the kernel to bind all GPIO devices to the stub driver - a fix in
gpio-manager is easier to distribute than a kernel fix.
Since an *added* GPIO device is considered functional, even without
binding to the stub driver, we can rely on the "add"/"remove" uevent
pair when detecting when GPIO chips come and go.
Fixes: a5ab76da1e ("dbus: add the D-Bus daemon, command-line client and tests")
Reported-by: David Lechner <dlechner@baylibre.com>
Closes: https://github.com/brgl/libgpiod/issues/175
Tested-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20260218-gpio-manager-bind-vs-add-v1-1-0fb22c448de3@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
The header generated by gdbus-codegen and the library wrapper around it
are not part of the stable API so don't install them.
Fixes: a5ab76da1e ("dbus: add the D-Bus daemon, command-line client and tests")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Currently gpiocli does not display the libgpiod API version in the
output of gpiocli --version because it's not linked against libgpiod -
it's only a consumer of the DBus API.
However, with the recent changes to the versioning scheme and the
disassociation of the core C API from the libgpiod package version, it
now makes sense to display the latter so add it.
Acked-by: Erik Wierich <erik@riscstar.com>
Link: https://lore.kernel.org/r/20250903-api-version-detach-v1-7-027ca5928518@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
The org.freedesktop.DBus.Peer.Ping() method isn't correct for checking
if a given object is exposed by a service. It only lets us know if the
service is available no matter the object on which it's called (in fact:
it will not return an error even if it's called on a nonexistent object).
While this has worked for most part by accident, if the timing isn't
right, we may start calling methods in chips which are not yet fully
registered. We should try to read the chip's property instead and keep
on waiting for as long as org.freedesktop.DBus.Properties.Get() returns
an error.
While at it: fix the counter increment as its syntax is invalid.
Fixes: a5ab76da1e ("dbus: add the D-Bus daemon, command-line client and tests")
Link: https://lore.kernel.org/r/20250203-fix-dbus-wait-for-chip-v1-1-563f7132c04f@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Remove the .txt file extension from the license identifier as it got
there by mistake and makes `reuse lint` complain.
Fixes: a5ab76da1e ("dbus: add the D-Bus daemon, command-line client and tests")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
When passing -v/--version to gpiocli or gpio-manager, it's useful to
also know the version of the GPIO D-Bus API the program implements.
Define the version in the gpiodbus.h header and print it together with
the library version.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Several data and test files were not included in distro tarballs so add
"dist_" automake variable prefixes where required.
Fixes: a5ab76da1e ("dbus: add the D-Bus daemon, command-line client and tests")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Use G_GUINT64_FORMAT whenever printing 64-bit types to avoid format
specifier warnings.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
On 32-bit architectures the size of a gulong will typically be 4 bytes
while we try to package an 8-byte integer when creating the edge event
variant. The client also expects wrong types and crashes. Use strict
type sizes for sending the events.
Closes: https://github.com/brgl/libgpiod/issues/103
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>