Cross-Platform build scripts for audio plugins
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.8KB

  1. Don't copy the whole /bin when symlinking.
  2. Also provide python3.exe for backwards compat.
  3. Unset MSYSTEM, to fix some path comparisons due to os.sep differences.
  4. Skip some msvc build specifics
  5. diff -Naur Python-3.8.0-orig/Lib/venv/__init__.py Python-3.8.0/Lib/venv/__init__.py
  6. --- Python-3.8.0-orig/Lib/venv/__init__.py 2019-10-22 10:05:21.691201800 +0300
  7. +++ Python-3.8.0/Lib/venv/__init__.py 2019-10-22 10:05:25.591208600 +0300
  8. @@ -11,6 +11,7 @@
  9. import sys
  10. import sysconfig
  11. import types
  12. +from sysconfig import _POSIX_BUILD
  13. logger = logging.getLogger(__name__)
  14. @@ -110,7 +111,7 @@
  15. context.executable = executable
  16. context.python_dir = dirname
  17. context.python_exe = exename
  18. - if sys.platform == 'win32':
  19. + if sys.platform == 'win32' and not _POSIX_BUILD:
  20. binname = 'Scripts'
  21. incpath = 'Include'
  22. libpath = os.path.join(env_dir, 'Lib', 'site-packages')
  23. @@ -244,7 +244,7 @@
  24. if not os.path.islink(path):
  25. os.chmod(path, 0o755)
  26. else:
  27. - if self.symlinks:
  28. + if self.symlinks and not _POSIX_BUILD:
  29. # For symlinking, we need a complete copy of the root directory
  30. # If symlinks fail, you'll get unnecessary copies of files, but
  31. # we assume that if you've opted into symlinks on Windows then
  32. @@ -266,7 +267,13 @@
  33. if os.path.lexists(src):
  34. copier(src, os.path.join(binpath, suffix))
  35. - if sysconfig.is_python_build(True):
  36. + if _POSIX_BUILD:
  37. + # copy from python/pythonw so the venvlauncher magic in symlink_or_copy triggers
  38. + copier(os.path.join(dirname, 'python.exe'), os.path.join(binpath, 'python3.exe'))
  39. + copier(os.path.join(dirname, 'python.exe'), os.path.join(binpath, 'python%d.%d.exe' % sys.version_info[:2]))
  40. + copier(os.path.join(dirname, 'pythonw.exe'), os.path.join(binpath, 'python3w.exe'))
  41. +
  42. + if sysconfig.is_python_build(True) and not _POSIX_BUILD:
  43. # copy init.tcl
  44. for root, dirs, files in os.walk(context.python_dir):
  45. if 'init.tcl' in files:
  46. @@ -285,9 +285,11 @@
  47. # We run ensurepip in isolated mode to avoid side effects from
  48. # environment vars, the current directory and anything else
  49. # intended for the global Python environment
  50. + env = os.environ.copy()
  51. + env.pop("MSYSTEM", None)
  52. cmd = [context.env_exe, '-Im', 'ensurepip', '--upgrade',
  53. - '--default-pip']
  54. - subprocess.check_output(cmd, stderr=subprocess.STDOUT)
  55. + '--default-pip']
  56. + subprocess.check_call(cmd, stderr=subprocess.STDOUT, env=env)
  57. def setup_scripts(self, context):
  58. """