python-virtualenv: More changes for mingw python support
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
diff -Naur virtualenv-16.1.0-orig/src/virtualenv.py virtualenv-16.1.0/src/virtualenv.py
|
||||
--- virtualenv-16.1.0-orig/src/virtualenv.py 2018-10-31 18:06:44.000000000 +0300
|
||||
+++ virtualenv-16.1.0/src/virtualenv.py 2019-06-19 11:57:28.507377600 +0300
|
||||
+++ virtualenv-16.1.0/src/virtualenv.py 2019-06-20 10:53:09.878842500 +0300
|
||||
@@ -57,6 +57,7 @@
|
||||
is_jython = sys.platform.startswith("java")
|
||||
is_pypy = hasattr(sys, "pypy_version_info")
|
||||
@@ -36,7 +36,22 @@ diff -Naur virtualenv-16.1.0-orig/src/virtualenv.py virtualenv-16.1.0/src/virtua
|
||||
if is_jython:
|
||||
lib_dir = join(home_dir, "Lib")
|
||||
inc_dir = join(home_dir, "Include")
|
||||
@@ -1197,7 +1203,7 @@
|
||||
@@ -1156,8 +1162,12 @@
|
||||
""" copy tcl/tk libraries on Windows (issue #93) """
|
||||
for libversion in "8.5", "8.6":
|
||||
for libname in "tcl", "tk":
|
||||
- srcdir = join(src, "tcl", libname + libversion)
|
||||
- destdir = join(dest, "tcl", libname + libversion)
|
||||
+ if is_mingw:
|
||||
+ srcdir = join(src, "lib", libname + libversion)
|
||||
+ destdir = join(dest, "lib", libname + libversion)
|
||||
+ else:
|
||||
+ srcdir = join(src, "tcl", libname + libversion)
|
||||
+ destdir = join(dest, "tcl", libname + libversion)
|
||||
# Only copy the dirs from the above combinations that exist
|
||||
if os.path.exists(srcdir) and not os.path.exists(destdir):
|
||||
copyfileordir(srcdir, destdir, symlink)
|
||||
@@ -1197,7 +1207,7 @@
|
||||
mkdir(lib_dir)
|
||||
fix_lib64(lib_dir, symlink)
|
||||
stdlib_dirs = [os.path.dirname(os.__file__)]
|
||||
@@ -45,7 +60,16 @@ diff -Naur virtualenv-16.1.0-orig/src/virtualenv.py virtualenv-16.1.0/src/virtua
|
||||
stdlib_dirs.append(join(os.path.dirname(stdlib_dirs[0]), "DLLs"))
|
||||
elif is_darwin:
|
||||
stdlib_dirs.append(join(stdlib_dirs[0], "site-packages"))
|
||||
@@ -1263,7 +1269,7 @@
|
||||
@@ -1238,7 +1248,7 @@
|
||||
if not site_packages:
|
||||
writefile(site_packages_filename, "")
|
||||
|
||||
- if is_pypy or is_win:
|
||||
+ if (is_pypy or is_win) and not is_mingw:
|
||||
stdinc_dir = join(prefix, "include")
|
||||
else:
|
||||
stdinc_dir = join(prefix, "include", py_version + abiflags)
|
||||
@@ -1263,7 +1273,7 @@
|
||||
|
||||
# pypy never uses exec_prefix, just ignore it
|
||||
if sys.exec_prefix != prefix and not is_pypy:
|
||||
@@ -54,16 +78,38 @@ diff -Naur virtualenv-16.1.0-orig/src/virtualenv.py virtualenv-16.1.0/src/virtua
|
||||
exec_dir = join(sys.exec_prefix, "lib")
|
||||
elif is_jython:
|
||||
exec_dir = join(sys.exec_prefix, "Lib")
|
||||
@@ -1365,7 +1371,11 @@
|
||||
@@ -1338,10 +1348,16 @@
|
||||
py_executable_dlls = [
|
||||
("python%s.dll" % (sys.version_info[0]), "python%s_d.dll" % (sys.version_info[0])),
|
||||
(
|
||||
+ "libpython{}.{}{}.dll".format(sys.version_info[0], sys.version_info[1], sys.abiflags),
|
||||
+ "libpython{}.{}{}_d.dll".format(sys.version_info[0], sys.version_info[1], sys.abiflags),
|
||||
+ ),
|
||||
+ (
|
||||
"python{}{}.dll".format(sys.version_info[0], sys.version_info[1]),
|
||||
"python{}{}_d.dll".format(sys.version_info[0], sys.version_info[1]),
|
||||
),
|
||||
]
|
||||
+ if is_mingw:
|
||||
+ py_executable_dlls += [ ("libwinpthread-1.dll", "libwinpthread-1d.dll"), ]
|
||||
|
||||
for py_executable_dll, py_executable_dll_d in py_executable_dlls:
|
||||
pythondll = os.path.join(os.path.dirname(sys.executable), py_executable_dll)
|
||||
@@ -1365,8 +1381,15 @@
|
||||
copyfile(py_executable, python_executable, symlink)
|
||||
|
||||
if is_win:
|
||||
- for name in ["libexpat.dll", "libeay32.dll", "ssleay32.dll", "sqlite3.dll", "tcl85.dll", "tk85.dll"]:
|
||||
- src = join(prefix, name)
|
||||
+ if is_mingw:
|
||||
+ dllstocopy = ["libexpat-1.dll", "libcrypto-1_1.dll", "libssl-1_1.dll", "libsqlite3-0.dll", "tcl86.dll", "tk86.dll"]
|
||||
+ else:
|
||||
+ dllstocopy = ["libexpat.dll", "libeay32.dll", "ssleay32.dll", "sqlite3.dll", "tcl85.dll", "tk85.dll"]
|
||||
+ for name in dllstocopy:
|
||||
src = join(prefix, name)
|
||||
+ if is_mingw:
|
||||
+ src = join(prefix + "\\bin", name)
|
||||
+ else:
|
||||
+ src = join(prefix, name)
|
||||
if os.path.exists(src):
|
||||
copyfile(src, join(bin_dir, name), symlink)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user