summarylogtreecommitdiffstats
path: root/0090-distutils-generalization-of-posix-build-in-distutils.patch
diff options
context:
space:
mode:
authoratomlong2021-10-23 17:55:22 +0800
committeratomlong2021-10-23 18:06:15 +0800
commit80096c8de4b34ec1ed8f30bb428918cd592b2424 (patch)
treeb48dd1e73de9ea35a4709fb6b93deb16331ec514 /0090-distutils-generalization-of-posix-build-in-distutils.patch
parent89a67c05174951d172252b1db96ff93cc4ec4bcd (diff)
downloadaur-mingw-w64-python.tar.gz
update to 3.9.7
Diffstat (limited to '0090-distutils-generalization-of-posix-build-in-distutils.patch')
-rw-r--r--0090-distutils-generalization-of-posix-build-in-distutils.patch95
1 files changed, 95 insertions, 0 deletions
diff --git a/0090-distutils-generalization-of-posix-build-in-distutils.patch b/0090-distutils-generalization-of-posix-build-in-distutils.patch
new file mode 100644
index 000000000000..9a66e7e3483b
--- /dev/null
+++ b/0090-distutils-generalization-of-posix-build-in-distutils.patch
@@ -0,0 +1,95 @@
+From 24eed4bff46abb9913a9869684eef985161155a3 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:41 +0530
+Subject: [PATCH 090/N] distutils: generalization of posix build in distutils
+ sys
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Co-authored-by: Алексей <alexey.pawlow@gmail.com>
+---
+ Lib/distutils/sysconfig.py | 24 +++++++++++++++++++-----
+ 1 file changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index bbe8e3c..80d3523 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -64,6 +64,17 @@ def _python_build():
+ python_build = _python_build()
+
+
++def _posix_build():
++ # GCC[mingw*] use posix build system
++ # Check for cross builds explicitly
++ host_platform = os.environ.get("_PYTHON_HOST_PLATFORM")
++ if host_platform:
++ if host_platform.startswith('mingw'):
++ return True
++ return os.name == 'posix' or \
++ (os.name == "nt" and 'GCC' in sys.version)
++posix_build = _posix_build()
++
+ # Calculate the build qualifier flags if they are defined. Adding the flags
+ # to the include and lib directories only makes sense for an installation, not
+ # an in-source build.
+@@ -97,7 +108,7 @@ def get_python_inc(plat_specific=0, prefix=None):
+ """
+ if prefix is None:
+ prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
+- if os.name == "posix":
++ if posix_build:
+ if python_build:
+ # Assume the executable is in the build directory. The
+ # pyconfig.h file should be in the same directory. Since
+@@ -144,7 +155,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
+ else:
+ prefix = plat_specific and EXEC_PREFIX or PREFIX
+
+- if os.name == "posix":
++ if posix_build:
+ if plat_specific or standard_lib:
+ # Platform-specific modules (any module from a non-pure-Python
+ # module distribution) or standard Python library modules.
+@@ -261,7 +272,7 @@ def customize_compiler(compiler):
+ def get_config_h_filename():
+ """Return full pathname of installed pyconfig.h file."""
+ 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
+@@ -467,6 +478,9 @@ def _init_posix():
+
+
+ def _init_nt():
++ if posix_build:
++ _init_posix()
++ return
+ """Initialize the module as appropriate for NT"""
+ g = {}
+ # set basic install directories
+@@ -516,7 +530,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
+@@ -535,7 +549,7 @@ def get_config_vars(*args):
+ # Normally it is relative to the build directory. However, during
+ # testing, for example, we might be running a non-installed python
+ # from a different directory.
+- if python_build and os.name == "posix":
++ if python_build and posix_build:
+ base = project_base
+ if (not os.path.isabs(_config_vars['srcdir']) and
+ base != os.getcwd()):
+--
+2.33.0
+