python: patch "nt" scheme again

This commit is contained in:
Christoph Reiter
2026-01-09 13:05:59 +01:00
parent 0f201a34b4
commit 70f2ba8aa4
2 changed files with 35 additions and 4 deletions

View File

@@ -0,0 +1,28 @@
From 0796b35fb89ff06c2ffc13256832c7de45bda77d Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Fri, 9 Jan 2026 12:25:11 +0100
Subject: [PATCH 103/N] sysconfig: patch nt schemes again
setuptools doesn't play along
---
Lib/sysconfig/__init__.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py
index fb40ef6..08892ea 100644
--- a/Lib/sysconfig/__init__.py
+++ b/Lib/sysconfig/__init__.py
@@ -167,6 +167,13 @@ if _HAS_USER_BASE:
},
}
+# XXX: setuptools uses os.name to select the scheme and doesn't use
+# sysconfig, we have to monkey patch the 'nt' scheme for mingw builds
+# until that is fixed
+if os.name == 'nt' and sys._is_mingw:
+ _INSTALL_SCHEMES['nt'] = _INSTALL_SCHEMES['posix_prefix']
+ _INSTALL_SCHEMES['nt_user'] = _INSTALL_SCHEMES['posix_user']
+
_SCHEME_KEYS = ('stdlib', 'platstdlib', 'purelib', 'platlib', 'include',
'scripts', 'data')

View File

@@ -23,7 +23,7 @@ else
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}${_pybasever}")
fi
pkgver=${_pybasever}.11
pkgrel=3
pkgrel=4
pkgdesc="A high-level scripting language (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
@@ -157,7 +157,8 @@ source=("https://www.python.org/ftp/python/${pkgver%rc?}/Python-${pkgver}.tar.xz
0099-pycore_time-fix-missing-timeval.patch
0100-mmapmodule-define-DONT_USE_SEH.patch
0101-build-Add-ABIFLAGS-to-targets-when-needed.patch
0102-getcompiler-include-GCC-in-sys.version-even-for-clan.patch)
0102-getcompiler-include-GCC-in-sys.version-even-for-clan.patch
0103-sysconfig-patch-nt-schemes-again.patch)
# Helper macros to help make tasks easier #
apply_patch_with_msg() {
@@ -272,7 +273,8 @@ prepare() {
0099-pycore_time-fix-missing-timeval.patch \
0100-mmapmodule-define-DONT_USE_SEH.patch \
0101-build-Add-ABIFLAGS-to-targets-when-needed.patch \
0102-getcompiler-include-GCC-in-sys.version-even-for-clan.patch
0102-getcompiler-include-GCC-in-sys.version-even-for-clan.patch \
0103-sysconfig-patch-nt-schemes-again.patch
autoreconf -vfi
}
@@ -479,4 +481,5 @@ sha256sums=('16ede7bb7cdbfa895d11b0642fa0e523f291e6487194d53cf6d3b338c3a17ea2'
'00345500847abe3587df2e8bcca0be89553c47c58551798441913cf42d507935'
'a2ec1610a1a9169510ef4c69905e9754f646d2d81981617738ca8a1bd8f4c417'
'75f7ae3fb9aa689319c23230dc29b368394d3d92c8241fb9845efcf4cf167ceb'
'a31b9a6643703f653b22e216a1e218377512d8e689f86538b039d3bf5cdb2c65')
'a31b9a6643703f653b22e216a1e218377512d8e689f86538b039d3bf5cdb2c65'
'3eab4c42429fb7f82cf059cc16da06f2ba54fd2ee8a6543fec8379655c59a508')