Lines 1157-1163
def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear, sy
Link Here
|
1157 |
else: |
1157 |
else: |
1158 |
prefix = sys.prefix |
1158 |
prefix = sys.prefix |
1159 |
mkdir(lib_dir) |
1159 |
mkdir(lib_dir) |
1160 |
fix_lib64(lib_dir, symlink) |
1160 |
|
|
|
1161 |
# Account for libdir of explicit bitness. |
1162 |
is_bitness_explicit, libdir_bitness = fix_libdir_bitness(lib_dir, symlink) |
1163 |
|
1161 |
stdlib_dirs = [os.path.dirname(os.__file__)] |
1164 |
stdlib_dirs = [os.path.dirname(os.__file__)] |
1162 |
if is_win: |
1165 |
if is_win: |
1163 |
stdlib_dirs.append(join(os.path.dirname(stdlib_dirs[0]), 'DLLs')) |
1166 |
stdlib_dirs.append(join(os.path.dirname(stdlib_dirs[0]), 'DLLs')) |
Lines 1192-1197
def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear, sy
Link Here
|
1192 |
site_dir = os.path.dirname(site_filename_dst) |
1195 |
site_dir = os.path.dirname(site_filename_dst) |
1193 |
writefile(site_filename_dst, SITE_PY) |
1196 |
writefile(site_filename_dst, SITE_PY) |
1194 |
writefile(join(site_dir, 'orig-prefix.txt'), prefix) |
1197 |
writefile(join(site_dir, 'orig-prefix.txt'), prefix) |
|
|
1198 |
|
1199 |
# We need to record the bitness of original libdir, or the virtualenv |
1200 |
# site.py will not be able to insert the correct system package paths. |
1201 |
# Assuming that the simplicity of orig-prefix.txt may be relied upon by |
1202 |
# external programs, we have to write a new file here. |
1203 |
if is_bitness_explicit: |
1204 |
writefile(join(site_dir, 'libdir-bitness.txt'), libdir_bitness) |
1205 |
|
1195 |
site_packages_filename = join(site_dir, 'no-global-site-packages.txt') |
1206 |
site_packages_filename = join(site_dir, 'no-global-site-packages.txt') |
1196 |
if not site_packages: |
1207 |
if not site_packages: |
1197 |
writefile(site_packages_filename, '') |
1208 |
writefile(site_packages_filename, '') |
Lines 1549-1584
def fix_local_scheme(home_dir, symlink=True):
Link Here
|
1549 |
copyfile(os.path.abspath(os.path.join(home_dir, subdir_name)), \ |
1560 |
copyfile(os.path.abspath(os.path.join(home_dir, subdir_name)), \ |
1550 |
os.path.join(local_path, subdir_name), symlink) |
1561 |
os.path.join(local_path, subdir_name), symlink) |
1551 |
|
1562 |
|
1552 |
def fix_lib64(lib_dir, symlink=True): |
1563 |
def fix_libdir_bitness(lib_dir, symlink=True): |
1553 |
""" |
1564 |
""" |
1554 |
Some platforms (particularly Gentoo on x64) put things in lib64/pythonX.Y |
1565 |
Some platforms (such as Gentoo on x64 or on MIPS ABI n32/n64) put things |
1555 |
instead of lib/pythonX.Y. If this is such a platform we'll just create a |
1566 |
in lib{64,32}/pythonX.Y instead of lib/pythonX.Y. If this is such a |
1556 |
symlink so lib64 points to lib |
1567 |
platform we'll just create a symlink so libXX points to lib. |
1557 |
""" |
1568 |
""" |
|
|
1569 |
|
1570 |
# Common bitnesses. |
1571 |
for bitness in '64', '32', 'x32': |
1572 |
if _do_fix_libdir_bitness(lib_dir, symlink, bitness): |
1573 |
return True, bitness |
1574 |
|
1575 |
return False, None |
1576 |
|
1577 |
def _do_fix_libdir_bitness(lib_dir, symlink, bitness): |
1578 |
target_dirname = 'lib' + bitness |
1579 |
logger.debug("Trying to symlink libdir '%s' to lib" % (target_dirname, )) |
1580 |
|
1558 |
if [p for p in distutils.sysconfig.get_config_vars().values() |
1581 |
if [p for p in distutils.sysconfig.get_config_vars().values() |
1559 |
if isinstance(p, basestring) and 'lib64' in p]: |
1582 |
if isinstance(p, basestring) and target_dirname in p]: |
1560 |
# PyPy's library path scheme is not affected by this. |
1583 |
# PyPy's library path scheme is not affected by this. |
1561 |
# Return early or we will die on the following assert. |
1584 |
# Return early or we will die on the following assert. |
|
|
1585 |
# Pretend we have succeeded and report the correct bitness back, |
1586 |
# because later on the bitness information is still needed by site.py |
1587 |
# inside the virtualenv, to find the correct system package path. |
1562 |
if is_pypy: |
1588 |
if is_pypy: |
1563 |
logger.debug('PyPy detected, skipping lib64 symlinking') |
1589 |
logger.debug('PyPy detected, skipping %s symlinking' % (target_dirname, )) |
1564 |
return |
1590 |
return True |
1565 |
|
1591 |
|
1566 |
logger.debug('This system uses lib64; symlinking lib64 to lib') |
1592 |
logger.debug('This system uses %s; symlinking %s to lib' % ( |
|
|
1593 |
target_dirname, |
1594 |
target_dirname, |
1595 |
)) |
1567 |
|
1596 |
|
1568 |
assert os.path.basename(lib_dir) == 'python%s' % sys.version[:3], ( |
1597 |
assert os.path.basename(lib_dir) == 'python%s' % sys.version[:3], ( |
1569 |
"Unexpected python lib dir: %r" % lib_dir) |
1598 |
"Unexpected python lib dir: %r" % lib_dir) |
1570 |
lib_parent = os.path.dirname(lib_dir) |
1599 |
lib_parent = os.path.dirname(lib_dir) |
1571 |
top_level = os.path.dirname(lib_parent) |
1600 |
top_level = os.path.dirname(lib_parent) |
1572 |
lib_dir = os.path.join(top_level, 'lib') |
1601 |
lib_dir = os.path.join(top_level, 'lib') |
1573 |
lib64_link = os.path.join(top_level, 'lib64') |
1602 |
target_lib_link = os.path.join(top_level, target_dirname) |
1574 |
assert os.path.basename(lib_parent) == 'lib', ( |
1603 |
assert os.path.basename(lib_parent) == 'lib', ( |
1575 |
"Unexpected parent dir: %r" % lib_parent) |
1604 |
"Unexpected parent dir: %r" % lib_parent) |
1576 |
if os.path.lexists(lib64_link): |
1605 |
if os.path.lexists(target_lib_link): |
1577 |
return |
1606 |
return True |
1578 |
if symlink: |
1607 |
if symlink: |
1579 |
os.symlink('lib', lib64_link) |
1608 |
os.symlink('lib', target_lib_link) |
1580 |
else: |
1609 |
else: |
1581 |
copyfile('lib', lib64_link) |
1610 |
copyfile('lib', target_lib_link) |
|
|
1611 |
# Seems not affected, continue checking |
1612 |
return False |
1582 |
|
1613 |
|
1583 |
def resolve_interpreter(exe): |
1614 |
def resolve_interpreter(exe): |
1584 |
""" |
1615 |
""" |
Lines 1999-2004
n6kJTcsp4tG42yeT7nQbtdUFwgVJjwDSUYEAC8F0dKOTILrlLO/xC70bnNd0Ha97whQ6UkHJYj5H
Link Here
|
1999 |
cA/j+zX4tbtTIfGjujOKpj83aHOgXnIQbvYduNXEC4UMm4T21Bs+GHABuCa7v//LR/TvpjHa7oe7 |
2030 |
cA/j+zX4tbtTIfGjujOKpj83aHOgXnIQbvYduNXEC4UMm4T21Bs+GHABuCa7v//LR/TvpjHa7oe7 |
2000 |
/Grb6lVvHSD7spj5iplBLRKZxxEYGdCbY9LWWC5hBB2voWno6DJUMzfkC3T8KJsWL9umDQY5szPt |
2031 |
/Grb6lVvHSD7spj5iplBLRKZxxEYGdCbY9LWWC5hBB2voWno6DJUMzfkC3T8KJsWL9umDQY5szPt |
2001 |
AVijEPwfucjncQ== |
2032 |
AVijEPwfucjncQ== |
|
|
2033 |
CDKnFwi6c88xITGnRQVv4Ovd1ctjc8CH/I6vLUFC2Z0jyzy7srKjd97zanUnZimmlD6LHrd1LKNa |
2034 |
XFtQ2bIb8lA7JWIDXqzOO2JII+d9f26p7uH8bxijNqaG9Y5hSmL8rJzQtKyiOoW7eTLpTrcRW10g |
2035 |
XCD4CCAdEQiwEExHNloJ21uuuhi/UMbNvKYbsu1TXt/aFZS86XIE99AWfINfuzsV9j+qO6Oo+3OD |
2036 |
NgeqJYfNzTYFt7JoslMltKfe8MGAacB3JPT3f/mI/t2zHNP9cJd3ZFod9dblskeCmeiYqdcikX4c |
2037 |
gJIBuTkmaY3lS3qj47VQDR1thmrmhnyBBiFlt+P99+Qmksk7UxaAUQre/wFK8wT0 |
2002 |
""") |
2038 |
""") |
2003 |
|
2039 |
|
2004 |
##file activate.sh |
2040 |
##file activate.sh |