diff options
Diffstat (limited to 'sjhbuild/config.py')
-rw-r--r-- | sjhbuild/config.py | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/sjhbuild/config.py b/sjhbuild/config.py new file mode 100644 index 0000000..d89d69b --- /dev/null +++ b/sjhbuild/config.py @@ -0,0 +1,76 @@ +import os +import sys + +import jhbuild.config + +import sysdeps + +class Config(jhbuild.config.Config): + def __init__(self, base_dir, rc_file): + self.base_dir = base_dir + jhbuild.config.Config.__init__(self, os.path.join(self.base_dir, 'sugar.jhbuildrc')) + self._setup() + + def _setup(self): + self.autogenargs = '' + + self.checkoutroot = os.path.join(self.base_dir, 'source') + self.tarballdir = os.path.join(self.base_dir, 'source') + self.moduleset = os.path.join(self.base_dir, 'sjhbuild/modulesets/sugar.modules') + + for package, source in sysdeps.get_packages(): + if source and source not in self.skip: + self.skip.append(source) + + def setup_env(self): + # Hack to replace the default prefix + if self.prefix == '/opt/gnome2': + self.prefix = os.path.join(self.base_dir, 'install') + + #Hack to allow sugar-jhbuild to find its self again. + + MY_PATH = os.getenv('PATH', 'Error') + os.environ["PATH"] = MY_PATH + ':' + self.base_dir + + jhbuild.config.Config.setup_env(self) + + jhbuild.config.addpath('XDG_DATA_DIRS', '/usr/share') + jhbuild.config.addpath('XDG_DATA_DIRS', os.path.join(self.prefix, 'share')) + + if self.use_lib64: + path = 'lib64/gtk-2.0/' + else: + path = 'lib/gtk-2.0/' + jhbuild.config.addpath('GTK_PATH', os.path.join(self.prefix, path)) + jhbuild.config.addpath('GTK_DATA_PREFIX', self.prefix) + + os.environ['SUGAR_PREFIX'] = self.prefix + os.environ['SUGAR_PATH'] = os.path.join(self.prefix, 'share', 'sugar') + os.environ['SUGAR_LOGGER_LEVEL'] = 'debug' + + # Enable debug log of the Telepathy components + os.environ['GABBLE_DEBUG'] = 'all' + os.environ['SALUT_DEBUG'] = 'all' + os.environ['STREAM_ENGINE_DEBUG'] = 'all' + + # We need to add the gtk-2.0 directory explicitly to + # the Python path since '.pth' files (here pygtk.pth) + # only work properly in system directories + pythonversion = 'python' + str(sys.version_info[0]) + '.' + \ + str(sys.version_info[1]) + if self.use_lib64: + pythonpath = os.path.join(self.prefix, 'lib64', pythonversion, + 'site-packages', 'gtk-2.0') + else: + pythonpath = os.path.join(self.prefix, 'lib', pythonversion, + 'site-packages', 'gtk-2.0') + jhbuild.config.addpath('PYTHONPATH', pythonpath) + + python_lib = os.path.join(self.prefix, 'lib', 'python2.5', 'site-packages') + os.environ['PYTHON_LIB'] = python_lib + + if 'DBUS_SESSION_BUS_ADDRESS' in os.environ: + del os.environ['DBUS_SESSION_BUS_ADDRESS'] + + if not 'SUGAR_PROFILE' in os.environ: + os.environ['SUGAR_PROFILE'] = 'default' |