[gnome-online-accounts/wip/jfelder/add-goabackend-introspection] build: Add introspection support for goabackend



commit 06fd528ece9f69324e45689697344bd6da7aafad
Author: Jean Felder <jfelder src gnome org>
Date:   Sat Sep 14 16:46:48 2019 +0200

    build: Add introspection support for goabackend
    
    The autotools part was done by Andrea Azzarone.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=792865

 src/goa/meson.build        |  6 +++++-
 src/goabackend/Makefile.am | 34 ++++++++++++++++++++++++++++++++++
 src/goabackend/meson.build | 25 +++++++++++++++++++++++++
 3 files changed, 64 insertions(+), 1 deletion(-)
---
diff --git a/src/goa/meson.build b/src/goa/meson.build
index 1d86b7b0..26f168e2 100644
--- a/src/goa/meson.build
+++ b/src/goa/meson.build
@@ -131,8 +131,12 @@ if enable_introspection
     install: true
   )
 
+  libgoa_gir_dep = declare_dependency(
+    sources: libgoa_gir
+  )
+
   if enable_vapi
-    gnome.generate_vapi(
+    libgoa_vapi = gnome.generate_vapi(
       goa_api_name,
       sources: libgoa_gir[0],
       packages: 'gio-2.0',
diff --git a/src/goabackend/Makefile.am b/src/goabackend/Makefile.am
index 83852378..81a3cee3 100644
--- a/src/goabackend/Makefile.am
+++ b/src/goabackend/Makefile.am
@@ -1,7 +1,9 @@
+-include $(INTROSPECTION_MAKEFILE)
 
 NULL =
 CLEANFILES =
 EXTRA_DIST =
+INTROSPECTION_GIRS =
 
 AM_CPPFLAGS =                                                  \
        -I$(top_builddir)/src -I$(top_srcdir)/src               \
@@ -216,6 +218,38 @@ pkgconfig_DATA = goa-backend-1.0.pc
 
 # ----------------------------------------------------------------------------------------------------
 
+if HAVE_INTROSPECTION
+introspection_sources =                                                \
+       $(libgoa_backend_1_0_la_HEADERS)                        \
+       goabackendenumtypes.c                                   \
+       goaprovider.c
+
+GoaBackend-1.0.gir: libgoa-backend-1.0.la
+GoaBackend_1_0_gir_INCLUDES = Gio-2.0 Gtk-3.0 Goa-1.0
+GoaBackend_1_0_gir_EXPORT_PACKAGES = goa-backend-1.0
+GoaBackend_1_0_gir_LIBS = goa-backend-1.0
+GoaBackend_1_0_gir_FILES = $(introspection_sources)
+GoaBackend_1_0_gir_CFLAGS = $(AM_CPPFLAGS) $(libgoa_backend_1_0_la_CFLAGS)
+GoaBackend_1_0_gir_SCANNERFLAGS =                                      \
+       $(WARN_SCANNERFLAGS)                                            \
+       --c-include='goabackend/goabackend.h'                           \
+       --identifier-prefix=Goa                                         \
+       --include-uninstalled=$(top_builddir)/src/goa/Goa-1.0.gir       \
+       $(NULL)
+INTROSPECTION_GIRS += GoaBackend-1.0.gir
+
+girdir = $(datadir)/gir-1.0
+gir_DATA = GoaBackend-1.0.gir
+
+typelibsdir = $(libdir)/girepository-1.0
+typelibs_DATA = GoaBackend-1.0.typelib
+
+CLEANFILES += $(gir_DATA) $(typelibs_DATA)
+
+endif # HAVE_INTROSPECTION
+
+# ----------------------------------------------------------------------------------------------------
+
 CLEANFILES += \
        $(BUILT_SOURCES) \
        $(enum_built_sources) \
diff --git a/src/goabackend/meson.build b/src/goabackend/meson.build
index 3d9dee8b..2a4eaee3 100644
--- a/src/goabackend/meson.build
+++ b/src/goabackend/meson.build
@@ -147,6 +147,31 @@ pkg.generate(
   variables: 'exec_prefix=${prefix}'
 )
 
+if enable_introspection
+  libgoa_backend_gir = gnome.generate_gir(
+    libgoa_backend,
+    sources: enum_sources + files('goaprovider.c') + headers,
+    dependencies: [libgoa_dep, libgoa_gir_dep],
+    includes: ['Gio-2.0', 'Gtk-3.0', libgoa_gir[0]],
+    nsversion: goa_api_version,
+    namespace: 'GoaBackend',
+    identifier_prefix: goa_ns,
+    export_packages: goa_backend_api_name,
+    extra_args: ['-DGOA_BACKEND_COMPILATION', '-DGOA_API_IS_SUBJECT_TO_CHANGE'],
+    header: join_paths('goabackend', 'goabackend.h'),
+    install: true
+  )
+
+  if enable_vapi
+    gnome.generate_vapi(
+      goa_backend_api_name,
+      sources: libgoa_backend_gir[0],
+      packages: ['gio-2.0', 'gtk+-3.0', libgoa_vapi],
+      install: true
+    )
+  endif
+endif
+
 libgoawebextension_sources = files(
   'goawebextension.c',
   'goawebextensionmain.c'


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]