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
7 - fix_lib64(lib_dir, symlink)
8 + fix_libarch(lib_dir, symlink)
9 stdlib_dirs = [os.path.dirname(os.__file__)]
11 stdlib_dirs.append(join(os.path.dirname(stdlib_dirs[0]), 'DLLs'))
13 copyfile(os.path.abspath(os.path.join(home_dir, subdir_name)), \
14 os.path.join(local_path, subdir_name), symlink)
16 -def fix_lib64(lib_dir, symlink=True):
17 +def fix_libarch(lib_dir, symlink=True):
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.
25 - logger.debug('PyPy detected, skipping lib64 symlinking')
26 + logger.debug('PyPy detected, skipping lib64/libx32 symlinking')
28 - # Check we have a lib64 library path
29 - if not [p for p in distutils.sysconfig.get_config_vars().values()
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]:
36 + if [p for p in distutils.sysconfig.get_config_vars().values()
37 if isinstance(p, basestring) and 'lib64' in p]:
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)
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):
59 - os.symlink('lib', lib64_link)
60 + os.symlink('lib', libarch_link)
62 - copyfile('lib', lib64_link)
63 + copyfile('lib', libarch_link)
65 def resolve_interpreter(exe):
67 --- virtualenv-15.0.1/virtualenv_support/site.py~ 2016-10-19 09:09:07.000000000 +0200
68 +++ virtualenv-15.0.1/virtualenv_support/site.py 2016-10-19 09:11:26.681732254 +0200
70 sitedirs.insert(0, lib64_dir)
72 sitedirs.append(lib64_dir)
73 + libx32_dir = os.path.join(prefix, "libx32", "python" + sys.version[:3], "site-packages")
74 + if (os.path.exists(libx32_dir) and
75 + os.path.realpath(libx32_dir) not in [os.path.realpath(p) for p in sitedirs]):
77 + sitedirs.append(libx32_dir)
79 + sitedirs.insert(0, libx32_dir)
81 # sys.getobjects only available in --with-pydebug build
84 paths.insert(0, lib64_path)
86 paths.append(lib64_path)
87 + libx32_path = os.path.join(sys.real_prefix, 'libx32', 'python'+sys.version[:3])
88 + if os.path.exists(libx32_path):
90 + paths.append(libx32_path)
92 + paths.insert(0, libx32_path)
93 # This is hardcoded in the Python executable, but relative to
94 # sys.prefix. Debian change: we need to add the multiarch triplet
95 # here, which is where the real stuff lives. As per PEP 421, in