summarylogtreecommitdiffstats
path: root/0024-MINGW-generalization-of-posix-build-in-sysconfig.py.patch
diff options
context:
space:
mode:
authoratomlong2021-10-23 17:55:22 +0800
committeratomlong2021-10-23 18:06:15 +0800
commit80096c8de4b34ec1ed8f30bb428918cd592b2424 (patch)
treeb48dd1e73de9ea35a4709fb6b93deb16331ec514 /0024-MINGW-generalization-of-posix-build-in-sysconfig.py.patch
parent89a67c05174951d172252b1db96ff93cc4ec4bcd (diff)
downloadaur-mingw-w64-python.tar.gz
update to 3.9.7
Diffstat (limited to '0024-MINGW-generalization-of-posix-build-in-sysconfig.py.patch')
-rw-r--r--0024-MINGW-generalization-of-posix-build-in-sysconfig.py.patch80
1 files changed, 80 insertions, 0 deletions
diff --git a/0024-MINGW-generalization-of-posix-build-in-sysconfig.py.patch b/0024-MINGW-generalization-of-posix-build-in-sysconfig.py.patch
new file mode 100644
index 000000000000..f3e36a97e516
--- /dev/null
+++ b/0024-MINGW-generalization-of-posix-build-in-sysconfig.py.patch
@@ -0,0 +1,80 @@
+From 9cd7f11ee87717152eb4deebdf74217495440b11 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?=
+ <alexey.pawlow@gmail.com>
+Date: Thu, 17 Jun 2021 18:51:38 +0530
+Subject: [PATCH 024/N] MINGW generalization of posix build in sysconfig.py
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Co-authored-by: Алексей <alexey.pawlow@gmail.com>
+---
+ Lib/sysconfig.py | 15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
+index 42de9b3..65cb345 100644
+--- a/Lib/sysconfig.py
++++ b/Lib/sysconfig.py
+@@ -100,6 +100,9 @@ _BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix)
+ _CONFIG_VARS = None
+ _USER_BASE = None
+
++# GCC[mingw*] use posix build system
++_POSIX_BUILD = os.name == 'posix' or \
++ (os.name == "nt" and 'GCC' in sys.version)
+
+ def _safe_realpath(path):
+ try:
+@@ -183,7 +186,7 @@ def _expand_vars(scheme, vars):
+
+
+ def _get_default_scheme():
+- if os.name == 'posix':
++ if _POSIX_BUILD:
+ # the default scheme for posix is posix_prefix
+ return 'posix_prefix'
+ return os.name
+@@ -199,7 +202,7 @@ def _getuserbase():
+ def joinuser(*args):
+ return os.path.expanduser(os.path.join(*args))
+
+- if os.name == "nt":
++ if os.name == "nt" and not _POSIX_BUILD:
+ base = os.environ.get("APPDATA") or "~"
+ return joinuser(base, "Python")
+
+@@ -505,7 +508,7 @@ def parse_config_h(fp, vars=None):
+ def get_config_h_filename():
+ """Return the path of pyconfig.h."""
+ if _PYTHON_BUILD:
+- if os.name == "nt":
++ if os.name == "nt" and not _POSIX_BUILD:
+ inc_dir = os.path.join(_sys_home or _PROJECT_BASE, "PC")
+ else:
+ inc_dir = _sys_home or _PROJECT_BASE
+@@ -577,10 +580,10 @@ def get_config_vars(*args):
+ # sys.abiflags may not be defined on all platforms.
+ _CONFIG_VARS['abiflags'] = ''
+
+- if os.name == 'nt':
++ if os.name == 'nt' and not _POSIX_BUILD:
+ _init_non_posix(_CONFIG_VARS)
+ _CONFIG_VARS['TZPATH'] = ''
+- if os.name == 'posix':
++ if _POSIX_BUILD:
+ _init_posix(_CONFIG_VARS)
+ # For backward compatibility, see issue19555
+ SO = _CONFIG_VARS.get('EXT_SUFFIX')
+@@ -593,7 +596,7 @@ def get_config_vars(*args):
+
+ # Always convert srcdir to an absolute path
+ srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE)
+- if os.name == 'posix':
++ if _POSIX_BUILD:
+ if _PYTHON_BUILD:
+ # If srcdir is a relative path (typically '.' or '..')
+ # then it should be interpreted relative to the directory
+--
+2.33.0
+