Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sjhbuild
diff options
context:
space:
mode:
authorSascha Silbe <sascha-org-sugar-git@silbe.org>2009-03-25 12:16:07 (GMT)
committer Sascha Silbe <sascha-org-sugar-git@silbe.org>2009-03-25 12:16:07 (GMT)
commit8141d32aeb8d64a7aaf50f7fbdfccfc799de33f5 (patch)
tree7b6948e8445ad1b21021313fbd364a4245eea27e /sjhbuild
parente970023cf99e5c201fa36e952955b5f018565fa9 (diff)
add support for Python 2.6
Diffstat (limited to 'sjhbuild')
-rw-r--r--sjhbuild/config.py29
1 files changed, 12 insertions, 17 deletions
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']