| 1 | Support the PURPLE_PLUGIN_PATH environment variable. This patch is based on
|
| 2 | one from Nixpkgs, but properly handles the case where that variable is unset.
|
| 3 |
|
| 4 | |
| 5 | |
| 6 | @@ -1178,8 +1178,19 @@
|
| 7 | void
|
| 8 | purple_plugins_init(void) {
|
| 9 | void *handle = purple_plugins_get_handle();
|
| 10 | + const gchar *purple_plugin_path;
|
| 11 |
|
| 12 | purple_plugins_add_search_path(LIBDIR);
|
| 13 | + purple_plugin_path = g_getenv("PURPLE_PLUGIN_PATH");
|
| 14 | + if (purple_plugin_path && *purple_plugin_path) {
|
| 15 | + gchar **paths = g_strsplit(purple_plugin_path, ":", -1);
|
| 16 | + if (paths) {
|
| 17 | + gchar **p;
|
| 18 | + for (p = paths; *p; ++p)
|
| 19 | + if (**p) purple_plugins_add_search_path(*p);
|
| 20 | + }
|
| 21 | + g_strfreev(paths);
|
| 22 | + }
|
| 23 |
|
| 24 | purple_signal_register(handle, "plugin-load",
|
| 25 | purple_marshal_VOID__POINTER,
|