So I just ran into this problem at another place
where some data files aren't read because absolute paths are used in the code. There are at least 5 plugins affected by this - I didn't notice this myself because I have these files installed at the given paths but people who only get the bundle run into this problem.
So now the question is what to do - there are unfortunately various problems:
Taking the above into account I tried the following for the GeniusPaste plugin:
static gchar *get_data_dir(void)
{
gchar *prefix = NULL;
gchar *dir;
#ifdef G_OS_WIN32
prefix = g_win32_get_package_installation_directory_of_module(NULL);
#elif defined(__APPLE__)
if (g_getenv("GTK_PATH"))
return g_build_filename(g_getenv("GTK_PATH"),
"share", "geany-plugins", PLUGIN, "pastebins", NULL);
#endif
dir = g_build_filename(prefix ? prefix : "", PLUGINDATADIR, "pastebins", NULL);
g_free(prefix);
return dir;
}
For the bundle, GTK_PATH is defined and basically points to what /usr
would contain on linux. When it's not defined, I assume it's not a bundle and that PLUGINDATADIR can be used. I tested this both for the bundle and non-bundle case and it works.
Is it OK to have a function like that copied to every affected plugin (basically the ones referencing either PLUGINDATADIR in the code or g_win32_get_package_installation_directory_of_module())? Or does anyone have a better idea how to do this?
cc @b4n
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.