]> git.pld-linux.org Git - packages/python-virtualenv.git/blob - multilib.patch
b33ab8086c3d90c7040f5a06970b3d4b0aa4d5c3
[packages/python-virtualenv.git] / multilib.patch
1 --- virtualenv-15.0.1/virtualenv.py~    2016-03-17 16:16:07.000000000 +0100
2 +++ virtualenv-15.0.1/virtualenv.py     2016-10-18 22:48:47.174956732 +0200
3 @@ -1094,7 +1094,7 @@
4      else:
5          prefix = sys.prefix
6      mkdir(lib_dir)
7 -    fix_lib64(lib_dir, symlink)
8 +    fix_libarch(lib_dir, symlink)
9      stdlib_dirs = [os.path.dirname(os.__file__)]
10      if is_win:
11          stdlib_dirs.append(join(os.path.dirname(stdlib_dirs[0]), 'DLLs'))
12 @@ -1498,7 +1498,7 @@
13                      copyfile(os.path.abspath(os.path.join(home_dir, subdir_name)), \
14                                                              os.path.join(local_path, subdir_name), symlink)
15  
16 -def fix_lib64(lib_dir, symlink=True):
17 +def fix_libarch(lib_dir, symlink=True):
18      """
19      Some platforms (particularly Gentoo on x64) put things in lib64/pythonX.Y
20      instead of lib/pythonX.Y.  If this is such a platform we'll just create a
21 @@ -1507,29 +1507,37 @@
22      # PyPy's library path scheme is not affected by this.
23      # Return early or we will die on the following assert.
24      if is_pypy:
25 -        logger.debug('PyPy detected, skipping lib64 symlinking')
26 +        logger.debug('PyPy detected, skipping lib64/libx32 symlinking')
27          return
28 -    # Check we have a lib64 library path
29 -    if not [p for p in distutils.sysconfig.get_config_vars().values()
30 +    lib_arch = None
31 +    # Check we have a lib64 or libx32 library path
32 +    if [p for p in distutils.sysconfig.get_config_vars().values()
33 +            if isinstance(p, basestring) and 'libx32' in p]:
34 +        lib_arch = 'libx32'
35 +
36 +    if [p for p in distutils.sysconfig.get_config_vars().values()
37              if isinstance(p, basestring) and 'lib64' in p]:
38 +        lib_arch = 'lib64'
39 +
40 +    if not lib_arch:
41          return
42  
43 -    logger.debug('This system uses lib64; symlinking lib64 to lib')
44 +    logger.debug('This system uses %s; symlinking %s to lib', lib_arch, lib_arch)
45  
46      assert os.path.basename(lib_dir) == 'python%s' % sys.version[:3], (
47          "Unexpected python lib dir: %r" % lib_dir)
48      lib_parent = os.path.dirname(lib_dir)
49      top_level = os.path.dirname(lib_parent)
50      lib_dir = os.path.join(top_level, 'lib')
51 -    lib64_link = os.path.join(top_level, 'lib64')
52 +    libarch_link = os.path.join(top_level, lib_arch)
53      assert os.path.basename(lib_parent) == 'lib', (
54          "Unexpected parent dir: %r" % lib_parent)
55 -    if os.path.lexists(lib64_link):
56 +    if os.path.lexists(libarch_link):
57          return
58      if symlink:
59 -        os.symlink('lib', lib64_link)
60 +        os.symlink('lib', libarch_link)
61      else:
62 -        copyfile('lib', lib64_link)
63 +        copyfile('lib', libarch_link)
64  
65  def resolve_interpreter(exe):
66      """
This page took 0.052394 seconds and 2 git commands to generate.