From d45e07b7a1e1b1dac1793543721b3e77d72948c8 Mon Sep 17 00:00:00 2001 From: JosephMcc Date: Sun, 8 Jan 2017 04:00:44 -0800 Subject: [PATCH] Install introspection data and lib into a private dir --- debian/control | 50 +-------------------------------------- debian/gir1.2-xed.install | 2 -- debian/xed-common.install | 12 +++++----- debian/xed-dev.install | 4 +++- debian/xed-doc.install | 1 - debian/xed.install | 9 ++++--- xed/Makefile.am | 26 +++++++++++++------- xed/xed-plugins-engine.c | 37 ++++++++++++++++++----------- 8 files changed, 56 insertions(+), 85 deletions(-) delete mode 100644 debian/gir1.2-xed.install delete mode 100644 debian/xed-doc.install diff --git a/debian/control b/debian/control index a3e97b3..0e2f191 100644 --- a/debian/control +++ b/debian/control @@ -117,52 +117,4 @@ Description: generic text editor (debugging symbols) provided to help debugging problems. . The debugging symbols are installed in /usr/lib/debug and will - automatically be used by gdb. - -Package: xed-doc -Section: doc -Architecture: all -Depends: ${misc:Depends}, -Description: generic text editor (documentation files) - Xed is a text editor which supports most standard editor features, - extending this basic functionality with other features not usually - found in simple text editors. Xed is a graphical application which - supports editing multiple text files in one window (known sometimes as - tabs or MDI). - . - Xed fully supports international text through its use of the - Unicode UTF-8 encoding in edited files. Its core feature set includes syntax - highlighting of source code, auto indentation and printing and print preview - support. - . - Xed is also extensible through its plugin system, which currently - includes support for spell checking, comparing files, viewing CVS - ChangeLogs, and adjusting indentation levels. - . - This package contains the documentation files. - -Package: gir1.2-xed -Architecture: any -Depends: ${gir:Depends}, - ${misc:Depends}, - ${shlibs:Depends}, -Description: GObject introspection data for Xed - Xed is a text editor which supports most standard editor features, - extending this basic functionality with other features not usually - found in simple text editors. Xed is a graphical application which - supports editing multiple text files in one window (known sometimes as - tabs or MDI). - . - Xed fully supports international text through its use of the - Unicode UTF-8 encoding in edited files. Its core feature set includes syntax - highlighting of source code, auto indentation and printing and print preview - support. - . - Xed is also extensible through its plugin system, which currently - includes support for spell checking, comparing files, viewing CVS - ChangeLogs, and adjusting indentation levels. - . - This package contains introspection data for Xed. - . - It can be used by packages using the GIRepository format to generate - dynamic bindings. \ No newline at end of file + automatically be used by gdb. \ No newline at end of file diff --git a/debian/gir1.2-xed.install b/debian/gir1.2-xed.install deleted file mode 100644 index d8bd766..0000000 --- a/debian/gir1.2-xed.install +++ /dev/null @@ -1,2 +0,0 @@ -usr/lib/*/girepository-1.0 -usr/share/gir-1.0 \ No newline at end of file diff --git a/debian/xed-common.install b/debian/xed-common.install index 2235f57..ea36e5f 100644 --- a/debian/xed-common.install +++ b/debian/xed-common.install @@ -1,7 +1,7 @@ -usr/share/appdata/ -usr/share/glib-2.0/ -usr/share/help/ -usr/share/locale/ -usr/share/xed/icons/ -usr/share/xed/plugins/ +usr/share/appdata +usr/share/glib-2.0 +usr/share/help +usr/share/locale +usr/share/xed/icons +usr/share/xed/plugins usr/share/xed/ui/ diff --git a/debian/xed-dev.install b/debian/xed-dev.install index f91091d..20c7fd4 100644 --- a/debian/xed-dev.install +++ b/debian/xed-dev.install @@ -1,2 +1,4 @@ -usr/include/xed/ +usr/include usr/lib/*/pkgconfig/ +usr/share/gtk-doc +usr/share/xed/gir-1.0 diff --git a/debian/xed-doc.install b/debian/xed-doc.install deleted file mode 100644 index d6da04c..0000000 --- a/debian/xed-doc.install +++ /dev/null @@ -1 +0,0 @@ -usr/share/gtk-doc/ diff --git a/debian/xed.install b/debian/xed.install index 4135f88..61d679f 100644 --- a/debian/xed.install +++ b/debian/xed.install @@ -1,5 +1,8 @@ -usr/bin/ -usr/lib/*/xed/plugins/ +usr/bin/xed +usr/lib/*/xed/plugins/*.plugin +usr/lib/*/xed/girepository-1.0/ +usr/lib/*/xed/plugins/*.plugin +usr/lib/*/xed/plugins/*.so usr/lib/xed/xed-bugreport.sh -usr/share/applications/ +usr/share/applications/xed.desktop usr/share/man/ diff --git a/xed/Makefile.am b/xed/Makefile.am index e7d6d36..fadeb3e 100644 --- a/xed/Makefile.am +++ b/xed/Makefile.am @@ -19,7 +19,11 @@ AM_CPPFLAGS = \ xed_SOURCES = \ xed.c -xed_LDADD = libxed.la $(XED_LIBS) $(EGG_SMCLIENT_LIBS) $(INTROSPECTION_LIBS) +xed_LDADD = \ + libxed.la \ + $(XED_LIBS) \ + $(EGG_SMCLIENT_LIBS) \ + $(INTROSPECTION_LIBS) xed_LDFLAGS = -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*" @@ -152,8 +156,8 @@ libxed_c_files = \ xedtextregion.c libxed_la_SOURCES = \ - $(libxed_c_files) \ $(BUILT_SOURCES) \ + $(libxed_c_files) \ $(BACON_FILES) \ $(POSIXIO_FILES) \ $(NOINST_H_FILES) \ @@ -194,22 +198,26 @@ CLEANFILES = $(BUILT_SOURCES) if HAVE_INTROSPECTION -include $(INTROSPECTION_MAKEFILE) INTROSPECTION_GIRS = Xed-1.0.gir -INTROSPECTION_SCANNER_ARGS = -I$(top_srcdir) --warn-all + + Xed-1.0.gir: xed -Xed_1_0_gir_INCLUDES = Gtk-3.0 GtkSource-3.0 -Xed_1_0_gir_FILES = $(INST_H_FILES) $(libxed_c_files) $(BUILT_SOURCES) +INTROSPECTION_SCANNER_ARGS = -I$(top_srcdir) --warn-all +Xed_1_0_gir_NAMESPACE = Xed Xed_1_0_gir_VERSION = 1.0 Xed_1_0_gir_PROGRAM = $(builddir)/xed -Xed_1_0_gir_NAMESPACE = Xed +Xed_1_0_gir_FILES = $(INST_H_FILES) $(libxed_c_files) $(BUILT_SOURCES) +Xed_1_0_gir_INCLUDES = Gtk-3.0 GtkSource-3.0 -girdir = $(datadir)/gir-1.0 +girdir = $(datadir)/xed/gir-1.0 gir_DATA = $(INTROSPECTION_GIRS) -typelibdir = $(libdir)/girepository-1.0 +typelibdir = $(libdir)/xed/girepository-1.0 typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) -CLEANFILES += $(gir_DATA) $(typelib_DATA) +CLEANFILES += \ + $(gir_DATA) \ + $(typelib_DATA) endif dist-hook: diff --git a/xed/xed-plugins-engine.c b/xed/xed-plugins-engine.c index c3160ab..d0a6caf 100644 --- a/xed/xed-plugins-engine.c +++ b/xed/xed-plugins-engine.c @@ -55,7 +55,7 @@ XedPluginsEngine *default_engine = NULL; static void xed_plugins_engine_init (XedPluginsEngine *engine) { - gchar *private_path; + gchar *typelib_dir; GError *error = NULL; xed_debug (DEBUG_PLUGINS); @@ -66,6 +66,17 @@ xed_plugins_engine_init (XedPluginsEngine *engine) peas_engine_enable_loader (PEAS_ENGINE (engine), "python3"); + typelib_dir = g_build_filename (xed_dirs_get_xed_lib_dir (), "girepository-1.0", NULL); + + if (!g_irepository_require_private (g_irepository_get_default (), typelib_dir, "Xed", "1.0", 0, &error)) + { + g_warning ("Could not load Xed repository: %s", error->message); + g_error_free (error); + error = NULL; + } + + g_free (typelib_dir); + /* This should be moved to libpeas */ if (!g_irepository_require (g_irepository_get_default (), "Peas", "1.0", 0, &error)) { @@ -81,16 +92,16 @@ xed_plugins_engine_init (XedPluginsEngine *engine) error = NULL; } - private_path = g_build_filename (LIBDIR, "girepository-1.0", NULL); + // private_path = g_build_filename (LIBDIR, "girepository-1.0", NULL); - if (!g_irepository_require_private (g_irepository_get_default (), private_path, "Xed", "1.0", 0, &error)) - { - g_warning ("Could not load Xed repository: %s", error->message); - g_error_free (error); - error = NULL; - } + // if (!g_irepository_require_private (g_irepository_get_default (), private_path, "Xed", "1.0", 0, &error)) + // { + // g_warning ("Could not load Xed repository: %s", error->message); + // g_error_free (error); + // error = NULL; + // } - g_free (private_path); + // g_free (private_path); peas_engine_add_search_path (PEAS_ENGINE (engine), xed_dirs_get_user_plugins_dir (), @@ -131,13 +142,11 @@ xed_plugins_engine_class_init (XedPluginsEngineClass *klass) XedPluginsEngine * xed_plugins_engine_get_default (void) { - if (default_engine != NULL) + if (default_engine == NULL) { - return default_engine; + default_engine = XED_PLUGINS_ENGINE (g_object_new (XED_TYPE_PLUGINS_ENGINE, NULL)); + g_object_add_weak_pointer (G_OBJECT (default_engine), (gpointer) &default_engine); } - default_engine = XED_PLUGINS_ENGINE (g_object_new (XED_TYPE_PLUGINS_ENGINE, NULL)); - g_object_add_weak_pointer (G_OBJECT (default_engine), (gpointer) &default_engine); - return default_engine; }