On Dec 8, 2004, at 12:20 PM, Jean-Marc Lasgouttes wrote:
In 1.3.x, it is in LyX::init, where you find around line 398 of
lyx_main.C
string oldpath = GetEnv("PATH");
string newpath = "PATH=" + oldpath + ":" + binpath + ":";
newpath += "/sw/bin:/usr/local/bin:/usr/local/teTeX/bin/powerpc-apple-darwin- current";
PutEnv(newpath);
lyxerr[Debug::INIT] << "Running from LyX/Mac bundle. "
"Setting PATH to: " << GetEnv("PATH") << endl;
So this means that
/sw/bin:/usr/local/bin:/usr/local/teTeX/bin/powerpc-apple-darwin- current
is added to PATH.
However, if you go to the info.plist route, you will not be able to _add_ to PATH, I think. You need to provide a full PATH variable (with /usr/bin and friends).
So an alternative way might be to define a variable LYX_PATH in info.plist that contains these values and change the code above to only append the value of LYX_PATH to PATH.
In 1.4.0cvs, the method is the same, but the code is around line 313 of src/support/path_define.C.in.
Does this answer to your questions?
Yes, but I can't get it to work neatly. (I've been trying in LyX-140.)
It seems like many people have trouble using LSEnvironment in info.plist, especially when porting *nix programs to the Mac. I've also seen reports that using LSEnvironment won't work at all prior to OS X 10.3 (though I haven't seen documentation on that on Apple's website).
So I've tried a different route others have suggested: create a shell script in the LyX bundle that sets PATH and then starts LyX. This requires setting CFBundleExecutable to the name of the shell script in info.plist. (This would have the benefit of overcoming Ronald's "gotcha" -- at least assuming we can get LyX-140 to behave normally when run from the command line.) However, I haven't been able to get this to work either: it seems Mac OS X is ignoring the value of CFBundleExecutable and executing LyX.app/Contents/MacOS/lyx in every case when the LyX icon is double-clicked.
When I rename lyx to lyx-app, and use "lyx" as the name of my shell script, things seem to work just fine at least with respect to the path problem. But for some reason lyx is finding the preferences and configuration files in ~/.lyx (which is where LyX-13x files are) rather than in ~/Library/Preferences/LyX (where the LyX-140 files are). I'm not sure what's going on here.
Bennett