Install introspection data and lib into a private dir

This commit is contained in:
JosephMcc
2017-01-08 04:00:44 -08:00
parent 32fd96e327
commit d45e07b7a1
8 changed files with 56 additions and 85 deletions

View File

@@ -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;
}