diff --git a/bin/sugar.in b/bin/sugar.in index bfdf8f95..de2595da 100644 --- a/bin/sugar.in +++ b/bin/sugar.in @@ -1,2 +1,2 @@ -export GTK2_RC_FILES=@prefix@/share/sugar/gtkrc +export GTK2_RC_FILES=@prefix@/share/sugar/data/gtkrc dbus-launch --exit-with-session sugar-shell diff --git a/data/Makefile.am b/data/Makefile.am index 632c2c9b..3ff222b9 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,4 +1,4 @@ -sugardir = $(pkgdatadir) +sugardir = $(pkgdatadir)/data sugar_DATA = \ gtkrc \ gecko-prefs.js \ diff --git a/sugar/env.py b/sugar/env.py index a8d8ef0f..3555e938 100644 --- a/sugar/env.py +++ b/sugar/env.py @@ -29,6 +29,17 @@ def _get_prefix_path(base, path=None): else: return os.path.join(prefix, base) +def _get_sugar_path(base, path=None): + if os.environ.has_key('SUGAR_PATH'): + sugar_path = os.environ['SUGAR_PATH'] + else: + sugar_path = _get_prefix_path('share/sugar') + + if path: + return os.path.join(sugar_path, base, path) + else: + return os.path.join(sugar_path, base) + def is_emulator(): if os.environ.has_key('SUGAR_EMULATOR'): if os.environ['SUGAR_EMULATOR'] == 'yes': @@ -56,17 +67,17 @@ def get_profile_path(path=None): def get_user_activities_path(): return os.path.expanduser('~/Activities') -def get_bin_path(path=None): - return _get_prefix_path('share/sugar/bin', path) - def get_locale_path(path=None): return _get_prefix_path('share/locale', path) +def get_bin_path(path=None): + return _get_sugar_path('bin', path) + def get_service_path(name): - return _get_prefix_path('share/sugar/services', name) + return _get_sugar_path('services', name) def get_shell_path(path=None): - return _get_prefix_path('share/sugar/shell', path) + return _get_sugar_path('shell', path) def get_data_path(path=None): - return _get_prefix_path('share/sugar', path) + return _get_sugar_path('data', path)