Files
MINGW-packages/mingw-w64-python3/0000-make-_sysconfigdata.py-relocatable.patch
Алексей edc01d04d6 Update python to 3.7.0 (#4047)
* Initial python-3.7 port

* python3: Add setup.config.in to remove before patching

* python3: Implement setenv for mingw. Fix building with NT threads. Build
with unicode

* Fix typos

* Fix linking core modules

* Mingw build have exec_prefix

* Remove deprecated patch

* Fix building python and modules. Failing to build readline module and
install not working yet

* More getpath changes and more aggressive path separator conversion

* Fix readline module compilation and linking errors

* python3: By default building with posix threads, NT threads are broken.
Some patches optimization. First buildable commit

* Py_DecodeLocale handle char, not wchar

* Fix building multiprocessing module with posix threads
2018-07-06 09:57:52 +03:00

32 lines
1.3 KiB
Diff

diff -Naur Python-3.7.0-orig/Lib/sysconfig.py Python-3.7.0/Lib/sysconfig.py
--- Python-3.7.0-orig/Lib/sysconfig.py 2018-06-27 06:07:35.000000000 +0300
+++ Python-3.7.0/Lib/sysconfig.py 2018-06-30 11:15:26.083733900 +0300
@@ -251,6 +251,7 @@
# if the expansion uses the name without a prefix.
renamed_variables = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS')
+ done['prefix']='${SYS_PREFIX}'
while len(variables) > 0:
for name in tuple(variables):
value = notdone[name]
@@ -404,6 +405,19 @@
f.write('build_time_vars = ')
pprint.pprint(vars, stream=f)
+ # Now reload the file and replace:
+ replacements = {": '${SYS_PREFIX}'" : ": sys.prefix",
+ ": '${SYS_PREFIX}" : ": sys.prefix + '",
+ "${SYS_PREFIX}'" : "' + sys.prefix",
+ "${SYS_PREFIX}" : "' + sys.prefix + '"}
+
+ contents = open(destfile).read()
+ for rep in replacements.keys():
+ contents = contents.replace(rep, replacements[rep])
+ with open(destfile, 'w', encoding='utf8') as f:
+ f.write('import sys\n')
+ f.write(contents)
+
# Create file used for sys.path fixup -- see Modules/getpath.c
with open('pybuilddir.txt', 'w', encoding='ascii') as f:
f.write(pybuilddir)