gimp: macOS run from build directory

This change allows gimp to run from the build
directory rather than having to wait for the
full packaging process to complete.

However, 'gi' modules are not loading properly
so that might be something to fix.
This commit is contained in:
Lukas Oberhuber 2021-12-22 01:33:04 +00:00
parent d0dcb19e75
commit d8afa6c829
1 changed files with 18 additions and 2 deletions

View File

@ -345,8 +345,24 @@ gimp_macos_setenv (const char * progname)
}
else
{
g_free (res_dir);
return;
tmp = g_strdup_printf ("%s/../share", app_dir);
res_dir = g_canonicalize_filename (tmp, NULL);
g_free(tmp);
if (res_dir && !stat (res_dir, &sb) && S_ISDIR (sb.st_mode))
{
g_free (res_dir);
g_print ("GIMP is started in the build directory\n");
tmp = g_strdup_printf ("%s/..", app_dir); /* running in build dir */
res_dir = g_canonicalize_filename (tmp, NULL);
g_free(tmp);
}
else
{
g_free (res_dir);
return;
}
}
path_len = strlen (g_getenv ("PATH") ? g_getenv ("PATH") : "") + strlen (app_dir) + 2;