Sophie

Sophie

distrib > Mageia > 9 > armv7hl > media > core-release-src > by-pkgid > d8c679353daa984effd8ef75a56451e3 > files > 13

mingw-python3-3.10.9-1.mga9.src.rpm

diff -rupN --no-dereference Python-3.10.9/Lib/sysconfig.py Python-3.10.9-new/Lib/sysconfig.py
--- Python-3.10.9/Lib/sysconfig.py	2022-12-08 09:36:58.779024848 +0100
+++ Python-3.10.9-new/Lib/sysconfig.py	2022-12-08 09:36:58.784024848 +0100
@@ -2,6 +2,7 @@
 
 import os
 import sys
+import textwrap
 from os.path import pardir, realpath
 
 __all__ = [
@@ -460,11 +461,29 @@ def _generate_posix_vars():
     os.makedirs(pybuilddir, exist_ok=True)
     destfile = os.path.join(pybuilddir, name + '.py')
 
+    replacement = """
+        keys_to_replace = [
+            'BINDIR', 'BINLIBDEST', 'CONFINCLUDEDIR',
+            'CONFINCLUDEPY', 'DESTDIRS', 'DESTLIB', 'DESTSHARED',
+            'INCLDIRSTOMAKE', 'INCLUDEDIR', 'INCLUDEPY',
+            'LIBDEST', 'LIBDIR', 'LIBPC', 'LIBPL', 'MACHDESTLIB',
+            'MANDIR', 'SCRIPTDIR', 'datarootdir', 'exec_prefix',
+        ]
+
+        prefix = build_time_vars['BINDIR'][:-4]
+
+        for key in keys_to_replace:
+            value = build_time_vars[key]
+            build_time_vars[key] = value.replace(prefix, sys.prefix)
+    """
+
     with open(destfile, 'w', encoding='utf8') as f:
+        f.write('import sys\n')
         f.write('# system configuration generated and used by'
                 ' the sysconfig module\n')
         f.write('build_time_vars = ')
         pprint.pprint(vars, stream=f)
+        f.write('\n%s' % textwrap.dedent(replacement))
 
     # Create file used for sys.path fixup -- see Modules/getpath.c
     with open('pybuilddir.txt', 'w', encoding='utf8') as f: