From a4dcd9177a32626929783b3920d660782d89bf01 Mon Sep 17 00:00:00 2001 From: monsta Date: Thu, 1 Dec 2016 14:18:33 +0300 Subject: build GObject introspection data mostly adapted from eom and from this upstream commit: https://git.gnome.org/browse/gedit/commit/?id=58921206b7dea94d0ec0359dc43de94745f2a19e --- configure.ac | 11 +++++++++++ pluma/Makefile.am | 38 +++++++++++++++++++++++++++++++------- pluma/pluma.c | 8 ++++++++ 3 files changed, 50 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 7024575a..6757c498 100644 --- a/configure.ac +++ b/configure.ac @@ -175,6 +175,16 @@ PKG_CHECK_MODULES(EGG_SMCLIENT, [sm >= 1.0.0]) AC_SUBST(EGG_SMCLIENT_CFLAGS) AC_SUBST(EGG_SMCLIENT_LIBS) +# Introspection +GOBJECT_INTROSPECTION_CHECK([0.9.3]) + +if test "$found_introspection" = "yes"; then + have_introspection=yes + AC_DEFINE([HAVE_INTROSPECTION], [1], [Define to enable GObject Introspection]) +else + have_introspection=no +fi + dnl ================================================================ dnl GSettings related settings dnl ================================================================ @@ -268,6 +278,7 @@ Configuration: Compiler: ${CC} Spell Plugin enabled: $enable_enchant Gvfs metadata enabled: $enable_gvfs_metadata + GObject Introspection: ${have_introspection} Tests enabled: $enable_tests " diff --git a/pluma/Makefile.am b/pluma/Makefile.am index 01914351..1173ca7a 100644 --- a/pluma/Makefile.am +++ b/pluma/Makefile.am @@ -11,6 +11,7 @@ AM_CPPFLAGS = \ -I$(srcdir)/smclient \ $(PLUMA_CFLAGS) \ $(WARN_CFLAGS) \ + $(INTROSPECTION_CFLAGS) \ $(DISABLE_DEPRECATED_CFLAGS) \ -DDATADIR=\""$(datadir)"\" \ -DLIBDIR=\""$(libdir)"\" @@ -18,7 +19,7 @@ AM_CPPFLAGS = \ pluma_SOURCES = \ pluma.c -pluma_LDADD = libpluma.la $(PLUMA_LIBS) $(EGG_SMCLIENT_LIBS) +pluma_LDADD = libpluma.la $(PLUMA_LIBS) $(EGG_SMCLIENT_LIBS) $(INTROSPECTION_LIBS) pluma_LDFLAGS = -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*" @@ -102,11 +103,7 @@ headerdir = $(prefix)/include/pluma header_DATA = \ $(INST_H_FILES) - -libpluma_la_SOURCES = \ - $(BUILT_SOURCES) \ - $(BACON_FILES) \ - $(POSIXIO_FILES) \ +libpluma_c_files = \ pluma-app.c \ pluma-close-button.c \ pluma-commands-documents.c \ @@ -160,7 +157,13 @@ libpluma_la_SOURCES = \ pluma-utils.c \ pluma-view.c \ pluma-window.c \ - plumatextregion.c \ + plumatextregion.c + +libpluma_la_SOURCES = \ + $(libpluma_c_files) \ + $(BUILT_SOURCES) \ + $(BACON_FILES) \ + $(POSIXIO_FILES) \ $(NOINST_H_FILES) \ $(INST_H_FILES) @@ -195,6 +198,27 @@ EXTRA_DIST = \ CLEANFILES = $(BUILT_SOURCES) +if HAVE_INTROSPECTION +-include $(INTROSPECTION_MAKEFILE) +INTROSPECTION_GIRS = Pluma-1.0.gir +INTROSPECTION_SCANNER_ARGS = -I$(top_srcdir) --warn-all + +Pluma-1.0.gir: pluma +Pluma_1_0_gir_INCLUDES = Gtk-3.0 GtkSource-3.0 +Pluma_1_0_gir_FILES = $(INST_H_FILES) $(libpluma_c_files) $(BUILT_SOURCES) +Pluma_1_0_gir_VERSION = 1.0 +Pluma_1_0_gir_PROGRAM = $(builddir)/pluma +Pluma_1_0_gir_NAMESPACE = Pluma + +girdir = $(datadir)/gir-1.0 +gir_DATA = $(INTROSPECTION_GIRS) + +typelibdir = $(libdir)/girepository-1.0 +typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) + +CLEANFILES += $(gir_DATA) $(typelib_DATA) +endif + dist-hook: cd $(distdir); rm -f $(BUILT_SOURCES) diff --git a/pluma/pluma.c b/pluma/pluma.c index 4fb5a752..ef05db8c 100644 --- a/pluma/pluma.c +++ b/pluma/pluma.c @@ -42,6 +42,10 @@ #include #include +#ifdef HAVE_INTROSPECTION +#include +#endif + #include "pluma-app.h" #include "pluma-commands.h" #include "pluma-debug.h" @@ -522,6 +526,10 @@ main (int argc, char *argv[]) g_option_context_add_group (context, gtk_get_option_group (FALSE)); g_option_context_add_group (context, egg_sm_client_get_option_group ()); +#ifdef HAVE_INTROSPECTION + g_option_context_add_group (context, g_irepository_get_option_group ()); +#endif + gtk_init (&argc, &argv); if (!g_option_context_parse (context, &argc, &argv, &error)) -- cgit v1.2.1