From 8141d32aeb8d64a7aaf50f7fbdfccfc799de33f5 Mon Sep 17 00:00:00 2001 From: Sascha Silbe Date: Wed, 25 Mar 2009 12:16:07 +0000 Subject: add support for Python 2.6 --- diff --git a/sjhbuild/config.py b/sjhbuild/config.py index 4efe4e6..df7d569 100644 --- a/sjhbuild/config.py +++ b/sjhbuild/config.py @@ -2,6 +2,7 @@ import os import sys import jhbuild.config +import distutils.sysconfig import sysdeps @@ -36,11 +37,7 @@ class Config(jhbuild.config.Config): 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_PATH', os.path.join(self.prefix, ['lib', 'lib64'][self.use_lib64], 'gtk-2.0', '')) jhbuild.config.addpath('GTK_DATA_PREFIX', self.prefix) os.environ['SUGAR_PREFIX'] = self.prefix @@ -55,18 +52,16 @@ class Config(jhbuild.config.Config): # 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 + pythonpath_basic = distutils.sysconfig.get_python_lib(prefix='').split('/', 1)[1] + pythonpath_gtk = os.path.join(self.prefix, ["lib", "lib64"][self.use_lib64], pythonpath_basic, 'gtk-2.0') + jhbuild.config.addpath('PYTHONPATH', pythonpath_gtk) + + # workaround for bug in jhbuild + # note: even for use_lib64 we need "lib" here as that's where distutils installs to + pythonpath_lib = os.path.join(self.prefix, "lib", pythonpath_basic) + jhbuild.config.addpath('PYTHONPATH', pythonpath_lib) + + os.environ['PYTHON_LIB'] = distutils.sysconfig.get_python_lib(prefix=self.prefix) if 'DBUS_SESSION_BUS_ADDRESS' in os.environ: del os.environ['DBUS_SESSION_BUS_ADDRESS'] -- cgit v0.9.1