From eb7b9fa565d1c038dacdee57b1f809e1153791d7 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Fri, 29 Apr 2011 21:54:38 +0000 Subject: [PATCH] Provide for PREFIX to be set to the bundle when the platform is darwin. Bundle is detected by differing sys.prefix and sys.exec_prefix, indicating that sys.prefix has been changed (which it is, in rungramps.py). svn: r17347 --- mac/rungramps.py | 3 ++- src/const.py.in | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mac/rungramps.py b/mac/rungramps.py index 2b98b3eb0..ac948eab4 100755 --- a/mac/rungramps.py +++ b/mac/rungramps.py @@ -18,6 +18,7 @@ sys.path = [_gramps_path, _site_lib_path, _pylib_path] +sys.prefix = _res_path os.environ["GTK_PATH"] = _res_path os.environ["GTK2_RC_FILES"] = os.path.join(_gtk2_conf, "gtkrc") os.environ["GTK_IM_MODULE_FILE"]= os.path.join(_gtk2_conf, "immodules") @@ -125,7 +126,7 @@ else: LC_ALL = _language os.environ["LC_ALL"] = LC_ALL #Spell-checker dictionary support -print LANG, LC_ALL + #LaunchServices sticks this argument on the front of argument #lists. It must make sense to somebody, but Gramps isn't that #somebody. diff --git a/src/const.py.in b/src/const.py.in index f8c67b41c..1f737f815 100644 --- a/src/const.py.in +++ b/src/const.py.in @@ -80,10 +80,13 @@ APP_VCARD = ["text/x-vcard", "text/x-vcalendar"] # system paths # #------------------------------------------------------------------------- -if sys.platform == "win32" or sys.platform == "darwin": +if sys.platform == "win32": if sys.prefix == os.path.dirname(os.getcwd()): PREFIXDIR = sys.prefix SYSCONFDIR = os.path.join(sys.prefix, "etc") +elif sys.platform == "darwin" and sys.prefix != sys.exec_prefix: + PREFIXDIR = sys.prefix + SYSCONFDIR = os.path.join(sys.prefix, "etc") else: PREFIXDIR = "@prefix@" SYSCONFDIR = "@sysconfdir@"