Ticket #494: sugar-jhbuild-python-2.6-fix.patch
File sugar-jhbuild-python-2.6-fix.patch, 2.4 KB (added by sascha_silbe, 15 years ago) |
---|
-
sjhbuild/config.py
diff --git a/sjhbuild/config.py b/sjhbuild/config.py index 4efe4e6..df7d569 100644
a b import os 2 2 import sys 3 3 4 4 import jhbuild.config 5 import distutils.sysconfig 5 6 6 7 import sysdeps 7 8 … … class Config(jhbuild.config.Config): 36 37 jhbuild.config.addpath('XDG_DATA_DIRS', '/usr/share') 37 38 jhbuild.config.addpath('XDG_DATA_DIRS', os.path.join(self.prefix, 'share')) 38 39 39 if self.use_lib64: 40 path = 'lib64/gtk-2.0/' 41 else: 42 path = 'lib/gtk-2.0/' 43 jhbuild.config.addpath('GTK_PATH', os.path.join(self.prefix, path)) 40 jhbuild.config.addpath('GTK_PATH', os.path.join(self.prefix, ['lib', 'lib64'][self.use_lib64], 'gtk-2.0', '')) 44 41 jhbuild.config.addpath('GTK_DATA_PREFIX', self.prefix) 45 42 46 43 os.environ['SUGAR_PREFIX'] = self.prefix … … class Config(jhbuild.config.Config): 55 52 # We need to add the gtk-2.0 directory explicitly to 56 53 # the Python path since '.pth' files (here pygtk.pth) 57 54 # only work properly in system directories 58 pythonversion = 'python' + str(sys.version_info[0]) + '.' + \ 59 str(sys.version_info[1]) 60 if self.use_lib64: 61 pythonpath = os.path.join(self.prefix, 'lib64', pythonversion, 62 'site-packages', 'gtk-2.0') 63 else: 64 pythonpath = os.path.join(self.prefix, 'lib', pythonversion, 65 'site-packages', 'gtk-2.0') 66 jhbuild.config.addpath('PYTHONPATH', pythonpath) 67 68 python_lib = os.path.join(self.prefix, 'lib', 'python2.5', 'site-packages') 69 os.environ['PYTHON_LIB'] = python_lib 55 pythonpath_basic = distutils.sysconfig.get_python_lib(prefix='').split('/', 1)[1] 56 pythonpath_gtk = os.path.join(self.prefix, ["lib", "lib64"][self.use_lib64], pythonpath_basic, 'gtk-2.0') 57 jhbuild.config.addpath('PYTHONPATH', pythonpath_gtk) 58 59 # workaround for bug in jhbuild 60 # note: even for use_lib64 we need "lib" here as that's where distutils installs to 61 pythonpath_lib = os.path.join(self.prefix, "lib", pythonpath_basic) 62 jhbuild.config.addpath('PYTHONPATH', pythonpath_lib) 63 64 os.environ['PYTHON_LIB'] = distutils.sysconfig.get_python_lib(prefix=self.prefix) 70 65 71 66 if 'DBUS_SESSION_BUS_ADDRESS' in os.environ: 72 67 del os.environ['DBUS_SESSION_BUS_ADDRESS']