pidgin/pidgin

Add PURPLE_PLUGIN_PATH environment variable
purple-plugin-path
2015-12-31, Mike Ruprecht
f28a27411235
Add PURPLE_PLUGIN_PATH environment variable
This allows plugins in arbitrary paths to be loaded.
--- a/libpurple/plugins.c Tue Dec 29 18:49:11 2015 -0600
+++ b/libpurple/plugins.c Thu Dec 31 02:33:19 2015 -0600
@@ -1108,6 +1108,9 @@
purple_plugins_init(void)
{
void *handle = purple_plugins_get_handle();
+#ifdef PURPLE_PLUGINS
+ const gchar *search_path;
+#endif
purple_signal_register(handle, "plugin-load",
purple_marshal_VOID__POINTER,
@@ -1118,6 +1121,20 @@
#ifdef PURPLE_PLUGINS
gplugin_init();
+
+ search_path = g_getenv("PURPLE_PLUGIN_PATH");
+ if (search_path) {
+ gchar **paths;
+ int i;
+
+ paths = g_strsplit(search_path, G_SEARCHPATH_SEPARATOR_S, 0);
+ for (i = 0; paths[i]; ++i) {
+ purple_plugins_add_search_path(paths[i]);
+ }
+
+ g_strfreev(paths);
+ }
+
gplugin_manager_add_default_paths();
purple_plugins_add_search_path(PURPLE_LIBDIR);