Patch to the suggested .jhbuildrc



The current gtk-2.0 trick doesn't really work on x86_64. PYTHONPATH is
not yet set when .jhbuildrc is executed.
The attached patch fixes it, it's just a modified version of the jhbuild code.

For a real fix, did anyone look into the .pth problem? Is it a python
bug/limitation?

Marco

--- .jhbuildrc.orig     2008-04-08 12:16:55.000000000 +0200
+++ .jhbuildrc  2008-04-08 12:37:03.000000000 +0200
@@ -27,15 +27,14 @@

 # 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
-import re, sys
-python_version = sys.version.split()[0]
-python_version = re.sub(r"^(\d+.\d+).\d+$", r"\1", python_version)
-lib_packages = os.path.join(prefix, 'lib', 'python' + python_version,
'site-packages')
-lib64_packages = os.path.join(prefix, 'lib64', 'python' +
python_version, 'site-packages')
-if lib64_packages in sys.path:
-    addpath('PYTHONPATH', os.path.join(lib64_packages, 'gtk-2.0'))
+import os
+import sys
+pythonversion = 'python' + str(sys.version_info[0]) + '.' +
str(sys.version_info[1])
+if use_lib64:
+    pythonpath = os.path.join(prefix, 'lib64', pythonversion,
'site-packages', 'gtk-2.0')
 else:
-    addpath('PYTHONPATH', os.path.join(lib_packages, 'gtk-2.0'))
+    pythonpath = os.path.join(prefix, 'lib', pythonversion,
'site-packages', 'gtk-2.0')
+addpath('PYTHONPATH', pythonpath)

 # Rebuild faster
 os.environ['INSTALL'] = os.path.expanduser('~/bin/install-check')


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