Hi!
I’m the author and maintainer of libgpiod. I’m building a D-Bus daemon for managing GPIOs in linux and basing the work on GLib bindings to libgpiod I created and which @pwithnall has been already helping me with on the linux-gpio mailing list (thanks!).
I’m stuck on generating the introspection data for the library and have been unable to move it forward. Here is the relevant Makefile.
Here’s the relevant portion of it:
if HAVE_INTROSPECTION
INTROSPECTION_GIRS = Gpiodglib-1.0.gir
girdir = $(INTROSPECTION_GIRDIR)
gir_DATA = Gpiodglib-1.0.gir
typelibsdir = $(INTROSPECTION_TYPELIBDIR)
typelibs_DATA = Gpiodglib-1.0.typelib
Gpiodglib_1_0_gir_SCANNERFLAGS = \
--c-include="gpiod-glib.h" \
--warn-all \
--namespace Gpiodglib \
--identifier-prefix Gpiodglib \
--symbol-prefix gpiodglib
Gpiodglib_1_0_gir_CFLAGS = $(libgpiod_glib_la_CFLAGS)
Gpiodglib-1.0.gir: libgpiod-glib.la
Gpiodglib_1_0_gir_INCLUDES = Gio-2.0
Gpiodglib_1_0_gir_LIBS = libgpiod-glib.la
Gpiodglib_1_0_gir_FILES = $(libgpiod_glib_la_SOURCES)
Gpiodglib_1_0_gir_EXPORT_PACKAGES = gpiod-glib
include $(INTROSPECTION_MAKEFILE)
endif
The generated .gir
file looks like this:
<?xml version="1.0"?>
<!-- This file was automatically generated from C sources - DO NOT EDIT!
To affect the contents of this file, edit the original C definitions,
and/or use gtk-doc annotations. -->
<repository version="1.2"
xmlns="http://www.gtk.org/introspection/core/1.0"
xmlns:c="http://www.gtk.org/introspection/c/1.0"
xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
<include name="Gio" version="2.0"/>
<package name="gpiod-glib"/>
<c:include name="gpiod-glib.h"/>
<namespace name="Gpiodglib"
version="1.0"
shared-library="libgpiod-glib.so.1"
c:identifier-prefixes="Gpiodglib"
c:symbol-prefixes="gpiodglib">
</namespace>
</repository>
And the following warning is emitted by g-ir-scanner
:
<unknown>:: Error: Gpiodglib: Namespace is empty; likely causes are:
* Not including .h files to be scanned
* Broken --identifier-prefix
I’ve based my work on some existing examples that do work - namely UDisks2 which also uses autotools. Any hints as to what is wrong with my example?
To reproduce:
git clone https://github.com/brgl/libgpiod-private -b b4/dbus libgpiod
cd libgpiod
./autogen --enable-bindings-glib
make