Commit | Line | Data |
---|---|---|
b1a2bc89 MW |
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 | --- pidgin-2.10.11/libpurple/plugin.c.orig 2014-11-23 11:41:25.000000000 -0500 | |
5 | +++ pidgin-2.10.11/libpurple/plugin.c 2015-08-04 14:31:02.257366144 -0400 | |
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, |