--- a/gplugin-gtk3-viewer/gplugin-gtk-viewer.c Sun Oct 03 00:05:29 2021 -0500
+++ b/gplugin-gtk3-viewer/gplugin-gtk-viewer.c Sun Oct 03 01:44:30 2021 -0500
@@ -27,8 +27,7 @@
*****************************************************************************/
static gboolean show_internal = FALSE;
-static gboolean add_default_paths = TRUE, version_only = FALSE;
-static gchar **paths = NULL;
+static gboolean version_only = FALSE; /******************************************************************************
@@ -80,18 +79,6 @@
- G_GNUC_UNUSED const gchar *n,
- G_GNUC_UNUSED const gchar *v,
- G_GNUC_UNUSED gpointer d,
- G_GNUC_UNUSED GError **e)
- add_default_paths = FALSE;
G_GNUC_UNUSED const gchar *n,
G_GNUC_UNUSED const gchar *v,
@@ -161,14 +148,6 @@
internal_cb, "Show internal plugins",
- "no-default-paths", 'D', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
- no_default_cb, "Do not search the default plugin paths",
- "path", 'p', 0, G_OPTION_ARG_STRING_ARRAY,
- &paths, "Additional paths to look for plugins",
"version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
version_cb, "Display the version and exit",
@@ -185,10 +164,12 @@
GOptionContext *ctx = NULL;
GtkWidget *window = NULL;
+ const gchar *env_paths = NULL; ctx = g_option_context_new("");
g_option_context_add_main_entries(ctx, entries, NULL);
g_option_context_add_group(ctx, gtk_get_option_group(TRUE));
+ g_option_context_add_group(ctx, gplugin_get_option_group()); g_option_context_parse(ctx, &argc, &argv, &error);
g_option_context_free(ctx);
@@ -212,15 +193,16 @@
manager = gplugin_manager_get_default();
- gplugin_manager_add_default_paths(manager);
+ env_paths = g_getenv("GPLUGIN_PLUGIN_PATH"); + if(env_paths != NULL) { + gchar **paths = g_strsplit(env_paths, G_SEARCHPATH_SEPARATOR_S, 0); - for(i = 0; paths[i]; i++) {
+ for(i = 0; paths[i] != NULL; i++) { gplugin_manager_prepend_path(manager, paths[i]);
gplugin_manager_refresh(manager);
--- a/gplugin-query/gplugin-query.c Sun Oct 03 00:05:29 2021 -0500
+++ b/gplugin-query/gplugin-query.c Sun Oct 03 01:44:30 2021 -0500
@@ -298,6 +298,7 @@
GOptionContext *ctx = NULL;
GOptionGroup *group = NULL;
+ const gchar *env_paths = NULL; ctx = g_option_context_new("PLUGIN-ID...");
@@ -328,6 +329,18 @@
manager = gplugin_manager_get_default();
+ env_paths = g_getenv("GPLUGIN_PLUGIN_PATH"); + if(env_paths != NULL) { + gchar **paths = g_strsplit(env_paths, G_SEARCHPATH_SEPARATOR_S, 0); + for(i = 0; paths[i] != NULL; i++) { + gplugin_manager_prepend_path(manager, paths[i]); --- a/gplugin/tests/meson.build Sun Oct 03 00:05:29 2021 -0500
+++ b/gplugin/tests/meson.build Sun Oct 03 01:44:30 2021 -0500
@@ -16,6 +16,9 @@
###############################################################################
+# Add the normal plugins to the plugin path envvar +devenv.append('GPLUGIN_PLUGIN_PATH', meson.current_build_dir() / 'plugins') #######################################
# Simple Tests (single file)
#######################################
--- a/lua/meson.build Sun Oct 03 00:05:29 2021 -0500
+++ b/lua/meson.build Sun Oct 03 01:44:30 2021 -0500
@@ -57,6 +57,9 @@
install_dir : get_option('libdir') / 'gplugin'
+ # Add the loader's path to our environment variable + devenv.append('GPLUGIN_PLUGIN_PATH', meson.current_build_dir()) --- a/lua/tests/meson.build Sun Oct 03 00:05:29 2021 -0500
+++ b/lua/tests/meson.build Sun Oct 03 01:44:30 2021 -0500
@@ -10,4 +10,7 @@
dependencies : [GLIB, GOBJECT, LUA, gplugin_dep])
+# Add the test plugins path to our environment variable +devenv.append('GPLUGIN_PLUGIN_PATH', meson.current_source_dir() / 'plugins') --- a/meson.build Sun Oct 03 00:05:29 2021 -0500
+++ b/meson.build Sun Oct 03 01:44:30 2021 -0500
@@ -47,6 +47,26 @@
###############################################################################
+# This sets up the meson devenv stuff. See +# https://mesonbuild.com/Commands.html#devenv for more information. +############################################################################### +if meson.version().version_compare('>=0.58.0') + config_home = get_option('devenv-config-dir') + config_home = meson.build_root() / 'config' + devenv.set('XDG_CONFIG_HOME', config_home) + meson.add_devenv(devenv) +############################################################################### ###############################################################################
GETTEXT_PACKAGE = 'gplugin'
--- a/meson_options.txt Sun Oct 03 00:05:29 2021 -0500
+++ b/meson_options.txt Sun Oct 03 01:44:30 2021 -0500
@@ -11,6 +11,12 @@
+ description : 'config directory for running a devenv (defaults to a subdirectory of buildroot)' type : 'boolean', value : true,
description : 'Whether or not to build the gtk3 library'
--- a/perl5/meson.build Sun Oct 03 00:05:29 2021 -0500
+++ b/perl5/meson.build Sun Oct 03 01:44:30 2021 -0500
@@ -71,6 +71,9 @@
install_dir : get_option('libdir') / 'gplugin'
+ # Add the loader's path to our environment variable + devenv.append('GPLUGIN_PLUGIN_PATH', meson.current_build_dir()) --- a/perl5/tests/meson.build Sun Oct 03 00:05:29 2021 -0500
+++ b/perl5/tests/meson.build Sun Oct 03 01:44:30 2021 -0500
@@ -9,4 +9,7 @@
dependencies : [GLIB, GOBJECT, gplugin_dep, perl_dep])
+# Add the test plugins path to our environment variable +devenv.append('GPLUGIN_PLUGIN_PATH', meson.current_source_dir() / 'plugins') --- a/python3/meson.build Sun Oct 03 00:05:29 2021 -0500
+++ b/python3/meson.build Sun Oct 03 01:44:30 2021 -0500
@@ -83,6 +83,9 @@
include_directories : gplugin_python3_inc,
link_with : gplugin_python3_static,
+ # Add the loader's path to our environment variable + devenv.append('GPLUGIN_PLUGIN_PATH', meson.current_build_dir()) --- a/python3/tests/meson.build Sun Oct 03 00:05:29 2021 -0500
+++ b/python3/tests/meson.build Sun Oct 03 01:44:30 2021 -0500
@@ -19,4 +19,7 @@
gplugin_python3_static_dep])
+# Add the test plugins path to our environment variable +devenv.append('GPLUGIN_PLUGIN_PATH', meson.current_source_dir() / 'plugins') --- a/tcc/meson.build Sun Oct 03 00:05:29 2021 -0500
+++ b/tcc/meson.build Sun Oct 03 01:44:30 2021 -0500
@@ -26,6 +26,9 @@
install_dir : get_option('libdir') / 'gplugin'
+ # Add the loader's path to our environment variable + devenv.append('GPLUGIN_PLUGIN_PATH', meson.current_build_dir()) --- a/vala/tests/genie-plugins/meson.build Sun Oct 03 00:05:29 2021 -0500
+++ b/vala/tests/genie-plugins/meson.build Sun Oct 03 01:44:30 2021 -0500
@@ -17,4 +17,7 @@
shared_library('unload-failed-plugin', 'unload-failed.gs',
dependencies : [gplugin_dep, gplugin_vapi])
+ # Add the test plugins path to our environment variable + devenv.append('GPLUGIN_PLUGIN_PATH', meson.current_build_dir()) --- a/vala/tests/plugins/meson.build Sun Oct 03 00:05:29 2021 -0500
+++ b/vala/tests/plugins/meson.build Sun Oct 03 01:44:30 2021 -0500
@@ -17,4 +17,7 @@
shared_library('vala-unload-shutdown', 'unload-shutdown.vala',
dependencies : [gplugin_dep, gplugin_vapi])
+ # Add the test plugins path to our environment variable + devenv.append('GPLUGIN_PLUGIN_PATH', meson.current_build_dir())