From c02fb1dcdb84dbfea038d098840b6fa42209da7c Mon Sep 17 00:00:00 2001 From: Andre Anjos <andre.anjos@idiap.ch> Date: Thu, 21 Mar 2013 13:12:08 +0100 Subject: [PATCH] Fix site-packages for ArchLinux installations --- setup.py | 2 +- xbob/buildout/python.py | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 3f91410..aae72a1 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ from setuptools import setup, find_packages setup( name='xbob.buildout', - version='0.2.12', + version='0.2.13', description="zc.buildout recipes to perform a variety of tasks required by Bob satellite packages", keywords=['buildout', 'sphinx', 'nose', 'recipe', 'eggs', 'bob'], url='http://github.com/bioidiap/xbob.buildout', diff --git a/xbob/buildout/python.py b/xbob/buildout/python.py index 89dd9c3..76f5349 100644 --- a/xbob/buildout/python.py +++ b/xbob/buildout/python.py @@ -18,6 +18,15 @@ from zc.buildout.buildout import bool_option import zc.buildout.easy_install from zc.recipe.egg import Scripts +# Standard prefixes to check +PYTHONDIR = 'python%d.%d' % sys.version_info[0:2] +SUFFIXES = tools.uniq([ + get_python_lib(prefix=''), + os.path.join('lib', PYTHONDIR, 'site-packages'), + os.path.join('lib32', PYTHONDIR, 'site-packages'), + os.path.join('lib64', PYTHONDIR, 'site-packages'), + ]) + # Python interpreter script template py_script_template = """#!%(interpreter)s # %(date)s @@ -77,9 +86,10 @@ class Recipe(Scripts): self.user_paths = [] if prefixes: for k in prefixes: - candidate = os.path.realpath(get_python_lib(prefix=k)) - if os.path.exists(candidate) and candidate not in self.user_paths: - self.user_paths.append(candidate) + for suffix in SUFFIXES: + candidate = os.path.realpath(os.path.join(k, suffix)) + if os.path.exists(candidate) and candidate not in self.user_paths: + self.user_paths.append(candidate) # Shall we panic or ignore if we cannot find all eggs? self.panic = options.get('error-on-failure', 'true').lower() == 'true' -- GitLab