[Bugs] #494 UNSP: Python exec dir is hardcoded

SugarLabs Bugs bugtracker-noreply at sugarlabs.org
Mon Mar 9 12:13:14 EDT 2009


#494: Python exec dir is hardcoded
------------------------------------------+---------------------------------
    Reporter:  sadam                      |          Owner:  tomeu                      
        Type:  defect                     |         Status:  new                        
    Priority:  Unspecified by Maintainer  |      Milestone:  Unspecified by Release Team
   Component:  sugar                      |        Version:  Git as of bugdate          
    Severity:  Blocker                    |     Resolution:                             
    Keywords:                             |   Distribution:  Unspecified                
Status_field:  Unconfimed                 |  
------------------------------------------+---------------------------------

Comment(by tomeu):

 What about this?

 {{{
 diff --git a/sjhbuild/config.py b/sjhbuild/config.py
 index 4efe4e6..014dbec 100644
 --- a/sjhbuild/config.py
 +++ b/sjhbuild/config.py
 @@ -1,5 +1,6 @@
  import os
  import sys
 +from distutils import sysconfig

  import jhbuild.config

 @@ -55,18 +56,15 @@ 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])
 +        python_packages = sysconfig.get_python_lib(0, 0, prefix='')
          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_packages = python_packages.split('/', 1)[1]
 +            python_packages = os.path.join('lib64', python_packages)
 +        python_packages = os.path.join(self.prefix, python_packages)
 +
 +        jhbuild.config.addpath('PYTHONPATH',
 os.path.join(python_packages, 'gtk-2.0'))

 -        python_lib = os.path.join(self.prefix, 'lib', 'python2.5', 'site-
 packages')
 -        os.environ['PYTHON_LIB'] = python_lib
 +        os.environ['PYTHON_LIB'] = python_packages

          if 'DBUS_SESSION_BUS_ADDRESS' in os.environ:
             del os.environ['DBUS_SESSION_BUS_ADDRESS']
 }}}

-- 
Ticket URL: <http://dev.sugarlabs.org/ticket/494#comment:3>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list