[pitivi] Handle bundle in generated paths



commit 9762eb1793d1c4dd3870f2cc1e35bdc8a0aff429
Author: Thibault Saunier <thibault saunier collabora com>
Date:   Sat Mar 15 08:43:03 2014 +0100

    Handle bundle in generated paths

 bin/pitivi.in          |   22 ++++++++++++++++------
 pitivi/configure.py.in |    9 +++++++--
 2 files changed, 23 insertions(+), 8 deletions(-)
---
diff --git a/bin/pitivi.in b/bin/pitivi.in
index 3e879f2..a8eb12a 100644
--- a/bin/pitivi.in
+++ b/bin/pitivi.in
@@ -26,12 +26,22 @@ import string
 import locale
 import gettext
 
-CONFIGURED_PYTHONPATH = '@CONFIGURED_PYTHONPATH@'
-CONFIGURED_GI_TYPELIB_PATH = '@CONFIGURED_GI_TYPELIB_PATH@'
-CONFIGURED_LD_LIBRARY_PATH = '@CONFIGURED_LD_LIBRARY_PATH@'
-CONFIGURED_GST_PLUGIN_PATH = '@CONFIGURED_GST_PLUGIN_PATH@'
-LIBDIR = '@LIBDIR@'
 localedir = ""
+if os.environ.has_key("APPDIR"):
+    basedir = os.environ["APPDIR"]
+    CONFIGURED_PYTHONPATH = ""
+    CONFIGURED_GI_TYPELIB_PATH = ""
+    CONFIGURED_LD_LIBRARY_PATH = ""
+    CONFIGURED_GST_PLUGIN_PATH = ""
+    LIBDIR = os.path.join(basedir, 'usr', 'lib')
+    DATADIR = os.path.join(basedir, "usr", "share")
+else:
+    CONFIGURED_PYTHONPATH = '@CONFIGURED_PYTHONPATH@'
+    CONFIGURED_GI_TYPELIB_PATH = '@CONFIGURED_GI_TYPELIB_PATH@'
+    CONFIGURED_LD_LIBRARY_PATH = '@CONFIGURED_LD_LIBRARY_PATH@'
+    CONFIGURED_GST_PLUGIN_PATH = '@CONFIGURED_GST_PLUGIN_PATH@'
+    LIBDIR = '@LIBDIR@'
+    DATADIR = '@DATADIR'
 
 
 def _prepend_env_path(name, value):
@@ -61,7 +71,7 @@ def _add_pitivi_path():
         localedir = os.path.join(os.path.split(dir)[0], 'locale')
     else:
         root = os.path.join(LIBDIR, 'pitivi', 'python')
-        localedir = "@DATADIR@/locale"
+        localedir = os.path.join(DATADIR, "locale")
 
     if not root in sys.path:
         sys.path.insert(0, root)
diff --git a/pitivi/configure.py.in b/pitivi/configure.py.in
index 2cbbfcb..ebf8a19 100644
--- a/pitivi/configure.py.in
+++ b/pitivi/configure.py.in
@@ -38,9 +38,14 @@ def in_devel():
     rd = _get_root_dir()
     return os.path.exists(os.path.join(rd, '.git'))
 
+if os.environ.has_key("APPDIR"):
+    basedir = os.environ["APPDIR"]
+    LIBDIR = os.path.join(basedir, 'usr', 'lib')
+    PKGDATADIR = os.path.join(basedir, 'usr', 'share', 'pitivi')
+else:
+    LIBDIR = '@LIBDIR@'
+    PKGDATADIR = '@DATADIR@/@PACKAGE@'
 
-LIBDIR = '@LIBDIR@'
-PKGDATADIR = '@DATADIR@/@PACKAGE@'
 VERSION = '@VERSION@'
 APPNAME = '@PACKAGE_NAME@'
 APPURL = 'http://www.pitivi.org/'


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]