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.

42 lines
1.5KB

  1. diff -Naur Python-3.8.0-orig/Lib/sysconfig.py Python-3.8.0/Lib/sysconfig.py
  2. --- Python-3.8.0-orig/Lib/sysconfig.py 2019-10-14 16:34:47.000000000 +0300
  3. +++ Python-3.8.0/Lib/sysconfig.py 2019-10-22 10:00:17.317067000 +0300
  4. @@ -2,6 +2,7 @@
  5. import os
  6. import sys
  7. +import textwrap
  8. from os.path import pardir, realpath
  9. __all__ = [
  10. @@ -405,11 +406,29 @@
  11. os.makedirs(pybuilddir, exist_ok=True)
  12. destfile = os.path.join(pybuilddir, name + '.py')
  13. + replacement = """
  14. + keys_to_replace = [
  15. + 'BINDIR', 'BINLIBDEST', 'CONFINCLUDEDIR',
  16. + 'CONFINCLUDEPY', 'DESTDIRS', 'DESTLIB', 'DESTSHARED',
  17. + 'INCLDIRSTOMAKE', 'INCLUDEDIR', 'INCLUDEPY',
  18. + 'LIBDEST', 'LIBDIR', 'LIBPC', 'LIBPL', 'MACHDESTLIB',
  19. + 'MANDIR', 'SCRIPTDIR', 'datarootdir', 'exec_prefix',
  20. + ]
  21. +
  22. + prefix = build_time_vars['BINDIR'][:-4]
  23. +
  24. + for key in keys_to_replace:
  25. + value = build_time_vars[key]
  26. + build_time_vars[key] = value.replace(prefix, sys.prefix)
  27. + """
  28. +
  29. with open(destfile, 'w', encoding='utf8') as f:
  30. + f.write('import sys\n')
  31. f.write('# system configuration generated and used by'
  32. ' the sysconfig module\n')
  33. f.write('build_time_vars = ')
  34. pprint.pprint(vars, stream=f)
  35. + f.write('\n%s' % textwrap.dedent(replacement))
  36. # Create file used for sys.path fixup -- see Modules/getpath.c
  37. with open('pybuilddir.txt', 'w', encoding='utf8') as f: