From 9c111fba29cd99bf5876c693e48d3ffbe4b22b32 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Fri, 27 Sep 2019 11:36:31 +0200 Subject: [PATCH] macports: ensure the GUI finds recollindex --- src/common/rclinit.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/common/rclinit.cpp b/src/common/rclinit.cpp index 45ba5741..e5eed5e2 100644 --- a/src/common/rclinit.cpp +++ b/src/common/rclinit.cpp @@ -273,6 +273,18 @@ RclConfig *recollinit(int flags, if (cleanup) atexit(cleanup); +#ifdef MACPORTS + // Apple keeps changing the way to set the environment (PATH) for + // a desktop app (started by launchd or whatever). Life is too + // short. + const char *cp = getenv("PATH"); + if (!cp) //?? + cp = ""; + string PATH(cp); + PATH = string("/opt/local/bin/") + ":" + PATH; + setenv("PATH", PATH.c_str(), 1); +#endif + // Make sure the locale is set. This is only for converting file names // to utf8 for indexing. setlocale(LC_CTYPE, "");