[gnome-builder] plugins: move plugin setup to libgnome-builder.la



commit 5c36b3fb323525b29f6c649c272d40331caa7be5
Author: Christian Hergert <christian hergert me>
Date:   Sun Aug 23 11:49:41 2015 -0700

    plugins: move plugin setup to libgnome-builder.la
    
    This allows plugins to be loaded which require symbols from the Builder
    UI process. We link against that rather than the plugin hooks+libide.

 src/Makefile.am       |   20 +++-----------------
 src/util/gb-plugins.c |   18 ++++++++++++++++++
 tools/Makefile.am     |    8 +-------
 3 files changed, 22 insertions(+), 24 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index a3e2c60..784a1ec 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -5,7 +5,7 @@ EXTRA_DIST =
 
 bin_PROGRAMS = gnome-builder
 
-noinst_LTLIBRARIES = libgnome-builder.la libplugins-util.la
+noinst_LTLIBRARIES = libgnome-builder.la
 
 libgnome_builder_la_SOURCES = \
        $(gnome_builder_built_sources) \
@@ -124,6 +124,8 @@ libgnome_builder_la_SOURCES = \
        util/gb-gtk.h \
        util/gb-pango.c \
        util/gb-pango.h \
+       util/gb-plugins.c \
+       util/gb-plugins.h \
        util/gb-rgba.c \
        util/gb-rgba.h \
        util/gb-string.c \
@@ -217,27 +219,11 @@ libgnome_builder_la_CFLAGS = \
        $(NULL)
 
 
-libplugins_util_la_SOURCES = \
-       util/gb-plugins.c \
-       util/gb-plugins.h \
-       $(NULL)
-libplugins_util_la_CFLAGS = \
-       $(BUILDER_CFLAGS) \
-       -DPACKAGE_DATADIR="\"${datadir}\"" \
-       -DPACKAGE_LOCALE_DIR=\""${datadir}/locale"\" \
-       -DPACKAGE_LIBDIR=\""${libdir}"\" \
-       $(NULL)
-libplugins_util_la_LDFLAGS = \
-       -avoid-version \
-       $(NULL)
-
-
 gnome_builder_SOURCES = main.c
 gnome_builder_CFLAGS = $(libgnome_builder_la_CFLAGS)
 gnome_builder_LDADD = \
        $(top_builddir)/libide/libide-1.0.la \
        libgnome-builder.la \
-       libplugins-util.la \
        $(NULL)
 gnome_builder_LDFLAGS = \
        -export-dynamic \
diff --git a/src/util/gb-plugins.c b/src/util/gb-plugins.c
index e5b29c6..9188d22 100644
--- a/src/util/gb-plugins.c
+++ b/src/util/gb-plugins.c
@@ -24,7 +24,13 @@
 
 #include <libpeas/peas.h>
 
+#include "gb-application.h"
+#include "gb-document.h"
 #include "gb-plugins.h"
+#include "gb-tree-builder.h"
+#include "gb-view.h"
+#include "gb-workbench.h"
+#include "gb-workspace.h"
 
 void
 gb_plugins_init (void)
@@ -32,6 +38,18 @@ gb_plugins_init (void)
   PeasEngine *engine;
   const GList *list;
 
+  /*
+   * Ensure plugin-extensible types are registered.
+   * This allows libgnome-builder.la to be linked and not drop
+   * important symbols.
+   */
+  g_type_ensure (GB_TYPE_APPLICATION);
+  g_type_ensure (GB_TYPE_DOCUMENT);
+  g_type_ensure (GB_TYPE_TREE_BUILDER);
+  g_type_ensure (GB_TYPE_VIEW);
+  g_type_ensure (GB_TYPE_WORKBENCH);
+  g_type_ensure (GB_TYPE_WORKSPACE);
+
   engine = peas_engine_get_default ();
 
   peas_engine_enable_loader (engine, "python3");
diff --git a/tools/Makefile.am b/tools/Makefile.am
index caeda26..01fb180 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -9,17 +9,11 @@ tools_cflags = \
 
 tools_libs = \
        $(LIBIDE_LIBS) \
-       $(top_builddir)/libide/libide-1.0.la \
-       $(top_builddir)/src/libplugins-util.la \
+       $(top_builddir)/src/libgnome-builder.la \
        $(NULL)
 
 toolsdir = $(libexecdir)/gnome-builder
 
-# TODO:
-# 
-#  We should make these utilities require gnome-builder since lots of plugins will
-#  be extending types in the application as well as libide.
-
 tools_PROGRAMS += ide-build
 ide_build_SOURCES = ide-build.c
 ide_build_CFLAGS = $(tools_cflags)


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