=== modified file 'src/main.cpp' --- src/main.cpp 2015-11-20 17:34:03 +0000 +++ src/main.cpp 2016-04-06 08:15:43 +0000 @@ -540,6 +540,12 @@ { gchar const *path = g_getenv("PATH"); gchar const *pythonpath = g_getenv("PYTHONPATH"); + gchar const *inkscape_extensions_path = g_getenv("INKSCAPE_EXTENSIONS_PATH"); + gchar const *inkscape_extensions_pythonpath = g_getenv("INKSCAPE_EXTENSIONS_PYTHONPATH"); + g_message("PATH: %s", path); + g_message("PYTHONPATH: %s", pythonpath); + g_message("INKSCAPE_EXTENSIONS_PATH: %s", inkscape_extensions_path); + g_message("INKSCAPE_EXTENSIONS_PYTHONPATH: %s", inkscape_extensions_pythonpath); gchar *python = g_build_filename(exe, "python", NULL); gchar *scripts = g_build_filename(exe, "python", "Scripts", NULL); @@ -557,33 +563,41 @@ gchar *new_path; gchar *new_pythonpath; - if (path) { - new_path = g_strdup_printf("%s;%s;%s;%s;%s", exe, python, scripts, perl, path); + if (inkscape_extensions_path) { + new_path = const_cast(inkscape_extensions_path); } else { - new_path = g_strdup_printf("%s;%s;%s;%s", exe, python, scripts, perl); + if (path) { + new_path = g_strdup_printf("%s;%s;%s;%s;%s", exe, python, scripts, perl, path); + } else { + new_path = g_strdup_printf("%s;%s;%s;%s", exe, python, scripts, perl); + } } - if (pythonpath) { - new_pythonpath = g_strdup_printf("%s;%s;%s;%s", - python_s, pythonlib_s, pythondll_s, pythonpath); + if (inkscape_extensions_pythonpath) { + new_pythonpath = const_cast(inkscape_extensions_pythonpath); } else { - new_pythonpath = g_strdup_printf("%s;%s;%s", - python_s, pythonlib_s, pythondll_s); + if (pythonpath) { + new_pythonpath = g_strdup_printf("%s;%s;%s;%s", + python_s, pythonlib_s, pythondll_s, pythonpath); + } else { + new_pythonpath = g_strdup_printf("%s;%s;%s", + python_s, pythonlib_s, pythondll_s); + } } g_setenv("PATH", new_path, TRUE); g_setenv("PYTHONPATH", new_pythonpath, TRUE); - /* - printf("PATH = %s\n\n", g_getenv("PATH")); - printf("PYTHONPATH = %s\n\n", g_getenv("PYTHONPATH")); + + g_message("New PATH = %s\n\n", g_getenv("PATH")); + g_message("New PYTHONPATH = %s\n\n", g_getenv("PYTHONPATH")); gchar *p = g_find_program_in_path("python"); if (p) { - printf("python in %s\n\n", p); + g_message("python in %s\n\n", p); g_free(p); } else { - printf("python not found\n\n"); - }*/ + g_message("python not found\n\n"); + } // INKSCAPE_LOCALEDIR is needed by Python/Gettext gchar *localepath = g_build_filename(exe, PACKAGE_LOCALE_DIR, NULL);