From abfaec6c0cfc9383e12f19a663165437495ed276 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 16 Dec 2003 14:51:59 +0000 Subject: [PATCH] make osx builds relocatable git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_3_X@8260 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 5 +++++ lib/reLyX/reLyX.in | 4 +++- src/ChangeLog | 5 +++++ src/lyx_main.C | 28 +++++++++++++++++++++++++--- status.13x | 4 +++- 5 files changed, 41 insertions(+), 5 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index b9a256e7bb..e13ae92e00 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2003-12-12 Ronald Florence + + * reLyX/reLyX.in: search for library in + "$dir/../Resources/LyX/reLyX" for LyX/Mac + 2003-12-10 Jean-Marc Lasgouttes * CREDITS: add Felix Kurth diff --git a/lib/reLyX/reLyX.in b/lib/reLyX/reLyX.in index 846188a4a2..b4e3a402a3 100644 --- a/lib/reLyX/reLyX.in +++ b/lib/reLyX/reLyX.in @@ -44,7 +44,9 @@ push @maybe_dir, "$dir/$srcdir"; if (exists $ENV{LYX_DIR_13x}) { push @maybe_dir, "$ENV{LYX_DIR_13x}/reLyX"}; # case 4: e.g., reLyX in /opt/bin, $mainscript in /opt/share/lyx/reLyX push @maybe_dir, "$dir/../share/$lyxname/reLyX"; # case 4 -# case 5: configure figured out where $mainscript is +# case 5: LyX/Mac -- reLyX is in a MacOS X application bundle +push @maybe_dir, "$dir/../Resources/LyX/reLyX"; # case 5 +# case 6: configure figured out where $mainscript is push @maybe_dir, "$lyxdir/reLyX"; # Decide which one is the real directory, based on the existence of diff --git a/src/ChangeLog b/src/ChangeLog index 84f9a5af87..c3b3251c60 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2003-12-12 Ronald Florence + + * lyx_main.C: determine system directory and set PATH for + relocatable LyX/Mac bundle. + 2003-12-04 Jean-Marc Lasgouttes * BufferView_pimpl.C (viewDispatch): new method, called by the qt diff --git a/src/lyx_main.C b/src/lyx_main.C index 0b0e0802ac..355a73bd91 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -246,10 +246,11 @@ void LyX::init(bool gui) // 1) -sysdir command line parameter // 2) LYX_DIR_13x environment variable // 3) Maybe /TOP_SRCDIR/lib - // 4) /../share// - // 4a) repeat 4 after following the Symlink if /../Resources// [for LyX/Mac] + // 5) /../share// + // 5a) repeat 4 after following the Symlink if is a symbolic link. - // 5) hardcoded lyx_dir + // 6) hardcoded lyx_dir // The directory is checked for the presence of the file // "chkconfig.ltx", and if that is present, the directory // is accepted as the system directory. @@ -268,6 +269,10 @@ void LyX::init(bool gui) searchpath += lyxdir + ';'; } + // Path of binary/../Resources/ + searchpath += NormalizePath(AddPath(binpath, "../Resources/") + + OnlyFilename(binname)) + ';'; + string fullbinpath = binpath; FileInfo file(fullbinname, true); if (file.isLink()) { @@ -382,6 +387,23 @@ void LyX::init(bool gui) lyxerr[Debug::INIT] << "System directory: '" << system_lyxdir << '\'' << endl; + // + // Set PATH for LyX/Mac + // LyX/Mac is a relocatable application bundle; here we add to + // the PATH so it can find binaries like reLyX inside its own + // application bundle, and also append PATH elements that it + // needs to run latex, previewers, etc. + // + + if (system_lyxdir == NormalizePath(AddPath(binpath, "../Resources/") + + OnlyFilename(binname))) { + 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; + } + // // Determine user lyx-dir // diff --git a/status.13x b/status.13x index 46133008f1..7721eb1fb1 100644 --- a/status.13x +++ b/status.13x @@ -22,7 +22,7 @@ What's new ** Updates -- it is now possible to open documents which use a textclasse for +- it is now possible to open documents which use a textclass for which no LaTeX support is installed. The documents can be normally edited, but they can of course not be previewed or printed. Note that the format of the file .lyx/textclasses.lst has changed as a @@ -33,6 +33,8 @@ What's new - add support for opening files with LyX in finder [Qt/Mac only] +- make MacOSX build relocatable + - add support for \boldsymbol in math editor - add support for g-brief2 textclass