From 4b833c89ead5d1fd30c976b42cbabd456320d41c Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Thu, 17 Jun 2021 23:06:55 +0530 Subject: [PATCH 1/2] python3.9: autogenerate patches from git https://github.com/msys2-contrib/cpython-mingw this is a similar setup to msys2-runtime --- mingw-w64-python3.9/.gitignore | 1 + ...-make-_sysconfigdata.py-relocatable.patch} | 26 +- .../0002-restore-setup-config.patch | 80 ++- ...0003-MINGW-BASE-use-NT-thread-model.patch} | 87 ++- ...gcc-internal-defines-to-python-platf.patch | 44 ++ ...gure-MACHDEP-and-platform-for-build.patch} | 62 +- ...006-MINGW-preset-configure-defaults.patch} | 97 ++- ...largefile-support-for-windows-builds.patch | 43 ++ ...008-MINGW-add-srcdir-PC-to-CPPFLAGS.patch} | 26 +- ...tch => 0009-MINGW-init-system-calls.patch} | 107 +-- ...NGW-build-in-windows-modules-winreg.patch} | 73 +- ...etermine-if-pwdmodule-should-be-used.patch | 65 ++ ...er-customize-mingw-cygwin-compilers.patch} | 28 +- ...013-MINGW-compiler-enable-new-dtags.patch} | 26 +- ...Mingw-recognition-to-pyport.h-to-al.patch} | 42 +- ...15-MINGW-configure-for-shared-build.patch} | 32 +- ... 0016-MINGW-dynamic-loading-support.patch} | 122 ++-- ...nore-main-program-for-frozen-scripts.patch | 52 ++ ...-MINGW-setup-_multiprocessing-module.patch | 34 + ...h => 0019-MINGW-setup-select-module.patch} | 38 +- ...up-_ctypes-module-with-system-libffi.patch | 45 ++ ...t-winsock2-and-setup-_socket-module.patch} | 138 ++-- ...022-MINGW-exclude-unix-only-modules.patch} | 32 +- ...GW-setup-msvcrt-and-_winapi-modules.patch} | 50 +- ...024-MINGW-build-extensions-with-GCC.patch} | 48 +- ...CCompiler-as-default-compiler-for-m.patch} | 40 +- .../0026-MINGW-find-import-library.patch | 29 + .../0027-MINGW-setup-_ssl-module.patch | 30 + ...tion-of-posix-build-in-sysconfig.py.patch} | 36 +- ...-support-stdcall-without-underscore.patch} | 38 +- ...ead-rename-to-avoid-failure-on-windo.patch | 31 + ...ular-dependency-from-time-module-dur.patch | 37 + ...ion-of-posix-build-in-distutils-sys.patch} | 38 +- ....patch => 0033-MINGW-customize-site.patch} | 35 +- ....patch => 0034-add-python-config-sh.patch} | 33 +- ....patch => 0035-cross-darwin-feature.patch} | 42 +- ...36-py3k-mingw-ntthreads-vs-pthreads.patch} | 35 +- .../0037-mingw-system-libffi.patch | 30 + ...ys-mingw-prefer-unix-sep-if-MSYSTEM.patch} | 114 ++-- ...tch => 0039-mingw-use-posix-getpath.patch} | 157 +++-- ...ingw-add-ModuleFileName-dir-to-PATH.patch} | 26 +- ...dd-BUILDIN_WIN32_MODULEs-time-msvcrt.patch | 27 + ...-cygwin-semi-native-build-sysconfig.patch} | 100 +-- ... => 0043-mingw-sysconfig-like-posix.patch} | 40 +- ...builtin_for_Popen_in_cygwinccompile.patch} | 51 +- ...d-multiarch-paths-if-cross-compiling.patch | 33 + ...ngw-use-backslashes-in-compileall-py.patch | 30 + ...msys-convert_path-fix-and-root-hack.patch} | 54 +- ...tk.patch => 0048-allow-static-tcltk.patch} | 32 +- .../0049-mingw-pdcurses_ISPAD.patch | 35 + mingw-w64-python3.9/0050-grammar-fixes.patch | 45 ++ ...-fixes.patch => 0051-builddir-fixes.patch} | 39 +- ...ys-monkeypatch-os-system-via-sh-exe.patch} | 26 +- ...lace-slashes-used-in-io-redirection.patch} | 35 +- ... 0054-mingw-install-layout-as-posix.patch} | 28 +- .../0055-remove_path_max.default.patch | 29 + .../0056-dont-link-with-gettext.patch | 60 ++ .../0057-ctypes-python-dll.patch | 33 + .../0058-gdbm-module-includes.patch | 30 + ...ch => 0059-use-gnu_printf-in-format.patch} | 79 ++- ...w-fix-ssl-dont-use-enum_certificates.patch | 39 ++ .../0061-mingw-build-optimized-ext.patch | 34 + ...mpiler-dont-strip-modules-if-pydebug.patch | 29 + ...fix-using-dllhandle-and-winver-mingw.patch | 39 ++ ...0064-mingw-add-LIBPL-to-library-dirs.patch | 26 + ...config-so-msvccompiler-get_build_ve.patch} | 21 +- ...6-MINGW-link-with-additional-library.patch | 33 + mingw-w64-python3.9/0067-install-msilib.patch | 30 + ...068-dont-include-system-ncurses-path.patch | 36 + .../0069-fix-signal-module-build.patch | 29 + .../0070-build-winconsoleio.patch | 29 + .../0071-expose-sem_unlink.patch | 29 + ...-isatty.patch => 0072-cygpty-isatty.patch} | 131 ++-- .../0073-disable-broken-gdbm-module.patch | 29 + ...in-resource-files-and-build-pythonw.patch} | 100 +-- .../0075-3.7-mpdec-mingw.patch | 26 + .../0076-disable-readline.patch | 32 + .../0077-fix-isselectable.patch | 29 + ...78-use-_wcsnicmp-instead-wcsncasecmp.patch | 26 + .../0079-_xxsubinterpretersmodule.patch | 26 + ...atch => 0080-sqlite3-module-defines.patch} | 20 +- .../0081-configure-have-inet-pton.patch | 35 + .../0082-fix-msvc9-import.patch | 38 ++ .../0083-set-venv-activate-path-unix.patch | 29 + ...s.patch => 0084-venv-creation-fixes.patch} | 35 +- .../0085-pass-gen-profile-ldflags.patch | 29 + ...utils-add-windmc-to-cygwinccompiler.patch} | 24 +- ...indows-must-link-ext-with-python-lib.patch | 38 ++ .../0088-importlib-bootstrap-path-sep.patch | 31 + .../0089-pathlib-path-sep.patch | 25 + ...-fixes.patch => 0090-warnings-fixes.patch} | 82 ++- .../0091-fix-build-testinternalcapi.patch | 28 + .../0092-extend-MS_WINDOWS-flag.patch | 25 + ...ang-arm64.patch => 0093-clang-arm64.patch} | 43 +- .../0094-MINGW-stack-reserve.patch | 28 + ...dd-support-for-Windows-7-Python-3.9.patch} | 17 +- ...gcc-internal-defines-to-python-platf.patch | 25 - ...largefile-support-for-windows-builds.patch | 24 - ...etermine-if-pwdmodule-should-be-used.patch | 42 -- ...nore-main-program-for-frozen-scripts.patch | 32 - ...-MINGW-setup-_multiprocessing-module.patch | 16 - ...up-_ctypes-module-with-system-libffi.patch | 26 - .../0430-MINGW-find-import-library.patch | 11 - .../0440-MINGW-setup-_ssl-module.patch | 12 - ...ead-rename-to-avoid-failure-on-windo.patch | 12 - ...ular-dependency-from-time-module-dur.patch | 19 - .../0530-mingw-system-libffi.patch | 12 - ...dd-BUILDIN_WIN32_MODULEs-time-msvcrt.patch | 9 - ...d-multiarch-paths-if-cross-compiling.patch | 15 - ...ngw-use-backslashes-in-compileall-py.patch | 12 - .../0720-mingw-pdcurses_ISPAD.patch | 17 - mingw-w64-python3.9/0740-grammar-fixes.patch | 25 - .../0810-remove_path_max.default.patch | 11 - .../0820-dont-link-with-gettext.patch | 40 -- .../0830-ctypes-python-dll.patch | 14 - .../0840-gdbm-module-includes.patch | 12 - ...w-fix-ssl-dont-use-enum_certificates.patch | 21 - .../0890-mingw-build-optimized-ext.patch | 16 - ...mpiler-dont-strip-modules-if-pydebug.patch | 12 - ...fix-using-dllhandle-and-winver-mingw.patch | 21 - ...0920-mingw-add-LIBPL-to-library-dirs.patch | 12 - ...0-MINGW-link-with-additional-library.patch | 19 - mingw-w64-python3.9/1010-install-msilib.patch | 11 - ...060-dont-include-system-ncurses-path.patch | 22 - .../1620-fix-signal-module-build.patch | 12 - .../1630-build-winconsoleio.patch | 12 - .../1650-expose-sem_unlink.patch | 12 - .../1701-disable-broken-gdbm-module.patch | 12 - .../1810-3.7-mpdec-mingw.patch | 12 - .../1850-disable-readline.patch | 15 - .../1860-fix-isselectable.patch | 12 - ...70-use-_wcsnicmp-instead-wcsncasecmp.patch | 12 - .../1890-_xxsubinterpretersmodule.patch | 11 - .../2010-configure-have-inet-pton.patch | 18 - .../2030-fix-msvc9-import.patch | 21 - .../2051-set-venv-activate-path-unix.patch | 12 - .../2060-pass-gen-profile-ldflags.patch | 12 - ...indows-must-link-ext-with-python-lib.patch | 20 - .../3000-importlib-bootstrap-path-sep.patch | 13 - .../3001-pathlib-path-sep.patch | 11 - .../3011-fix-build-testinternalcapi.patch | 14 - .../3020-extend-MS_WINDOWS-flag.patch | 11 - .../4010-MINGW-stack-reserve.patch | 14 - mingw-w64-python3.9/PKGBUILD | 638 ++++++++---------- mingw-w64-python3.9/README.md | 4 + mingw-w64-python3.9/update-patches.sh | 75 ++ 146 files changed, 3774 insertions(+), 1974 deletions(-) create mode 100644 mingw-w64-python3.9/.gitignore rename mingw-w64-python3.9/{0000-make-_sysconfigdata.py-relocatable.patch => 0001-make-_sysconfigdata.py-relocatable.patch} (64%) rename mingw-w64-python3.9/{0100-MINGW-BASE-use-NT-thread-model.patch => 0003-MINGW-BASE-use-NT-thread-model.patch} (77%) create mode 100644 mingw-w64-python3.9/0004-MINGW-translate-gcc-internal-defines-to-python-platf.patch rename mingw-w64-python3.9/{0130-MINGW-configure-MACHDEP-and-platform-for-build.patch => 0005-MINGW-configure-MACHDEP-and-platform-for-build.patch} (58%) rename mingw-w64-python3.9/{0140-MINGW-preset-configure-defaults.patch => 0006-MINGW-preset-configure-defaults.patch} (54%) create mode 100644 mingw-w64-python3.9/0007-MINGW-configure-largefile-support-for-windows-builds.patch rename mingw-w64-python3.9/{0170-MINGW-add-srcdir-PC-to-CPPFLAGS.patch => 0008-MINGW-add-srcdir-PC-to-CPPFLAGS.patch} (50%) rename mingw-w64-python3.9/{0180-MINGW-init-system-calls.patch => 0009-MINGW-init-system-calls.patch} (63%) rename mingw-w64-python3.9/{0200-MINGW-build-in-windows-modules-winreg.patch => 0010-MINGW-build-in-windows-modules-winreg.patch} (52%) create mode 100644 mingw-w64-python3.9/0011-MINGW-determine-if-pwdmodule-should-be-used.patch rename mingw-w64-python3.9/{0250-MINGW-compiler-customize-mingw-cygwin-compilers.patch => 0012-MINGW-compiler-customize-mingw-cygwin-compilers.patch} (66%) rename mingw-w64-python3.9/{0260-MINGW-compiler-enable-new-dtags.patch => 0013-MINGW-compiler-enable-new-dtags.patch} (50%) rename mingw-w64-python3.9/{0290-issue6672-v2-Add-Mingw-recognition-to-pyport.h-to-al.patch => 0014-issue6672-v2-Add-Mingw-recognition-to-pyport.h-to-al.patch} (70%) rename mingw-w64-python3.9/{0300-MINGW-configure-for-shared-build.patch => 0015-MINGW-configure-for-shared-build.patch} (59%) rename mingw-w64-python3.9/{0310-MINGW-dynamic-loading-support.patch => 0016-MINGW-dynamic-loading-support.patch} (54%) create mode 100644 mingw-w64-python3.9/0017-MINGW-ignore-main-program-for-frozen-scripts.patch create mode 100644 mingw-w64-python3.9/0018-MINGW-setup-_multiprocessing-module.patch rename mingw-w64-python3.9/{0360-MINGW-setup-select-module.patch => 0019-MINGW-setup-select-module.patch} (51%) create mode 100644 mingw-w64-python3.9/0020-MINGW-setup-_ctypes-module-with-system-libffi.patch rename mingw-w64-python3.9/{0380-MINGW-defect-winsock2-and-setup-_socket-module.patch => 0021-MINGW-defect-winsock2-and-setup-_socket-module.patch} (68%) rename mingw-w64-python3.9/{0390-MINGW-exclude-unix-only-modules.patch => 0022-MINGW-exclude-unix-only-modules.patch} (75%) rename mingw-w64-python3.9/{0400-MINGW-setup-msvcrt-and-_winapi-modules.patch => 0023-MINGW-setup-msvcrt-and-_winapi-modules.patch} (59%) rename mingw-w64-python3.9/{0410-MINGW-build-extensions-with-GCC.patch => 0024-MINGW-build-extensions-with-GCC.patch} (59%) rename mingw-w64-python3.9/{0420-MINGW-use-Mingw32CCompiler-as-default-compiler-for-m.patch => 0025-MINGW-use-Mingw32CCompiler-as-default-compiler-for-m.patch} (61%) create mode 100644 mingw-w64-python3.9/0026-MINGW-find-import-library.patch create mode 100644 mingw-w64-python3.9/0027-MINGW-setup-_ssl-module.patch rename mingw-w64-python3.9/{0460-MINGW-generalization-of-posix-build-in-sysconfig.py.patch => 0028-MINGW-generalization-of-posix-build-in-sysconfig.py.patch} (64%) rename mingw-w64-python3.9/{0462-MINGW-support-stdcall-without-underscore.patch => 0029-MINGW-support-stdcall-without-underscore.patch} (59%) create mode 100644 mingw-w64-python3.9/0030-use-replace-instead-rename-to-avoid-failure-on-windo.patch create mode 100644 mingw-w64-python3.9/0031-MINGW-avoid-circular-dependency-from-time-module-dur.patch rename mingw-w64-python3.9/{0480-MINGW-generalization-of-posix-build-in-distutils-sys.patch => 0032-MINGW-generalization-of-posix-build-in-distutils-sys.patch} (69%) rename mingw-w64-python3.9/{0490-MINGW-customize-site.patch => 0033-MINGW-customize-site.patch} (56%) rename mingw-w64-python3.9/{0500-add-python-config-sh.patch => 0034-add-python-config-sh.patch} (82%) rename mingw-w64-python3.9/{0510-cross-darwin-feature.patch => 0035-cross-darwin-feature.patch} (73%) rename mingw-w64-python3.9/{0520-py3k-mingw-ntthreads-vs-pthreads.patch => 0036-py3k-mingw-ntthreads-vs-pthreads.patch} (51%) create mode 100644 mingw-w64-python3.9/0037-mingw-system-libffi.patch rename mingw-w64-python3.9/{0555-msys-mingw-prefer-unix-sep-if-MSYSTEM.patch => 0038-msys-mingw-prefer-unix-sep-if-MSYSTEM.patch} (76%) rename mingw-w64-python3.9/{0560-mingw-use-posix-getpath.patch => 0039-mingw-use-posix-getpath.patch} (73%) rename mingw-w64-python3.9/{0565-mingw-add-ModuleFileName-dir-to-PATH.patch => 0040-mingw-add-ModuleFileName-dir-to-PATH.patch} (65%) create mode 100644 mingw-w64-python3.9/0041-mingw-add-BUILDIN_WIN32_MODULEs-time-msvcrt.patch rename mingw-w64-python3.9/{0610-msys-cygwin-semi-native-build-sysconfig.patch => 0042-msys-cygwin-semi-native-build-sysconfig.patch} (73%) rename mingw-w64-python3.9/{0620-mingw-sysconfig-like-posix.patch => 0043-mingw-sysconfig-like-posix.patch} (71%) rename mingw-w64-python3.9/{0630-mingw-_winapi_as_builtin_for_Popen_in_cygwinccompiler.patch => 0044-mingw-_winapi_as_builtin_for_Popen_in_cygwinccompile.patch} (58%) create mode 100644 mingw-w64-python3.9/0045-cross-dont-add-multiarch-paths-if-cross-compiling.patch create mode 100644 mingw-w64-python3.9/0046-mingw-use-backslashes-in-compileall-py.patch rename mingw-w64-python3.9/{0670-msys-convert_path-fix-and-root-hack.patch => 0047-msys-convert_path-fix-and-root-hack.patch} (66%) rename mingw-w64-python3.9/{0690-allow-static-tcltk.patch => 0048-allow-static-tcltk.patch} (80%) create mode 100644 mingw-w64-python3.9/0049-mingw-pdcurses_ISPAD.patch create mode 100644 mingw-w64-python3.9/0050-grammar-fixes.patch rename mingw-w64-python3.9/{0750-builddir-fixes.patch => 0051-builddir-fixes.patch} (63%) rename mingw-w64-python3.9/{0760-msys-monkeypatch-os-system-via-sh-exe.patch => 0052-msys-monkeypatch-os-system-via-sh-exe.patch} (50%) rename mingw-w64-python3.9/{0770-msys-replace-slashes-used-in-io-redirection.patch => 0053-msys-replace-slashes-used-in-io-redirection.patch} (71%) rename mingw-w64-python3.9/{0800-mingw-install-layout-as-posix.patch => 0054-mingw-install-layout-as-posix.patch} (53%) create mode 100644 mingw-w64-python3.9/0055-remove_path_max.default.patch create mode 100644 mingw-w64-python3.9/0056-dont-link-with-gettext.patch create mode 100644 mingw-w64-python3.9/0057-ctypes-python-dll.patch create mode 100644 mingw-w64-python3.9/0058-gdbm-module-includes.patch rename mingw-w64-python3.9/{0850-use-gnu_printf-in-format.patch => 0059-use-gnu_printf-in-format.patch} (58%) create mode 100644 mingw-w64-python3.9/0060-mingw-fix-ssl-dont-use-enum_certificates.patch create mode 100644 mingw-w64-python3.9/0061-mingw-build-optimized-ext.patch create mode 100644 mingw-w64-python3.9/0062-cygwinccompiler-dont-strip-modules-if-pydebug.patch create mode 100644 mingw-w64-python3.9/0063-fix-using-dllhandle-and-winver-mingw.patch create mode 100644 mingw-w64-python3.9/0064-mingw-add-LIBPL-to-library-dirs.patch rename mingw-w64-python3.9/{0970-Add-AMD64-to-sys-config-so-msvccompiler-get_build_version-works.patch => 0065-Add-AMD64-to-sys-config-so-msvccompiler-get_build_ve.patch} (58%) create mode 100644 mingw-w64-python3.9/0066-MINGW-link-with-additional-library.patch create mode 100644 mingw-w64-python3.9/0067-install-msilib.patch create mode 100644 mingw-w64-python3.9/0068-dont-include-system-ncurses-path.patch create mode 100644 mingw-w64-python3.9/0069-fix-signal-module-build.patch create mode 100644 mingw-w64-python3.9/0070-build-winconsoleio.patch create mode 100644 mingw-w64-python3.9/0071-expose-sem_unlink.patch rename mingw-w64-python3.9/{1700-cygpty-isatty.patch => 0072-cygpty-isatty.patch} (77%) create mode 100644 mingw-w64-python3.9/0073-disable-broken-gdbm-module.patch rename mingw-w64-python3.9/{1800-link-win-resource-files-and-build-pythonw.patch => 0074-link-win-resource-files-and-build-pythonw.patch} (75%) create mode 100644 mingw-w64-python3.9/0075-3.7-mpdec-mingw.patch create mode 100644 mingw-w64-python3.9/0076-disable-readline.patch create mode 100644 mingw-w64-python3.9/0077-fix-isselectable.patch create mode 100644 mingw-w64-python3.9/0078-use-_wcsnicmp-instead-wcsncasecmp.patch create mode 100644 mingw-w64-python3.9/0079-_xxsubinterpretersmodule.patch rename mingw-w64-python3.9/{1891-sqlite3-module-defines.patch => 0080-sqlite3-module-defines.patch} (52%) create mode 100644 mingw-w64-python3.9/0081-configure-have-inet-pton.patch create mode 100644 mingw-w64-python3.9/0082-fix-msvc9-import.patch create mode 100644 mingw-w64-python3.9/0083-set-venv-activate-path-unix.patch rename mingw-w64-python3.9/{2052-venv-creation-fixes.patch => 0084-venv-creation-fixes.patch} (77%) create mode 100644 mingw-w64-python3.9/0085-pass-gen-profile-ldflags.patch rename mingw-w64-python3.9/{2070-distutils-add-windmc-to-cygwinccompiler.patch => 0086-distutils-add-windmc-to-cygwinccompiler.patch} (75%) create mode 100644 mingw-w64-python3.9/0087-pkg-config-windows-must-link-ext-with-python-lib.patch create mode 100644 mingw-w64-python3.9/0088-importlib-bootstrap-path-sep.patch create mode 100644 mingw-w64-python3.9/0089-pathlib-path-sep.patch rename mingw-w64-python3.9/{5000-warnings-fixes.patch => 0090-warnings-fixes.patch} (56%) create mode 100644 mingw-w64-python3.9/0091-fix-build-testinternalcapi.patch create mode 100644 mingw-w64-python3.9/0092-extend-MS_WINDOWS-flag.patch rename mingw-w64-python3.9/{4000-clang-arm64.patch => 0093-clang-arm64.patch} (64%) create mode 100644 mingw-w64-python3.9/0094-MINGW-stack-reserve.patch rename mingw-w64-python3.9/{0001-Add-support-for-Windows-7-Python-3.9.patch => 0095-Add-support-for-Windows-7-Python-3.9.patch} (91%) delete mode 100644 mingw-w64-python3.9/0110-MINGW-translate-gcc-internal-defines-to-python-platf.patch delete mode 100644 mingw-w64-python3.9/0150-MINGW-configure-largefile-support-for-windows-builds.patch delete mode 100644 mingw-w64-python3.9/0210-MINGW-determine-if-pwdmodule-should-be-used.patch delete mode 100644 mingw-w64-python3.9/0330-MINGW-ignore-main-program-for-frozen-scripts.patch delete mode 100644 mingw-w64-python3.9/0350-MINGW-setup-_multiprocessing-module.patch delete mode 100644 mingw-w64-python3.9/0370-MINGW-setup-_ctypes-module-with-system-libffi.patch delete mode 100644 mingw-w64-python3.9/0430-MINGW-find-import-library.patch delete mode 100644 mingw-w64-python3.9/0440-MINGW-setup-_ssl-module.patch delete mode 100644 mingw-w64-python3.9/0464-use-replace-instead-rename-to-avoid-failure-on-windo.patch delete mode 100644 mingw-w64-python3.9/0470-MINGW-avoid-circular-dependency-from-time-module-dur.patch delete mode 100644 mingw-w64-python3.9/0530-mingw-system-libffi.patch delete mode 100644 mingw-w64-python3.9/0570-mingw-add-BUILDIN_WIN32_MODULEs-time-msvcrt.patch delete mode 100644 mingw-w64-python3.9/0650-cross-dont-add-multiarch-paths-if-cross-compiling.patch delete mode 100644 mingw-w64-python3.9/0660-mingw-use-backslashes-in-compileall-py.patch delete mode 100644 mingw-w64-python3.9/0720-mingw-pdcurses_ISPAD.patch delete mode 100644 mingw-w64-python3.9/0740-grammar-fixes.patch delete mode 100644 mingw-w64-python3.9/0810-remove_path_max.default.patch delete mode 100644 mingw-w64-python3.9/0820-dont-link-with-gettext.patch delete mode 100644 mingw-w64-python3.9/0830-ctypes-python-dll.patch delete mode 100644 mingw-w64-python3.9/0840-gdbm-module-includes.patch delete mode 100644 mingw-w64-python3.9/0870-mingw-fix-ssl-dont-use-enum_certificates.patch delete mode 100644 mingw-w64-python3.9/0890-mingw-build-optimized-ext.patch delete mode 100644 mingw-w64-python3.9/0900-cygwinccompiler-dont-strip-modules-if-pydebug.patch delete mode 100644 mingw-w64-python3.9/0910-fix-using-dllhandle-and-winver-mingw.patch delete mode 100644 mingw-w64-python3.9/0920-mingw-add-LIBPL-to-library-dirs.patch delete mode 100644 mingw-w64-python3.9/0990-MINGW-link-with-additional-library.patch delete mode 100644 mingw-w64-python3.9/1010-install-msilib.patch delete mode 100644 mingw-w64-python3.9/1060-dont-include-system-ncurses-path.patch delete mode 100644 mingw-w64-python3.9/1620-fix-signal-module-build.patch delete mode 100644 mingw-w64-python3.9/1630-build-winconsoleio.patch delete mode 100644 mingw-w64-python3.9/1650-expose-sem_unlink.patch delete mode 100644 mingw-w64-python3.9/1701-disable-broken-gdbm-module.patch delete mode 100644 mingw-w64-python3.9/1810-3.7-mpdec-mingw.patch delete mode 100644 mingw-w64-python3.9/1850-disable-readline.patch delete mode 100644 mingw-w64-python3.9/1860-fix-isselectable.patch delete mode 100644 mingw-w64-python3.9/1870-use-_wcsnicmp-instead-wcsncasecmp.patch delete mode 100644 mingw-w64-python3.9/1890-_xxsubinterpretersmodule.patch delete mode 100644 mingw-w64-python3.9/2010-configure-have-inet-pton.patch delete mode 100644 mingw-w64-python3.9/2030-fix-msvc9-import.patch delete mode 100644 mingw-w64-python3.9/2051-set-venv-activate-path-unix.patch delete mode 100644 mingw-w64-python3.9/2060-pass-gen-profile-ldflags.patch delete mode 100644 mingw-w64-python3.9/2080-pkg-config-windows-must-link-ext-with-python-lib.patch delete mode 100644 mingw-w64-python3.9/3000-importlib-bootstrap-path-sep.patch delete mode 100644 mingw-w64-python3.9/3001-pathlib-path-sep.patch delete mode 100644 mingw-w64-python3.9/3011-fix-build-testinternalcapi.patch delete mode 100644 mingw-w64-python3.9/3020-extend-MS_WINDOWS-flag.patch delete mode 100644 mingw-w64-python3.9/4010-MINGW-stack-reserve.patch create mode 100644 mingw-w64-python3.9/README.md create mode 100644 mingw-w64-python3.9/update-patches.sh diff --git a/mingw-w64-python3.9/.gitignore b/mingw-w64-python3.9/.gitignore new file mode 100644 index 0000000000000..bf450f0bbd0c4 --- /dev/null +++ b/mingw-w64-python3.9/.gitignore @@ -0,0 +1 @@ +cpython/ diff --git a/mingw-w64-python3.9/0000-make-_sysconfigdata.py-relocatable.patch b/mingw-w64-python3.9/0001-make-_sysconfigdata.py-relocatable.patch similarity index 64% rename from mingw-w64-python3.9/0000-make-_sysconfigdata.py-relocatable.patch rename to mingw-w64-python3.9/0001-make-_sysconfigdata.py-relocatable.patch index bb238fed553a1..f66e015e230b4 100644 --- a/mingw-w64-python3.9/0000-make-_sysconfigdata.py-relocatable.patch +++ b/mingw-w64-python3.9/0001-make-_sysconfigdata.py-relocatable.patch @@ -1,6 +1,21 @@ -diff -Naur Python-3.8.0-orig/Lib/sysconfig.py Python-3.8.0/Lib/sysconfig.py ---- Python-3.8.0-orig/Lib/sysconfig.py 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Lib/sysconfig.py 2019-10-22 10:00:17.317067000 +0300 +From 6a1ea73cdc8c8d00b196fa6319b352d1a7196e2f Mon Sep 17 00:00:00 2001 +From: Ray Donnelly +Date: Thu, 17 Jun 2021 18:51:10 +0530 +Subject: [PATCH 01/N] make _sysconfigdata.py relocatable +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: lovetox <8661218+lovetox@users.noreply.github.com> +--- + Lib/sysconfig.py | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py +index e3f79bf..505d538 100644 +--- a/Lib/sysconfig.py ++++ b/Lib/sysconfig.py @@ -2,6 +2,7 @@ import os @@ -9,7 +24,7 @@ diff -Naur Python-3.8.0-orig/Lib/sysconfig.py Python-3.8.0/Lib/sysconfig.py from os.path import pardir, realpath __all__ = [ -@@ -405,11 +406,29 @@ +@@ -413,11 +414,29 @@ def _generate_posix_vars(): os.makedirs(pybuilddir, exist_ok=True) destfile = os.path.join(pybuilddir, name + '.py') @@ -39,3 +54,6 @@ diff -Naur Python-3.8.0-orig/Lib/sysconfig.py Python-3.8.0/Lib/sysconfig.py # Create file used for sys.path fixup -- see Modules/getpath.c with open('pybuilddir.txt', 'w', encoding='utf8') as f: +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0002-restore-setup-config.patch b/mingw-w64-python3.9/0002-restore-setup-config.patch index 0cb775058b1c8..0ef19fc6d4f1f 100644 --- a/mingw-w64-python3.9/0002-restore-setup-config.patch +++ b/mingw-w64-python3.9/0002-restore-setup-config.patch @@ -1,28 +1,21 @@ -diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac ---- Python-3.8.0-orig/configure.ac 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/configure.ac 2019-10-22 10:00:26.817483700 +0300 -@@ -5624,7 +5624,7 @@ - - - # generate output files --AC_CONFIG_FILES(Makefile.pre Misc/python.pc Misc/python-embed.pc Misc/python-config.sh) -+AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc Misc/python-embed.pc Misc/python-config.sh) - AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix]) - AC_OUTPUT - -@@ -5636,7 +5636,7 @@ - - echo "creating Makefile" >&AS_MESSAGE_FD - $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \ -- -s Modules \ -+ -s Modules Modules/Setup.config \ - Modules/Setup.local $srcdir/Modules/Setup - mv config.c Modules - -diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in ---- Python-3.8.0-orig/Makefile.pre.in 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Makefile.pre.in 2019-10-22 10:00:27.207484400 +0300 -@@ -683,10 +683,12 @@ +From 4116e31a23d6b32e61ccae0b444a03aa581a6348 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?= + +Date: Thu, 17 Jun 2021 18:51:12 +0530 +Subject: [PATCH 02/N] restore setup config + +--- + Makefile.pre.in | 4 ++++ + Modules/Setup.config.in | 5 +++++ + configure.ac | 4 ++-- + 3 files changed, 11 insertions(+), 2 deletions(-) + create mode 100644 Modules/Setup.config.in + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 0c3981c..7f591e3 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -714,10 +714,12 @@ oldsharedmods: $(SHAREDMODS) Makefile Modules/config.c: Makefile.pre \ $(srcdir)/Modules/config.c.in \ $(MAKESETUP) \ @@ -35,7 +28,7 @@ diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in Modules/Setup.local \ $(srcdir)/Modules/Setup @mv config.c Modules -@@ -1574,6 +1576,7 @@ +@@ -1669,6 +1671,7 @@ libainstall: @DEF_MAKE_RULE@ python-config $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile $(INSTALL_DATA) $(srcdir)/Modules/Setup $(DESTDIR)$(LIBPL)/Setup $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local @@ -43,7 +36,7 @@ diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc $(INSTALL_DATA) Misc/python-embed.pc $(DESTDIR)$(LIBPC)/python-$(VERSION)-embed.pc $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup -@@ -1789,6 +1792,7 @@ +@@ -1895,6 +1898,7 @@ distclean: clobber if test "$$file" != "$(srcdir)/Lib/test/data/README"; then rm "$$file"; fi; \ done -rm -f core Makefile Makefile.pre config.status Modules/Setup.local \ @@ -51,12 +44,39 @@ diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in Modules/ld_so_aix Modules/python.exp Misc/python.pc \ Misc/python-embed.pc Misc/python-config.sh -rm -f python*-gdb.py -diff -Naur Python-3.8.0-orig/Modules/Setup.config.in Python-3.8.0/Modules/Setup.config.in ---- Python-3.8.0-orig/Modules/Setup.config.in 1970-01-01 03:00:00.000000000 +0300 -+++ Python-3.8.0/Modules/Setup.config.in 2019-10-22 10:00:27.613085100 +0300 +diff --git a/Modules/Setup.config.in b/Modules/Setup.config.in +new file mode 100644 +index 0000000..5c1299d +--- /dev/null ++++ b/Modules/Setup.config.in @@ -0,0 +1,5 @@ +# This file is transmogrified into Setup.config by config.status. + +# The purpose of this file is to conditionally enable certain modules +# based on configure-time options. + +diff --git a/configure.ac b/configure.ac +index b1e4c6c..a5ca784 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -5825,7 +5825,7 @@ AC_DEFINE_UNQUOTED(PY_BUILTIN_HASHLIB_HASHES, "$default_hashlib_hashes") + ]) + + # generate output files +-AC_CONFIG_FILES(Makefile.pre Misc/python.pc Misc/python-embed.pc Misc/python-config.sh) ++AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc Misc/python-embed.pc Misc/python-config.sh) + AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix]) + AC_OUTPUT + +@@ -5837,7 +5837,7 @@ fi + + echo "creating Makefile" >&AS_MESSAGE_FD + $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \ +- -s Modules \ ++ -s Modules Modules/Setup.config \ + Modules/Setup.local $srcdir/Modules/Setup + mv config.c Modules + +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0100-MINGW-BASE-use-NT-thread-model.patch b/mingw-w64-python3.9/0003-MINGW-BASE-use-NT-thread-model.patch similarity index 77% rename from mingw-w64-python3.9/0100-MINGW-BASE-use-NT-thread-model.patch rename to mingw-w64-python3.9/0003-MINGW-BASE-use-NT-thread-model.patch index bdc68917fbdfe..2e646c189a603 100644 --- a/mingw-w64-python3.9/0100-MINGW-BASE-use-NT-thread-model.patch +++ b/mingw-w64-python3.9/0003-MINGW-BASE-use-NT-thread-model.patch @@ -1,7 +1,39 @@ -diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac ---- Python-3.8.0-orig/configure.ac 2019-10-22 10:00:29.329088100 +0300 -+++ Python-3.8.0/configure.ac 2019-10-22 10:00:31.778292400 +0300 -@@ -1960,6 +1960,46 @@ +From 40e31674ce05a531746af50cac90b53ad0bb7cab 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?= + +Date: Thu, 17 Jun 2021 18:51:12 +0530 +Subject: [PATCH 03/N] MINGW BASE use NT thread model +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +--- + Modules/_multiprocessing/multiprocessing.h | 3 + + configure.ac | 94 +++++++++++++++++++++- + pyconfig.h.in | 3 + + 3 files changed, 98 insertions(+), 2 deletions(-) + +diff --git a/Modules/_multiprocessing/multiprocessing.h b/Modules/_multiprocessing/multiprocessing.h +index fe78135..344b76e 100644 +--- a/Modules/_multiprocessing/multiprocessing.h ++++ b/Modules/_multiprocessing/multiprocessing.h +@@ -21,6 +21,9 @@ + # endif + # define SEM_HANDLE HANDLE + # define SEM_VALUE_MAX LONG_MAX ++# if defined(HAVE_SEM_OPEN) && defined(_POSIX_THREADS) ++# include ++# endif + #else + # include /* O_CREAT and O_EXCL */ + # if defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED) +diff --git a/configure.ac b/configure.ac +index a5ca784..ff84557 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2037,6 +2037,46 @@ then BASECFLAGS="$BASECFLAGS $ac_arch_flags" fi @@ -48,7 +80,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac # On some compilers, pthreads are available without further options # (e.g. MacOS X). On some of these systems, the compiler will not # complain if unaccepted options are passed (e.g. gcc on Mac OS X). -@@ -2078,6 +2118,8 @@ +@@ -2155,6 +2195,8 @@ CC="$ac_save_cc"]) AC_MSG_RESULT($ac_cv_pthread) fi @@ -57,7 +89,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac # If we have set a CC compiler flag for thread support then # check if it works for CXX, too. ac_cv_cxx_thread=no -@@ -2098,6 +2140,10 @@ +@@ -2175,6 +2217,10 @@ elif test "$ac_cv_pthread" = "yes" then CXX="$CXX -pthread" ac_cv_cxx_thread=yes @@ -68,7 +100,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac fi if test $ac_cv_cxx_thread = yes -@@ -2130,8 +2176,8 @@ +@@ -2207,8 +2253,8 @@ dnl AC_MSG_RESULT($cpp_type) AC_HEADER_STDC AC_CHECK_HEADERS(asm/types.h crypt.h conio.h direct.h dlfcn.h errno.h \ fcntl.h grp.h \ @@ -79,7 +111,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac utime.h \ poll.h sys/devpoll.h sys/epoll.h sys/poll.h \ sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/ioctl.h \ -@@ -2145,6 +2191,14 @@ +@@ -2222,6 +2268,14 @@ sys/endian.h sys/sysmacros.h linux/memfd.h linux/wait.h sys/memfd.h sys/mman.h) AC_HEADER_DIRENT AC_HEADER_MAJOR @@ -94,7 +126,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac # bluetooth/bluetooth.h has been known to not compile with -std=c99. # http://permalink.gmane.org/gmane.linux.bluez.kernel/22294 SAVE_CFLAGS=$CFLAGS -@@ -2342,6 +2396,10 @@ +@@ -2419,6 +2473,10 @@ fi AC_MSG_CHECKING(for pthread_t) have_pthread_t=no @@ -105,7 +137,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[#include ]], [[pthread_t x; x = *(pthread_t*)0;]]) ],[have_pthread_t=yes],[]) -@@ -2372,6 +2430,7 @@ +@@ -2449,6 +2507,7 @@ if test "$ac_cv_sizeof_pthread_key_t" -eq "$ac_cv_sizeof_int" ; then else AC_MSG_RESULT(no) fi @@ -113,7 +145,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac CC="$ac_save_cc" AC_SUBST(OTHER_LIBTOOL_OPT) -@@ -2814,10 +2873,15 @@ +@@ -2894,10 +2953,15 @@ void *x = uuid_enc_be [AC_MSG_RESULT(no)] ) @@ -129,7 +161,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac # check if we need libintl for locale functions AC_CHECK_LIB(intl, textdomain, -@@ -3087,6 +3151,11 @@ +@@ -3229,6 +3293,11 @@ then CXX="$CXX -pthread" fi posix_threads=yes @@ -141,7 +173,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac else if test ! -z "$withval" -a -d "$withval" then LDFLAGS="$LDFLAGS -L$withval" -@@ -3538,6 +3607,15 @@ +@@ -3689,6 +3758,15 @@ else fi # checks for library functions @@ -157,7 +189,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \ clock confstr copy_file_range ctermid dup3 execv explicit_bzero explicit_memset \ faccessat fchmod fchmodat fchown fchownat \ -@@ -4462,6 +4540,10 @@ +@@ -4610,6 +4688,10 @@ AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include ]]) # the kernel module that provides POSIX semaphores # isn't loaded by default, so an attempt to call # sem_open results in a 'Signal 12' error. @@ -168,7 +200,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac AC_MSG_CHECKING(whether POSIX semaphores are enabled) AC_CACHE_VAL(ac_cv_posix_semaphores_enabled, AC_RUN_IFELSE([AC_LANG_SOURCE([[ -@@ -4495,6 +4577,14 @@ +@@ -4643,6 +4725,14 @@ fi # Multiprocessing check for broken sem_getvalue AC_MSG_CHECKING(for broken sem_getvalue) @@ -183,23 +215,11 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac AC_CACHE_VAL(ac_cv_broken_sem_getvalue, AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include -diff -Naur Python-3.8.0-orig/Modules/_multiprocessing/multiprocessing.h Python-3.8.0/Modules/_multiprocessing/multiprocessing.h ---- Python-3.8.0-orig/Modules/_multiprocessing/multiprocessing.h 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Modules/_multiprocessing/multiprocessing.h 2019-10-22 10:00:32.168293100 +0300 -@@ -21,6 +21,9 @@ - # endif - # define SEM_HANDLE HANDLE - # define SEM_VALUE_MAX LONG_MAX -+# if defined(HAVE_SEM_OPEN) && defined(_POSIX_THREADS) -+# include -+# endif - #else - # include /* O_CREAT and O_EXCL */ - # if defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED) -diff -Naur Python-3.8.0-orig/pyconfig.h.in Python-3.8.0/pyconfig.h.in ---- Python-3.8.0-orig/pyconfig.h.in 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/pyconfig.h.in 2019-10-22 10:00:32.558293800 +0300 -@@ -1352,6 +1352,9 @@ +diff --git a/pyconfig.h.in b/pyconfig.h.in +index 8510c87..e84708e 100644 +--- a/pyconfig.h.in ++++ b/pyconfig.h.in +@@ -1355,6 +1355,9 @@ /* Define if mvwdelch in curses.h is an expression. */ #undef MVWDELCH_IS_EXPRESSION @@ -209,3 +229,6 @@ diff -Naur Python-3.8.0-orig/pyconfig.h.in Python-3.8.0/pyconfig.h.in /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0004-MINGW-translate-gcc-internal-defines-to-python-platf.patch b/mingw-w64-python3.9/0004-MINGW-translate-gcc-internal-defines-to-python-platf.patch new file mode 100644 index 0000000000000..9a16e3f2f4dd6 --- /dev/null +++ b/mingw-w64-python3.9/0004-MINGW-translate-gcc-internal-defines-to-python-platf.patch @@ -0,0 +1,44 @@ +From c0de4a6d61bbf0d860b2b0fa619a229e26147bd6 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?= + +Date: Thu, 17 Jun 2021 18:51:13 +0530 +Subject: [PATCH 04/N] MINGW translate gcc internal defines to python platf +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +--- + Include/pyport.h | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/Include/pyport.h b/Include/pyport.h +index 4bd4eb4..475c2a8 100644 +--- a/Include/pyport.h ++++ b/Include/pyport.h +@@ -26,6 +26,21 @@ + #endif + + ++#ifdef __MINGW32__ ++/* Translate GCC[mingw*] platform specific defines to those ++ * used in python code. ++ */ ++#if !defined(MS_WIN64) && defined(_WIN64) ++# define MS_WIN64 ++#endif ++#if !defined(MS_WIN32) && defined(_WIN32) ++# define MS_WIN32 ++#endif ++#if !defined(MS_WINDOWS) && defined(MS_WIN32) ++# define MS_WINDOWS ++#endif ++#endif /* __MINGW32__*/ ++ + /************************************************************************** + Symbols and macros to supply platform-independent interfaces to basic + C language & library operations whose spellings vary across platforms. +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0130-MINGW-configure-MACHDEP-and-platform-for-build.patch b/mingw-w64-python3.9/0005-MINGW-configure-MACHDEP-and-platform-for-build.patch similarity index 58% rename from mingw-w64-python3.9/0130-MINGW-configure-MACHDEP-and-platform-for-build.patch rename to mingw-w64-python3.9/0005-MINGW-configure-MACHDEP-and-platform-for-build.patch index 45acd7442dc99..437e938706f7b 100644 --- a/mingw-w64-python3.9/0130-MINGW-configure-MACHDEP-and-platform-for-build.patch +++ b/mingw-w64-python3.9/0005-MINGW-configure-MACHDEP-and-platform-for-build.patch @@ -1,7 +1,40 @@ -diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac ---- Python-3.8.0-orig/configure.ac 2019-10-22 10:00:34.321096900 +0300 -+++ Python-3.8.0/configure.ac 2019-10-22 10:00:39.843506600 +0300 -@@ -362,6 +362,17 @@ +From 79fa18e79ac161d80ff9ab6699c06c26137aaaee 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?= + +Date: Thu, 17 Jun 2021 18:51:14 +0530 +Subject: [PATCH 05/N] MINGW configure MACHDEP and platform for build +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Python/getplatform.c | 6 ++++++ + configure.ac | 22 ++++++++++++++++++++++ + 2 files changed, 28 insertions(+) + +diff --git a/Python/getplatform.c b/Python/getplatform.c +index 81a0f7a..636b0a8 100644 +--- a/Python/getplatform.c ++++ b/Python/getplatform.c +@@ -1,6 +1,12 @@ + + #include "Python.h" + ++#ifdef __MINGW32__ ++# undef PLATFORM ++/* see PC/pyconfig.h */ ++# define PLATFORM "win32" ++#endif ++ + #ifndef PLATFORM + #define PLATFORM "unknown" + #endif +diff --git a/configure.ac b/configure.ac +index ff84557..e1e4ccb 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -383,6 +383,17 @@ AC_DEFINE_UNQUOTED(_PYTHONFRAMEWORK, "${PYTHONFRAMEWORK}", [framework name]) # Set name for machine-dependent library files AC_ARG_VAR([MACHDEP], [name for machine-dependent library files]) AC_MSG_CHECKING(MACHDEP) @@ -19,7 +52,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac if test -z "$MACHDEP" then # avoid using uname for cross builds -@@ -431,12 +442,23 @@ +@@ -452,12 +463,23 @@ if test "$cross_compiling" = yes; then *-*-vxworks*) _host_cpu=$host_cpu ;; @@ -43,19 +76,6 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac fi # Some systems cannot stand _XOPEN_SOURCE being defined at all; they -diff -Naur Python-3.8.0-orig/Python/getplatform.c Python-3.8.0/Python/getplatform.c ---- Python-3.8.0-orig/Python/getplatform.c 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Python/getplatform.c 2019-10-22 10:00:40.249107300 +0300 -@@ -1,6 +1,12 @@ - - #include "Python.h" - -+#ifdef __MINGW32__ -+# undef PLATFORM -+/* see PC/pyconfig.h */ -+# define PLATFORM "win32" -+#endif -+ - #ifndef PLATFORM - #define PLATFORM "unknown" - #endif +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0140-MINGW-preset-configure-defaults.patch b/mingw-w64-python3.9/0006-MINGW-preset-configure-defaults.patch similarity index 54% rename from mingw-w64-python3.9/0140-MINGW-preset-configure-defaults.patch rename to mingw-w64-python3.9/0006-MINGW-preset-configure-defaults.patch index cc9f8db4e241f..6e2c28473f708 100644 --- a/mingw-w64-python3.9/0140-MINGW-preset-configure-defaults.patch +++ b/mingw-w64-python3.9/0006-MINGW-preset-configure-defaults.patch @@ -1,7 +1,62 @@ -diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac ---- Python-3.8.0-orig/configure.ac 2019-10-22 10:00:41.996310400 +0300 -+++ Python-3.8.0/configure.ac 2019-10-22 10:00:43.025912200 +0300 -@@ -893,6 +893,28 @@ +From 8e857fbb3aae73e0c64893be92094f86f86faaff 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?= + +Date: Thu, 17 Jun 2021 18:51:15 +0530 +Subject: [PATCH 06/N] MINGW preset configure defaults +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +--- + Misc/config_mingw | 12 ++++++++++++ + Misc/cross_mingw32 | 11 +++++++++++ + configure.ac | 22 ++++++++++++++++++++++ + 3 files changed, 45 insertions(+) + create mode 100644 Misc/config_mingw + create mode 100644 Misc/cross_mingw32 + +diff --git a/Misc/config_mingw b/Misc/config_mingw +new file mode 100644 +index 0000000..513065d +--- /dev/null ++++ b/Misc/config_mingw +@@ -0,0 +1,12 @@ ++# configure defaults for mingw* hosts ++ ++# mingw functions to ignore ++ac_cv_func_ftruncate=ignore # implement it as _chsize ++ ++# mingw-w64 functions to ignore ++ac_cv_func_truncate=ignore ++ac_cv_func_alarm=ignore ++ ++# files to ignore ++ac_cv_file__dev_ptmx=ignore #NOTE: under MSYS environment device exist ++ac_cv_file__dev_ptc=no +diff --git a/Misc/cross_mingw32 b/Misc/cross_mingw32 +new file mode 100644 +index 0000000..03fde9e +--- /dev/null ++++ b/Misc/cross_mingw32 +@@ -0,0 +1,11 @@ ++# configure defaults for mingw32 host if cross-build ++ ++ac_cv_little_endian_double=yes ++ac_cv_big_endian_double=no ++ac_cv_mixed_endian_double=no ++ ++ac_cv_tanh_preserves_zero_sign=yes ++ ++ac_cv_wchar_t_signed=no ++ ++ac_cv_have_size_t_format=no +diff --git a/configure.ac b/configure.ac +index e1e4ccb..bdfe905 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -920,6 +920,28 @@ if test x$MULTIARCH != x; then fi AC_SUBST(MULTIARCH_CPPFLAGS) @@ -30,34 +85,6 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac AC_MSG_CHECKING([for -Wl,--no-as-needed]) save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,--no-as-needed" -diff -Naur Python-3.8.0-orig/Misc/config_mingw Python-3.8.0/Misc/config_mingw ---- Python-3.8.0-orig/Misc/config_mingw 1970-01-01 03:00:00.000000000 +0300 -+++ Python-3.8.0/Misc/config_mingw 2019-10-22 10:00:43.415912900 +0300 -@@ -0,0 +1,12 @@ -+# configure defaults for mingw* hosts -+ -+# mingw functions to ignore -+ac_cv_func_ftruncate=ignore # implement it as _chsize -+ -+# mingw-w64 functions to ignore -+ac_cv_func_truncate=ignore -+ac_cv_func_alarm=ignore -+ -+# files to ignore -+ac_cv_file__dev_ptmx=ignore #NOTE: under MSYS environment device exist -+ac_cv_file__dev_ptc=no -diff -Naur Python-3.8.0-orig/Misc/cross_mingw32 Python-3.8.0/Misc/cross_mingw32 ---- Python-3.8.0-orig/Misc/cross_mingw32 1970-01-01 03:00:00.000000000 +0300 -+++ Python-3.8.0/Misc/cross_mingw32 2019-10-22 10:00:43.837113600 +0300 -@@ -0,0 +1,11 @@ -+# configure defaults for mingw32 host if cross-build -+ -+ac_cv_little_endian_double=yes -+ac_cv_big_endian_double=no -+ac_cv_mixed_endian_double=no -+ -+ac_cv_tanh_preserves_zero_sign=yes -+ -+ac_cv_wchar_t_signed=no -+ -+ac_cv_have_size_t_format=no +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0007-MINGW-configure-largefile-support-for-windows-builds.patch b/mingw-w64-python3.9/0007-MINGW-configure-largefile-support-for-windows-builds.patch new file mode 100644 index 0000000000000..2abe8b1e1821e --- /dev/null +++ b/mingw-w64-python3.9/0007-MINGW-configure-largefile-support-for-windows-builds.patch @@ -0,0 +1,43 @@ +From 41ae0ae95098c28faeb4510637eeca828cf59b2d 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?= + +Date: Thu, 17 Jun 2021 18:51:16 +0530 +Subject: [PATCH 07/N] MINGW configure largefile support for windows builds +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +--- + configure.ac | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/configure.ac b/configure.ac +index bdfe905..8471604 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2484,8 +2484,20 @@ AC_CHECK_SIZEOF(off_t, [], [ + ]) + + AC_MSG_CHECKING(whether to enable large file support) ++have_largefile_support=no + if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ + "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then ++ have_largefile_support=yes ++else ++ case $host in ++ *-*-mingw*) ++ dnl Activate on windows platforms (32&64-bit) where off_t(4) < fpos_t(8) ++ have_largefile_support=yes ++ ;; ++ esac ++fi ++ ++if test $have_largefile_support = yes ; then + AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1, + [Defined to enable large file support when an off_t is bigger than a long + and long long is at least as big as an off_t. You may need +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0170-MINGW-add-srcdir-PC-to-CPPFLAGS.patch b/mingw-w64-python3.9/0008-MINGW-add-srcdir-PC-to-CPPFLAGS.patch similarity index 50% rename from mingw-w64-python3.9/0170-MINGW-add-srcdir-PC-to-CPPFLAGS.patch rename to mingw-w64-python3.9/0008-MINGW-add-srcdir-PC-to-CPPFLAGS.patch index 15d80d46c17c0..7749cb1252034 100644 --- a/mingw-w64-python3.9/0170-MINGW-add-srcdir-PC-to-CPPFLAGS.patch +++ b/mingw-w64-python3.9/0008-MINGW-add-srcdir-PC-to-CPPFLAGS.patch @@ -1,7 +1,22 @@ -diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac ---- Python-3.8.0-orig/configure.ac 2019-10-22 10:00:49.172323000 +0300 -+++ Python-3.8.0/configure.ac 2019-10-22 10:00:50.295525000 +0300 -@@ -5619,8 +5619,21 @@ +From dc17d51b15cf63c5235984e7cb74f2560c2f590e 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?= + +Date: Thu, 17 Jun 2021 18:51:18 +0530 +Subject: [PATCH 08/N] MINGW add srcdir PC to CPPFLAGS +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + configure.ac | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 8471604..2230067 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -5623,8 +5623,21 @@ do THREADHEADERS="$THREADHEADERS \$(srcdir)/$h" done @@ -23,3 +38,6 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac AC_MSG_CHECKING(for build directories) for dir in $SRCDIRS; do if test ! -d $dir; then +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0180-MINGW-init-system-calls.patch b/mingw-w64-python3.9/0009-MINGW-init-system-calls.patch similarity index 63% rename from mingw-w64-python3.9/0180-MINGW-init-system-calls.patch rename to mingw-w64-python3.9/0009-MINGW-init-system-calls.patch index 9612a43072cc9..105c857ba40ce 100644 --- a/mingw-w64-python3.9/0180-MINGW-init-system-calls.patch +++ b/mingw-w64-python3.9/0009-MINGW-init-system-calls.patch @@ -1,24 +1,48 @@ -diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac ---- Python-3.8.0-orig/configure.ac 2019-10-22 10:00:52.028128100 +0300 -+++ Python-3.8.0/configure.ac 2019-10-22 10:00:53.198130100 +0300 -@@ -574,6 +574,14 @@ - AC_DEFINE(_INCLUDE__STDC_A1_SOURCE, 1, Define to include mbstate_t for mbrtowc) - fi +From 0404a199cbe3adb2fa425c5fd070e0fe7fe55ff1 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?= + +Date: Thu, 17 Jun 2021 18:51:19 +0530 +Subject: [PATCH 09/N] MINGW init system calls +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Modules/Setup | 1 - + Modules/Setup.config.in | 3 +++ + Modules/posixmodule.c | 29 +++++++++++++++++++++++++---- + configure.ac | 8 ++++++++ + 4 files changed, 36 insertions(+), 5 deletions(-) + +diff --git a/Modules/Setup b/Modules/Setup +index 02cfb67..6b6926d 100644 +--- a/Modules/Setup ++++ b/Modules/Setup +@@ -101,7 +101,6 @@ PYTHONPATH=$(COREPYTHONPATH) + # This only contains the minimal set of modules required to run the + # setup.py script in the root of the Python source tree. -+AC_MSG_CHECKING([for init system calls]) -+AC_SUBST(INITSYS) -+case $host in -+ *-*-mingw*) INITSYS=nt;; -+ *) INITSYS=posix;; -+esac -+AC_MSG_RESULT([$INITSYS]) +-posix -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal posixmodule.c # posix (UNIX) system calls + errno errnomodule.c # posix (UNIX) errno values + pwd pwdmodule.c # this is needed to find out the user's home dir + # if $HOME is not set +diff --git a/Modules/Setup.config.in b/Modules/Setup.config.in +index 5c1299d..9b364fe 100644 +--- a/Modules/Setup.config.in ++++ b/Modules/Setup.config.in +@@ -3,3 +3,6 @@ + # The purpose of this file is to conditionally enable certain modules + # based on configure-time options. + ++# init system calls(posix/nt/...) for INITFUNC (used by makesetup) ++@INITSYS@ -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal posixmodule.c + - # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET, - # it may influence the way we can build extensions, so distutils - # needs to check it ---- Python-3.8.1/Modules/posixmodule.c.orig 2019-12-18 18:21:23.000000000 +0100 -+++ Python-3.8.1/Modules/posixmodule.c 2019-12-23 10:35:51.095967700 +0100 -@@ -309,6 +309,27 @@ +diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c +index c984e2e..3f3e1f3 100644 +--- a/Modules/posixmodule.c ++++ b/Modules/posixmodule.c +@@ -310,6 +310,27 @@ corresponding Unix manual entries for more information on calls."); # define HAVE_CWAIT 1 # define HAVE_FSYNC 1 # define fsync _commit @@ -46,7 +70,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac # else /* Unix functions that the configure script doesn't check for */ # ifndef __VXWORKS__ -@@ -409,7 +430,7 @@ +@@ -410,7 +431,7 @@ extern char *ctermid_r(char *); # endif #endif @@ -55,7 +79,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac # ifdef HAVE_DIRECT_H # include # endif -@@ -431,7 +452,7 @@ +@@ -432,7 +453,7 @@ extern char *ctermid_r(char *); # include // ShellExecute() # include // UNLEN # define HAVE_SYMLINK @@ -64,7 +88,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac #ifndef MAXPATHLEN # if defined(PATH_MAX) && PATH_MAX > 1024 -@@ -1520,9 +1520,9 @@ +@@ -1521,9 +1542,9 @@ win32_get_reparse_tag(HANDLE reparse_point_handle, ULONG *reparse_tag) ** man environ(7). */ #include @@ -76,24 +100,25 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac static PyObject * convertenviron(void) -diff -Naur Python-3.8.0-orig/Modules/Setup Python-3.8.0/Modules/Setup ---- Python-3.8.0-orig/Modules/Setup 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Modules/Setup 2019-10-22 10:00:54.430532300 +0300 -@@ -101,7 +101,6 @@ - # This only contains the minimal set of modules required to run the - # setup.py script in the root of the Python source tree. - --posix -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal posixmodule.c # posix (UNIX) system calls - errno errnomodule.c # posix (UNIX) errno values - pwd pwdmodule.c # this is needed to find out the user's home dir - # if $HOME is not set -diff -Naur Python-3.8.0-orig/Modules/Setup.config.in Python-3.8.0/Modules/Setup.config.in ---- Python-3.8.0-orig/Modules/Setup.config.in 2019-10-22 10:00:30.171489600 +0300 -+++ Python-3.8.0/Modules/Setup.config.in 2019-10-22 10:00:54.009331600 +0300 -@@ -3,3 +3,6 @@ - # The purpose of this file is to conditionally enable certain modules - # based on configure-time options. +diff --git a/configure.ac b/configure.ac +index 2230067..d8977f7 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -601,6 +601,14 @@ then + AC_DEFINE(_INCLUDE__STDC_A1_SOURCE, 1, Define to include mbstate_t for mbrtowc) + fi -+# init system calls(posix/nt/...) for INITFUNC (used by makesetup) -+@INITSYS@ -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal posixmodule.c ++AC_MSG_CHECKING([for init system calls]) ++AC_SUBST(INITSYS) ++case $host in ++ *-*-mingw*) INITSYS=nt;; ++ *) INITSYS=posix;; ++esac ++AC_MSG_RESULT([$INITSYS]) + + # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET, + # it may influence the way we can build extensions, so distutils + # needs to check it +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0200-MINGW-build-in-windows-modules-winreg.patch b/mingw-w64-python3.9/0010-MINGW-build-in-windows-modules-winreg.patch similarity index 52% rename from mingw-w64-python3.9/0200-MINGW-build-in-windows-modules-winreg.patch rename to mingw-w64-python3.9/0010-MINGW-build-in-windows-modules-winreg.patch index 9ee4b813cfff4..e25dd0523a5d8 100644 --- a/mingw-w64-python3.9/0200-MINGW-build-in-windows-modules-winreg.patch +++ b/mingw-w64-python3.9/0010-MINGW-build-in-windows-modules-winreg.patch @@ -1,23 +1,24 @@ -diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac ---- Python-3.8.0-orig/configure.ac 2019-10-22 10:00:56.583336100 +0300 -+++ Python-3.8.0/configure.ac 2019-10-22 10:00:58.938940200 +0300 -@@ -3181,6 +3181,13 @@ - fi]) - AC_MSG_RESULT($with_dbmliborder) - -+# Determine if windows modules should be used. -+AC_SUBST(USE_WIN32_MODULE) -+USE_WIN32_MODULE='#' -+case $host in -+ *-*-mingw*) USE_WIN32_MODULE=;; -+esac -+ - # Templates for things AC_DEFINEd more than once. - # For a single AC_DEFINE, no template is needed. - AH_TEMPLATE(_REENTRANT, -diff -Naur Python-3.8.0-orig/Modules/Setup.config.in Python-3.8.0/Modules/Setup.config.in ---- Python-3.8.0-orig/Modules/Setup.config.in 2019-10-22 10:00:57.800138200 +0300 -+++ Python-3.8.0/Modules/Setup.config.in 2019-10-22 10:00:59.328940900 +0300 +From 9329bd4f6860fe9664a6629465c8242288513073 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?= + +Date: Thu, 17 Jun 2021 18:51:20 +0530 +Subject: [PATCH 10/N] MINGW build in windows modules winreg +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +--- + Modules/Setup.config.in | 3 +++ + PC/winreg.c | 19 +++++++++++++++++++ + configure.ac | 7 +++++++ + 3 files changed, 29 insertions(+) + +diff --git a/Modules/Setup.config.in b/Modules/Setup.config.in +index 9b364fe..612cabd 100644 +--- a/Modules/Setup.config.in ++++ b/Modules/Setup.config.in @@ -6,3 +6,6 @@ # init system calls(posix/nt/...) for INITFUNC (used by makesetup) @INITSYS@ -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal posixmodule.c @@ -25,12 +26,13 @@ diff -Naur Python-3.8.0-orig/Modules/Setup.config.in Python-3.8.0/Modules/Setup. +# build-in modules for windows platform: +@USE_WIN32_MODULE@winreg ../PC/winreg.c + -diff -Naur Python-3.8.0-orig/PC/winreg.c Python-3.8.0/PC/winreg.c ---- Python-3.8.0-orig/PC/winreg.c 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/PC/winreg.c 2019-10-22 10:00:59.734541600 +0300 +diff --git a/PC/winreg.c b/PC/winreg.c +index fd1ccb7..b6f1a8f 100644 +--- a/PC/winreg.c ++++ b/PC/winreg.c @@ -17,6 +17,25 @@ - #include "structmember.h" - #include "windows.h" + #include "structmember.h" // PyMemberDef + #include +#ifndef SIZEOF_HKEY +/* used only here */ @@ -54,3 +56,24 @@ diff -Naur Python-3.8.0-orig/PC/winreg.c Python-3.8.0/PC/winreg.c static BOOL PyHKEY_AsHKEY(PyObject *ob, HKEY *pRes, BOOL bNoneOK); static BOOL clinic_HKEY_converter(PyObject *ob, void *p); static PyObject *PyHKEY_FromHKEY(HKEY h); +diff --git a/configure.ac b/configure.ac +index d8977f7..b78a9b4 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3323,6 +3323,13 @@ else + fi]) + AC_MSG_RESULT($with_dbmliborder) + ++# Determine if windows modules should be used. ++AC_SUBST(USE_WIN32_MODULE) ++USE_WIN32_MODULE='#' ++case $host in ++ *-*-mingw*) USE_WIN32_MODULE=;; ++esac ++ + # Templates for things AC_DEFINEd more than once. + # For a single AC_DEFINE, no template is needed. + AH_TEMPLATE(_REENTRANT, +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0011-MINGW-determine-if-pwdmodule-should-be-used.patch b/mingw-w64-python3.9/0011-MINGW-determine-if-pwdmodule-should-be-used.patch new file mode 100644 index 0000000000000..f8b63a9d6b9cb --- /dev/null +++ b/mingw-w64-python3.9/0011-MINGW-determine-if-pwdmodule-should-be-used.patch @@ -0,0 +1,65 @@ +From 606adec077293ec07b9f5f6f28a0b830dd0bae2a 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?= + +Date: Thu, 17 Jun 2021 18:51:21 +0530 +Subject: [PATCH 11/N] MINGW determine if pwdmodule should be used +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +--- + Modules/Setup | 2 -- + Modules/Setup.config.in | 3 +++ + configure.ac | 7 +++++++ + 3 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/Modules/Setup b/Modules/Setup +index 6b6926d..2bafdd0 100644 +--- a/Modules/Setup ++++ b/Modules/Setup +@@ -102,8 +102,6 @@ PYTHONPATH=$(COREPYTHONPATH) + # setup.py script in the root of the Python source tree. + + errno errnomodule.c # posix (UNIX) errno values +-pwd pwdmodule.c # this is needed to find out the user's home dir +- # if $HOME is not set + _sre _sre.c # Fredrik Lundh's new regular expressions + _codecs _codecsmodule.c # access to the builtin codecs and codec registry + _weakref _weakref.c # weak references +diff --git a/Modules/Setup.config.in b/Modules/Setup.config.in +index 612cabd..d071a74 100644 +--- a/Modules/Setup.config.in ++++ b/Modules/Setup.config.in +@@ -6,6 +6,9 @@ + # init system calls(posix/nt/...) for INITFUNC (used by makesetup) + @INITSYS@ -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal posixmodule.c + ++# This is needed to find out the user's home dir if $HOME is not set ++@USE_PWD_MODULE@pwd pwdmodule.c ++ + # build-in modules for windows platform: + @USE_WIN32_MODULE@winreg ../PC/winreg.c + +diff --git a/configure.ac b/configure.ac +index b78a9b4..5320f26 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3330,6 +3330,13 @@ case $host in + *-*-mingw*) USE_WIN32_MODULE=;; + esac + ++# Determine if pwdmodule should be used. ++AC_SUBST(USE_PWD_MODULE) ++USE_PWD_MODULE= ++case $host in ++ *-*-mingw*) USE_PWD_MODULE='#';; ++esac ++ + # Templates for things AC_DEFINEd more than once. + # For a single AC_DEFINE, no template is needed. + AH_TEMPLATE(_REENTRANT, +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0250-MINGW-compiler-customize-mingw-cygwin-compilers.patch b/mingw-w64-python3.9/0012-MINGW-compiler-customize-mingw-cygwin-compilers.patch similarity index 66% rename from mingw-w64-python3.9/0250-MINGW-compiler-customize-mingw-cygwin-compilers.patch rename to mingw-w64-python3.9/0012-MINGW-compiler-customize-mingw-cygwin-compilers.patch index eb8d0205b48d4..ddbdb3ba3f353 100644 --- a/mingw-w64-python3.9/0250-MINGW-compiler-customize-mingw-cygwin-compilers.patch +++ b/mingw-w64-python3.9/0012-MINGW-compiler-customize-mingw-cygwin-compilers.patch @@ -1,7 +1,22 @@ -diff -Naur Python-3.8.0-orig/Lib/distutils/sysconfig.py Python-3.8.0/Lib/distutils/sysconfig.py ---- Python-3.8.0-orig/Lib/distutils/sysconfig.py 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Lib/distutils/sysconfig.py 2019-10-22 10:01:09.125758100 +0300 -@@ -170,7 +170,23 @@ +From 8063c2d1bef0aa75fdeac5f768fd2669f3f08f7a 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?= + +Date: Thu, 17 Jun 2021 18:51:21 +0530 +Subject: [PATCH 12/N] MINGW compiler customize mingw cygwin compilers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Lib/distutils/sysconfig.py | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py +index 37feae5..bbe8e3c 100644 +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -176,7 +176,23 @@ def customize_compiler(compiler): Mainly needed on Unix, so we can plug in the information that varies across Unices and is stored in Python's Makefile. """ @@ -26,7 +41,7 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/sysconfig.py Python-3.8.0/Lib/distuti if sys.platform == "darwin": # Perform first-time customization of compiler-related # config vars on OS X now that we know we need a compiler. -@@ -180,7 +196,6 @@ +@@ -186,7 +202,6 @@ def customize_compiler(compiler): # that Python itself was built on. Also the user OS # version and build tools may not support the same set # of CPU architectures for universal builds. @@ -34,3 +49,6 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/sysconfig.py Python-3.8.0/Lib/distuti # Use get_config_var() to ensure _config_vars is initialized. if not get_config_var('CUSTOMIZED_OSX_COMPILER'): import _osx_support +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0260-MINGW-compiler-enable-new-dtags.patch b/mingw-w64-python3.9/0013-MINGW-compiler-enable-new-dtags.patch similarity index 50% rename from mingw-w64-python3.9/0260-MINGW-compiler-enable-new-dtags.patch rename to mingw-w64-python3.9/0013-MINGW-compiler-enable-new-dtags.patch index 88cb08f06e95d..4cca8f577bd16 100644 --- a/mingw-w64-python3.9/0260-MINGW-compiler-enable-new-dtags.patch +++ b/mingw-w64-python3.9/0013-MINGW-compiler-enable-new-dtags.patch @@ -1,7 +1,22 @@ -diff -Naur Python-3.8.0-orig/Lib/distutils/unixccompiler.py Python-3.8.0/Lib/distutils/unixccompiler.py ---- Python-3.8.0-orig/Lib/distutils/unixccompiler.py 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Lib/distutils/unixccompiler.py 2019-10-22 10:01:11.964963100 +0300 -@@ -248,9 +248,13 @@ +From 4d87fad7b9ab33833ec986fd9434181f2c762629 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?= + +Date: Thu, 17 Jun 2021 18:51:22 +0530 +Subject: [PATCH 13/N] MINGW compiler enable new dtags +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Lib/distutils/unixccompiler.py | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py +index f0792de..60776bc 100644 +--- a/Lib/distutils/unixccompiler.py ++++ b/Lib/distutils/unixccompiler.py +@@ -248,9 +248,13 @@ class UnixCCompiler(CCompiler): # -Wl whenever gcc was used in the past it is probably # safest to keep doing so. if sysconfig.get_config_var("GNULD") == "yes": @@ -17,3 +32,6 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/unixccompiler.py Python-3.8.0/Lib/dis else: return "-Wl,-R" + dir else: +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0290-issue6672-v2-Add-Mingw-recognition-to-pyport.h-to-al.patch b/mingw-w64-python3.9/0014-issue6672-v2-Add-Mingw-recognition-to-pyport.h-to-al.patch similarity index 70% rename from mingw-w64-python3.9/0290-issue6672-v2-Add-Mingw-recognition-to-pyport.h-to-al.patch rename to mingw-w64-python3.9/0014-issue6672-v2-Add-Mingw-recognition-to-pyport.h-to-al.patch index c95a59a04c45d..c822b28677fdd 100644 --- a/mingw-w64-python3.9/0290-issue6672-v2-Add-Mingw-recognition-to-pyport.h-to-al.patch +++ b/mingw-w64-python3.9/0014-issue6672-v2-Add-Mingw-recognition-to-pyport.h-to-al.patch @@ -1,7 +1,23 @@ -diff -Naur Python-3.8.0-orig/Include/pyport.h Python-3.8.0/Include/pyport.h ---- Python-3.8.0-orig/Include/pyport.h 2019-10-22 10:00:37.955903300 +0300 -+++ Python-3.8.0/Include/pyport.h 2019-10-22 10:01:14.850968200 +0300 -@@ -664,12 +664,12 @@ +From 128ba7236216058f94f7030245dcacd09c82de1e 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?= + +Date: Thu, 17 Jun 2021 18:51:23 +0530 +Subject: [PATCH 14/N] issue6672 v2 Add Mingw recognition to pyport.h to al +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Include/pyport.h | 20 +++++++++++--------- + setup.py | 3 +++ + 2 files changed, 14 insertions(+), 9 deletions(-) + +diff --git a/Include/pyport.h b/Include/pyport.h +index 475c2a8..a05fa3a 100644 +--- a/Include/pyport.h ++++ b/Include/pyport.h +@@ -664,12 +664,12 @@ extern char * _getpty(int *, int, mode_t, int); */ /* @@ -17,7 +33,7 @@ diff -Naur Python-3.8.0-orig/Include/pyport.h Python-3.8.0/Include/pyport.h # define HAVE_DECLSPEC_DLL #endif -@@ -682,21 +682,23 @@ +@@ -682,21 +682,23 @@ extern char * _getpty(int *, int, mode_t, int); # define PyAPI_FUNC(RTYPE) Py_EXPORTED_SYMBOL RTYPE # define PyAPI_DATA(RTYPE) extern Py_EXPORTED_SYMBOL RTYPE /* module init functions inside the core need no external linkage */ @@ -47,12 +63,13 @@ diff -Naur Python-3.8.0-orig/Include/pyport.h Python-3.8.0/Include/pyport.h # define PyAPI_DATA(RTYPE) extern Py_IMPORTED_SYMBOL RTYPE /* module init functions outside the core must be exported */ # if defined(__cplusplus) -diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py ---- Python-3.8.0-orig/setup.py 2019-10-22 10:00:25.787881900 +0300 -+++ Python-3.8.0/setup.py 2019-10-22 10:01:15.256568900 +0300 -@@ -316,6 +316,9 @@ - raise ValueError("No source directory; cannot proceed.") - self.srcdir = os.path.abspath(self.srcdir) +diff --git a/setup.py b/setup.py +index 04eb6b2..b483dd3 100644 +--- a/setup.py ++++ b/setup.py +@@ -444,6 +444,9 @@ class PyBuildExt(build_ext): + def build_extensions(self): + self.set_srcdir() + if MS_WINDOWS: + self.compiler.define_macro("Py_BUILD_CORE_MODULE") @@ -60,3 +77,6 @@ diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py # Detect which modules should be compiled self.detect_modules() +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0300-MINGW-configure-for-shared-build.patch b/mingw-w64-python3.9/0015-MINGW-configure-for-shared-build.patch similarity index 59% rename from mingw-w64-python3.9/0300-MINGW-configure-for-shared-build.patch rename to mingw-w64-python3.9/0015-MINGW-configure-for-shared-build.patch index 1b81791f8510e..cdc6d12c0e0e5 100644 --- a/mingw-w64-python3.9/0300-MINGW-configure-for-shared-build.patch +++ b/mingw-w64-python3.9/0015-MINGW-configure-for-shared-build.patch @@ -1,7 +1,22 @@ -diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac ---- Python-3.8.0-orig/configure.ac 2019-10-22 10:01:07.206954700 +0300 -+++ Python-3.8.0/configure.ac 2019-10-22 10:01:18.470174500 +0300 -@@ -1204,6 +1204,13 @@ +From 391120bfde1bea508237ae8478e75064f9e423b0 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?= + +Date: Thu, 17 Jun 2021 18:51:24 +0530 +Subject: [PATCH 15/N] MINGW configure for shared build +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + configure.ac | 20 +++++++++++++++++++- + 1 file changed, 19 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 5320f26..a55413f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1240,6 +1240,13 @@ if test $enable_shared = "yes"; then ;; esac @@ -15,7 +30,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac else # shared is disabled PY_ENABLE_SHARED=0 case $ac_sys_system in -@@ -1212,6 +1219,10 @@ +@@ -1248,6 +1255,10 @@ else # shared is disabled LDLIBRARY='libpython$(LDVERSION).dll.a' ;; esac @@ -26,7 +41,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac fi if test "$cross_compiling" = yes; then -@@ -2760,6 +2771,12 @@ +@@ -2840,6 +2851,12 @@ then LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";; *) LDSHARED="ld";; esac @@ -39,7 +54,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac fi AC_MSG_RESULT($LDSHARED) LDCXXSHARED=${LDCXXSHARED-$LDSHARED} -@@ -5478,7 +5495,8 @@ +@@ -5651,7 +5668,8 @@ case $host in dnl "errmap.h" from $srcdir/PC. dnl Note we cannot use BASECPPFLAGS as autogenerated pyconfig.h dnl has to be before customized located in ../PC. @@ -49,3 +64,6 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac ;; esac +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0310-MINGW-dynamic-loading-support.patch b/mingw-w64-python3.9/0016-MINGW-dynamic-loading-support.patch similarity index 54% rename from mingw-w64-python3.9/0310-MINGW-dynamic-loading-support.patch rename to mingw-w64-python3.9/0016-MINGW-dynamic-loading-support.patch index 791c700515e76..514b991b8aa6e 100644 --- a/mingw-w64-python3.9/0310-MINGW-dynamic-loading-support.patch +++ b/mingw-w64-python3.9/0016-MINGW-dynamic-loading-support.patch @@ -1,46 +1,24 @@ -diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac ---- Python-3.8.0-orig/configure.ac 2019-10-22 10:01:20.201777600 +0300 -+++ Python-3.8.0/configure.ac 2019-10-22 10:01:21.340579600 +0300 -@@ -2635,6 +2635,9 @@ - CYGWIN*) SHLIB_SUFFIX=.dll;; - *) SHLIB_SUFFIX=.so;; - esac -+ case $host_os in -+ mingw*) SHLIB_SUFFIX=.dll;; -+ esac - fi - AC_MSG_RESULT($SHLIB_SUFFIX) - -@@ -3677,6 +3680,12 @@ - fi - ;; - esac -+ case $host in -+ *-*-mingw*) -+ DYNLOADFILE="dynload_win.o" -+ extra_machdep_objs="$extra_machdep_objs PC/dl_nt.o" -+ ;; -+ esac - fi - AC_MSG_RESULT($DYNLOADFILE) - if test "$DYNLOADFILE" != "dynload_stub.o" -@@ -4837,6 +4846,12 @@ - *) - EXT_SUFFIX=${SHLIB_SUFFIX};; - esac -+case $host_os in -+ mingw*) -+ dnl Synchronized with _PyImport_DynLoadFiletab (dynload_win.c) -+ dnl Do not use more then one dot on this platform ! -+ EXT_SUFFIX=-$SOABI$SHLIB_SUFFIX;; -+esac - - AC_MSG_CHECKING(LDVERSION) - LDVERSION='$(VERSION)$(ABIFLAGS)' -diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in ---- Python-3.8.0-orig/Makefile.pre.in 2019-10-22 10:00:29.734688900 +0300 -+++ Python-3.8.0/Makefile.pre.in 2019-10-22 10:01:21.746180300 +0300 -@@ -784,6 +784,12 @@ +From 35fc50f08aa08c33ff0ac6b1a034269ef9d6f067 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?= + +Date: Thu, 17 Jun 2021 18:51:25 +0530 +Subject: [PATCH 16/N] MINGW dynamic loading support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Makefile.pre.in | 6 ++++++ + Python/dynload_win.c | 9 +++++++-- + configure.ac | 15 +++++++++++++++ + 3 files changed, 28 insertions(+), 2 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 7f591e3..71d0056 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -823,6 +823,12 @@ Python/dynload_hpux.o: $(srcdir)/Python/dynload_hpux.c Makefile -DSHLIB_EXT='"$(EXT_SUFFIX)"' \ -o $@ $(srcdir)/Python/dynload_hpux.c @@ -53,10 +31,11 @@ diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile $(srcdir)/Include/pydtrace.h $(CC) -c $(PY_CORE_CFLAGS) \ -DABIFLAGS='"$(ABIFLAGS)"' \ -diff -Naur Python-3.8.0-orig/Python/dynload_win.c Python-3.8.0/Python/dynload_win.c ---- Python-3.8.0-orig/Python/dynload_win.c 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Python/dynload_win.c 2019-10-22 10:01:22.151781000 +0300 -@@ -33,6 +33,12 @@ +diff --git a/Python/dynload_win.c b/Python/dynload_win.c +index 81787e5..9d7690e 100644 +--- a/Python/dynload_win.c ++++ b/Python/dynload_win.c +@@ -27,6 +27,12 @@ #define PYD_UNTAGGED_SUFFIX PYD_DEBUG_SUFFIX ".pyd" const char *_PyImport_DynLoadFiletab[] = { @@ -69,7 +48,7 @@ diff -Naur Python-3.8.0-orig/Python/dynload_win.c Python-3.8.0/Python/dynload_wi PYD_TAGGED_SUFFIX, PYD_UNTAGGED_SUFFIX, NULL -@@ -203,8 +209,7 @@ +@@ -192,8 +198,7 @@ _Py_COMP_DIAG_POP ensure DLLs adjacent to the PYD are preferred. */ Py_BEGIN_ALLOW_THREADS hDLL = LoadLibraryExW(wpathname, NULL, @@ -77,5 +56,48 @@ diff -Naur Python-3.8.0-orig/Python/dynload_win.c Python-3.8.0/Python/dynload_wi - LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR); + LOAD_WITH_ALTERED_SEARCH_PATH); Py_END_ALLOW_THREADS - #if HAVE_SXS - _Py_DeactivateActCtx(cookie); + + /* restore old error mode settings */ +diff --git a/configure.ac b/configure.ac +index a55413f..16b8e96 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2715,6 +2715,9 @@ if test -z "$SHLIB_SUFFIX"; then + CYGWIN*) SHLIB_SUFFIX=.dll;; + *) SHLIB_SUFFIX=.so;; + esac ++ case $host_os in ++ mingw*) SHLIB_SUFFIX=.dll;; ++ esac + fi + AC_MSG_RESULT($SHLIB_SUFFIX) + +@@ -3828,6 +3831,12 @@ then + fi + ;; + esac ++ case $host in ++ *-*-mingw*) ++ DYNLOADFILE="dynload_win.o" ++ extra_machdep_objs="$extra_machdep_objs PC/dl_nt.o" ++ ;; ++ esac + fi + AC_MSG_RESULT($DYNLOADFILE) + if test "$DYNLOADFILE" != "dynload_stub.o" +@@ -5648,6 +5657,12 @@ case "$ac_cv_computed_gotos" in yes*) + AC_DEFINE(HAVE_COMPUTED_GOTOS, 1, + [Define if the C compiler supports computed gotos.]) + esac ++case $host_os in ++ mingw*) ++ dnl Synchronized with _PyImport_DynLoadFiletab (dynload_win.c) ++ dnl Do not use more then one dot on this platform ! ++ EXT_SUFFIX=-$SOABI$SHLIB_SUFFIX;; ++esac + + case $ac_sys_system in + AIX*) +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0017-MINGW-ignore-main-program-for-frozen-scripts.patch b/mingw-w64-python3.9/0017-MINGW-ignore-main-program-for-frozen-scripts.patch new file mode 100644 index 0000000000000..34939ad0f5150 --- /dev/null +++ b/mingw-w64-python3.9/0017-MINGW-ignore-main-program-for-frozen-scripts.patch @@ -0,0 +1,52 @@ +From ec428fdd03d073280e6e335e2b94e5a57e2cba79 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?= + +Date: Thu, 17 Jun 2021 18:51:26 +0530 +Subject: [PATCH 17/N] MINGW ignore main program for frozen scripts +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Makefile.pre.in | 2 +- + configure.ac | 10 ++++++++++ + 2 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 71d0056..f58b701 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -352,7 +352,7 @@ PYTHON_OBJS= \ + Python/context.o \ + Python/dynamic_annotations.o \ + Python/errors.o \ +- Python/frozenmain.o \ ++ @PYTHON_OBJS_FROZENMAIN@ \ + Python/future.o \ + Python/getargs.o \ + Python/getcompiler.o \ +diff --git a/configure.ac b/configure.ac +index 16b8e96..f7d668a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -5688,6 +5688,16 @@ case $host in + ;; + esac + ++dnl Python interpreter main program for frozen scripts ++AC_SUBST(PYTHON_OBJS_FROZENMAIN) ++PYTHON_OBJS_FROZENMAIN="Python/frozenmain.o" ++case $host in ++ *-*-mingw*) ++ dnl 'PC/frozen_dllmain.c' - not yet ++ PYTHON_OBJS_FROZENMAIN= ++ ;; ++esac ++ + AC_SUBST(SRCDIRS) + SRCDIRS="Parser Parser/pegen Objects Python Modules Modules/_io Programs" + case $host in +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0018-MINGW-setup-_multiprocessing-module.patch b/mingw-w64-python3.9/0018-MINGW-setup-_multiprocessing-module.patch new file mode 100644 index 0000000000000..fbc3ffaf1eb74 --- /dev/null +++ b/mingw-w64-python3.9/0018-MINGW-setup-_multiprocessing-module.patch @@ -0,0 +1,34 @@ +From aab5093a1e1fa6e96d97b693319e705a5428395f 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?= + +Date: Thu, 17 Jun 2021 18:51:26 +0530 +Subject: [PATCH 18/N] MINGW setup _multiprocessing module +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + setup.py | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/setup.py b/setup.py +index b483dd3..1f96ad4 100644 +--- a/setup.py ++++ b/setup.py +@@ -1761,7 +1761,12 @@ class PyBuildExt(build_ext): + libraries=libs, + include_dirs=["Modules/_multiprocessing"])) + ++ multiprocessing_libs = [] ++ if MS_WINDOWS: ++ multiprocessing_libs += ['ws2_32'] + self.add(Extension('_multiprocessing', multiprocessing_srcs, ++ define_macros={}, ++ libraries=multiprocessing_libs, + include_dirs=["Modules/_multiprocessing"])) + + def detect_uuid(self): +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0360-MINGW-setup-select-module.patch b/mingw-w64-python3.9/0019-MINGW-setup-select-module.patch similarity index 51% rename from mingw-w64-python3.9/0360-MINGW-setup-select-module.patch rename to mingw-w64-python3.9/0019-MINGW-setup-select-module.patch index e8b9763925c1f..2ae641c156143 100644 --- a/mingw-w64-python3.9/0360-MINGW-setup-select-module.patch +++ b/mingw-w64-python3.9/0019-MINGW-setup-select-module.patch @@ -1,7 +1,23 @@ -diff -Naur Python-3.8.0-orig/Modules/selectmodule.c Python-3.8.0/Modules/selectmodule.c ---- Python-3.8.0-orig/Modules/selectmodule.c 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Modules/selectmodule.c 2019-10-22 10:01:32.759799600 +0300 -@@ -134,9 +134,9 @@ +From 756659799bc95a9c798fcdf772899518fce6f04a 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?= + +Date: Thu, 17 Jun 2021 18:51:29 +0530 +Subject: [PATCH 19/N] MINGW setup select module +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Modules/selectmodule.c | 6 +++--- + setup.py | 6 +++++- + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c +index fb71e91..ad3990c 100644 +--- a/Modules/selectmodule.c ++++ b/Modules/selectmodule.c +@@ -155,9 +155,9 @@ seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1]) v = PyObject_AsFileDescriptor( o ); if (v == -1) goto finally; @@ -13,7 +29,7 @@ diff -Naur Python-3.8.0-orig/Modules/selectmodule.c Python-3.8.0/Modules/selectm if (!_PyIsSelectable_fd(v)) { PyErr_SetString(PyExc_ValueError, "filedescriptor out of range in select()"); -@@ -144,7 +144,7 @@ +@@ -165,7 +165,7 @@ seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1]) } if (v > max) max = v; @@ -22,10 +38,11 @@ diff -Naur Python-3.8.0-orig/Modules/selectmodule.c Python-3.8.0/Modules/selectm FD_SET(v, set); /* add object and its file descriptor to the list */ -diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py ---- Python-3.8.0-orig/setup.py 2019-10-22 10:01:31.636597600 +0300 -+++ Python-3.8.0/setup.py 2019-10-22 10:01:33.181000400 +0300 -@@ -817,7 +817,11 @@ +diff --git a/setup.py b/setup.py +index 1f96ad4..a6145c4 100644 +--- a/setup.py ++++ b/setup.py +@@ -903,7 +903,11 @@ class PyBuildExt(build_ext): self.missing.append('spwd') # select(2); not on ancient System V @@ -38,3 +55,6 @@ diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py # Fred Drake's interface to the Python parser self.add(Extension('parser', ['parsermodule.c'])) +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0020-MINGW-setup-_ctypes-module-with-system-libffi.patch b/mingw-w64-python3.9/0020-MINGW-setup-_ctypes-module-with-system-libffi.patch new file mode 100644 index 0000000000000..c67dd39c3d705 --- /dev/null +++ b/mingw-w64-python3.9/0020-MINGW-setup-_ctypes-module-with-system-libffi.patch @@ -0,0 +1,45 @@ +From 188887b42ba6d0275fc7fed4e24651ffb5a4c343 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?= + +Date: Thu, 17 Jun 2021 18:51:30 +0530 +Subject: [PATCH 20/N] MINGW setup _ctypes module with system libffi +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +--- + setup.py | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index a6145c4..e36ef5d 100644 +--- a/setup.py ++++ b/setup.py +@@ -2149,9 +2149,12 @@ class PyBuildExt(build_ext): + self.add(ext) + if TEST_EXTENSIONS: + # function my_sqrt() needs libm for sqrt() ++ ffi_test_libs = ['m'] ++ if MS_WINDOWS: ++ ffi_test_libs += ['oleaut32'] + self.add(Extension('_ctypes_test', + sources=['_ctypes/_ctypes_test.c'], +- libraries=['m'])) ++ libraries=ffi_test_libs)) + + ffi_inc = sysconfig.get_config_var("LIBFFI_INCLUDEDIR") + ffi_lib = None +@@ -2196,6 +2199,8 @@ class PyBuildExt(build_ext): + + ext.include_dirs.append(ffi_inc) + ext.libraries.append(ffi_lib) ++ if MS_WINDOWS: ++ ext.libraries.extend(['ole32', 'oleaut32', 'uuid']) + self.use_system_libffi = True + + if sysconfig.get_config_var('HAVE_LIBDL'): +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0380-MINGW-defect-winsock2-and-setup-_socket-module.patch b/mingw-w64-python3.9/0021-MINGW-defect-winsock2-and-setup-_socket-module.patch similarity index 68% rename from mingw-w64-python3.9/0380-MINGW-defect-winsock2-and-setup-_socket-module.patch rename to mingw-w64-python3.9/0021-MINGW-defect-winsock2-and-setup-_socket-module.patch index b36a1318b9f9e..6b74e6c7277da 100644 --- a/mingw-w64-python3.9/0380-MINGW-defect-winsock2-and-setup-_socket-module.patch +++ b/mingw-w64-python3.9/0021-MINGW-defect-winsock2-and-setup-_socket-module.patch @@ -1,7 +1,70 @@ -diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac ---- Python-3.8.0-orig/configure.ac 2019-10-22 10:01:27.970591200 +0300 -+++ Python-3.8.0/configure.ac 2019-10-22 10:01:39.327411100 +0300 -@@ -4291,21 +4291,36 @@ +From 4b846b0a795f43be6fcdc4b16aa8c191cc2f25e6 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?= + +Date: Thu, 17 Jun 2021 18:51:30 +0530 +Subject: [PATCH 21/N] MINGW defect winsock2 and setup _socket module +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Misc/config_mingw | 3 +++ + Modules/socketmodule.c | 8 ++++++-- + configure.ac | 28 +++++++++++++++++++++++----- + pyconfig.h.in | 7 +++++-- + setup.py | 2 ++ + 5 files changed, 39 insertions(+), 9 deletions(-) + +diff --git a/Misc/config_mingw b/Misc/config_mingw +index 513065d..9be43fd 100644 +--- a/Misc/config_mingw ++++ b/Misc/config_mingw +@@ -10,3 +10,6 @@ ac_cv_func_alarm=ignore + # files to ignore + ac_cv_file__dev_ptmx=ignore #NOTE: under MSYS environment device exist + ac_cv_file__dev_ptc=no ++ ++# force detection of winsock2 functionality - require wxp or newer ++ac_cv_func_getpeername=yes +diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c +index 8953185..d15bb4f 100644 +--- a/Modules/socketmodule.c ++++ b/Modules/socketmodule.c +@@ -305,7 +305,7 @@ http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/net/getaddrinfo.c.diff?r1=1.82& + # endif + + /* Macros based on the IPPROTO enum, see: https://bugs.python.org/issue29515 */ +-#ifdef MS_WINDOWS ++#ifdef _MSC_VER + #define IPPROTO_ICMP IPPROTO_ICMP + #define IPPROTO_IGMP IPPROTO_IGMP + #define IPPROTO_GGP IPPROTO_GGP +@@ -336,7 +336,7 @@ http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/net/getaddrinfo.c.diff?r1=1.82& + #define IPPROTO_PGM IPPROTO_PGM // WinSock2 only + #define IPPROTO_L2TP IPPROTO_L2TP // WinSock2 only + #define IPPROTO_SCTP IPPROTO_SCTP // WinSock2 only +-#endif /* MS_WINDOWS */ ++#endif /* _MSC_VER */ + + /* Provides the IsWindows7SP1OrGreater() function */ + #include +@@ -429,6 +429,10 @@ remove_unusable_flags(PyObject *m) + /* Do not include addrinfo.h for MSVC7 or greater. 'addrinfo' and + * EAI_* constants are defined in (the already included) ws2tcpip.h. + */ ++#elif defined(__MINGW32__) ++ /* Do not include addrinfo.h as minimum supported version is ++ * _WIN32_WINNT >= WindowsXP(0x0501) ++ */ + #else + # include "addrinfo.h" + #endif +diff --git a/configure.ac b/configure.ac +index f7d668a..46a7c81 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -4439,21 +4439,36 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ],[]) AC_MSG_RESULT($was_it_defined) @@ -42,7 +105,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac [ac_cv_struct_sockaddr_storage=yes], [ac_cv_struct_sockaddr_storage=no])) AC_MSG_RESULT($ac_cv_struct_sockaddr_storage) -@@ -5411,7 +5426,10 @@ +@@ -5578,7 +5593,10 @@ fi AC_CHECK_TYPE(socklen_t,, AC_DEFINE(socklen_t,int, @@ -54,51 +117,10 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac #ifdef HAVE_SYS_TYPES_H #include #endif -diff -Naur Python-3.8.0-orig/Misc/config_mingw Python-3.8.0/Misc/config_mingw ---- Python-3.8.0-orig/Misc/config_mingw 2019-10-22 10:00:45.989917400 +0300 -+++ Python-3.8.0/Misc/config_mingw 2019-10-22 10:01:39.733011900 +0300 -@@ -10,3 +10,6 @@ - # files to ignore - ac_cv_file__dev_ptmx=ignore #NOTE: under MSYS environment device exist - ac_cv_file__dev_ptc=no -+ -+# force detection of winsock2 functionality - require wxp or newer -+ac_cv_func_getpeername=yes -diff -Naur Python-3.8.0-orig/Modules/socketmodule.c Python-3.8.0/Modules/socketmodule.c ---- Python-3.8.0-orig/Modules/socketmodule.c 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Modules/socketmodule.c 2019-10-22 10:01:40.123012500 +0300 -@@ -310,7 +310,7 @@ - # endif - - /* Macros based on the IPPROTO enum, see: https://bugs.python.org/issue29515 */ --#ifdef MS_WINDOWS -+#ifdef _MSC_VER - #define IPPROTO_ICMP IPPROTO_ICMP - #define IPPROTO_IGMP IPPROTO_IGMP - #define IPPROTO_GGP IPPROTO_GGP -@@ -341,7 +341,7 @@ - #define IPPROTO_PGM IPPROTO_PGM // WinSock2 only - #define IPPROTO_L2TP IPPROTO_L2TP // WinSock2 only - #define IPPROTO_SCTP IPPROTO_SCTP // WinSock2 only --#endif /* MS_WINDOWS */ -+#endif /* _MSC_VER */ - - /* Provides the IsWindows7SP1OrGreater() function */ - #include -@@ -434,6 +434,10 @@ - /* Do not include addrinfo.h for MSVC7 or greater. 'addrinfo' and - * EAI_* constants are defined in (the already included) ws2tcpip.h. - */ -+#elif defined(__MINGW32__) -+ /* Do not include addrinfo.h as minimum supported version is -+ * _WIN32_WINNT >= WindowsXP(0x0501) -+ */ - #else - # include "addrinfo.h" - #endif -diff -Naur Python-3.8.0-orig/pyconfig.h.in Python-3.8.0/pyconfig.h.in ---- Python-3.8.0-orig/pyconfig.h.in 2019-10-22 10:00:35.132298300 +0300 -+++ Python-3.8.0/pyconfig.h.in 2019-10-22 10:01:40.513013200 +0300 +diff --git a/pyconfig.h.in b/pyconfig.h.in +index e84708e..574189a 100644 +--- a/pyconfig.h.in ++++ b/pyconfig.h.in @@ -54,7 +54,7 @@ /* Define to 1 if you have the `acosh' function. */ #undef HAVE_ACOSH @@ -108,7 +130,7 @@ diff -Naur Python-3.8.0-orig/pyconfig.h.in Python-3.8.0/pyconfig.h.in #undef HAVE_ADDRINFO /* Define to 1 if you have the `alarm' function. */ -@@ -1335,6 +1335,9 @@ +@@ -1338,6 +1338,9 @@ /* Define if libssl has X509_VERIFY_PARAM_set1_host and related function */ #undef HAVE_X509_VERIFY_PARAM_SET1_HOST @@ -118,7 +140,7 @@ diff -Naur Python-3.8.0-orig/pyconfig.h.in Python-3.8.0/pyconfig.h.in /* Define if the zlib library has inflateCopy */ #undef HAVE_ZLIB_COPY -@@ -1644,7 +1647,7 @@ +@@ -1654,7 +1657,7 @@ /* Define to `unsigned int' if does not define. */ #undef size_t @@ -127,10 +149,11 @@ diff -Naur Python-3.8.0-orig/pyconfig.h.in Python-3.8.0/pyconfig.h.in #undef socklen_t /* Define to `int' if doesn't define. */ -diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py ---- Python-3.8.0-orig/setup.py 2019-10-22 10:01:38.141809100 +0300 -+++ Python-3.8.0/setup.py 2019-10-22 10:01:40.934214000 +0300 -@@ -1140,6 +1140,8 @@ +diff --git a/setup.py b/setup.py +index e36ef5d..b29d23b 100644 +--- a/setup.py ++++ b/setup.py +@@ -1140,6 +1140,8 @@ class PyBuildExt(build_ext): if MACOS: # Issue #35569: Expose RFC 3542 socket options. kwargs['extra_compile_args'] = ['-D__APPLE_USE_RFC_3542'] @@ -139,3 +162,6 @@ diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py self.add(Extension('_socket', ['socketmodule.c'], **kwargs)) elif self.compiler.find_library_file(self.lib_dirs, 'net'): +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0390-MINGW-exclude-unix-only-modules.patch b/mingw-w64-python3.9/0022-MINGW-exclude-unix-only-modules.patch similarity index 75% rename from mingw-w64-python3.9/0390-MINGW-exclude-unix-only-modules.patch rename to mingw-w64-python3.9/0022-MINGW-exclude-unix-only-modules.patch index 624f08cf2408b..9a3fa3c8613cd 100644 --- a/mingw-w64-python3.9/0390-MINGW-exclude-unix-only-modules.patch +++ b/mingw-w64-python3.9/0022-MINGW-exclude-unix-only-modules.patch @@ -1,7 +1,22 @@ -diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py ---- Python-3.8.0-orig/setup.py 2019-10-22 10:01:44.336020000 +0300 -+++ Python-3.8.0/setup.py 2019-10-22 10:01:45.428021900 +0300 -@@ -800,13 +800,21 @@ +From e213cbcfa0d1431ffc9b702bc211b139dcc40490 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?= + +Date: Thu, 17 Jun 2021 18:51:31 +0530 +Subject: [PATCH 22/N] MINGW exclude unix only modules +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + setup.py | 41 +++++++++++++++++++++++++++++------------ + 1 file changed, 29 insertions(+), 12 deletions(-) + +diff --git a/setup.py b/setup.py +index b29d23b..5280ea0 100644 +--- a/setup.py ++++ b/setup.py +@@ -886,13 +886,21 @@ class PyBuildExt(build_ext): if (self.config_h_vars.get('FLOCK_NEEDS_LIBBSD', False)): # May be necessary on AIX for flock function libs = ['bsd'] @@ -27,7 +42,7 @@ diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py # spwd, shadow passwords if (self.config_h_vars.get('HAVE_GETSPNAM', False) or self.config_h_vars.get('HAVE_GETSPENT', False)): -@@ -831,7 +839,10 @@ +@@ -917,7 +925,10 @@ class PyBuildExt(build_ext): # Lance Ellinghaus's syslog module # syslog daemon interface @@ -39,7 +54,7 @@ diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py # Python interface to subinterpreter C-API. self.add(Extension('_xxsubinterpreters', ['_xxsubinterpretersmodule.c'])) -@@ -857,7 +868,10 @@ +@@ -943,7 +954,10 @@ class PyBuildExt(build_ext): self.add(Extension('_csv', ['_csv.c'])) # POSIX subprocess module helper. @@ -51,7 +66,7 @@ diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py def detect_test_extensions(self): # Python C API test module -@@ -1039,13 +1053,16 @@ +@@ -1125,13 +1139,16 @@ class PyBuildExt(build_ext): # the encryption. return @@ -74,3 +89,6 @@ diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py def detect_socket(self): # socket(2) +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0400-MINGW-setup-msvcrt-and-_winapi-modules.patch b/mingw-w64-python3.9/0023-MINGW-setup-msvcrt-and-_winapi-modules.patch similarity index 59% rename from mingw-w64-python3.9/0400-MINGW-setup-msvcrt-and-_winapi-modules.patch rename to mingw-w64-python3.9/0023-MINGW-setup-msvcrt-and-_winapi-modules.patch index e3bdf4fc3e7db..55806510c0ce2 100644 --- a/mingw-w64-python3.9/0400-MINGW-setup-msvcrt-and-_winapi-modules.patch +++ b/mingw-w64-python3.9/0023-MINGW-setup-msvcrt-and-_winapi-modules.patch @@ -1,6 +1,24 @@ -diff -Naur Python-3.8.0-orig/Modules/_winapi.c Python-3.8.0/Modules/_winapi.c ---- Python-3.8.0-orig/Modules/_winapi.c 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Modules/_winapi.c 2019-10-22 10:01:48.485627300 +0300 +From 20ceea30c5c1835866fc69c51367d01ac3a6b45b 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?= + +Date: Thu, 17 Jun 2021 18:51:33 +0530 +Subject: [PATCH 23/N] MINGW setup msvcrt and _winapi modules +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Modules/_winapi.c | 2 ++ + PC/msvcrtmodule.c | 2 ++ + Python/dynamic_annotations.c | 2 +- + setup.py | 21 +++++++++++++++++++++ + 4 files changed, 26 insertions(+), 1 deletion(-) + +diff --git a/Modules/_winapi.c b/Modules/_winapi.c +index e1672c4..ba318a1 100644 +--- a/Modules/_winapi.c ++++ b/Modules/_winapi.c @@ -39,7 +39,9 @@ #define WINDOWS_LEAN_AND_MEAN @@ -11,9 +29,10 @@ diff -Naur Python-3.8.0-orig/Modules/_winapi.c Python-3.8.0/Modules/_winapi.c #include "winreparse.h" #if defined(MS_WIN32) && !defined(MS_WIN64) -diff -Naur Python-3.8.0-orig/PC/msvcrtmodule.c Python-3.8.0/PC/msvcrtmodule.c ---- Python-3.8.0-orig/PC/msvcrtmodule.c 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/PC/msvcrtmodule.c 2019-10-22 10:01:48.891228000 +0300 +diff --git a/PC/msvcrtmodule.c b/PC/msvcrtmodule.c +index faceb03..28e1957 100644 +--- a/PC/msvcrtmodule.c ++++ b/PC/msvcrtmodule.c @@ -21,7 +21,9 @@ #include #include @@ -24,9 +43,10 @@ diff -Naur Python-3.8.0-orig/PC/msvcrtmodule.c Python-3.8.0/PC/msvcrtmodule.c #include #ifdef _MSC_VER -diff -Naur Python-3.8.0-orig/Python/dynamic_annotations.c Python-3.8.0/Python/dynamic_annotations.c ---- Python-3.8.0-orig/Python/dynamic_annotations.c 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Python/dynamic_annotations.c 2019-10-22 10:01:49.296828700 +0300 +diff --git a/Python/dynamic_annotations.c b/Python/dynamic_annotations.c +index 7febaa0..70d5b3d 100644 +--- a/Python/dynamic_annotations.c ++++ b/Python/dynamic_annotations.c @@ -27,7 +27,7 @@ * Author: Kostya Serebryany */ @@ -36,10 +56,11 @@ diff -Naur Python-3.8.0-orig/Python/dynamic_annotations.c Python-3.8.0/Python/dy # include #endif -diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py ---- Python-3.8.0-orig/setup.py 2019-10-22 10:01:47.378025300 +0300 -+++ Python-3.8.0/setup.py 2019-10-22 10:01:49.702429400 +0300 -@@ -1540,6 +1540,27 @@ +diff --git a/setup.py b/setup.py +index 5280ea0..736b0f0 100644 +--- a/setup.py ++++ b/setup.py +@@ -1599,6 +1599,27 @@ class PyBuildExt(build_ext): '-framework', 'SystemConfiguration', '-framework', 'CoreFoundation'])) @@ -67,3 +88,6 @@ diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py def detect_compress_exts(self): # Andrew Kuchling's zlib module. Note that some versions of zlib # 1.1.3 have security problems. See CERT Advisory CA-2002-07: +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0410-MINGW-build-extensions-with-GCC.patch b/mingw-w64-python3.9/0024-MINGW-build-extensions-with-GCC.patch similarity index 59% rename from mingw-w64-python3.9/0410-MINGW-build-extensions-with-GCC.patch rename to mingw-w64-python3.9/0024-MINGW-build-extensions-with-GCC.patch index 436f2c442d4d7..ab010e17ae1b3 100644 --- a/mingw-w64-python3.9/0410-MINGW-build-extensions-with-GCC.patch +++ b/mingw-w64-python3.9/0024-MINGW-build-extensions-with-GCC.patch @@ -1,7 +1,24 @@ -diff -Naur Python-3.8.0-orig/Lib/distutils/command/build_ext.py Python-3.8.0/Lib/distutils/command/build_ext.py ---- Python-3.8.0-orig/Lib/distutils/command/build_ext.py 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Lib/distutils/command/build_ext.py 2019-10-22 10:01:53.789636600 +0300 -@@ -186,7 +186,7 @@ +From e1fdcc07f1b62c8c380561cfe174855d888f98dc 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?= + +Date: Thu, 17 Jun 2021 18:51:34 +0530 +Subject: [PATCH 24/N] MINGW build extensions with GCC +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Lib/distutils/command/build_ext.py | 16 +++++++++++++++- + Lib/distutils/util.py | 2 ++ + Lib/sysconfig.py | 2 ++ + 3 files changed, 19 insertions(+), 1 deletion(-) + +diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py +index 1a9bd12..1c9d471 100644 +--- a/Lib/distutils/command/build_ext.py ++++ b/Lib/distutils/command/build_ext.py +@@ -186,7 +186,7 @@ class build_ext(Command): # for extensions under windows use different directories # for Release and Debug builds. # also Python's library directory must be appended to library_dirs @@ -10,7 +27,7 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/command/build_ext.py Python-3.8.0/Lib # the 'libs' directory is for binary installs - we assume that # must be the *native* platform. But we don't really support # cross-compiling via a binary install anyway, so we let it go. -@@ -703,6 +703,20 @@ +@@ -712,6 +712,20 @@ class build_ext(Command): # pyconfig.h that MSVC groks. The other Windows compilers all seem # to need it mentioned explicitly, though, so that's what we do. # Append '_d' to the python import library on debug builds. @@ -31,10 +48,11 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/command/build_ext.py Python-3.8.0/Lib if sys.platform == "win32": from distutils._msvccompiler import MSVCCompiler if not isinstance(self.compiler, MSVCCompiler): -diff -Naur Python-3.8.0-orig/Lib/distutils/util.py Python-3.8.0/Lib/distutils/util.py ---- Python-3.8.0-orig/Lib/distutils/util.py 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Lib/distutils/util.py 2019-10-22 10:01:54.210837300 +0300 -@@ -36,6 +36,8 @@ +diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py +index 4b002ec..7b2e1e0 100644 +--- a/Lib/distutils/util.py ++++ b/Lib/distutils/util.py +@@ -36,6 +36,8 @@ def get_host_platform(): """ if os.name == 'nt': @@ -43,10 +61,11 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/util.py Python-3.8.0/Lib/distutils/ut if 'amd64' in sys.version.lower(): return 'win-amd64' if '(arm)' in sys.version.lower(): -diff -Naur Python-3.8.0-orig/Lib/sysconfig.py Python-3.8.0/Lib/sysconfig.py ---- Python-3.8.0-orig/Lib/sysconfig.py 2019-10-22 10:00:21.731874800 +0300 -+++ Python-3.8.0/Lib/sysconfig.py 2019-10-22 10:01:54.600838000 +0300 -@@ -643,6 +643,8 @@ +diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py +index 505d538..aa49d80 100644 +--- a/Lib/sysconfig.py ++++ b/Lib/sysconfig.py +@@ -656,6 +656,8 @@ def get_platform(): """ if os.name == 'nt': @@ -55,3 +74,6 @@ diff -Naur Python-3.8.0-orig/Lib/sysconfig.py Python-3.8.0/Lib/sysconfig.py if 'amd64' in sys.version.lower(): return 'win-amd64' if '(arm)' in sys.version.lower(): +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0420-MINGW-use-Mingw32CCompiler-as-default-compiler-for-m.patch b/mingw-w64-python3.9/0025-MINGW-use-Mingw32CCompiler-as-default-compiler-for-m.patch similarity index 61% rename from mingw-w64-python3.9/0420-MINGW-use-Mingw32CCompiler-as-default-compiler-for-m.patch rename to mingw-w64-python3.9/0025-MINGW-use-Mingw32CCompiler-as-default-compiler-for-m.patch index e0c0edb3b1fcd..6756baf813956 100644 --- a/mingw-w64-python3.9/0420-MINGW-use-Mingw32CCompiler-as-default-compiler-for-m.patch +++ b/mingw-w64-python3.9/0025-MINGW-use-Mingw32CCompiler-as-default-compiler-for-m.patch @@ -1,7 +1,23 @@ -diff -Naur Python-3.8.0-orig/Lib/distutils/ccompiler.py Python-3.8.0/Lib/distutils/ccompiler.py ---- Python-3.8.0-orig/Lib/distutils/ccompiler.py 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Lib/distutils/ccompiler.py 2019-10-22 10:01:58.266844500 +0300 -@@ -9,7 +9,7 @@ +From 3de841304c79b647ae07d5a4f2feb261ade5c956 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?= + +Date: Thu, 17 Jun 2021 18:51:35 +0530 +Subject: [PATCH 25/N] MINGW use Mingw32CCompiler as default compiler for m +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Lib/distutils/ccompiler.py | 4 +++- + Lib/distutils/cygwinccompiler.py | 11 ++++++++--- + 2 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py +index b5ef143..24eafc6 100644 +--- a/Lib/distutils/ccompiler.py ++++ b/Lib/distutils/ccompiler.py +@@ -9,7 +9,7 @@ from distutils.spawn import spawn from distutils.file_util import move_file from distutils.dir_util import mkpath from distutils.dep_util import newer_group @@ -10,7 +26,7 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/ccompiler.py Python-3.8.0/Lib/distuti from distutils import log class CCompiler: -@@ -948,6 +948,8 @@ +@@ -948,6 +948,8 @@ def get_default_compiler(osname=None, platform=None): osname = os.name if platform is None: platform = sys.platform @@ -19,10 +35,11 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/ccompiler.py Python-3.8.0/Lib/distuti for pattern, compiler in _default_compilers: if re.match(pattern, platform) is not None or \ re.match(pattern, osname) is not None: -diff -Naur Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py Python-3.8.0/Lib/distutils/cygwinccompiler.py ---- Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Lib/distutils/cygwinccompiler.py 2019-10-22 10:01:58.656845200 +0300 -@@ -255,11 +255,16 @@ +diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py +index 66c12dd..1960ef8 100644 +--- a/Lib/distutils/cygwinccompiler.py ++++ b/Lib/distutils/cygwinccompiler.py +@@ -253,11 +253,16 @@ class CygwinCCompiler(UnixCCompiler): output_dir = '' obj_names = [] for src_name in source_filenames: @@ -41,7 +58,7 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py Python-3.8.0/Lib/d if strip_dir: base = os.path.basename (base) if ext in ('.res', '.rc'): -@@ -315,7 +320,7 @@ +@@ -313,7 +318,7 @@ class Mingw32CCompiler(CygwinCCompiler): # Include the appropriate MSVC runtime library if Python was built # with MSVC 7.0 or later. @@ -50,3 +67,6 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py Python-3.8.0/Lib/d # Because these compilers aren't configured in Python's pyconfig.h file by # default, we should at least warn the user if he is using an unmodified +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0026-MINGW-find-import-library.patch b/mingw-w64-python3.9/0026-MINGW-find-import-library.patch new file mode 100644 index 0000000000000..f8c65a4fb9113 --- /dev/null +++ b/mingw-w64-python3.9/0026-MINGW-find-import-library.patch @@ -0,0 +1,29 @@ +From a9a0d4789170e68d46a57a75d7c94f95ee2ba809 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?= + +Date: Thu, 17 Jun 2021 18:51:36 +0530 +Subject: [PATCH 26/N] MINGW find import library +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Lib/distutils/cygwinccompiler.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py +index 1960ef8..39ad631 100644 +--- a/Lib/distutils/cygwinccompiler.py ++++ b/Lib/distutils/cygwinccompiler.py +@@ -91,6 +91,7 @@ class CygwinCCompiler(UnixCCompiler): + obj_extension = ".o" + static_lib_extension = ".a" + shared_lib_extension = ".dll" ++ dylib_lib_extension = ".dll.a" + static_lib_format = "lib%s%s" + shared_lib_format = "%s%s" + exe_extension = ".exe" +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0027-MINGW-setup-_ssl-module.patch b/mingw-w64-python3.9/0027-MINGW-setup-_ssl-module.patch new file mode 100644 index 0000000000000..d704938950c79 --- /dev/null +++ b/mingw-w64-python3.9/0027-MINGW-setup-_ssl-module.patch @@ -0,0 +1,30 @@ +From 910384b221ffc5af984e8de945dfde1a1ed63e26 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?= + +Date: Thu, 17 Jun 2021 18:51:37 +0530 +Subject: [PATCH 27/N] MINGW setup _ssl module +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + setup.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/setup.py b/setup.py +index 736b0f0..143a1c9 100644 +--- a/setup.py ++++ b/setup.py +@@ -2381,6 +2381,8 @@ class PyBuildExt(build_ext): + openssl_includes = split_var('OPENSSL_INCLUDES', '-I') + openssl_libdirs = split_var('OPENSSL_LDFLAGS', '-L') + openssl_libs = split_var('OPENSSL_LIBS', '-l') ++ if MS_WINDOWS: ++ openssl_libs += tuple(['ws2_32']) + if not openssl_libs: + # libssl and libcrypto not found + self.missing.extend(['_ssl', '_hashlib']) +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0460-MINGW-generalization-of-posix-build-in-sysconfig.py.patch b/mingw-w64-python3.9/0028-MINGW-generalization-of-posix-build-in-sysconfig.py.patch similarity index 64% rename from mingw-w64-python3.9/0460-MINGW-generalization-of-posix-build-in-sysconfig.py.patch rename to mingw-w64-python3.9/0028-MINGW-generalization-of-posix-build-in-sysconfig.py.patch index 5b0858296788d..4f830e3011d07 100644 --- a/mingw-w64-python3.9/0460-MINGW-generalization-of-posix-build-in-sysconfig.py.patch +++ b/mingw-w64-python3.9/0028-MINGW-generalization-of-posix-build-in-sysconfig.py.patch @@ -1,7 +1,22 @@ -diff -Naur Python-3.8.0-orig/Lib/sysconfig.py Python-3.8.0/Lib/sysconfig.py ---- Python-3.8.0-orig/Lib/sysconfig.py 2019-10-22 10:01:57.159242500 +0300 -+++ Python-3.8.0/Lib/sysconfig.py 2019-10-22 10:02:07.580060800 +0300 -@@ -100,6 +100,9 @@ +From 55628e9cab822879556e1bee2b1fb5cdf6960977 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?= + +Date: Thu, 17 Jun 2021 18:51:38 +0530 +Subject: [PATCH 28/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: Алексей +--- + Lib/sysconfig.py | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py +index aa49d80..d4298f7 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 @@ -11,7 +26,7 @@ diff -Naur Python-3.8.0-orig/Lib/sysconfig.py Python-3.8.0/Lib/sysconfig.py def _safe_realpath(path): try: -@@ -183,7 +186,7 @@ +@@ -183,7 +186,7 @@ def _expand_vars(scheme, vars): def _get_default_scheme(): @@ -20,7 +35,7 @@ diff -Naur Python-3.8.0-orig/Lib/sysconfig.py Python-3.8.0/Lib/sysconfig.py # the default scheme for posix is posix_prefix return 'posix_prefix' return os.name -@@ -199,7 +202,7 @@ +@@ -199,7 +202,7 @@ def _getuserbase(): def joinuser(*args): return os.path.expanduser(os.path.join(*args)) @@ -29,7 +44,7 @@ diff -Naur Python-3.8.0-orig/Lib/sysconfig.py Python-3.8.0/Lib/sysconfig.py base = os.environ.get("APPDATA") or "~" return joinuser(base, "Python") -@@ -504,7 +507,7 @@ +@@ -504,7 +507,7 @@ def parse_config_h(fp, vars=None): def get_config_h_filename(): """Return the path of pyconfig.h.""" if _PYTHON_BUILD: @@ -38,7 +53,7 @@ diff -Naur Python-3.8.0-orig/Lib/sysconfig.py Python-3.8.0/Lib/sysconfig.py inc_dir = os.path.join(_sys_home or _PROJECT_BASE, "PC") else: inc_dir = _sys_home or _PROJECT_BASE -@@ -576,10 +579,10 @@ +@@ -576,10 +579,10 @@ def get_config_vars(*args): # sys.abiflags may not be defined on all platforms. _CONFIG_VARS['abiflags'] = '' @@ -51,7 +66,7 @@ diff -Naur Python-3.8.0-orig/Lib/sysconfig.py Python-3.8.0/Lib/sysconfig.py _init_posix(_CONFIG_VARS) # For backward compatibility, see issue19555 SO = _CONFIG_VARS.get('EXT_SUFFIX') -@@ -592,7 +595,7 @@ +@@ -592,7 +595,7 @@ def get_config_vars(*args): # Always convert srcdir to an absolute path srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE) @@ -60,3 +75,6 @@ diff -Naur Python-3.8.0-orig/Lib/sysconfig.py Python-3.8.0/Lib/sysconfig.py if _PYTHON_BUILD: # If srcdir is a relative path (typically '.' or '..') # then it should be interpreted relative to the directory +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0462-MINGW-support-stdcall-without-underscore.patch b/mingw-w64-python3.9/0029-MINGW-support-stdcall-without-underscore.patch similarity index 59% rename from mingw-w64-python3.9/0462-MINGW-support-stdcall-without-underscore.patch rename to mingw-w64-python3.9/0029-MINGW-support-stdcall-without-underscore.patch index bcd83aaf586ba..dba343801fd55 100644 --- a/mingw-w64-python3.9/0462-MINGW-support-stdcall-without-underscore.patch +++ b/mingw-w64-python3.9/0029-MINGW-support-stdcall-without-underscore.patch @@ -1,7 +1,22 @@ -diff -Naur Python-3.8.0-orig/Modules/_ctypes/_ctypes.c Python-3.8.0/Modules/_ctypes/_ctypes.c ---- Python-3.8.0-orig/Modules/_ctypes/_ctypes.c 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Modules/_ctypes/_ctypes.c 2019-10-22 10:02:10.434865800 +0300 -@@ -3342,11 +3342,30 @@ +From 84dfb7132e843e81cf6ace7f858b6956b4b77a48 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?= + +Date: Thu, 17 Jun 2021 18:51:39 +0530 +Subject: [PATCH 29/N] MINGW support stdcall without underscore +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Modules/_ctypes/_ctypes.c | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c +index ceae67e..b9cf96b 100644 +--- a/Modules/_ctypes/_ctypes.c ++++ b/Modules/_ctypes/_ctypes.c +@@ -3406,6 +3406,18 @@ static PPROC FindAddress(void *handle, const char *name, PyObject *type) mangled_name = alloca(strlen(name) + 1 + 1 + 1 + 3); /* \0 _ @ %d */ if (!mangled_name) return NULL; @@ -20,15 +35,20 @@ diff -Naur Python-3.8.0-orig/Modules/_ctypes/_ctypes.c Python-3.8.0/Modules/_cty for (i = 0; i < 32; ++i) { sprintf(mangled_name, "_%s@%d", name, i*4); Py_BEGIN_ALLOW_THREADS - address = (PPROC)GetProcAddress(handle, mangled_name); +@@ -3413,6 +3425,13 @@ static PPROC FindAddress(void *handle, const char *name, PyObject *type) Py_END_ALLOW_THREADS -+ if (address) -+ return address; + if (address) + return address; + /* search for function without underscore as weel */ + sprintf(mangled_name, "%s@%d", name, i*4); + Py_BEGIN_ALLOW_THREADS + address = (PPROC)GetProcAddress(handle, mangled_name); + Py_END_ALLOW_THREADS - if (address) - return address; ++ if (address) ++ return address; } + return NULL; + #endif +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0030-use-replace-instead-rename-to-avoid-failure-on-windo.patch b/mingw-w64-python3.9/0030-use-replace-instead-rename-to-avoid-failure-on-windo.patch new file mode 100644 index 0000000000000..b68ae12e9e038 --- /dev/null +++ b/mingw-w64-python3.9/0030-use-replace-instead-rename-to-avoid-failure-on-windo.patch @@ -0,0 +1,31 @@ +From 87c6be7c71ae6ad3b60e620cac3a3fb04cdf6e04 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?= + +Date: Thu, 17 Jun 2021 18:51:40 +0530 +Subject: [PATCH 30/N] use replace instead rename to avoid failure on windo +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +--- + setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index 143a1c9..23e7689 100644 +--- a/setup.py ++++ b/setup.py +@@ -2602,7 +2602,7 @@ class PyBuildScripts(build_scripts): + else: + newfilename = filename + minoronly + log.info('renaming %s to %s', filename, newfilename) +- os.rename(filename, newfilename) ++ os.replace(filename, newfilename) + newoutfiles.append(newfilename) + if filename in updated_files: + newupdated_files.append(newfilename) +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0031-MINGW-avoid-circular-dependency-from-time-module-dur.patch b/mingw-w64-python3.9/0031-MINGW-avoid-circular-dependency-from-time-module-dur.patch new file mode 100644 index 0000000000000..08245f1c712a6 --- /dev/null +++ b/mingw-w64-python3.9/0031-MINGW-avoid-circular-dependency-from-time-module-dur.patch @@ -0,0 +1,37 @@ +From f494a42a1460e94f7cf210f338cc0b75be4ba7a5 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?= + +Date: Thu, 17 Jun 2021 18:51:41 +0530 +Subject: [PATCH 31/N] MINGW avoid circular dependency from time module dur +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Lib/distutils/cygwinccompiler.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py +index 39ad631..5b281e2 100644 +--- a/Lib/distutils/cygwinccompiler.py ++++ b/Lib/distutils/cygwinccompiler.py +@@ -48,7 +48,6 @@ cygwin in no-cygwin mode). + import os + import sys + import copy +-from subprocess import Popen, PIPE, check_output + import re + + from distutils.unixccompiler import UnixCCompiler +@@ -383,6 +382,7 @@ def _find_exe_version(cmd): + executable = cmd.split()[0] + if find_executable(executable) is None: + return None ++ from subprocess import Popen, PIPE + out = Popen(cmd, shell=True, stdout=PIPE).stdout + try: + out_string = out.read() +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0480-MINGW-generalization-of-posix-build-in-distutils-sys.patch b/mingw-w64-python3.9/0032-MINGW-generalization-of-posix-build-in-distutils-sys.patch similarity index 69% rename from mingw-w64-python3.9/0480-MINGW-generalization-of-posix-build-in-distutils-sys.patch rename to mingw-w64-python3.9/0032-MINGW-generalization-of-posix-build-in-distutils-sys.patch index 727c9feee9a53..975b961480753 100644 --- a/mingw-w64-python3.9/0480-MINGW-generalization-of-posix-build-in-distutils-sys.patch +++ b/mingw-w64-python3.9/0032-MINGW-generalization-of-posix-build-in-distutils-sys.patch @@ -1,7 +1,22 @@ -diff -Naur Python-3.8.0-orig/Lib/distutils/sysconfig.py Python-3.8.0/Lib/distutils/sysconfig.py ---- Python-3.8.0-orig/Lib/distutils/sysconfig.py 2019-10-22 10:01:10.872961200 +0300 -+++ Python-3.8.0/Lib/distutils/sysconfig.py 2019-10-22 10:02:18.890080700 +0300 -@@ -64,6 +64,17 @@ +From e88398a38a7f2cf4f2649149c12290e3bdddd392 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?= + +Date: Thu, 17 Jun 2021 18:51:41 +0530 +Subject: [PATCH 32/N] MINGW 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: Алексей +--- + 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() @@ -19,7 +34,7 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/sysconfig.py Python-3.8.0/Lib/distuti # 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 @@ +@@ -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 @@ -28,7 +43,7 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/sysconfig.py Python-3.8.0/Lib/distuti 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 @@ +@@ -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 @@ -37,7 +52,7 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/sysconfig.py Python-3.8.0/Lib/distuti 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 @@ +@@ -261,7 +272,7 @@ def customize_compiler(compiler): def get_config_h_filename(): """Return full pathname of installed pyconfig.h file.""" if python_build: @@ -46,7 +61,7 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/sysconfig.py Python-3.8.0/Lib/distuti inc_dir = os.path.join(_sys_home or project_base, "PC") else: inc_dir = _sys_home or project_base -@@ -467,6 +478,9 @@ +@@ -467,6 +478,9 @@ def _init_posix(): def _init_nt(): @@ -56,7 +71,7 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/sysconfig.py Python-3.8.0/Lib/distuti """Initialize the module as appropriate for NT""" g = {} # set basic install directories -@@ -516,7 +530,7 @@ +@@ -516,7 +530,7 @@ def get_config_vars(*args): # Always convert srcdir to an absolute path srcdir = _config_vars.get('srcdir', project_base) @@ -65,7 +80,7 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/sysconfig.py Python-3.8.0/Lib/distuti if python_build: # If srcdir is a relative path (typically '.' or '..') # then it should be interpreted relative to the directory -@@ -535,7 +549,7 @@ +@@ -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. @@ -74,3 +89,6 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/sysconfig.py Python-3.8.0/Lib/distuti base = project_base if (not os.path.isabs(_config_vars['srcdir']) and base != os.getcwd()): +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0490-MINGW-customize-site.patch b/mingw-w64-python3.9/0033-MINGW-customize-site.patch similarity index 56% rename from mingw-w64-python3.9/0490-MINGW-customize-site.patch rename to mingw-w64-python3.9/0033-MINGW-customize-site.patch index 897d411a8d6e8..f22139fae1b47 100644 --- a/mingw-w64-python3.9/0490-MINGW-customize-site.patch +++ b/mingw-w64-python3.9/0033-MINGW-customize-site.patch @@ -1,7 +1,23 @@ -diff -Naur Python-3.8.0-orig/Lib/site.py Python-3.8.0/Lib/site.py ---- Python-3.8.0-orig/Lib/site.py 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Lib/site.py 2019-10-22 10:02:21.776085800 +0300 -@@ -251,7 +251,8 @@ +From 21c349e1638e5bc0960504f00ec472ef06b979bd 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?= + +Date: Thu, 17 Jun 2021 18:51:42 +0530 +Subject: [PATCH 33/N] MINGW customize site +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +--- + Lib/site.py | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/Lib/site.py b/Lib/site.py +index 9e617af..b344f03 100644 +--- a/Lib/site.py ++++ b/Lib/site.py +@@ -251,7 +251,8 @@ def _getuserbase(): def joinuser(*args): return os.path.expanduser(os.path.join(*args)) @@ -11,7 +27,7 @@ diff -Naur Python-3.8.0-orig/Lib/site.py Python-3.8.0/Lib/site.py base = os.environ.get("APPDATA") or "~" return joinuser(base, "Python") -@@ -266,7 +267,8 @@ +@@ -266,7 +267,8 @@ def _getuserbase(): def _get_path(userbase): version = sys.version_info @@ -21,7 +37,7 @@ diff -Naur Python-3.8.0-orig/Lib/site.py Python-3.8.0/Lib/site.py return f'{userbase}\\Python{version[0]}{version[1]}\\site-packages' if sys.platform == 'darwin' and sys._framework: -@@ -329,6 +331,7 @@ +@@ -329,6 +331,7 @@ def getsitepackages(prefixes=None): if prefixes is None: prefixes = PREFIXES @@ -29,12 +45,15 @@ diff -Naur Python-3.8.0-orig/Lib/site.py Python-3.8.0/Lib/site.py for prefix in prefixes: if not prefix or prefix in seen: continue -@@ -338,7 +341,7 @@ +@@ -338,7 +341,7 @@ def getsitepackages(prefixes=None): if sys.platlibdir != "lib": libdirs.append("lib") - + - if os.sep == '/': + if _POSIX_BUILD: for libdir in libdirs: path = os.path.join(prefix, libdir, "python%d.%d" % sys.version_info[:2], +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0500-add-python-config-sh.patch b/mingw-w64-python3.9/0034-add-python-config-sh.patch similarity index 82% rename from mingw-w64-python3.9/0500-add-python-config-sh.patch rename to mingw-w64-python3.9/0034-add-python-config-sh.patch index be9fa77862831..058f71fbdf39d 100644 --- a/mingw-w64-python3.9/0500-add-python-config-sh.patch +++ b/mingw-w64-python3.9/0034-add-python-config-sh.patch @@ -1,6 +1,22 @@ -diff -Naur Python-3.8.0-orig/Misc/python-config.sh.in Python-3.8.0/Misc/python-config.sh.in ---- Python-3.8.0-orig/Misc/python-config.sh.in 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Misc/python-config.sh.in 2019-10-22 10:02:24.584090700 +0300 +From 6dc04395fc45b3dde8eee803bcad431eabdd0431 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?= + +Date: Thu, 17 Jun 2021 18:51:43 +0530 +Subject: [PATCH 34/N] add python config sh +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +--- + Misc/python-config.sh.in | 62 +++++++++++++++++++++++++--------------- + 1 file changed, 39 insertions(+), 23 deletions(-) + +diff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in +index 2602fe2..e0e048a 100644 +--- a/Misc/python-config.sh.in ++++ b/Misc/python-config.sh.in @@ -1,32 +1,44 @@ #!/bin/sh @@ -56,7 +72,7 @@ diff -Naur Python-3.8.0-orig/Misc/python-config.sh.in Python-3.8.0/Misc/python-c # locations. Keep prefix & exec_prefix using their original values in case # they are referenced in other configure variables, to prevent double # substitution, issue #22140. -@@ -41,13 +53,17 @@ +@@ -41,13 +53,17 @@ LIBM="@LIBM@" LIBC="@LIBC@" SYSLIBS="$LIBM $LIBC" ABIFLAGS="@ABIFLAGS@" @@ -75,7 +91,7 @@ diff -Naur Python-3.8.0-orig/Misc/python-config.sh.in Python-3.8.0/Misc/python-c LIBDEST=${prefix_real}/lib/python${VERSION} LIBPL=$(echo "@LIBPL@" | sed "s#$prefix#$prefix_real#") SO="@EXT_SUFFIX@" -@@ -61,7 +77,7 @@ +@@ -61,7 +77,7 @@ for ARG in $* do case $ARG in --help) @@ -84,7 +100,7 @@ diff -Naur Python-3.8.0-orig/Misc/python-config.sh.in Python-3.8.0/Misc/python-c ;; --embed) PY_EMBED=1 -@@ -69,7 +85,7 @@ +@@ -69,7 +85,7 @@ do --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--abiflags|--configdir) ;; *) @@ -93,7 +109,7 @@ diff -Naur Python-3.8.0-orig/Misc/python-config.sh.in Python-3.8.0/Misc/python-c ;; esac done -@@ -80,37 +96,37 @@ +@@ -80,37 +96,37 @@ fi for ARG in "$@" do @@ -141,3 +157,6 @@ diff -Naur Python-3.8.0-orig/Misc/python-config.sh.in Python-3.8.0/Misc/python-c ;; esac done +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0510-cross-darwin-feature.patch b/mingw-w64-python3.9/0035-cross-darwin-feature.patch similarity index 73% rename from mingw-w64-python3.9/0510-cross-darwin-feature.patch rename to mingw-w64-python3.9/0035-cross-darwin-feature.patch index 7610492612fee..709f044e3eafe 100644 --- a/mingw-w64-python3.9/0510-cross-darwin-feature.patch +++ b/mingw-w64-python3.9/0035-cross-darwin-feature.patch @@ -1,7 +1,22 @@ -diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac ---- Python-3.8.0-orig/configure.ac 2019-10-22 10:01:42.698017100 +0300 -+++ Python-3.8.0/configure.ac 2019-10-22 10:02:27.392095600 +0300 -@@ -396,6 +396,7 @@ +From 5d6d323f954f9f9f14c2bec6aad287f99a3a518b 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?= + +Date: Thu, 17 Jun 2021 18:51:44 +0530 +Subject: [PATCH 35/N] cross darwin feature +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + configure.ac | 54 +++++++++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 49 insertions(+), 5 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 46a7c81..986052c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -398,6 +398,7 @@ if test -z "$MACHDEP" then # avoid using uname for cross builds if test "$cross_compiling" = yes; then @@ -9,7 +24,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac # ac_sys_system and ac_sys_release are used for setting # a lot of different things including 'define_xopen_source' # in the case statement below. -@@ -409,6 +410,27 @@ +@@ -411,6 +412,27 @@ then *-*-cygwin*) ac_sys_system=Cygwin ;; @@ -37,7 +52,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac *-*-vxworks*) ac_sys_system=VxWorks ;; -@@ -417,7 +439,6 @@ +@@ -419,7 +441,6 @@ then MACHDEP="unknown" AC_MSG_ERROR([cross build not supported for $host]) esac @@ -45,7 +60,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac else ac_sys_system=`uname -s` if test "$ac_sys_system" = "AIX" \ -@@ -464,6 +485,9 @@ +@@ -466,6 +487,9 @@ if test "$cross_compiling" = yes; then *-*-mingw*) _host_cpu= ;; @@ -55,7 +70,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac *) # for now, limit cross builds to known configurations MACHDEP="unknown" -@@ -1657,6 +1681,26 @@ +@@ -1659,6 +1683,26 @@ AC_SUBST(BASECFLAGS) AC_SUBST(CFLAGS_NODIST) AC_SUBST(LDFLAGS_NODIST) @@ -82,7 +97,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac # The -arch flags for universal builds on macOS UNIVERSAL_ARCH_FLAGS= AC_SUBST(UNIVERSAL_ARCH_FLAGS) -@@ -2033,7 +2077,7 @@ +@@ -2037,7 +2081,7 @@ yes) ;; esac else @@ -91,7 +106,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac then # 10.4 was the first release to support Intel archs cur_target="10.4" -@@ -2599,7 +2643,7 @@ +@@ -2603,7 +2647,7 @@ case $ac_sys_system/$ac_sys_release in if test "${enable_universalsdk}"; then : else @@ -100,7 +115,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac fi LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';; -@@ -2624,7 +2668,7 @@ +@@ -2628,7 +2672,7 @@ case $ac_sys_system/$ac_sys_release in ]])],[ac_osx_32bit=yes],[ac_osx_32bit=no],[ac_osx_32bit=yes]) if test "${ac_osx_32bit}" = "yes"; then @@ -109,7 +124,7 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac i386) MACOSX_DEFAULT_ARCH="i386" ;; -@@ -2636,7 +2680,7 @@ +@@ -2640,7 +2684,7 @@ case $ac_sys_system/$ac_sys_release in ;; esac else @@ -118,3 +133,6 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac i386) MACOSX_DEFAULT_ARCH="x86_64" ;; +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0520-py3k-mingw-ntthreads-vs-pthreads.patch b/mingw-w64-python3.9/0036-py3k-mingw-ntthreads-vs-pthreads.patch similarity index 51% rename from mingw-w64-python3.9/0520-py3k-mingw-ntthreads-vs-pthreads.patch rename to mingw-w64-python3.9/0036-py3k-mingw-ntthreads-vs-pthreads.patch index 24c444f86e033..93975e31159a0 100644 --- a/mingw-w64-python3.9/0520-py3k-mingw-ntthreads-vs-pthreads.patch +++ b/mingw-w64-python3.9/0036-py3k-mingw-ntthreads-vs-pthreads.patch @@ -1,6 +1,23 @@ -diff -Naur Python-3.8.0-orig/Include/internal/pycore_condvar.h Python-3.8.0/Include/internal/pycore_condvar.h ---- Python-3.8.0-orig/Include/internal/pycore_condvar.h 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Include/internal/pycore_condvar.h 2019-10-22 10:02:30.231300600 +0300 +From a39dffbb9b7b4e7800bb7ce39964632f23e41313 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?= + +Date: Thu, 17 Jun 2021 18:51:45 +0530 +Subject: [PATCH 36/N] py3k mingw ntthreads vs pthreads +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +--- + Include/internal/pycore_condvar.h | 10 ++++++++++ + Include/pythread.h | 6 ++++++ + 2 files changed, 16 insertions(+) + +diff --git a/Include/internal/pycore_condvar.h b/Include/internal/pycore_condvar.h +index 8b89d70..dd98245 100644 +--- a/Include/internal/pycore_condvar.h ++++ b/Include/internal/pycore_condvar.h @@ -5,6 +5,12 @@ # error "this header requires Py_BUILD_CORE define" #endif @@ -25,10 +42,11 @@ diff -Naur Python-3.8.0-orig/Include/internal/pycore_condvar.h Python-3.8.0/Incl /* options */ /* non-emulated condition variables are provided for those that want -diff -Naur Python-3.8.0-orig/Include/pythread.h Python-3.8.0/Include/pythread.h ---- Python-3.8.0-orig/Include/pythread.h 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Include/pythread.h 2019-10-22 10:02:30.652501400 +0300 -@@ -9,6 +9,12 @@ +diff --git a/Include/pythread.h b/Include/pythread.h +index bb9d864..f1e52c6 100644 +--- a/Include/pythread.h ++++ b/Include/pythread.h +@@ -8,6 +8,12 @@ typedef void *PyThread_type_lock; extern "C" { #endif @@ -41,3 +59,6 @@ diff -Naur Python-3.8.0-orig/Include/pythread.h Python-3.8.0/Include/pythread.h /* Return status codes for Python lock acquisition. Chosen for maximum * backwards compatibility, ie failure -> 0, success -> 1. */ typedef enum PyLockStatus { +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0037-mingw-system-libffi.patch b/mingw-w64-python3.9/0037-mingw-system-libffi.patch new file mode 100644 index 0000000000000..8564bd63745c3 --- /dev/null +++ b/mingw-w64-python3.9/0037-mingw-system-libffi.patch @@ -0,0 +1,30 @@ +From a6908e10a4c1179a6b427bb530a84a703366597f 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?= + +Date: Thu, 17 Jun 2021 18:51:45 +0530 +Subject: [PATCH 37/N] mingw system libffi +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + setup.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/setup.py b/setup.py +index 23e7689..72f1281 100644 +--- a/setup.py ++++ b/setup.py +@@ -2241,6 +2241,8 @@ class PyBuildExt(build_ext): + ext.libraries.append(ffi_lib) + if MS_WINDOWS: + ext.libraries.extend(['ole32', 'oleaut32', 'uuid']) ++ ext.export_symbols.extend(['DllGetClassObject PRIVATE', ++ 'DllCanUnloadNow PRIVATE']) + self.use_system_libffi = True + + if sysconfig.get_config_var('HAVE_LIBDL'): +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0555-msys-mingw-prefer-unix-sep-if-MSYSTEM.patch b/mingw-w64-python3.9/0038-msys-mingw-prefer-unix-sep-if-MSYSTEM.patch similarity index 76% rename from mingw-w64-python3.9/0555-msys-mingw-prefer-unix-sep-if-MSYSTEM.patch rename to mingw-w64-python3.9/0038-msys-mingw-prefer-unix-sep-if-MSYSTEM.patch index 5a59d71f95cc8..4ead9fca20e92 100644 --- a/mingw-w64-python3.9/0555-msys-mingw-prefer-unix-sep-if-MSYSTEM.patch +++ b/mingw-w64-python3.9/0038-msys-mingw-prefer-unix-sep-if-MSYSTEM.patch @@ -1,7 +1,27 @@ -diff -Naur Python-3.8.0-orig/Include/pylifecycle.h Python-3.8.0/Include/pylifecycle.h ---- Python-3.8.0-orig/Include/pylifecycle.h 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Include/pylifecycle.h 2019-10-22 10:02:36.752112100 +0300 -@@ -21,6 +21,12 @@ +From 348346a3ce94c0dd3780e271d78bea5c5c70752c Mon Sep 17 00:00:00 2001 +From: Ray Donnelly +Date: Thu, 17 Jun 2021 18:51:46 +0530 +Subject: [PATCH 38/N] msys mingw prefer unix sep if MSYSTEM +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +--- + Include/pylifecycle.h | 6 +++ + Lib/ntpath.py | 79 +++++++++++++++++------------- + Modules/posixmodule.c | 2 + + Python/initconfig.c | 4 +- + Python/pathconfig.c | 109 ++++++++++++++++++++++++++++++++++++++++++ + Python/traceback.c | 2 +- + 6 files changed, 165 insertions(+), 37 deletions(-) + +diff --git a/Include/pylifecycle.h b/Include/pylifecycle.h +index 783fcb4..4eec669 100644 +--- a/Include/pylifecycle.h ++++ b/Include/pylifecycle.h +@@ -21,6 +21,12 @@ PyAPI_FUNC(int) Py_IsInitialized(void); PyAPI_FUNC(PyThreadState *) Py_NewInterpreter(void); PyAPI_FUNC(void) Py_EndInterpreter(PyThreadState *); @@ -14,10 +34,11 @@ diff -Naur Python-3.8.0-orig/Include/pylifecycle.h Python-3.8.0/Include/pylifecy /* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level * exit functions. -diff -Naur Python-3.8.0-orig/Lib/ntpath.py Python-3.8.0/Lib/ntpath.py ---- Python-3.8.0-orig/Lib/ntpath.py 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Lib/ntpath.py 2019-10-22 10:02:37.157712800 +0300 -@@ -11,9 +11,7 @@ +diff --git a/Lib/ntpath.py b/Lib/ntpath.py +index 6f77177..77f5614 100644 +--- a/Lib/ntpath.py ++++ b/Lib/ntpath.py +@@ -11,9 +11,7 @@ module as os.path. curdir = '.' pardir = '..' extsep = '.' @@ -27,7 +48,7 @@ diff -Naur Python-3.8.0-orig/Lib/ntpath.py Python-3.8.0/Lib/ntpath.py defpath = '.;C:\\bin' devnull = 'nul' -@@ -23,6 +21,15 @@ +@@ -23,6 +21,15 @@ import stat import genericpath from genericpath import * @@ -43,7 +64,7 @@ diff -Naur Python-3.8.0-orig/Lib/ntpath.py Python-3.8.0/Lib/ntpath.py __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", "getatime","getctime", "islink","exists","lexists","isdir","isfile", -@@ -33,9 +40,27 @@ +@@ -33,9 +40,27 @@ __all__ = ["normcase","isabs","join","splitdrive","split","splitext", def _get_bothseps(path): if isinstance(path, bytes): @@ -61,19 +82,19 @@ diff -Naur Python-3.8.0-orig/Lib/ntpath.py Python-3.8.0/Lib/ntpath.py +def _get_altsep(path): + if isinstance(path, bytes): + return baltsep -+ else: + else: +- return '\\/' + return altsep + +def _get_colon(path): + if isinstance(path, bytes): + return b':' - else: -- return '\\/' ++ else: + return ':' # Normalize the case of a pathname and map slashes to backslashes. # Other normalizations (such as optimizing '../' away) are not done -@@ -47,9 +72,9 @@ +@@ -47,9 +72,9 @@ def normcase(s): Makes all characters lowercase and all slashes into backslashes.""" s = os.fspath(s) if isinstance(s, bytes): @@ -85,7 +106,7 @@ diff -Naur Python-3.8.0-orig/Lib/ntpath.py Python-3.8.0/Lib/ntpath.py # Return whether a path is absolute. -@@ -76,14 +101,9 @@ +@@ -76,14 +101,9 @@ def isabs(s): # Join two (or more) paths. def join(path, *paths): path = os.fspath(path) @@ -103,7 +124,7 @@ diff -Naur Python-3.8.0-orig/Lib/ntpath.py Python-3.8.0/Lib/ntpath.py try: if not paths: path[:0] + sep #23780: Ensure compatible data type even if p is null. -@@ -142,14 +162,9 @@ +@@ -142,14 +162,9 @@ def splitdrive(p): """ p = os.fspath(p) if len(p) >= 2: @@ -121,7 +142,7 @@ diff -Naur Python-3.8.0-orig/Lib/ntpath.py Python-3.8.0/Lib/ntpath.py normp = p.replace(altsep, sep) if (normp[0:2] == sep*2) and (normp[2:3] != sep): # is a UNC path: -@@ -203,9 +218,9 @@ +@@ -203,9 +218,9 @@ def split(p): def splitext(p): p = os.fspath(p) if isinstance(p, bytes): @@ -133,7 +154,7 @@ diff -Naur Python-3.8.0-orig/Lib/ntpath.py Python-3.8.0/Lib/ntpath.py splitext.__doc__ = genericpath._splitext.__doc__ -@@ -450,15 +465,13 @@ +@@ -450,15 +465,13 @@ def expandvars(path): def normpath(path): """Normalize path, eliminating double slashes, etc.""" path = os.fspath(path) @@ -151,7 +172,7 @@ diff -Naur Python-3.8.0-orig/Lib/ntpath.py Python-3.8.0/Lib/ntpath.py curdir = '.' pardir = '..' special_prefixes = ('\\\\.\\', '\\\\?\\') -@@ -668,6 +681,7 @@ +@@ -668,6 +681,7 @@ else: # strip the prefix anyway. if ex.winerror == initial_winerror: path = spath @@ -159,7 +180,7 @@ diff -Naur Python-3.8.0-orig/Lib/ntpath.py Python-3.8.0/Lib/ntpath.py return path -@@ -678,12 +692,11 @@ +@@ -678,12 +692,11 @@ supports_unicode_filenames = (hasattr(sys, "getwindowsversion") and def relpath(path, start=None): """Return a relative version of a path""" path = os.fspath(path) @@ -173,7 +194,7 @@ diff -Naur Python-3.8.0-orig/Lib/ntpath.py Python-3.8.0/Lib/ntpath.py curdir = '.' pardir = '..' -@@ -738,13 +751,11 @@ +@@ -738,13 +751,11 @@ def commonpath(paths): raise ValueError('commonpath() arg is an empty sequence') paths = tuple(map(os.fspath, paths)) @@ -189,10 +210,11 @@ diff -Naur Python-3.8.0-orig/Lib/ntpath.py Python-3.8.0/Lib/ntpath.py curdir = '.' try: -diff -Naur Python-3.8.0-orig/Modules/posixmodule.c Python-3.8.0/Modules/posixmodule.c ---- Python-3.8.0-orig/Modules/posixmodule.c 2019-10-22 10:00:56.988936800 +0300 -+++ Python-3.8.0/Modules/posixmodule.c 2019-10-22 10:02:37.547713500 +0300 -@@ -3739,6 +3739,7 @@ +diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c +index 3f3e1f3..1e61545 100644 +--- a/Modules/posixmodule.c ++++ b/Modules/posixmodule.c +@@ -3759,6 +3759,7 @@ posix_getcwd(int use_bytes) return PyErr_SetFromWindowsErr(0); } @@ -200,7 +222,7 @@ diff -Naur Python-3.8.0-orig/Modules/posixmodule.c Python-3.8.0/Modules/posixmod PyObject *resobj = PyUnicode_FromWideChar(wbuf2, len); if (wbuf2 != wbuf) { PyMem_RawFree(wbuf2); -@@ -4302,6 +4303,7 @@ +@@ -4322,6 +4323,7 @@ os__getfinalpathname_impl(PyObject *module, path_t *path) target_path = tmp; } @@ -208,10 +230,11 @@ diff -Naur Python-3.8.0-orig/Modules/posixmodule.c Python-3.8.0/Modules/posixmod result = PyUnicode_FromWideChar(target_path, result_length); if (result && path->narrow) { Py_SETREF(result, PyUnicode_EncodeFSDefault(result)); -diff -Naur Python-3.8.0-orig/Python/initconfig.c Python-3.8.0/Python/initconfig.c ---- Python-3.8.0-orig/Python/initconfig.c 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Python/initconfig.c 2019-10-22 10:02:37.968914200 +0300 -@@ -136,7 +136,7 @@ +diff --git a/Python/initconfig.c b/Python/initconfig.c +index 3caed38..d8f0005 100644 +--- a/Python/initconfig.c ++++ b/Python/initconfig.c +@@ -136,7 +136,7 @@ static const char usage_6[] = "PYTHONDEVMODE: enable the development mode.\n" "PYTHONPYCACHEPREFIX: root directory for bytecode cache (pyc) files.\n"; @@ -220,7 +243,7 @@ diff -Naur Python-3.8.0-orig/Python/initconfig.c Python-3.8.0/Python/initconfig. # define PYTHONHOMEHELP "\\python{major}{minor}" #else # define PYTHONHOMEHELP "/lib/pythonX.X" -@@ -1187,7 +1187,7 @@ +@@ -1187,7 +1187,7 @@ config_init_program_name(PyConfig *config) } /* Last fall back: hardcoded name */ @@ -229,9 +252,10 @@ diff -Naur Python-3.8.0-orig/Python/initconfig.c Python-3.8.0/Python/initconfig. const wchar_t *default_program_name = L"python"; #else const wchar_t *default_program_name = L"python3"; -diff -Naur Python-3.8.0-orig/Python/pathconfig.c Python-3.8.0/Python/pathconfig.c ---- Python-3.8.0-orig/Python/pathconfig.c 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Python/pathconfig.c 2019-10-22 10:02:38.358914900 +0300 +diff --git a/Python/pathconfig.c b/Python/pathconfig.c +index 9a30221..267ee4d 100644 +--- a/Python/pathconfig.c ++++ b/Python/pathconfig.c @@ -15,6 +15,114 @@ extern "C" { #endif @@ -346,19 +370,20 @@ diff -Naur Python-3.8.0-orig/Python/pathconfig.c Python-3.8.0/Python/pathconfig. +} _PyPathConfig _Py_path_config = _PyPathConfig_INIT; - #ifdef MS_WINDOWS -@@ -541,6 +649,7 @@ - if (_Py_path_config.program_name == NULL) { - Py_FatalError("Py_SetProgramName() failed: out of memory"); + +@@ -541,6 +649,7 @@ _Py_SetProgramFullPath(const wchar_t *program_full_path) + if (_Py_path_config.program_full_path == NULL) { + path_out_of_memory(__func__); } + Py_NormalizeSepsW(_Py_path_config.program_name); } - void -diff -Naur Python-3.8.0-orig/Python/traceback.c Python-3.8.0/Python/traceback.c ---- Python-3.8.0-orig/Python/traceback.c 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Python/traceback.c 2019-10-22 10:02:39.170116300 +0300 -@@ -314,7 +314,7 @@ + +diff --git a/Python/traceback.c b/Python/traceback.c +index a9a9dd9..e8d2786 100644 +--- a/Python/traceback.c ++++ b/Python/traceback.c +@@ -314,7 +314,7 @@ _Py_FindSourceFile(PyObject *filename, char* namebuf, size_t namelen, PyObject * filepath = PyBytes_AS_STRING(filebytes); /* Search tail of filename in sys.path before giving up */ @@ -367,3 +392,6 @@ diff -Naur Python-3.8.0-orig/Python/traceback.c Python-3.8.0/Python/traceback.c if (tail == NULL) tail = filepath; else +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0560-mingw-use-posix-getpath.patch b/mingw-w64-python3.9/0039-mingw-use-posix-getpath.patch similarity index 73% rename from mingw-w64-python3.9/0560-mingw-use-posix-getpath.patch rename to mingw-w64-python3.9/0039-mingw-use-posix-getpath.patch index 56492577c8661..d904ab311d66b 100644 --- a/mingw-w64-python3.9/0560-mingw-use-posix-getpath.patch +++ b/mingw-w64-python3.9/0039-mingw-use-posix-getpath.patch @@ -1,7 +1,43 @@ -diff -Naur Python-3.9.4-orig/Include/pylifecycle.h Python-3.9.4/Include/pylifecycle.h ---- Python-3.9.4-orig/Include/pylifecycle.h 2021-04-04 08:56:53 +0000 -+++ Python-3.9.4/Include/pylifecycle.h 2021-04-25 13:03:43 +0000 -@@ -49,7 +49,7 @@ +From 36195df97050360b3ed614c2cb48dc18739df3dc 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?= + +Date: Thu, 17 Jun 2021 18:51:47 +0530 +Subject: [PATCH 39/N] mingw use posix getpath +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +--- + Include/cpython/fileutils.h | 3 +- + Include/pylifecycle.h | 2 +- + Modules/getpath.c | 131 +++++++++++++++++++++++++++++++++--- + Modules/posixmodule.c | 2 +- + Python/dynload_win.c | 2 + + Python/fileutils.c | 22 +++++- + 6 files changed, 146 insertions(+), 16 deletions(-) + +diff --git a/Include/cpython/fileutils.h b/Include/cpython/fileutils.h +index e79d03e..c222833 100644 +--- a/Include/cpython/fileutils.h ++++ b/Include/cpython/fileutils.h +@@ -136,9 +136,8 @@ PyAPI_FUNC(wchar_t*) _Py_wrealpath( + size_t resolved_path_len); + #endif + +-#ifndef MS_WINDOWS + PyAPI_FUNC(int) _Py_isabs(const wchar_t *path); +-#endif ++PyAPI_FUNC(int) _Py_issep(const wchar_t ch); + + PyAPI_FUNC(int) _Py_abspath(const wchar_t *path, wchar_t **abspath_p); + +diff --git a/Include/pylifecycle.h b/Include/pylifecycle.h +index 4eec669..b34f110 100644 +--- a/Include/pylifecycle.h ++++ b/Include/pylifecycle.h +@@ -55,7 +55,7 @@ PyAPI_FUNC(wchar_t *) Py_GetPrefix(void); PyAPI_FUNC(wchar_t *) Py_GetExecPrefix(void); PyAPI_FUNC(wchar_t *) Py_GetPath(void); PyAPI_FUNC(void) Py_SetPath(const wchar_t *); @@ -10,9 +46,10 @@ diff -Naur Python-3.9.4-orig/Include/pylifecycle.h Python-3.9.4/Include/pylifecy int _Py_CheckPython3(void); #endif -diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c ---- Python-3.9.4-orig/Modules/getpath.c 2021-04-04 08:56:53 +0000 -+++ Python-3.9.4/Modules/getpath.c 2021-04-25 13:39:07 +0000 +diff --git a/Modules/getpath.c b/Modules/getpath.c +index 4035819..6851a3b 100644 +--- a/Modules/getpath.c ++++ b/Modules/getpath.c @@ -13,6 +13,11 @@ # include #endif @@ -25,7 +62,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c /* Search in some common locations for the associated Python libraries. * * Two directories must be found, the platform independent directory -@@ -129,6 +134,7 @@ +@@ -129,6 +134,7 @@ typedef struct { wchar_t *prefix_macro; /* PREFIX macro */ wchar_t *exec_prefix_macro; /* EXEC_PREFIX macro */ wchar_t *vpath_macro; /* VPATH macro */ @@ -33,7 +70,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c wchar_t *lib_python; /* / "pythonX.Y" */ -@@ -146,7 +152,7 @@ +@@ -146,7 +152,7 @@ typedef struct { } PyCalculatePath; static const wchar_t delimiter[2] = {DELIM, '\0'}; @@ -42,7 +79,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c /* Get file status. Encode the path to the locale encoding. */ -@@ -170,7 +176,7 @@ +@@ -170,7 +176,7 @@ static void reduce(wchar_t *dir) { size_t i = wcslen(dir); @@ -51,7 +88,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c --i; } dir[i] = '\0'; -@@ -224,6 +230,9 @@ +@@ -224,6 +230,9 @@ isdir(const wchar_t *filename) return 1; } @@ -61,7 +98,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c /* Add a path component, by appending stuff to buffer. buflen: 'buffer' length in characters including trailing NUL. -@@ -242,8 +251,8 @@ +@@ -242,8 +251,8 @@ joinpath(wchar_t *path, const wchar_t *path2, size_t path_len) return PATHLEN_ERR(); } @@ -72,7 +109,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c } } else { -@@ -285,7 +294,7 @@ +@@ -285,7 +294,7 @@ joinpath2(const wchar_t *path, const wchar_t *path2) } size_t len = wcslen(path); @@ -81,7 +118,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c len += add_sep; len += wcslen(path2); -@@ -334,7 +343,7 @@ +@@ -334,7 +343,7 @@ copy_absolute(wchar_t *abs_path, const wchar_t *path, size_t abs_path_len) } return _PyStatus_OK(); } @@ -90,7 +127,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c path += 2; } PyStatus status = joinpath(abs_path, path, abs_path_len); -@@ -478,6 +487,7 @@ +@@ -478,6 +487,7 @@ search_for_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig, return _PyStatus_NO_MEMORY(); } @@ -98,7 +135,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c int is_build_dir = isfile(path); PyMem_RawFree(path); -@@ -502,6 +512,7 @@ +@@ -502,6 +512,7 @@ search_for_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig, } int module; @@ -106,7 +143,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c status = ismodule(prefix, &module); if (_PyStatus_EXCEPTION(status)) { return status; -@@ -528,6 +539,7 @@ +@@ -528,6 +539,7 @@ search_for_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig, } int module; @@ -114,7 +151,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c status = ismodule(prefix, &module); if (_PyStatus_EXCEPTION(status)) { return status; -@@ -551,6 +563,7 @@ +@@ -551,6 +563,7 @@ search_for_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig, } int module; @@ -122,7 +159,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c status = ismodule(prefix, &module); if (_PyStatus_EXCEPTION(status)) { return status; -@@ -610,6 +623,11 @@ +@@ -610,6 +623,11 @@ calculate_set_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig) * return the compiled-in defaults instead. */ if (calculate->prefix_found > 0) { @@ -134,7 +171,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c wchar_t *prefix = _PyMem_RawWcsdup(calculate->prefix); if (prefix == NULL) { return _PyStatus_NO_MEMORY(); -@@ -625,7 +643,11 @@ +@@ -625,7 +643,11 @@ calculate_set_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig) /* The prefix is the root directory, but reduce() chopped off the "/". */ @@ -146,7 +183,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c if (pathconfig->prefix == NULL) { return _PyStatus_NO_MEMORY(); } -@@ -682,6 +704,7 @@ +@@ -682,6 +704,7 @@ calculate_pybuilddir(const wchar_t *argv0_path, return PATHLEN_ERR(); } status = joinpath(exec_prefix, pybuilddir, exec_prefix_len); @@ -154,7 +191,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c PyMem_RawFree(pybuilddir); if (_PyStatus_EXCEPTION(status)) { return status; -@@ -730,6 +753,7 @@ +@@ -730,6 +753,7 @@ search_for_exec_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig, /* Check for pybuilddir.txt */ assert(*found == 0); @@ -162,7 +199,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c status = calculate_pybuilddir(calculate->argv0_path, exec_prefix, exec_prefix_len, found); if (_PyStatus_EXCEPTION(status)) { -@@ -804,6 +828,7 @@ +@@ -804,6 +828,7 @@ calculate_exec_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig) return status; } @@ -170,7 +207,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c if (!calculate->exec_prefix_found) { if (calculate->warnings) { fprintf(stderr, -@@ -836,6 +861,47 @@ +@@ -836,6 +861,47 @@ calculate_exec_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig) } @@ -218,7 +255,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c static PyStatus calculate_set_exec_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig) -@@ -846,6 +913,12 @@ +@@ -846,6 +912,12 @@ calculate_set_exec_prefix(PyCalculatePath *calculate, return _PyStatus_NO_MEMORY(); } @@ -231,7 +268,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c reduce(exec_prefix); reduce(exec_prefix); reduce(exec_prefix); -@@ -859,7 +932,11 @@ +@@ -859,7 +931,11 @@ calculate_set_exec_prefix(PyCalculatePath *calculate, /* The exec_prefix is the root directory, but reduce() chopped off the "/". */ @@ -243,7 +280,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c if (pathconfig->exec_prefix == NULL) { return _PyStatus_NO_MEMORY(); } -@@ -964,13 +1041,22 @@ +@@ -964,13 +1040,22 @@ calculate_program_impl(PyCalculatePath *calculate, _PyPathConfig *pathconfig) * other way to find a directory to start the search from. If * $PATH isn't exported, you lose. */ @@ -267,7 +304,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c #ifdef __APPLE__ wchar_t *abs_path = NULL; -@@ -1007,7 +1088,7 @@ +@@ -1007,7 +1092,7 @@ calculate_program_impl(PyCalculatePath *calculate, _PyPathConfig *pathconfig) /* Calculate pathconfig->program_full_path */ @@ -276,7 +313,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c calculate_program(PyCalculatePath *calculate, _PyPathConfig *pathconfig) { PyStatus status; -@@ -1173,7 +1254,7 @@ +@@ -1173,7 +1258,7 @@ done: #endif @@ -285,7 +322,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c calculate_argv0_path(PyCalculatePath *calculate, _PyPathConfig *pathconfig) { -@@ -1191,10 +1272,12 @@ +@@ -1191,10 +1276,12 @@ calculate_argv0_path(PyCalculatePath *calculate, } #endif @@ -298,7 +335,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c reduce(calculate->argv0_path); -@@ -1328,6 +1411,8 @@ +@@ -1328,6 +1415,8 @@ calculate_zip_path(PyCalculatePath *calculate) calculate->zip_path[len - 6] = VERSION[0]; calculate->zip_path[len - 5] = VERSION[2]; @@ -307,7 +344,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c res = _PyStatus_OK(); done: -@@ -1367,7 +1452,14 @@ +@@ -1367,7 +1456,14 @@ calculate_module_search_path(PyCalculatePath *calculate, } bufsz += wcslen(calculate->zip_path) + 1; @@ -322,7 +359,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c /* Allocate the buffer */ wchar_t *buf = PyMem_RawMalloc(bufsz * sizeof(wchar_t)); -@@ -1395,7 +1487,7 @@ +@@ -1395,7 +1491,7 @@ calculate_module_search_path(PyCalculatePath *calculate, if (!_Py_isabs(defpath)) { wcscat(buf, calculate->prefix); @@ -331,7 +368,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c defpath[0] != (delim ? DELIM : L'\0')) { /* not empty */ -@@ -1417,8 +1509,15 @@ +@@ -1417,8 +1513,15 @@ calculate_module_search_path(PyCalculatePath *calculate, } wcscat(buf, delimiter); @@ -347,7 +384,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c pathconfig->module_search_path = buf; return _PyStatus_OK(); -@@ -1447,14 +1546,17 @@ +@@ -1447,14 +1550,17 @@ calculate_init(PyCalculatePath *calculate, const PyConfig *config) if (!calculate->pythonpath_macro) { return DECODE_LOCALE_ERR("PYTHONPATH macro", len); } @@ -365,7 +402,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c calculate->vpath_macro = Py_DecodeLocale(VPATH, &len); if (!calculate->vpath_macro) { return DECODE_LOCALE_ERR("VPATH macro", len); -@@ -1465,6 +1567,7 @@ +@@ -1465,6 +1571,7 @@ calculate_init(PyCalculatePath *calculate, const PyConfig *config) if (!pyversion) { return DECODE_LOCALE_ERR("VERSION macro", len); } @@ -373,7 +410,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c calculate->lib_python = joinpath2(config->platlibdir, pyversion); PyMem_RawFree(pyversion); if (calculate->lib_python == NULL) { -@@ -1481,6 +1584,7 @@ +@@ -1481,6 +1588,7 @@ calculate_free(PyCalculatePath *calculate) PyMem_RawFree(calculate->pythonpath_macro); PyMem_RawFree(calculate->prefix_macro); PyMem_RawFree(calculate->exec_prefix_macro); @@ -381,7 +418,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c PyMem_RawFree(calculate->vpath_macro); PyMem_RawFree(calculate->lib_python); PyMem_RawFree(calculate->path_env); -@@ -1496,6 +1600,8 @@ +@@ -1496,6 +1604,8 @@ calculate_path(PyCalculatePath *calculate, _PyPathConfig *pathconfig) { PyStatus status; @@ -390,7 +427,7 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c if (pathconfig->program_full_path == NULL) { status = calculate_program(calculate, pathconfig); if (_PyStatus_EXCEPTION(status)) { -@@ -1596,6 +1732,7 @@ +@@ -1596,6 +1706,7 @@ _PyPathConfig_Calculate(_PyPathConfig *pathconfig, const PyConfig *config) { PyStatus status; PyCalculatePath calculate; @@ -398,10 +435,11 @@ diff -Naur Python-3.9.4-orig/Modules/getpath.c Python-3.9.4/Modules/getpath.c memset(&calculate, 0, sizeof(calculate)); status = calculate_init(&calculate, config); -diff -Naur Python-3.9.4-orig/Modules/posixmodule.c Python-3.9.4/Modules/posixmodule.c ---- Python-3.9.4-orig/Modules/posixmodule.c 2021-04-04 08:56:53 +0000 -+++ Python-3.9.4/Modules/posixmodule.c 2021-04-25 13:03:43 +0000 -@@ -4007,7 +4007,7 @@ +diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c +index 1e61545..40fc270 100644 +--- a/Modules/posixmodule.c ++++ b/Modules/posixmodule.c +@@ -4049,7 +4049,7 @@ _listdir_windows_no_opendir(path_t *path, PyObject *list) Py_END_ALLOW_THREADS /* FindNextFile sets error to ERROR_NO_MORE_FILES if it got to the end of the directory. */ @@ -410,10 +448,11 @@ diff -Naur Python-3.9.4-orig/Modules/posixmodule.c Python-3.9.4/Modules/posixmod Py_DECREF(list); list = path_error(path); goto exit; -diff -Naur Python-3.9.4-orig/Python/dynload_win.c Python-3.9.4/Python/dynload_win.c ---- Python-3.9.4-orig/Python/dynload_win.c 2021-04-04 08:56:53 +0000 -+++ Python-3.9.4/Python/dynload_win.c 2021-04-25 13:03:43 +0000 -@@ -168,7 +168,9 @@ +diff --git a/Python/dynload_win.c b/Python/dynload_win.c +index 9d7690e..bd34310 100644 +--- a/Python/dynload_win.c ++++ b/Python/dynload_win.c +@@ -174,7 +174,9 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, char funcname[258], *import_python; const wchar_t *wpathname; @@ -423,22 +462,11 @@ diff -Naur Python-3.9.4-orig/Python/dynload_win.c Python-3.9.4/Python/dynload_wi _Py_COMP_DIAG_PUSH _Py_COMP_DIAG_IGNORE_DEPR_DECLS ---- Python-3.9.5/Include/cpython/fileutils.h.orig 2021-05-14 08:56:28.068122000 +0300 -+++ Python-3.9.5/Include/cpython/fileutils.h 2021-05-14 09:04:20.120420600 +0300 -@@ -136,9 +136,8 @@ - size_t resolved_path_len); - #endif - --#ifndef MS_WINDOWS - PyAPI_FUNC(int) _Py_isabs(const wchar_t *path); --#endif -+PyAPI_FUNC(int) _Py_issep(const wchar_t ch); - - PyAPI_FUNC(int) _Py_abspath(const wchar_t *path, wchar_t **abspath_p); - ---- Python-3.9.5/Python/fileutils.c.orig 2021-05-14 08:57:10.254566600 +0300 -+++ Python-3.9.5/Python/fileutils.c 2021-05-14 09:04:13.267070300 +0300 -@@ -1819,13 +1819,31 @@ +diff --git a/Python/fileutils.c b/Python/fileutils.c +index 769ab59..3a3b00a 100644 +--- a/Python/fileutils.c ++++ b/Python/fileutils.c +@@ -1818,13 +1818,31 @@ _Py_wrealpath(const wchar_t *path, #endif @@ -472,3 +500,6 @@ diff -Naur Python-3.9.4-orig/Python/dynload_win.c Python-3.9.4/Python/dynload_wi /* Get an absolute path. +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0565-mingw-add-ModuleFileName-dir-to-PATH.patch b/mingw-w64-python3.9/0040-mingw-add-ModuleFileName-dir-to-PATH.patch similarity index 65% rename from mingw-w64-python3.9/0565-mingw-add-ModuleFileName-dir-to-PATH.patch rename to mingw-w64-python3.9/0040-mingw-add-ModuleFileName-dir-to-PATH.patch index fa2fb5ffdf0a2..d33a20f93d140 100644 --- a/mingw-w64-python3.9/0565-mingw-add-ModuleFileName-dir-to-PATH.patch +++ b/mingw-w64-python3.9/0040-mingw-add-ModuleFileName-dir-to-PATH.patch @@ -1,7 +1,22 @@ -diff -Naur Python-3.9.5-orig/Modules/getpath.c Python-3.9.5/Modules/getpath.c ---- Python-3.9.5-orig/Modules/getpath.c 2019-10-22 10:02:47.765731400 +0300 -+++ Python-3.9.5/Modules/getpath.c 2019-10-22 10:02:49.637734700 +0300 -@@ -1530,6 +1636,36 @@ +From 2caf8f6a25d482e5ccf1dc3afb31d0cac46e2be8 Mon Sep 17 00:00:00 2001 +From: Ray Donnelly +Date: Thu, 17 Jun 2021 18:51:48 +0530 +Subject: [PATCH 40/N] mingw add ModuleFileName dir to PATH +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +--- + Modules/getpath.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +diff --git a/Modules/getpath.c b/Modules/getpath.c +index 6851a3b..750d5c3 100644 +--- a/Modules/getpath.c ++++ b/Modules/getpath.c +@@ -1640,6 +1640,36 @@ calculate_path(PyCalculatePath *calculate, _PyPathConfig *pathconfig) return status; } @@ -38,3 +53,6 @@ diff -Naur Python-3.9.5-orig/Modules/getpath.c Python-3.9.5/Modules/getpath.c if ((!calculate->prefix_found || !calculate->exec_prefix_found) && calculate->warnings) { +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0041-mingw-add-BUILDIN_WIN32_MODULEs-time-msvcrt.patch b/mingw-w64-python3.9/0041-mingw-add-BUILDIN_WIN32_MODULEs-time-msvcrt.patch new file mode 100644 index 0000000000000..368e67d1dffea --- /dev/null +++ b/mingw-w64-python3.9/0041-mingw-add-BUILDIN_WIN32_MODULEs-time-msvcrt.patch @@ -0,0 +1,27 @@ +From cf5b072fc27877641adacacd249d4e4e59cd1ca8 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?= + +Date: Thu, 17 Jun 2021 18:51:49 +0530 +Subject: [PATCH 41/N] mingw add BUILDIN_WIN32_MODULEs time msvcrt +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Modules/Setup.config.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Modules/Setup.config.in b/Modules/Setup.config.in +index d071a74..825ce5d 100644 +--- a/Modules/Setup.config.in ++++ b/Modules/Setup.config.in +@@ -11,4 +11,5 @@ + + # build-in modules for windows platform: + @USE_WIN32_MODULE@winreg ../PC/winreg.c ++@USE_WIN32_MODULE@msvcrt -DPy_BUILD_CORE ../PC/msvcrtmodule.c + +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0610-msys-cygwin-semi-native-build-sysconfig.patch b/mingw-w64-python3.9/0042-msys-cygwin-semi-native-build-sysconfig.patch similarity index 73% rename from mingw-w64-python3.9/0610-msys-cygwin-semi-native-build-sysconfig.patch rename to mingw-w64-python3.9/0042-msys-cygwin-semi-native-build-sysconfig.patch index 76957662b6ed5..9648aebf6626a 100644 --- a/mingw-w64-python3.9/0610-msys-cygwin-semi-native-build-sysconfig.patch +++ b/mingw-w64-python3.9/0042-msys-cygwin-semi-native-build-sysconfig.patch @@ -1,7 +1,61 @@ -diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac ---- Python-3.8.0-orig/configure.ac 2019-10-22 10:02:29.123698700 +0300 -+++ Python-3.8.0/configure.ac 2019-10-22 10:02:56.595346900 +0300 -@@ -598,6 +598,65 @@ +From c50c25e2d32cf7a94ce87eb03dc8398725bfb824 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?= + +Date: Thu, 17 Jun 2021 18:51:50 +0530 +Subject: [PATCH 42/N] msys cygwin semi native build sysconfig +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Lib/sysconfig.py | 8 +++++++ + Makefile.pre.in | 7 ++++++ + configure.ac | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 74 insertions(+) + +diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py +index d4298f7..5d336d8 100644 +--- a/Lib/sysconfig.py ++++ b/Lib/sysconfig.py +@@ -337,6 +337,14 @@ def _parse_makefile(filename, vars=None): + if isinstance(v, str): + done[k] = v.strip() + ++ # any keys that have one with the same name suffixed with _b2h ++ # need to be replaced with the value of the _b2h key. ++ # This converts from MSYS*/Cygwin paths to Windows paths. ++ for k, v in dict(done).items(): ++ if isinstance(k, str): ++ if k.endswith("_b2h"): ++ done[k[:-4]]=v ++ + # save the results in the global dictionary + vars.update(done) + return vars +diff --git a/Makefile.pre.in b/Makefile.pre.in +index f58b701..c20434e 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -137,6 +137,13 @@ exec_prefix= @exec_prefix@ + # Install prefix for data files + datarootdir= @datarootdir@ + ++# Locations needed for semi-native fixup of sysconfig. ++srcdir_b2h= @srcdir_b2h@ ++VPATH_b2h= @VPATH_b2h@ ++abs_srcdir_b2h= @abs_srcdir_b2h@ ++abs_builddir_b2h= @abs_builddir_b2h@ ++prefix_b2h= @prefix_b2h@ ++ + # Expanded directories + BINDIR= @bindir@ + LIBDIR= @libdir@ +diff --git a/configure.ac b/configure.ac +index 986052c..acb5bea 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -625,6 +625,65 @@ then AC_DEFINE(_INCLUDE__STDC_A1_SOURCE, 1, Define to include mbstate_t for mbrtowc) fi @@ -67,38 +121,6 @@ diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac AC_MSG_CHECKING([for init system calls]) AC_SUBST(INITSYS) case $host in -diff -Naur Python-3.8.0-orig/Lib/sysconfig.py Python-3.8.0/Lib/sysconfig.py ---- Python-3.8.0-orig/Lib/sysconfig.py 2019-10-22 10:02:09.342863900 +0300 -+++ Python-3.8.0/Lib/sysconfig.py 2019-10-22 10:02:57.000947600 +0300 -@@ -329,6 +329,14 @@ - if isinstance(v, str): - done[k] = v.strip() - -+ # any keys that have one with the same name suffixed with _b2h -+ # need to be replaced with the value of the _b2h key. -+ # This converts from MSYS*/Cygwin paths to Windows paths. -+ for k, v in dict(done).items(): -+ if isinstance(k, str): -+ if k.endswith("_b2h"): -+ done[k[:-4]]=v -+ - # save the results in the global dictionary - vars.update(done) - return vars -diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in ---- Python-3.8.0-orig/Makefile.pre.in 2019-10-22 10:01:28.376191900 +0300 -+++ Python-3.8.0/Makefile.pre.in 2019-10-22 10:02:57.390948300 +0300 -@@ -137,6 +137,13 @@ - # Install prefix for data files - datarootdir= @datarootdir@ - -+# Locations needed for semi-native fixup of sysconfig. -+srcdir_b2h= @srcdir_b2h@ -+VPATH_b2h= @VPATH_b2h@ -+abs_srcdir_b2h= @abs_srcdir_b2h@ -+abs_builddir_b2h= @abs_builddir_b2h@ -+prefix_b2h= @prefix_b2h@ -+ - # Expanded directories - BINDIR= @bindir@ - LIBDIR= @libdir@ +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0620-mingw-sysconfig-like-posix.patch b/mingw-w64-python3.9/0043-mingw-sysconfig-like-posix.patch similarity index 71% rename from mingw-w64-python3.9/0620-mingw-sysconfig-like-posix.patch rename to mingw-w64-python3.9/0043-mingw-sysconfig-like-posix.patch index 33a1a95bc5769..8758524949f37 100644 --- a/mingw-w64-python3.9/0620-mingw-sysconfig-like-posix.patch +++ b/mingw-w64-python3.9/0043-mingw-sysconfig-like-posix.patch @@ -1,7 +1,23 @@ -diff -Naur Python-3.8.0-orig/Lib/distutils/command/build_ext.py Python-3.8.0/Lib/distutils/command/build_ext.py ---- Python-3.8.0-orig/Lib/distutils/command/build_ext.py 2019-10-22 10:01:56.348041100 +0300 -+++ Python-3.8.0/Lib/distutils/command/build_ext.py 2019-10-22 10:03:01.072554800 +0300 -@@ -221,9 +221,10 @@ +From 862d4ae13e9dbe2b79e23eeede207129de0675d0 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?= + +Date: Thu, 17 Jun 2021 18:51:50 +0530 +Subject: [PATCH 43/N] mingw sysconfig like posix +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Lib/distutils/command/build_ext.py | 3 ++- + Lib/sysconfig.py | 28 ++++++++++++++-------------- + 2 files changed, 16 insertions(+), 15 deletions(-) + +diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py +index 1c9d471..1dbdfe0 100644 +--- a/Lib/distutils/command/build_ext.py ++++ b/Lib/distutils/command/build_ext.py +@@ -221,9 +221,10 @@ class build_ext(Command): if sys.platform[:6] == 'cygwin': if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): # building third party extensions @@ -13,10 +29,11 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/command/build_ext.py Python-3.8.0/Lib else: # building python standard extensions self.library_dirs.append('.') -diff -Naur Python-3.8.0-orig/Lib/sysconfig.py Python-3.8.0/Lib/sysconfig.py ---- Python-3.8.0-orig/Lib/sysconfig.py 2019-10-22 10:02:59.528152100 +0300 -+++ Python-3.8.0/Lib/sysconfig.py 2019-10-22 10:03:01.462555500 +0300 -@@ -43,23 +43,23 @@ +diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py +index 5d336d8..c0695e2 100644 +--- a/Lib/sysconfig.py ++++ b/Lib/sysconfig.py +@@ -48,23 +48,23 @@ _INSTALL_SCHEMES = { 'data': '{base}', }, 'nt': { @@ -53,12 +70,15 @@ diff -Naur Python-3.8.0-orig/Lib/sysconfig.py Python-3.8.0/Lib/sysconfig.py 'data': '{userbase}', }, 'posix_user': { -@@ -461,7 +461,7 @@ +@@ -470,7 +470,7 @@ def _init_non_posix(vars): vars['INCLUDEPY'] = get_path('include') - vars['EXT_SUFFIX'] = '.pyd' + vars['EXT_SUFFIX'] = _imp.extension_suffixes()[0] vars['EXE'] = '.exe' - vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT + vars['VERSION'] = _PY_VERSION_SHORT vars['BINDIR'] = os.path.dirname(_safe_realpath(sys.executable)) # +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0630-mingw-_winapi_as_builtin_for_Popen_in_cygwinccompiler.patch b/mingw-w64-python3.9/0044-mingw-_winapi_as_builtin_for_Popen_in_cygwinccompile.patch similarity index 58% rename from mingw-w64-python3.9/0630-mingw-_winapi_as_builtin_for_Popen_in_cygwinccompiler.patch rename to mingw-w64-python3.9/0044-mingw-_winapi_as_builtin_for_Popen_in_cygwinccompile.patch index 72c9f610af01f..8ffb1245e2692 100644 --- a/mingw-w64-python3.9/0630-mingw-_winapi_as_builtin_for_Popen_in_cygwinccompiler.patch +++ b/mingw-w64-python3.9/0044-mingw-_winapi_as_builtin_for_Popen_in_cygwinccompile.patch @@ -1,15 +1,33 @@ -diff -Naur Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py Python-3.8.0/Lib/distutils/cygwinccompiler.py ---- Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py 2019-10-22 10:02:17.798078800 +0300 -+++ Python-3.8.0/Lib/distutils/cygwinccompiler.py 2019-10-22 10:03:04.738561200 +0300 -@@ -58,6 +58,7 @@ - from distutils import log +From 2cb08e2d866eba2c0a8fa7f99808865c2c849d20 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?= + +Date: Thu, 17 Jun 2021 18:51:51 +0530 +Subject: [PATCH 44/N] mingw _winapi_as_builtin_for_Popen_in_cygwinccompiler +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +--- + Lib/distutils/cygwinccompiler.py | 14 ++++++++++++-- + Modules/Setup.config.in | 1 + + setup.py | 4 +++- + 3 files changed, 16 insertions(+), 3 deletions(-) + +diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py +index 5b281e2..f90af3b 100644 +--- a/Lib/distutils/cygwinccompiler.py ++++ b/Lib/distutils/cygwinccompiler.py +@@ -56,6 +56,7 @@ from distutils.errors import (DistutilsExecError, CCompilerError, + CompileError, UnknownFileError) from distutils.version import LooseVersion from distutils.spawn import find_executable +from subprocess import Popen, PIPE, check_output def get_msvcr(): """Include the appropriate MSVC runtime library if Python was built -@@ -373,7 +374,7 @@ +@@ -371,7 +372,7 @@ def check_config_h(): return (CONFIG_H_UNCERTAIN, "couldn't read '%s': %s" % (fn, exc.strerror)) @@ -18,7 +36,7 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py Python-3.8.0/Lib/d def _find_exe_version(cmd): """Find the version of an executable by running `cmd` in the shell. -@@ -402,7 +403,16 @@ +@@ -400,7 +401,16 @@ def get_versions(): If not possible it returns None for it. """ @@ -36,19 +54,21 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py Python-3.8.0/Lib/d return tuple([_find_exe_version(cmd) for cmd in commands]) def is_cygwingcc(): -diff -Naur Python-3.8.0-orig/Modules/Setup.config.in Python-3.8.0/Modules/Setup.config.in ---- Python-3.8.0-orig/Modules/Setup.config.in 2019-10-22 10:02:55.456544900 +0300 -+++ Python-3.8.0/Modules/Setup.config.in 2019-10-22 10:03:05.159762000 +0300 +diff --git a/Modules/Setup.config.in b/Modules/Setup.config.in +index 825ce5d..b4e7ff7 100644 +--- a/Modules/Setup.config.in ++++ b/Modules/Setup.config.in @@ -12,4 +12,5 @@ # build-in modules for windows platform: @USE_WIN32_MODULE@winreg ../PC/winreg.c @USE_WIN32_MODULE@msvcrt -DPy_BUILD_CORE ../PC/msvcrtmodule.c +@USE_WIN32_MODULE@_winapi _winapi.c -diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py ---- Python-3.8.0-orig/setup.py 2019-10-22 10:02:35.597710000 +0300 -+++ Python-3.8.0/setup.py 2019-10-22 10:03:05.939763300 +0300 -@@ -1545,7 +1545,9 @@ +diff --git a/setup.py b/setup.py +index 72f1281..36af6e9 100644 +--- a/setup.py ++++ b/setup.py +@@ -1607,7 +1607,9 @@ class PyBuildExt(build_ext): self.add(Extension('msvcrt', [os.path.join(pc_srcdir, p) for p in ['msvcrtmodule.c']])) @@ -59,3 +79,6 @@ diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py self.add(Extension('_msi', [os.path.join(pc_srcdir, p) for p in ['_msi.c']], +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0045-cross-dont-add-multiarch-paths-if-cross-compiling.patch b/mingw-w64-python3.9/0045-cross-dont-add-multiarch-paths-if-cross-compiling.patch new file mode 100644 index 0000000000000..c8eb24d09d474 --- /dev/null +++ b/mingw-w64-python3.9/0045-cross-dont-add-multiarch-paths-if-cross-compiling.patch @@ -0,0 +1,33 @@ +From 06682f8d898c1d1989be5ba8bff6bea4c9c5f420 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?= + +Date: Thu, 17 Jun 2021 18:51:52 +0530 +Subject: [PATCH 45/N] cross dont add multiarch paths if cross compiling +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index 36af6e9..55c7382 100644 +--- a/setup.py ++++ b/setup.py +@@ -734,10 +734,10 @@ class PyBuildExt(build_ext): + if not CROSS_COMPILING: + add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') + add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') ++ self.add_multiarch_paths() + # only change this for cross builds for 3.3, issues on Mageia + if CROSS_COMPILING: + self.add_cross_compiling_paths() +- self.add_multiarch_paths() + self.add_ldflags_cppflags() + + def init_inc_lib_dirs(self): +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0046-mingw-use-backslashes-in-compileall-py.patch b/mingw-w64-python3.9/0046-mingw-use-backslashes-in-compileall-py.patch new file mode 100644 index 0000000000000..e1d4bfc8e4dcb --- /dev/null +++ b/mingw-w64-python3.9/0046-mingw-use-backslashes-in-compileall-py.patch @@ -0,0 +1,30 @@ +From 922cca40d51358770fa41a9b80659cc455fea8b8 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?= + +Date: Thu, 17 Jun 2021 18:51:53 +0530 +Subject: [PATCH 46/N] mingw use backslashes in compileall py +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Lib/compileall.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Lib/compileall.py b/Lib/compileall.py +index fe7f450..4102839 100644 +--- a/Lib/compileall.py ++++ b/Lib/compileall.py +@@ -38,6 +38,8 @@ def _walk_dir(dir, maxlevels, quiet=0): + if name == '__pycache__': + continue + fullname = os.path.join(dir, name) ++ if sys.platform == "win32" and sys.version.find("GCC") >= 0: ++ fullname = fullname.replace('\\','/') + if not os.path.isdir(fullname): + yield fullname + elif (maxlevels > 0 and name != os.curdir and name != os.pardir and +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0670-msys-convert_path-fix-and-root-hack.patch b/mingw-w64-python3.9/0047-msys-convert_path-fix-and-root-hack.patch similarity index 66% rename from mingw-w64-python3.9/0670-msys-convert_path-fix-and-root-hack.patch rename to mingw-w64-python3.9/0047-msys-convert_path-fix-and-root-hack.patch index 8785a6ee7b6f2..148428ffc9aba 100644 --- a/mingw-w64-python3.9/0670-msys-convert_path-fix-and-root-hack.patch +++ b/mingw-w64-python3.9/0047-msys-convert_path-fix-and-root-hack.patch @@ -1,7 +1,26 @@ -diff -Naur Python-3.8.0-orig/Lib/distutils/command/install.py Python-3.8.0/Lib/distutils/command/install.py ---- Python-3.8.0-orig/Lib/distutils/command/install.py 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Lib/distutils/command/install.py 2019-10-22 10:03:18.045384600 +0300 -@@ -341,7 +341,8 @@ +From 5fa3a3a0d7125267116e51d535fa62d04537589d 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?= + +Date: Thu, 17 Jun 2021 18:51:54 +0530 +Subject: [PATCH 47/N] msys convert_path fix and root hack +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +Co-authored-by: Audrey Dutcher +--- + Lib/distutils/command/install.py | 3 ++- + Lib/distutils/util.py | 26 ++++++++++++++++++++++++-- + Makefile.pre.in | 12 +++++++++--- + 3 files changed, 35 insertions(+), 6 deletions(-) + +diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py +index aaa300e..eea417e 100644 +--- a/Lib/distutils/command/install.py ++++ b/Lib/distutils/command/install.py +@@ -342,7 +342,8 @@ class install(Command): # Convert directories from Unix /-separated syntax to the local # convention. @@ -11,10 +30,11 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/command/install.py Python-3.8.0/Lib/d 'scripts', 'data', 'headers', 'userbase', 'usersite') -diff -Naur Python-3.8.0-orig/Lib/distutils/util.py Python-3.8.0/Lib/distutils/util.py ---- Python-3.8.0-orig/Lib/distutils/util.py 2019-10-22 10:01:56.753641800 +0300 -+++ Python-3.8.0/Lib/distutils/util.py 2019-10-22 10:03:18.450985300 +0300 -@@ -130,6 +130,13 @@ +diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py +index 7b2e1e0..75a369d 100644 +--- a/Lib/distutils/util.py ++++ b/Lib/distutils/util.py +@@ -131,6 +131,13 @@ def convert_path (pathname): paths.remove('.') if not paths: return os.curdir @@ -28,7 +48,7 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/util.py Python-3.8.0/Lib/distutils/ut return os.path.join(*paths) # convert_path () -@@ -140,6 +147,10 @@ +@@ -141,6 +148,10 @@ def change_root (new_root, pathname): relative, this is equivalent to "os.path.join(new_root,pathname)". Otherwise, it requires making 'pathname' relative and then joining the two, which is tricky on DOS/Windows and Mac OS. @@ -39,7 +59,7 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/util.py Python-3.8.0/Lib/distutils/ut """ if os.name == 'posix': if not os.path.isabs(pathname): -@@ -149,9 +160,20 @@ +@@ -150,9 +161,20 @@ def change_root (new_root, pathname): elif os.name == 'nt': (drive, path) = os.path.splitdrive(pathname) @@ -62,10 +82,11 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/util.py Python-3.8.0/Lib/distutils/ut else: raise DistutilsPlatformError("nothing known about platform '%s'" % os.name) -diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in ---- Python-3.8.0-orig/Makefile.pre.in 2019-10-22 10:02:59.949352800 +0300 -+++ Python-3.8.0/Makefile.pre.in 2019-10-22 10:03:18.840986000 +0300 -@@ -1612,6 +1612,12 @@ +diff --git a/Makefile.pre.in b/Makefile.pre.in +index c20434e..4c8bb01 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1707,6 +1707,12 @@ libainstall: @DEF_MAKE_RULE@ python-config else true; \ fi @@ -78,7 +99,7 @@ diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in # Install the dynamically loadable modules # This goes into $(exec_prefix) sharedinstall: sharedmods -@@ -1619,9 +1625,9 @@ +@@ -1714,9 +1720,9 @@ sharedinstall: sharedmods --prefix=$(prefix) \ --install-scripts=$(BINDIR) \ --install-platlib=$(DESTSHARED) \ @@ -91,3 +112,6 @@ diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in # Here are a couple of targets for MacOSX again, to install a full # framework-based Python. frameworkinstall installs everything, the +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0690-allow-static-tcltk.patch b/mingw-w64-python3.9/0048-allow-static-tcltk.patch similarity index 80% rename from mingw-w64-python3.9/0690-allow-static-tcltk.patch rename to mingw-w64-python3.9/0048-allow-static-tcltk.patch index 377abb8fa86e1..4c797540b398a 100644 --- a/mingw-w64-python3.9/0690-allow-static-tcltk.patch +++ b/mingw-w64-python3.9/0048-allow-static-tcltk.patch @@ -1,7 +1,22 @@ -diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py ---- Python-3.8.0-orig/setup.py 2019-10-22 10:03:14.129777700 +0300 -+++ Python-3.8.0/setup.py 2019-10-22 10:03:22.475792400 +0300 -@@ -703,7 +703,7 @@ +From b5fb27c8f83ac741ad8a983430316214df8cf8f6 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?= + +Date: Thu, 17 Jun 2021 18:51:54 +0530 +Subject: [PATCH 48/N] allow static tcltk +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + setup.py | 35 +++++++++++++++++++++++++---------- + 1 file changed, 25 insertions(+), 10 deletions(-) + +diff --git a/setup.py b/setup.py +index 55c7382..d8fc413 100644 +--- a/setup.py ++++ b/setup.py +@@ -783,7 +783,7 @@ class PyBuildExt(build_ext): if HOST_PLATFORM == 'hp-ux11': self.lib_dirs += ['/usr/lib/hpux64', '/usr/lib/hpux32'] @@ -10,7 +25,7 @@ diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py # This should work on any unixy platform ;-) # If the user has bothered specifying additional -I and -L flags # in OPT and LDFLAGS we might as well use them here. -@@ -713,6 +713,8 @@ +@@ -793,6 +793,8 @@ class PyBuildExt(build_ext): # directories with whitespace in the name to store libraries. cflags, ldflags = sysconfig.get_config_vars( 'CFLAGS', 'LDFLAGS') @@ -19,7 +34,7 @@ diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py for item in cflags.split(): if item.startswith('-I'): self.inc_dirs.append(item[2:]) -@@ -1907,14 +1909,19 @@ +@@ -2042,14 +2044,19 @@ class PyBuildExt(build_ext): # The versions with dots are used on Unix, and the versions without # dots on Windows, for detection by cygwin. tcllib = tklib = tcl_includes = tk_includes = None @@ -47,7 +62,7 @@ diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py break # Now check for the header files -@@ -1985,10 +1992,18 @@ +@@ -2120,10 +2127,18 @@ class PyBuildExt(build_ext): # Add the Tcl/Tk libraries libs.append('tk'+ version) libs.append('tcl'+ version) @@ -67,3 +82,6 @@ diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py # XXX handle these, but how to detect? # *** Uncomment and edit for PIL (TkImaging) extension only: +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0049-mingw-pdcurses_ISPAD.patch b/mingw-w64-python3.9/0049-mingw-pdcurses_ISPAD.patch new file mode 100644 index 0000000000000..77354d1560814 --- /dev/null +++ b/mingw-w64-python3.9/0049-mingw-pdcurses_ISPAD.patch @@ -0,0 +1,35 @@ +From 30f4a5a6f752600870d2045ade63cecf2fc8483e 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?= + +Date: Thu, 17 Jun 2021 18:51:55 +0530 +Subject: [PATCH 49/N] mingw pdcurses_ISPAD +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Include/py_curses.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/Include/py_curses.h b/Include/py_curses.h +index b70252d..0d5cee2 100644 +--- a/Include/py_curses.h ++++ b/Include/py_curses.h +@@ -36,6 +36,13 @@ + #include + #endif + ++#if defined(__MINGW32__) ++#include ++#if !defined(_ISPAD) ++#define _ISPAD 0x10 ++#endif ++#endif ++ + #ifdef HAVE_NCURSES_H + /* configure was checking , but we will + use , which has some or all these features. */ +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0050-grammar-fixes.patch b/mingw-w64-python3.9/0050-grammar-fixes.patch new file mode 100644 index 0000000000000..0d6b6522f37eb --- /dev/null +++ b/mingw-w64-python3.9/0050-grammar-fixes.patch @@ -0,0 +1,45 @@ +From 19250ed6838ce7ca85fca4c563bf0716738ffee8 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?= + +Date: Thu, 17 Jun 2021 18:51:56 +0530 +Subject: [PATCH 50/N] grammar fixes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Modules/parsermodule.c | 2 +- + Python/graminit.c | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c +index 24b0ffb..98a3759 100644 +--- a/Modules/parsermodule.c ++++ b/Modules/parsermodule.c +@@ -38,7 +38,7 @@ + #include "grammar.h" + #include "parsetok.h" + +-extern grammar _PyParser_Grammar; /* From graminit.c */ ++PyAPI_DATA(grammar) _PyParser_Grammar; /* From graminit.c */ + + #ifdef lint + #include +diff --git a/Python/graminit.c b/Python/graminit.c +index b7aa528..4a1ee9a 100644 +--- a/Python/graminit.c ++++ b/Python/graminit.c +@@ -2,7 +2,8 @@ + + #include "exports.h" + #include "grammar.h" +-Py_EXPORTED_SYMBOL grammar _PyParser_Grammar; ++#include "pyport.h" ++PyAPI_DATA(grammar) _PyParser_Grammar; + static const arc arcs_0_0[3] = { + {2, 1}, + {3, 2}, +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0750-builddir-fixes.patch b/mingw-w64-python3.9/0051-builddir-fixes.patch similarity index 63% rename from mingw-w64-python3.9/0750-builddir-fixes.patch rename to mingw-w64-python3.9/0051-builddir-fixes.patch index 9544f8fa96ae8..3334a0f70ee44 100644 --- a/mingw-w64-python3.9/0750-builddir-fixes.patch +++ b/mingw-w64-python3.9/0051-builddir-fixes.patch @@ -1,7 +1,24 @@ -diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in ---- Python-3.8.0-orig/Makefile.pre.in 2019-10-22 10:03:21.368190400 +0300 -+++ Python-3.8.0/Makefile.pre.in 2019-10-22 10:03:31.336607900 +0300 -@@ -710,20 +710,20 @@ +From 04925982f8d6c8a3254e9c891b18d82ed11b20cc 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?= + +Date: Thu, 17 Jun 2021 18:51:57 +0530 +Subject: [PATCH 51/N] builddir fixes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +--- + Makefile.pre.in | 10 +++++----- + Programs/_freeze_importlib.c | 2 +- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 4c8bb01..38256f5 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -741,20 +741,20 @@ Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) Programs/_freeze_importlib.o: Programs/_freeze_importlib.c Makefile @@ -26,7 +43,7 @@ diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in $(srcdir)/Lib/importlib/_bootstrap.py \ $(srcdir)/Python/importlib.h.new $(UPDATE_FILE) $(srcdir)/Python/importlib.h $(srcdir)/Python/importlib.h.new -@@ -1781,7 +1781,7 @@ +@@ -1882,7 +1882,7 @@ clean-retain-profile: pycremoval find build -name '*.py[co]' -exec rm -f {} ';' || true -rm -f pybuilddir.txt -rm -f Lib/lib2to3/*Grammar*.pickle @@ -35,10 +52,11 @@ diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in -find build -type f -a ! -name '*.gc??' -exec rm -f {} ';' -rm -f Include/pydtrace_probes.h -rm -f profile-gen-stamp -diff -Naur Python-3.8.0-orig/Programs/_freeze_importlib.c Python-3.8.0/Programs/_freeze_importlib.c ---- Python-3.8.0-orig/Programs/_freeze_importlib.c 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Programs/_freeze_importlib.c 2019-10-22 10:03:31.757808700 +0300 -@@ -20,7 +20,7 @@ +diff --git a/Programs/_freeze_importlib.c b/Programs/_freeze_importlib.c +index 2e4ccbb..a8d5c31 100644 +--- a/Programs/_freeze_importlib.c ++++ b/Programs/_freeze_importlib.c +@@ -20,7 +20,7 @@ static const struct _frozen _PyImport_FrozenModules[] = { {0, 0, 0} /* sentinel */ }; @@ -47,3 +65,6 @@ diff -Naur Python-3.8.0-orig/Programs/_freeze_importlib.c Python-3.8.0/Programs/ /* On Windows, this links with the regular pythonXY.dll, so this variable comes from frozen.obj. In the Makefile, frozen.o is not linked into this executable, so we define the variable here. */ +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0760-msys-monkeypatch-os-system-via-sh-exe.patch b/mingw-w64-python3.9/0052-msys-monkeypatch-os-system-via-sh-exe.patch similarity index 50% rename from mingw-w64-python3.9/0760-msys-monkeypatch-os-system-via-sh-exe.patch rename to mingw-w64-python3.9/0052-msys-monkeypatch-os-system-via-sh-exe.patch index db89e15b764d5..b4ceb1fe379bd 100644 --- a/mingw-w64-python3.9/0760-msys-monkeypatch-os-system-via-sh-exe.patch +++ b/mingw-w64-python3.9/0052-msys-monkeypatch-os-system-via-sh-exe.patch @@ -1,7 +1,22 @@ -diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py ---- Python-3.8.0-orig/setup.py 2019-10-22 10:03:24.597396100 +0300 -+++ Python-3.8.0/setup.py 2019-10-22 10:03:35.002614400 +0300 -@@ -38,6 +38,17 @@ +From fde7aaa6d2286bb35c39adc60a961b4d248e7f7e 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?= + +Date: Thu, 17 Jun 2021 18:51:57 +0530 +Subject: [PATCH 52/N] msys monkeypatch os system via sh exe +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + setup.py | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/setup.py b/setup.py +index d8fc413..20fff27 100644 +--- a/setup.py ++++ b/setup.py +@@ -58,6 +58,17 @@ def get_platform(): return sys.platform @@ -19,3 +34,6 @@ diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py CROSS_COMPILING = ("_PYTHON_HOST_PLATFORM" in os.environ) HOST_PLATFORM = get_platform() MS_WINDOWS = (HOST_PLATFORM == 'win32') +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0770-msys-replace-slashes-used-in-io-redirection.patch b/mingw-w64-python3.9/0053-msys-replace-slashes-used-in-io-redirection.patch similarity index 71% rename from mingw-w64-python3.9/0770-msys-replace-slashes-used-in-io-redirection.patch rename to mingw-w64-python3.9/0053-msys-replace-slashes-used-in-io-redirection.patch index 4ddc55a242add..eda6db571dc91 100644 --- a/mingw-w64-python3.9/0770-msys-replace-slashes-used-in-io-redirection.patch +++ b/mingw-w64-python3.9/0053-msys-replace-slashes-used-in-io-redirection.patch @@ -1,7 +1,23 @@ -diff -Naur Python-3.9.4-orig/setup.py Python-3.9.4/setup.py ---- Python-3.9.4-orig/setup.py 2021-04-04 08:56:53 +0000 -+++ Python-3.9.4/setup.py 2021-04-05 21:28:28 +0000 -@@ -629,7 +629,7 @@ +From 327d9358a207dfc8171c3996a9707a7198acec82 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?= + +Date: Thu, 17 Jun 2021 18:51:58 +0530 +Subject: [PATCH 53/N] msys replace slashes used in io redirection +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +--- + setup.py | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/setup.py b/setup.py +index 20fff27..f5914d8 100644 +--- a/setup.py ++++ b/setup.py +@@ -643,7 +643,7 @@ class PyBuildExt(build_ext): # Debian/Ubuntu multiarch support. # https://wiki.ubuntu.com/MultiarchSpec cc = sysconfig.get_config_var('CC') @@ -10,7 +26,7 @@ diff -Naur Python-3.9.4-orig/setup.py Python-3.9.4/setup.py if not os.path.exists(self.build_temp): os.makedirs(self.build_temp) ret = run_command( -@@ -654,7 +654,7 @@ +@@ -668,7 +668,7 @@ class PyBuildExt(build_ext): opt = '' if CROSS_COMPILING: opt = '-t' + sysconfig.get_config_var('HOST_GNU_TYPE') @@ -19,7 +35,7 @@ diff -Naur Python-3.9.4-orig/setup.py Python-3.9.4/setup.py if not os.path.exists(self.build_temp): os.makedirs(self.build_temp) ret = run_command( -@@ -673,7 +673,7 @@ +@@ -687,7 +687,7 @@ class PyBuildExt(build_ext): def add_cross_compiling_paths(self): cc = sysconfig.get_config_var('CC') @@ -28,7 +44,7 @@ diff -Naur Python-3.9.4-orig/setup.py Python-3.9.4/setup.py if not os.path.exists(self.build_temp): os.makedirs(self.build_temp) ret = run_command('%s -E -v - %s 1>/dev/null' % (cc, tmpfile)) -@@ -967,7 +967,7 @@ +@@ -1001,7 +1001,7 @@ class PyBuildExt(build_ext): readline_termcap_library = "" curses_library = "" # Cannot use os.popen here in py3k. @@ -37,7 +53,7 @@ diff -Naur Python-3.9.4-orig/setup.py Python-3.9.4/setup.py if not os.path.exists(self.build_temp): os.makedirs(self.build_temp) # Determine if readline is already linked against curses or tinfo. -@@ -1931,12 +1931,12 @@ +@@ -1998,12 +1998,12 @@ class PyBuildExt(build_ext): cflags = sysconfig.get_config_vars('CFLAGS')[0] archs = re.findall(r'-arch\s+(\w+)', cflags) @@ -52,3 +68,6 @@ diff -Naur Python-3.9.4-orig/setup.py Python-3.9.4/setup.py ) with open(tmpfile) as fp: detected_archs = [] +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0800-mingw-install-layout-as-posix.patch b/mingw-w64-python3.9/0054-mingw-install-layout-as-posix.patch similarity index 53% rename from mingw-w64-python3.9/0800-mingw-install-layout-as-posix.patch rename to mingw-w64-python3.9/0054-mingw-install-layout-as-posix.patch index 597a58b3b59e8..5a2cd0611bb7a 100644 --- a/mingw-w64-python3.9/0800-mingw-install-layout-as-posix.patch +++ b/mingw-w64-python3.9/0054-mingw-install-layout-as-posix.patch @@ -1,7 +1,22 @@ -diff -Naur Python-3.8.0-orig/Lib/distutils/command/install.py Python-3.8.0/Lib/distutils/command/install.py ---- Python-3.8.0-orig/Lib/distutils/command/install.py 2019-10-22 10:03:20.572589000 +0300 -+++ Python-3.8.0/Lib/distutils/command/install.py 2019-10-22 10:03:40.618624200 +0300 -@@ -20,10 +20,10 @@ +From c965eeaccbdd5d3c607fa6dff4bdf2f5747a96f3 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?= + +Date: Thu, 17 Jun 2021 18:51:59 +0530 +Subject: [PATCH 54/N] mingw install layout as posix +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Lib/distutils/command/install.py | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py +index eea417e..f8c42c7 100644 +--- a/Lib/distutils/command/install.py ++++ b/Lib/distutils/command/install.py +@@ -20,10 +20,10 @@ from site import USER_SITE HAS_USER_SITE = True WINDOWS_SCHEME = { @@ -16,7 +31,7 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/command/install.py Python-3.8.0/Lib/d 'data' : '$base', } -@@ -50,8 +50,8 @@ +@@ -50,8 +50,8 @@ if HAS_USER_SITE: INSTALL_SCHEMES['nt_user'] = { 'purelib': '$usersite', 'platlib': '$usersite', @@ -27,3 +42,6 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/command/install.py Python-3.8.0/Lib/d 'data' : '$userbase', } +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0055-remove_path_max.default.patch b/mingw-w64-python3.9/0055-remove_path_max.default.patch new file mode 100644 index 0000000000000..f65f94521667d --- /dev/null +++ b/mingw-w64-python3.9/0055-remove_path_max.default.patch @@ -0,0 +1,29 @@ +From 848fa1607dd6df33db5be9e11fb8ffd1c63d1112 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?= + +Date: Thu, 17 Jun 2021 18:51:59 +0530 +Subject: [PATCH 55/N] remove_path_max.default +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Include/osdefs.h | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/Include/osdefs.h b/Include/osdefs.h +index 3243944..99d4977 100644 +--- a/Include/osdefs.h ++++ b/Include/osdefs.h +@@ -10,7 +10,6 @@ extern "C" { + #ifdef MS_WINDOWS + #define SEP L'\\' + #define ALTSEP L'/' +-#define MAXPATHLEN 256 + #define DELIM L';' + #endif + +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0056-dont-link-with-gettext.patch b/mingw-w64-python3.9/0056-dont-link-with-gettext.patch new file mode 100644 index 0000000000000..77afc0792fbc4 --- /dev/null +++ b/mingw-w64-python3.9/0056-dont-link-with-gettext.patch @@ -0,0 +1,60 @@ +From 4b35cc22538ecba9fcd0fb69495d9f5919ee775e 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?= + +Date: Thu, 17 Jun 2021 18:52:00 +0530 +Subject: [PATCH 56/N] dont link with gettext +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Modules/_localemodule.c | 7 +++++++ + configure.ac | 9 +++++++++ + 2 files changed, 16 insertions(+) + +diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c +index 2e353bb..ea222af 100644 +--- a/Modules/_localemodule.c ++++ b/Modules/_localemodule.c +@@ -12,6 +12,13 @@ This software comes with no warranty. Use at your own risk. + #define PY_SSIZE_T_CLEAN + #include "Python.h" + #include "pycore_fileutils.h" ++#ifdef __MINGW32__ ++/* The header libintl.h and library libintl may exist on mingw host. ++ * To be compatible with MSVC build we has to undef some defines. ++ */ ++#undef HAVE_LIBINTL_H ++#undef HAVE_BIND_TEXTDOMAIN_CODESET ++#endif + + #include + #include +diff --git a/configure.ac b/configure.ac +index acb5bea..c09b5fb 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3151,10 +3151,19 @@ AC_SEARCH_LIBS(sem_init, pthread rt posix4) + fi + + # check if we need libintl for locale functions ++case $host in ++ *-*-mingw*) ++ dnl Native windows build don't use libintl (see _localemodule.c). ++ dnl Also we don't like setup.py to add "intl" library to the list ++ dnl when build _locale module. ++ ;; ++ *) + AC_CHECK_LIB(intl, textdomain, + [AC_DEFINE(WITH_LIBINTL, 1, + [Define to 1 if libintl is needed for locale functions.]) + LIBS="-lintl $LIBS"]) ++ ;; ++esac + + # checks for system dependent C++ extensions support + case "$ac_sys_system" in +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0057-ctypes-python-dll.patch b/mingw-w64-python3.9/0057-ctypes-python-dll.patch new file mode 100644 index 0000000000000..7cbb6a2fd6e70 --- /dev/null +++ b/mingw-w64-python3.9/0057-ctypes-python-dll.patch @@ -0,0 +1,33 @@ +From 36014b954c10629033948204a4c8a39bfc03542d 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?= + +Date: Thu, 17 Jun 2021 18:52:01 +0530 +Subject: [PATCH 57/N] ctypes python dll +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +--- + Lib/ctypes/__init__.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py +index 4afa4eb..2fe2eec 100644 +--- a/Lib/ctypes/__init__.py ++++ b/Lib/ctypes/__init__.py +@@ -456,7 +456,9 @@ class LibraryLoader(object): + cdll = LibraryLoader(CDLL) + pydll = LibraryLoader(PyDLL) + +-if _os.name == "nt": ++if _os.name == "nt" and _sys.version.find('GCC') >= 0: ++ pythonapi = PyDLL("libpython%d.%d%s.dll" % (_sys.version_info[:2] + (_sys.abiflags,)), None) ++elif _os.name == "nt": + pythonapi = PyDLL("python dll", None, _sys.dllhandle) + elif _sys.platform == "cygwin": + pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2]) +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0058-gdbm-module-includes.patch b/mingw-w64-python3.9/0058-gdbm-module-includes.patch new file mode 100644 index 0000000000000..978c705876aa8 --- /dev/null +++ b/mingw-w64-python3.9/0058-gdbm-module-includes.patch @@ -0,0 +1,30 @@ +From 48b0fefa0389e88d0340500cd68d8add22434502 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?= + +Date: Thu, 17 Jun 2021 18:52:02 +0530 +Subject: [PATCH 58/N] gdbm module includes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Modules/_gdbmmodule.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Modules/_gdbmmodule.c b/Modules/_gdbmmodule.c +index dd4c6b1..d51015c 100644 +--- a/Modules/_gdbmmodule.c ++++ b/Modules/_gdbmmodule.c +@@ -11,7 +11,7 @@ + #include + #include "gdbm.h" + +-#if defined(WIN32) && !defined(__CYGWIN__) ++#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__) + #include "gdbmerrno.h" + extern const char * gdbm_strerror(gdbm_error); + #endif +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0850-use-gnu_printf-in-format.patch b/mingw-w64-python3.9/0059-use-gnu_printf-in-format.patch similarity index 58% rename from mingw-w64-python3.9/0850-use-gnu_printf-in-format.patch rename to mingw-w64-python3.9/0059-use-gnu_printf-in-format.patch index 72d2d884e5b59..e079615c7db66 100644 --- a/mingw-w64-python3.9/0850-use-gnu_printf-in-format.patch +++ b/mingw-w64-python3.9/0059-use-gnu_printf-in-format.patch @@ -1,7 +1,25 @@ -diff -Naur Python-3.8.0-orig/Include/bytesobject.h Python-3.8.0/Include/bytesobject.h ---- Python-3.8.0-orig/Include/bytesobject.h 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Include/bytesobject.h 2019-10-22 10:03:56.031451300 +0300 -@@ -52,9 +52,9 @@ +From 19c04060e9c1ddde6be136678196c2545e76591e 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?= + +Date: Thu, 17 Jun 2021 18:52:03 +0530 +Subject: [PATCH 59/N] use gnu_printf in format +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Include/bytesobject.h | 4 ++-- + Include/pyerrors.h | 4 ++-- + Include/pyport.h | 6 ++++++ + Include/sysmodule.h | 4 ++-- + 4 files changed, 12 insertions(+), 6 deletions(-) + +diff --git a/Include/bytesobject.h b/Include/bytesobject.h +index 5062d8d..627e8b2 100644 +--- a/Include/bytesobject.h ++++ b/Include/bytesobject.h +@@ -38,9 +38,9 @@ PyAPI_FUNC(PyObject *) PyBytes_FromStringAndSize(const char *, Py_ssize_t); PyAPI_FUNC(PyObject *) PyBytes_FromString(const char *); PyAPI_FUNC(PyObject *) PyBytes_FromObject(PyObject *); PyAPI_FUNC(PyObject *) PyBytes_FromFormatV(const char*, va_list) @@ -13,12 +31,13 @@ diff -Naur Python-3.8.0-orig/Include/bytesobject.h Python-3.8.0/Include/bytesobj PyAPI_FUNC(Py_ssize_t) PyBytes_Size(PyObject *); PyAPI_FUNC(char *) PyBytes_AsString(PyObject *); PyAPI_FUNC(PyObject *) PyBytes_Repr(PyObject *, int); -diff -Naur Python-3.8.0-orig/Include/pyerrors.h Python-3.8.0/Include/pyerrors.h ---- Python-3.8.0-orig/Include/pyerrors.h 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Include/pyerrors.h 2019-10-22 10:03:56.437052000 +0300 -@@ -319,9 +319,9 @@ +diff --git a/Include/pyerrors.h b/Include/pyerrors.h +index 979a26b..28cfb0f 100644 +--- a/Include/pyerrors.h ++++ b/Include/pyerrors.h +@@ -310,9 +310,9 @@ PyAPI_FUNC(int) PyUnicodeTranslateError_SetReason( + ); - #include PyAPI_FUNC(int) PyOS_snprintf(char *str, size_t size, const char *format, ...) - Py_GCC_ATTRIBUTE((format(printf, 3, 4))); + Py_PRINTF(3, 4); @@ -28,24 +47,11 @@ diff -Naur Python-3.8.0-orig/Include/pyerrors.h Python-3.8.0/Include/pyerrors.h #ifndef Py_LIMITED_API # define Py_CPYTHON_ERRORS_H -diff -Naur Python-3.8.0-orig/Include/sysmodule.h Python-3.8.0/Include/sysmodule.h ---- Python-3.8.0-orig/Include/sysmodule.h 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Include/sysmodule.h 2019-10-22 10:03:56.858252800 +0300 -@@ -15,9 +15,9 @@ - PyAPI_FUNC(void) PySys_SetPath(const wchar_t *); - - PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...) -- Py_GCC_ATTRIBUTE((format(printf, 1, 2))); -+ Py_PRINTF(1, 2); - PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...) -- Py_GCC_ATTRIBUTE((format(printf, 1, 2))); -+ Py_PRINTF(1, 2); - PyAPI_FUNC(void) PySys_FormatStdout(const char *format, ...); - PyAPI_FUNC(void) PySys_FormatStderr(const char *format, ...); - ---- Python-3.9.5/Include/pyport.h.orig 2021-05-14 15:30:48.522516700 +0300 -+++ Python-3.9.5/Include/pyport.h 2021-05-14 15:44:47.249415100 +0300 -@@ -796,6 +798,12 @@ +diff --git a/Include/pyport.h b/Include/pyport.h +index a05fa3a..0972630 100644 +--- a/Include/pyport.h ++++ b/Include/pyport.h +@@ -798,6 +798,12 @@ extern char * _getpty(int *, int, mode_t, int); #define Py_VA_COPY va_copy @@ -58,3 +64,22 @@ diff -Naur Python-3.8.0-orig/Include/sysmodule.h Python-3.8.0/Include/sysmodule. /* * Convenient macros to deal with endianness of the platform. WORDS_BIGENDIAN is * detected by configure and defined in pyconfig.h. The code in pyconfig.h +diff --git a/Include/sysmodule.h b/Include/sysmodule.h +index 670e5d2..d582963 100644 +--- a/Include/sysmodule.h ++++ b/Include/sysmodule.h +@@ -15,9 +15,9 @@ PyAPI_FUNC(void) PySys_SetArgvEx(int, wchar_t **, int); + PyAPI_FUNC(void) PySys_SetPath(const wchar_t *); + + PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...) +- Py_GCC_ATTRIBUTE((format(printf, 1, 2))); ++ Py_PRINTF(1, 2); + PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...) +- Py_GCC_ATTRIBUTE((format(printf, 1, 2))); ++ Py_PRINTF(1, 2); + PyAPI_FUNC(void) PySys_FormatStdout(const char *format, ...); + PyAPI_FUNC(void) PySys_FormatStderr(const char *format, ...); + +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0060-mingw-fix-ssl-dont-use-enum_certificates.patch b/mingw-w64-python3.9/0060-mingw-fix-ssl-dont-use-enum_certificates.patch new file mode 100644 index 0000000000000..55bc3ef8fea95 --- /dev/null +++ b/mingw-w64-python3.9/0060-mingw-fix-ssl-dont-use-enum_certificates.patch @@ -0,0 +1,39 @@ +From 01c84b07e61e069b42a997c1fd96a1fb16888e35 Mon Sep 17 00:00:00 2001 +From: Ray Donnelly +Date: Thu, 17 Jun 2021 18:52:03 +0530 +Subject: [PATCH 60/N] mingw fix ssl dont use enum_certificates +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +--- + Lib/ssl.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Lib/ssl.py b/Lib/ssl.py +index 30f4e59..dda3ae1 100644 +--- a/Lib/ssl.py ++++ b/Lib/ssl.py +@@ -249,7 +249,7 @@ class _TLSMessageType(_IntEnum): + CHANGE_CIPHER_SPEC = 0x0101 + + +-if sys.platform == "win32": ++if sys.platform == "win32" and sys.version.find("GCC") == -1: + from _ssl import enum_certificates, enum_crls + + from socket import socket, SOCK_STREAM, create_connection +@@ -569,7 +569,7 @@ class SSLContext(_SSLContext): + def load_default_certs(self, purpose=Purpose.SERVER_AUTH): + if not isinstance(purpose, _ASN1Object): + raise TypeError(purpose) +- if sys.platform == "win32": ++ if sys.platform == "win32" and sys.version.find("GCC") == -1: + for storename in self._windows_cert_stores: + self._load_windows_store_certs(storename, purpose) + self.set_default_verify_paths() +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0061-mingw-build-optimized-ext.patch b/mingw-w64-python3.9/0061-mingw-build-optimized-ext.patch new file mode 100644 index 0000000000000..6730d2f178f0c --- /dev/null +++ b/mingw-w64-python3.9/0061-mingw-build-optimized-ext.patch @@ -0,0 +1,34 @@ +From 92f04d669d2a2283416e2b75108d13a06ff5f5db 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?= + +Date: Thu, 17 Jun 2021 18:52:04 +0530 +Subject: [PATCH 61/N] mingw build optimized ext +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Lib/distutils/cygwinccompiler.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py +index f90af3b..0bda7a3 100644 +--- a/Lib/distutils/cygwinccompiler.py ++++ b/Lib/distutils/cygwinccompiler.py +@@ -303,9 +303,9 @@ class Mingw32CCompiler(CygwinCCompiler): + raise CCompilerError( + 'Cygwin gcc cannot be used with --compiler=mingw32') + +- self.set_executables(compiler='gcc -O -Wall', +- compiler_so='gcc -mdll -O -Wall', +- compiler_cxx='g++ -O -Wall', ++ self.set_executables(compiler='gcc -O2 -Wall', ++ compiler_so='gcc -mdll -O2 -Wall', ++ compiler_cxx='g++ -O2 -Wall', + linker_exe='gcc', + linker_so='%s %s %s' + % (self.linker_dll, shared_option, +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0062-cygwinccompiler-dont-strip-modules-if-pydebug.patch b/mingw-w64-python3.9/0062-cygwinccompiler-dont-strip-modules-if-pydebug.patch new file mode 100644 index 0000000000000..c1be22b955f4a --- /dev/null +++ b/mingw-w64-python3.9/0062-cygwinccompiler-dont-strip-modules-if-pydebug.patch @@ -0,0 +1,29 @@ +From 61736a3c5ea3e737347d4565a7a6b40197fc76b7 Mon Sep 17 00:00:00 2001 +From: Ray Donnelly +Date: Thu, 17 Jun 2021 18:52:05 +0530 +Subject: [PATCH 62/N] cygwinccompiler dont strip modules if pydebug +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Lib/distutils/cygwinccompiler.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py +index 0bda7a3..09b6eda 100644 +--- a/Lib/distutils/cygwinccompiler.py ++++ b/Lib/distutils/cygwinccompiler.py +@@ -236,7 +236,7 @@ class CygwinCCompiler(UnixCCompiler): + # (On my machine: 10KiB < stripped_file < ??100KiB + # unstripped_file = stripped_file + XXX KiB + # ( XXX=254 for a typical python extension)) +- if not debug: ++ if not debug and not hasattr(sys, 'gettotalrefcount'): + extra_preargs.append("-s") + + UnixCCompiler.link(self, target_desc, objects, output_filename, +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0063-fix-using-dllhandle-and-winver-mingw.patch b/mingw-w64-python3.9/0063-fix-using-dllhandle-and-winver-mingw.patch new file mode 100644 index 0000000000000..7343e4f9a1242 --- /dev/null +++ b/mingw-w64-python3.9/0063-fix-using-dllhandle-and-winver-mingw.patch @@ -0,0 +1,39 @@ +From 822c48301dd2ba9c46e8753aed20f06039410a8a 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?= + +Date: Thu, 17 Jun 2021 18:52:06 +0530 +Subject: [PATCH 63/N] fix using dllhandle and winver mingw +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Python/sysmodule.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Python/sysmodule.c b/Python/sysmodule.c +index 3e4115f..839ed1c 100644 +--- a/Python/sysmodule.c ++++ b/Python/sysmodule.c +@@ -36,7 +36,7 @@ Data members: + #include + #endif /* MS_WINDOWS */ + +-#ifdef MS_COREDLL ++#if defined(MS_WINDOWS) && defined(Py_ENABLE_SHARED) + extern void *PyWin_DLLhModule; + /* A string loaded from the DLL at startup: */ + extern const char *PyWin_DLLVersionString; +@@ -2731,7 +2731,7 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict) + PyUnicode_FromString("little")); + #endif + +-#ifdef MS_COREDLL ++#if defined(MS_WINDOWS) && defined(Py_ENABLE_SHARED) + SET_SYS_FROM_STRING("dllhandle", + PyLong_FromVoidPtr(PyWin_DLLhModule)); + SET_SYS_FROM_STRING("winver", +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0064-mingw-add-LIBPL-to-library-dirs.patch b/mingw-w64-python3.9/0064-mingw-add-LIBPL-to-library-dirs.patch new file mode 100644 index 0000000000000..0df733f275460 --- /dev/null +++ b/mingw-w64-python3.9/0064-mingw-add-LIBPL-to-library-dirs.patch @@ -0,0 +1,26 @@ +From a5a17cbdffa08bfb3256ed55eacae5b20db918e8 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?= + +Date: Thu, 17 Jun 2021 18:52:06 +0530 +Subject: [PATCH 64/N] mingw add LIBPL to library dirs + +--- + Lib/distutils/command/build_ext.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py +index 1dbdfe0..1598735 100644 +--- a/Lib/distutils/command/build_ext.py ++++ b/Lib/distutils/command/build_ext.py +@@ -218,7 +218,7 @@ class build_ext(Command): + + # For extensions under Cygwin, Python's library directory must be + # appended to library_dirs +- if sys.platform[:6] == 'cygwin': ++ if sys.platform[:6] == 'cygwin' or self.plat_name.startswith(('mingw')): + if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): + # building third party extensions + config_dir_name = os.path.basename(sysconfig.get_config_var('LIBPL')) +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0970-Add-AMD64-to-sys-config-so-msvccompiler-get_build_version-works.patch b/mingw-w64-python3.9/0065-Add-AMD64-to-sys-config-so-msvccompiler-get_build_ve.patch similarity index 58% rename from mingw-w64-python3.9/0970-Add-AMD64-to-sys-config-so-msvccompiler-get_build_version-works.patch rename to mingw-w64-python3.9/0065-Add-AMD64-to-sys-config-so-msvccompiler-get_build_ve.patch index 023463b4a115f..3cbb0003131c8 100644 --- a/mingw-w64-python3.9/0970-Add-AMD64-to-sys-config-so-msvccompiler-get_build_version-works.patch +++ b/mingw-w64-python3.9/0065-Add-AMD64-to-sys-config-so-msvccompiler-get_build_ve.patch @@ -1,6 +1,18 @@ -diff -Naur Python-3.8.0-orig/Python/getcompiler.c Python-3.8.0/Python/getcompiler.c ---- Python-3.8.0-orig/Python/getcompiler.c 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Python/getcompiler.c 2019-10-22 10:04:17.450288900 +0300 +From 4a27f5ec3d5715a4d0396cb667917e78a9660e95 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?= + +Date: Thu, 17 Jun 2021 18:52:07 +0530 +Subject: [PATCH 65/N] Add AMD64 to sys config so msvccompiler + get_build_version works + +--- + Python/getcompiler.c | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +diff --git a/Python/getcompiler.c b/Python/getcompiler.c +index 59c0dbf..adccaa7 100644 +--- a/Python/getcompiler.c ++++ b/Python/getcompiler.c @@ -10,7 +10,22 @@ #if defined(__clang__) #define COMPILER "\n[Clang " __clang_version__ "]" @@ -25,3 +37,6 @@ diff -Naur Python-3.8.0-orig/Python/getcompiler.c Python-3.8.0/Python/getcompile // Generic fallbacks. #elif defined(__cplusplus) #define COMPILER "[C++]" +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0066-MINGW-link-with-additional-library.patch b/mingw-w64-python3.9/0066-MINGW-link-with-additional-library.patch new file mode 100644 index 0000000000000..135c83ddfe297 --- /dev/null +++ b/mingw-w64-python3.9/0066-MINGW-link-with-additional-library.patch @@ -0,0 +1,33 @@ +From 4238747aeb62b40be9d9ea7e3ce02958976eb554 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?= + +Date: Thu, 17 Jun 2021 18:52:08 +0530 +Subject: [PATCH 66/N] MINGW link with additional library + +--- + configure.ac | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/configure.ac b/configure.ac +index c09b5fb..7cec63a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -5841,6 +5841,15 @@ for dir in $SRCDIRS; do + done + AC_MSG_RESULT(done) + ++# For mingw build need additional library for linking ++case $host in ++ *-*-mingw*) ++ LIBS="$LIBS -lversion -lshlwapi -lpathcch" ++ ;; ++ *) ++ ;; ++esac ++ + # Availability of -O2: + AC_MSG_CHECKING(for -O2) + saved_cflags="$CFLAGS" +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0067-install-msilib.patch b/mingw-w64-python3.9/0067-install-msilib.patch new file mode 100644 index 0000000000000..f1eff4d3f878a --- /dev/null +++ b/mingw-w64-python3.9/0067-install-msilib.patch @@ -0,0 +1,30 @@ +From 127df4dd7e79146ad61612f843f3f6b568852e94 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= +Date: Thu, 17 Jun 2021 18:52:09 +0530 +Subject: [PATCH 67/N] install msilib +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +Co-authored-by: Christoph Reiter +Co-authored-by: Ray Donnelly +--- + Makefile.pre.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 38256f5..20e434a 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1497,6 +1497,7 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \ + test/test_peg_generator \ + test/test_tools test/test_warnings test/test_warnings/data \ + turtledemo \ ++ msilib \ + multiprocessing multiprocessing/dummy \ + unittest unittest/test unittest/test/testmock \ + venv venv/scripts venv/scripts/common venv/scripts/posix \ +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0068-dont-include-system-ncurses-path.patch b/mingw-w64-python3.9/0068-dont-include-system-ncurses-path.patch new file mode 100644 index 0000000000000..3939b8b2ec239 --- /dev/null +++ b/mingw-w64-python3.9/0068-dont-include-system-ncurses-path.patch @@ -0,0 +1,36 @@ +From c40518a519539a80341ef6ad76f3c6d5959ac446 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?= + +Date: Thu, 17 Jun 2021 18:52:09 +0530 +Subject: [PATCH 68/N] dont include system ncurses path + +--- + configure.ac | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 7cec63a..b452ca3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -5460,9 +5460,15 @@ fi + + # first curses header check + ac_save_cppflags="$CPPFLAGS" +-if test "$cross_compiling" = no; then +- CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" +-fi ++case $host_os in ++ mingw*) ++ ;; ++ *) ++ if test "$cross_compiling" = no; then ++ CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" ++ fi ++ ;; ++esac + + AC_CHECK_HEADERS(curses.h ncurses.h) + +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0069-fix-signal-module-build.patch b/mingw-w64-python3.9/0069-fix-signal-module-build.patch new file mode 100644 index 0000000000000..b5622082acaa0 --- /dev/null +++ b/mingw-w64-python3.9/0069-fix-signal-module-build.patch @@ -0,0 +1,29 @@ +From 9da0b6e321fc0346bc0a8d29260dd5001c9f2c27 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Thu, 17 Jun 2021 18:52:10 +0530 +Subject: [PATCH 69/N] fix signal module build +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Modules/Setup | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Modules/Setup b/Modules/Setup +index 2bafdd0..7ce4355 100644 +--- a/Modules/Setup ++++ b/Modules/Setup +@@ -111,7 +111,7 @@ _collections _collectionsmodule.c # Container types + _abc _abc.c # Abstract base classes + itertools itertoolsmodule.c # Functions creating iterators for efficient looping + atexit atexitmodule.c # Register functions to be run at interpreter-shutdown +-_signal -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal signalmodule.c ++_signal -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal signalmodule.c -lws2_32 + _stat _stat.c # stat.h interface + time -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal timemodule.c # -lm # time operations and variables + _thread -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal _threadmodule.c # low-level threading interface +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0070-build-winconsoleio.patch b/mingw-w64-python3.9/0070-build-winconsoleio.patch new file mode 100644 index 0000000000000..4bb7697dcc537 --- /dev/null +++ b/mingw-w64-python3.9/0070-build-winconsoleio.patch @@ -0,0 +1,29 @@ +From 484153a97c8d286295a1e67bdab4e79163e2e131 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Thu, 17 Jun 2021 18:52:11 +0530 +Subject: [PATCH 70/N] build winconsoleio +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Modules/Setup | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Modules/Setup b/Modules/Setup +index 7ce4355..6bb5e51 100644 +--- a/Modules/Setup ++++ b/Modules/Setup +@@ -120,7 +120,7 @@ _thread -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal _threadmodule.c # l + _locale -DPy_BUILD_CORE_BUILTIN _localemodule.c # -lintl + + # Standard I/O baseline +-_io -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c ++_io -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c _io/winconsoleio.c + + # faulthandler module + faulthandler faulthandler.c +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0071-expose-sem_unlink.patch b/mingw-w64-python3.9/0071-expose-sem_unlink.patch new file mode 100644 index 0000000000000..88bd3f65dd6c6 --- /dev/null +++ b/mingw-w64-python3.9/0071-expose-sem_unlink.patch @@ -0,0 +1,29 @@ +From fa940ac106793d80ca2e39adbf8a47b85364615b Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Thu, 17 Jun 2021 18:52:12 +0530 +Subject: [PATCH 71/N] expose sem_unlink +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Modules/_multiprocessing/multiprocessing.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Modules/_multiprocessing/multiprocessing.c b/Modules/_multiprocessing/multiprocessing.c +index 806e638..d7954d1 100644 +--- a/Modules/_multiprocessing/multiprocessing.c ++++ b/Modules/_multiprocessing/multiprocessing.c +@@ -128,7 +128,7 @@ static PyMethodDef module_methods[] = { + {"recv", multiprocessing_recv, METH_VARARGS, ""}, + {"send", multiprocessing_send, METH_VARARGS, ""}, + #endif +-#if !defined(POSIX_SEMAPHORES_NOT_ENABLED) && !defined(__ANDROID__) ++#if defined(MS_WINDOWS) || (!defined(POSIX_SEMAPHORES_NOT_ENABLED) && !defined(__ANDROID__)) + {"sem_unlink", _PyMp_sem_unlink, METH_VARARGS, ""}, + #endif + {NULL} +-- +2.32.0 + diff --git a/mingw-w64-python3.9/1700-cygpty-isatty.patch b/mingw-w64-python3.9/0072-cygpty-isatty.patch similarity index 77% rename from mingw-w64-python3.9/1700-cygpty-isatty.patch rename to mingw-w64-python3.9/0072-cygpty-isatty.patch index 46536dda9c963..2b36f7c242079 100644 --- a/mingw-w64-python3.9/1700-cygpty-isatty.patch +++ b/mingw-w64-python3.9/0072-cygpty-isatty.patch @@ -1,6 +1,33 @@ -diff -Naur Python-3.9.4-orig/Include/iscygpty.h Python-3.9.4/Include/iscygpty.h ---- Python-3.9.4-orig/Include/iscygpty.h 1969-12-31 19:00:00 +0000 -+++ Python-3.9.4/Include/iscygpty.h 2021-04-06 21:09:25 +0000 +From 9d10068ec68ceb8db0c0f814ecb82d725394df01 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Thu, 17 Jun 2021 18:52:14 +0530 +Subject: [PATCH 72/N] cygpty isatty +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Include/iscygpty.h | 41 ++++++++++ + Makefile.pre.in | 2 + + Modules/_io/fileio.c | 3 +- + Modules/main.c | 3 +- + Modules/posixmodule.c | 3 +- + Objects/fileobject.c | 3 +- + Python/bltinmodule.c | 5 +- + Python/fileutils.c | 3 +- + Python/frozenmain.c | 3 +- + Python/iscygpty.c | 185 ++++++++++++++++++++++++++++++++++++++++++ + Python/pylifecycle.c | 3 +- + 11 files changed, 245 insertions(+), 9 deletions(-) + create mode 100644 Include/iscygpty.h + create mode 100644 Python/iscygpty.c + +diff --git a/Include/iscygpty.h b/Include/iscygpty.h +new file mode 100644 +index 0000000..82fd0af +--- /dev/null ++++ b/Include/iscygpty.h @@ -0,0 +1,41 @@ +/* + * iscygpty.h -- part of ptycheck @@ -43,10 +70,11 @@ diff -Naur Python-3.9.4-orig/Include/iscygpty.h Python-3.9.4/Include/iscygpty.h +#endif + +#endif /* _ISCYGPTY_H */ -diff -Naur Python-3.9.4-orig/Makefile.pre.in Python-3.9.4/Makefile.pre.in ---- Python-3.9.4-orig/Makefile.pre.in 2021-04-04 08:56:53 +0000 -+++ Python-3.9.4/Makefile.pre.in 2021-04-06 21:09:25 +0000 -@@ -362,6 +362,7 @@ +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 20e434a..55f0ad7 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -372,6 +372,7 @@ PYTHON_OBJS= \ Python/import.o \ Python/importdl.o \ Python/initconfig.o \ @@ -54,7 +82,7 @@ diff -Naur Python-3.9.4-orig/Makefile.pre.in Python-3.9.4/Makefile.pre.in Python/marshal.o \ Python/modsupport.o \ Python/mysnprintf.o \ -@@ -1045,6 +1046,7 @@ +@@ -1070,6 +1071,7 @@ PYTHON_HEADERS= \ $(srcdir)/Include/import.h \ $(srcdir)/Include/interpreteridobject.h \ $(srcdir)/Include/intrcheck.h \ @@ -62,9 +90,10 @@ diff -Naur Python-3.9.4-orig/Makefile.pre.in Python-3.9.4/Makefile.pre.in $(srcdir)/Include/iterobject.h \ $(srcdir)/Include/listobject.h \ $(srcdir)/Include/longintrepr.h \ -diff -Naur Python-3.9.4-orig/Modules/_io/fileio.c Python-3.9.4/Modules/_io/fileio.c ---- Python-3.9.4-orig/Modules/_io/fileio.c 2021-04-04 08:56:53 +0000 -+++ Python-3.9.4/Modules/_io/fileio.c 2021-04-06 21:09:25 +0000 +diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c +index 048484b..0b56118 100644 +--- a/Modules/_io/fileio.c ++++ b/Modules/_io/fileio.c @@ -19,6 +19,7 @@ #endif #include /* For offsetof */ @@ -73,7 +102,7 @@ diff -Naur Python-3.9.4-orig/Modules/_io/fileio.c Python-3.9.4/Modules/_io/filei /* * Known likely problems: -@@ -1128,7 +1129,7 @@ +@@ -1128,7 +1129,7 @@ _io_FileIO_isatty_impl(fileio *self) return err_closed(); Py_BEGIN_ALLOW_THREADS _Py_BEGIN_SUPPRESS_IPH @@ -82,9 +111,10 @@ diff -Naur Python-3.9.4-orig/Modules/_io/fileio.c Python-3.9.4/Modules/_io/filei _Py_END_SUPPRESS_IPH Py_END_ALLOW_THREADS return PyBool_FromLong(res); -diff -Naur Python-3.9.4-orig/Modules/main.c Python-3.9.4/Modules/main.c ---- Python-3.9.4-orig/Modules/main.c 2021-04-04 08:56:53 +0000 -+++ Python-3.9.4/Modules/main.c 2021-04-06 21:13:33 +0000 +diff --git a/Modules/main.c b/Modules/main.c +index 2cc891f..17469e3 100644 +--- a/Modules/main.c ++++ b/Modules/main.c @@ -6,6 +6,7 @@ #include "pycore_pathconfig.h" // _PyPathConfig_ComputeSysPath0() #include "pycore_pylifecycle.h" // _Py_PreInitializeFromPyArgv() @@ -93,7 +123,7 @@ diff -Naur Python-3.9.4-orig/Modules/main.c Python-3.9.4/Modules/main.c /* Includes for exit_sigint() */ #include // perror() -@@ -91,7 +92,7 @@ +@@ -91,7 +92,7 @@ static inline int config_run_code(const PyConfig *config) static int stdin_is_interactive(const PyConfig *config) { @@ -102,10 +132,11 @@ diff -Naur Python-3.9.4-orig/Modules/main.c Python-3.9.4/Modules/main.c } -diff -Naur Python-3.9.4-orig/Modules/posixmodule.c Python-3.9.4/Modules/posixmodule.c ---- Python-3.9.4-orig/Modules/posixmodule.c 2021-04-04 08:56:53 +0000 -+++ Python-3.9.4/Modules/posixmodule.c 2021-04-06 21:09:25 +0000 -@@ -35,6 +35,7 @@ +diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c +index 40fc270..bb1b81d 100644 +--- a/Modules/posixmodule.c ++++ b/Modules/posixmodule.c +@@ -36,6 +36,7 @@ #ifdef __ANDROID__ # undef HAVE_FACCESSAT #endif @@ -113,7 +144,7 @@ diff -Naur Python-3.9.4-orig/Modules/posixmodule.c Python-3.9.4/Modules/posixmod #include /* needed for ctermid() */ -@@ -9992,7 +9993,7 @@ +@@ -10082,7 +10083,7 @@ os_isatty_impl(PyObject *module, int fd) { int return_value; _Py_BEGIN_SUPPRESS_IPH @@ -122,9 +153,10 @@ diff -Naur Python-3.9.4-orig/Modules/posixmodule.c Python-3.9.4/Modules/posixmod _Py_END_SUPPRESS_IPH return return_value; } -diff -Naur Python-3.9.4-orig/Objects/fileobject.c Python-3.9.4/Objects/fileobject.c ---- Python-3.9.4-orig/Objects/fileobject.c 2021-04-04 08:56:53 +0000 -+++ Python-3.9.4/Objects/fileobject.c 2021-04-06 21:17:02 +0000 +diff --git a/Objects/fileobject.c b/Objects/fileobject.c +index 1c6ecaf..afddc4f 100644 +--- a/Objects/fileobject.c ++++ b/Objects/fileobject.c @@ -2,6 +2,7 @@ #define PY_SSIZE_T_CLEAN @@ -133,7 +165,7 @@ diff -Naur Python-3.9.4-orig/Objects/fileobject.c Python-3.9.4/Objects/fileobjec #include "pycore_runtime.h" // _PyRuntime #if defined(HAVE_GETC_UNLOCKED) && !defined(_Py_MEMORY_SANITIZER) -@@ -435,7 +436,7 @@ +@@ -435,7 +436,7 @@ stdprinter_isatty(PyStdPrinter_Object *self, PyObject *Py_UNUSED(ignored)) } Py_BEGIN_ALLOW_THREADS @@ -142,9 +174,10 @@ diff -Naur Python-3.9.4-orig/Objects/fileobject.c Python-3.9.4/Objects/fileobjec Py_END_ALLOW_THREADS return PyBool_FromLong(res); -diff -Naur Python-3.9.4-orig/Python/bltinmodule.c Python-3.9.4/Python/bltinmodule.c ---- Python-3.9.4-orig/Python/bltinmodule.c 2021-04-04 08:56:53 +0000 -+++ Python-3.9.4/Python/bltinmodule.c 2021-04-06 21:10:56 +0000 +diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c +index 614012d..d29d06d 100644 +--- a/Python/bltinmodule.c ++++ b/Python/bltinmodule.c @@ -1,6 +1,7 @@ /* Built-in functions */ @@ -153,7 +186,7 @@ diff -Naur Python-3.9.4-orig/Python/bltinmodule.c Python-3.9.4/Python/bltinmodul #include #include "ast.h" #undef Yield /* undefine macro conflicting with */ -@@ -1980,7 +1981,7 @@ +@@ -1980,7 +1981,7 @@ builtin_input_impl(PyObject *module, PyObject *prompt) Py_DECREF(tmp); if (fd < 0 && PyErr_Occurred()) return NULL; @@ -162,7 +195,7 @@ diff -Naur Python-3.9.4-orig/Python/bltinmodule.c Python-3.9.4/Python/bltinmodul } if (tty) { tmp = _PyObject_CallMethodIdNoArgs(fout, &PyId_fileno); -@@ -1993,7 +1994,7 @@ +@@ -1993,7 +1994,7 @@ builtin_input_impl(PyObject *module, PyObject *prompt) Py_DECREF(tmp); if (fd < 0 && PyErr_Occurred()) return NULL; @@ -171,16 +204,17 @@ diff -Naur Python-3.9.4-orig/Python/bltinmodule.c Python-3.9.4/Python/bltinmodul } } -diff -Naur Python-3.9.4-orig/Python/fileutils.c Python-3.9.4/Python/fileutils.c ---- Python-3.9.4-orig/Python/fileutils.c 2021-04-04 08:56:53 +0000 -+++ Python-3.9.4/Python/fileutils.c 2021-04-06 21:11:24 +0000 +diff --git a/Python/fileutils.c b/Python/fileutils.c +index 3a3b00a..560109b 100644 +--- a/Python/fileutils.c ++++ b/Python/fileutils.c @@ -1,4 +1,5 @@ #include "Python.h" +#include "iscygpty.h" #include "pycore_fileutils.h" #include "osdefs.h" // SEP #include -@@ -66,7 +67,7 @@ +@@ -66,7 +67,7 @@ _Py_device_encoding(int fd) #endif int valid; _Py_BEGIN_SUPPRESS_IPH @@ -189,9 +223,10 @@ diff -Naur Python-3.9.4-orig/Python/fileutils.c Python-3.9.4/Python/fileutils.c _Py_END_SUPPRESS_IPH if (!valid) Py_RETURN_NONE; -diff -Naur Python-3.9.4-orig/Python/frozenmain.c Python-3.9.4/Python/frozenmain.c ---- Python-3.9.4-orig/Python/frozenmain.c 2021-04-04 08:56:53 +0000 -+++ Python-3.9.4/Python/frozenmain.c 2021-04-06 21:09:25 +0000 +diff --git a/Python/frozenmain.c b/Python/frozenmain.c +index dd04d60..6607762 100644 +--- a/Python/frozenmain.c ++++ b/Python/frozenmain.c @@ -4,6 +4,7 @@ #include "Python.h" #include "pycore_runtime.h" // _PyRuntime_Initialize() @@ -200,7 +235,7 @@ diff -Naur Python-3.9.4-orig/Python/frozenmain.c Python-3.9.4/Python/frozenmain. #ifdef MS_WINDOWS extern void PyWinFreeze_ExeInit(void); -@@ -107,7 +108,7 @@ +@@ -107,7 +108,7 @@ Py_FrozenMain(int argc, char **argv) else sts = 0; @@ -209,9 +244,11 @@ diff -Naur Python-3.9.4-orig/Python/frozenmain.c Python-3.9.4/Python/frozenmain. sts = PyRun_AnyFile(stdin, "") != 0; #ifdef MS_WINDOWS -diff -Naur Python-3.9.4-orig/Python/iscygpty.c Python-3.9.4/Python/iscygpty.c ---- Python-3.9.4-orig/Python/iscygpty.c 1969-12-31 19:00:00 +0000 -+++ Python-3.9.4/Python/iscygpty.c 2021-04-06 21:09:25 +0000 +diff --git a/Python/iscygpty.c b/Python/iscygpty.c +new file mode 100644 +index 0000000..722f88f +--- /dev/null ++++ b/Python/iscygpty.c @@ -0,0 +1,185 @@ +/* + * iscygpty.c -- part of ptycheck @@ -398,9 +435,10 @@ diff -Naur Python-3.9.4-orig/Python/iscygpty.c Python-3.9.4/Python/iscygpty.c +#endif /* _WIN32 */ + +/* vim: set ts=4 sw=4: */ -diff -Naur Python-3.9.4-orig/Python/pylifecycle.c Python-3.9.4/Python/pylifecycle.c ---- Python-3.9.4-orig/Python/pylifecycle.c 2021-04-04 08:56:53 +0000 -+++ Python-3.9.4/Python/pylifecycle.c 2021-04-06 21:15:46 +0000 +diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c +index 60f091c..734084c 100644 +--- a/Python/pylifecycle.c ++++ b/Python/pylifecycle.c @@ -19,6 +19,7 @@ #include "pycore_traceback.h" // _Py_DumpTracebackThreads() @@ -409,7 +447,7 @@ diff -Naur Python-3.9.4-orig/Python/pylifecycle.c Python-3.9.4/Python/pylifecycl #include // setlocale() #ifdef HAVE_SIGNAL_H -@@ -2470,7 +2471,7 @@ +@@ -2470,7 +2471,7 @@ _Py_RestoreSignals(void) int Py_FdIsInteractive(FILE *fp, const char *filename) { @@ -418,3 +456,6 @@ diff -Naur Python-3.9.4-orig/Python/pylifecycle.c Python-3.9.4/Python/pylifecycl return 1; if (!Py_InteractiveFlag) return 0; +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0073-disable-broken-gdbm-module.patch b/mingw-w64-python3.9/0073-disable-broken-gdbm-module.patch new file mode 100644 index 0000000000000..077d18bcad911 --- /dev/null +++ b/mingw-w64-python3.9/0073-disable-broken-gdbm-module.patch @@ -0,0 +1,29 @@ +From a1196d0f036301ba6b96332aa0d3c365785ea40a Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Thu, 17 Jun 2021 18:52:15 +0530 +Subject: [PATCH 73/N] disable broken gdbm module +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index f5914d8..a709723 100644 +--- a/setup.py ++++ b/setup.py +@@ -1399,7 +1399,7 @@ class PyBuildExt(build_ext): + if dbm_args: + dbm_order = [arg.split('=')[-1] for arg in dbm_args][-1].split(":") + else: +- dbm_order = "ndbm:gdbm:bdb".split(":") ++ dbm_order = [] + dbmext = None + for cand in dbm_order: + if cand == "ndbm": +-- +2.32.0 + diff --git a/mingw-w64-python3.9/1800-link-win-resource-files-and-build-pythonw.patch b/mingw-w64-python3.9/0074-link-win-resource-files-and-build-pythonw.patch similarity index 75% rename from mingw-w64-python3.9/1800-link-win-resource-files-and-build-pythonw.patch rename to mingw-w64-python3.9/0074-link-win-resource-files-and-build-pythonw.patch index c290d11f13871..4174670fbe2a5 100644 --- a/mingw-w64-python3.9/1800-link-win-resource-files-and-build-pythonw.patch +++ b/mingw-w64-python3.9/0074-link-win-resource-files-and-build-pythonw.patch @@ -1,37 +1,22 @@ ---- Python-3.8.7/configure.ac.orig 2021-02-14 08:44:30.296278300 +0100 -+++ Python-3.8.7/configure.ac 2021-02-14 08:44:39.824214800 +0100 -@@ -1320,6 +1320,9 @@ - - AC_MSG_RESULT($LDLIBRARY) - -+AC_SUBST(WINDRES) -+AC_CHECK_TOOL(WINDRES, windres) -+ - AC_SUBST(AR) - AC_CHECK_TOOLS(AR, ar aal, ar) - -@@ -5858,10 +5858,17 @@ - case $host in - *-*-mingw*) - LIBS="$LIBS -lversion -lshlwapi -lpathcch" -+ RCFLAGS="$RCFLAGS -O COFF" -+ case $host in -+ i686*) RCFLAGS="$RCFLAGS --target=pe-i386" ;; -+ x86_64*) RCFLAGS="$RCFLAGS --target=pe-x86-64" ;; -+ *) ;; -+ esac - ;; - *) - ;; - esac -+AC_SUBST(RCFLAGS) - - # Availability of -O2: - AC_MSG_CHECKING(for -O2) -diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in ---- Python-3.8.0-orig/Makefile.pre.in 2019-10-22 10:04:44.812737000 +0300 -+++ Python-3.8.0/Makefile.pre.in 2019-10-22 10:04:51.177548200 +0300 -@@ -38,6 +38,7 @@ +From 3eb535665e450ad0385c152365c3f573259787f4 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Thu, 17 Jun 2021 18:52:16 +0530 +Subject: [PATCH 74/N] link win resource files and build pythonw +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Makefile.pre.in | 29 ++++++++++++++++++++++++----- + configure.ac | 10 ++++++++++ + 2 files changed, 34 insertions(+), 5 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 55f0ad7..499f877 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -38,6 +38,7 @@ CXX= @CXX@ MAINCC= @MAINCC@ LINKCC= @LINKCC@ AR= @AR@ @@ -39,7 +24,7 @@ diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in READELF= @READELF@ SOABI= @SOABI@ LDVERSION= @LDVERSION@ -@@ -119,6 +119,7 @@ +@@ -119,6 +120,7 @@ PY_CORE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE PY_CORE_LDFLAGS=$(PY_LDFLAGS) $(PY_LDFLAGS_NODIST) # Strict or non-strict aliasing flags used to compile dtoa.c, see above CFLAGS_ALIASING=@CFLAGS_ALIASING@ @@ -47,7 +32,7 @@ diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in # Machine-dependent subdirectories -@@ -257,6 +258,7 @@ +@@ -260,6 +262,7 @@ LIBOBJS= @LIBOBJS@ PYTHON= python$(EXE) BUILDPYTHON= python$(BUILDEXE) @@ -55,7 +40,7 @@ diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in PYTHON_FOR_REGEN?=@PYTHON_FOR_REGEN@ UPDATE_FILE=@PYTHON_FOR_REGEN@ $(srcdir)/Tools/scripts/update_file.py -@@ -479,7 +481,7 @@ +@@ -482,7 +485,7 @@ DTRACE_DEPS = \ # Default target all: @DEF_MAKE_ALL_RULE@ @@ -64,7 +49,7 @@ diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in Programs/_testembed python-config # Check that the source is clean when building out of source. -@@ -593,9 +595,24 @@ +@@ -596,9 +599,24 @@ coverage-report: regen-grammar regen-token regen-importlib clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c $(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py --make --srcdir $(srcdir) @@ -91,7 +76,7 @@ diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in platform: $(BUILDPYTHON) pybuilddir.txt $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform -@@ -705,10 +725,10 @@ +@@ -708,10 +726,10 @@ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \ # This rule builds the Cygwin Python DLL and import library if configured # for a shared core library; otherwise, this rule is a noop. @@ -104,7 +89,7 @@ diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in else true; \ fi -@@ -1315,6 +1335,7 @@ +@@ -1325,6 +1343,7 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@ done if test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \ $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \ @@ -112,3 +97,38 @@ diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in else \ $(INSTALL_PROGRAM) $(STRIPFLAG) Mac/pythonw $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \ fi +diff --git a/configure.ac b/configure.ac +index b452ca3..87746f8 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1350,6 +1350,9 @@ fi + + AC_MSG_RESULT($LDLIBRARY) + ++AC_SUBST(WINDRES) ++AC_CHECK_TOOL(WINDRES, windres) ++ + AC_SUBST(AR) + AC_CHECK_TOOLS(AR, ar aal, ar) + +@@ -5851,10 +5854,17 @@ AC_MSG_RESULT(done) + case $host in + *-*-mingw*) + LIBS="$LIBS -lversion -lshlwapi -lpathcch" ++ RCFLAGS="$RCFLAGS -O COFF" ++ case $host in ++ i686*) RCFLAGS="$RCFLAGS --target=pe-i386" ;; ++ x86_64*) RCFLAGS="$RCFLAGS --target=pe-x86-64" ;; ++ *) ;; ++ esac + ;; + *) + ;; + esac ++AC_SUBST(RCFLAGS) + + # Availability of -O2: + AC_MSG_CHECKING(for -O2) +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0075-3.7-mpdec-mingw.patch b/mingw-w64-python3.9/0075-3.7-mpdec-mingw.patch new file mode 100644 index 0000000000000..bf290ff4ac371 --- /dev/null +++ b/mingw-w64-python3.9/0075-3.7-mpdec-mingw.patch @@ -0,0 +1,26 @@ +From d8aa1eb5c0ddad129864a25e48a5f0c1928622bd 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?= + +Date: Thu, 17 Jun 2021 18:52:17 +0530 +Subject: [PATCH 75/N] 3.7 mpdec mingw + +--- + setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index a709723..79111ab 100644 +--- a/setup.py ++++ b/setup.py +@@ -2283,7 +2283,7 @@ class PyBuildExt(build_ext): + undef_macros = [] + if '--with-system-libmpdec' in sysconfig.get_config_var("CONFIG_ARGS"): + include_dirs = [] +- libraries = [':libmpdec.so.2'] ++ libraries = [':libmpdec.dll.a'] + sources = ['_decimal/_decimal.c'] + depends = ['_decimal/docstrings.h'] + else: +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0076-disable-readline.patch b/mingw-w64-python3.9/0076-disable-readline.patch new file mode 100644 index 0000000000000..27672a94a0638 --- /dev/null +++ b/mingw-w64-python3.9/0076-disable-readline.patch @@ -0,0 +1,32 @@ +From 060c412a247ea7edbd28fc4f6422a977b2e8d809 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Thu, 17 Jun 2021 18:52:17 +0530 +Subject: [PATCH 76/N] disable readline +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + setup.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index 79111ab..ea2aa96 100644 +--- a/setup.py ++++ b/setup.py +@@ -997,7 +997,10 @@ class PyBuildExt(build_ext): + + def detect_readline_curses(self): + # readline +- do_readline = self.compiler.find_library_file(self.lib_dirs, 'readline') ++ if not MS_WINDOWS: ++ do_readline = self.compiler.find_library_file(self.lib_dirs, 'readline') ++ else: ++ do_readline = False + readline_termcap_library = "" + curses_library = "" + # Cannot use os.popen here in py3k. +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0077-fix-isselectable.patch b/mingw-w64-python3.9/0077-fix-isselectable.patch new file mode 100644 index 0000000000000..83075e449f162 --- /dev/null +++ b/mingw-w64-python3.9/0077-fix-isselectable.patch @@ -0,0 +1,29 @@ +From 2807758c581d2d735010fafed4a39cc9d135656a Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Thu, 17 Jun 2021 18:52:18 +0530 +Subject: [PATCH 77/N] fix isselectable +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Include/fileobject.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Include/fileobject.h b/Include/fileobject.h +index 6ec2994..a80f195 100644 +--- a/Include/fileobject.h ++++ b/Include/fileobject.h +@@ -30,7 +30,7 @@ PyAPI_DATA(int) Py_UTF8Mode; + #endif + + /* A routine to check if a file descriptor can be select()-ed. */ +-#ifdef _MSC_VER ++#ifdef MS_WINDOWS + /* On Windows, any socket fd can be select()-ed, no matter how high */ + #define _PyIsSelectable_fd(FD) (1) + #else +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0078-use-_wcsnicmp-instead-wcsncasecmp.patch b/mingw-w64-python3.9/0078-use-_wcsnicmp-instead-wcsncasecmp.patch new file mode 100644 index 0000000000000..6efcc0f242283 --- /dev/null +++ b/mingw-w64-python3.9/0078-use-_wcsnicmp-instead-wcsncasecmp.patch @@ -0,0 +1,26 @@ +From 50eb966efe2e9b8e8cfdfe8ddf59671f8474f8e4 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?= + +Date: Thu, 17 Jun 2021 18:52:19 +0530 +Subject: [PATCH 78/N] use _wcsnicmp instead wcsncasecmp + +--- + Modules/getpath.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Modules/getpath.c b/Modules/getpath.c +index 750d5c3..45ec1ff 100644 +--- a/Modules/getpath.c ++++ b/Modules/getpath.c +@@ -427,7 +427,7 @@ add_exe_suffix(wchar_t **progpath_p) + /* Check for already have an executable suffix */ + size_t n = wcslen(progpath); + size_t s = wcslen(EXE_SUFFIX); +- if (wcsncasecmp(EXE_SUFFIX, progpath + n - s, s) == 0) { ++ if (_wcsnicmp(EXE_SUFFIX, progpath + n - s, s) == 0) { + return _PyStatus_OK(); + } + +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0079-_xxsubinterpretersmodule.patch b/mingw-w64-python3.9/0079-_xxsubinterpretersmodule.patch new file mode 100644 index 0000000000000..7f8c79038677f --- /dev/null +++ b/mingw-w64-python3.9/0079-_xxsubinterpretersmodule.patch @@ -0,0 +1,26 @@ +From 3c4a2594e4cb486e2bb8d5bf31cb2e2c61deefdc 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?= + +Date: Thu, 17 Jun 2021 18:52:20 +0530 +Subject: [PATCH 79/N] _xxsubinterpretersmodule + +--- + Modules/_xxsubinterpretersmodule.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c +index 314059d..f26e662 100644 +--- a/Modules/_xxsubinterpretersmodule.c ++++ b/Modules/_xxsubinterpretersmodule.c +@@ -1761,7 +1761,7 @@ PyDoc_STRVAR(channelid_doc, + "A channel ID identifies a channel and may be used as an int."); + + static PyTypeObject ChannelIDtype = { +- PyVarObject_HEAD_INIT(&PyType_Type, 0) ++ PyVarObject_HEAD_INIT(NULL, 0) + "_xxsubinterpreters.ChannelID", /* tp_name */ + sizeof(channelid), /* tp_basicsize */ + 0, /* tp_itemsize */ +-- +2.32.0 + diff --git a/mingw-w64-python3.9/1891-sqlite3-module-defines.patch b/mingw-w64-python3.9/0080-sqlite3-module-defines.patch similarity index 52% rename from mingw-w64-python3.9/1891-sqlite3-module-defines.patch rename to mingw-w64-python3.9/0080-sqlite3-module-defines.patch index 6682997a57a91..9cf02cb618a4e 100644 --- a/mingw-w64-python3.9/1891-sqlite3-module-defines.patch +++ b/mingw-w64-python3.9/0080-sqlite3-module-defines.patch @@ -1,6 +1,17 @@ ---- Python-3.9.5/setup.py.orig 2021-05-13 08:59:26.086368300 +0300 -+++ Python-3.9.5/setup.py 2021-05-13 08:59:44.897106500 +0300 -@@ -1558,10 +1558,7 @@ +From 0956ea225d9a546750741ead24a2ebda4b556d86 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Thu, 17 Jun 2021 18:52:21 +0530 +Subject: [PATCH 80/N] sqlite3 module defines + +--- + setup.py | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/setup.py b/setup.py +index ea2aa96..14e1396 100644 +--- a/setup.py ++++ b/setup.py +@@ -1554,10 +1554,7 @@ class PyBuildExt(build_ext): '_sqlite/util.c', ] sqlite_defines = [] @@ -12,3 +23,6 @@ # Enable support for loadable extensions in the sqlite3 module # if --enable-loadable-sqlite-extensions configure option is used. +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0081-configure-have-inet-pton.patch b/mingw-w64-python3.9/0081-configure-have-inet-pton.patch new file mode 100644 index 0000000000000..1423448755b38 --- /dev/null +++ b/mingw-w64-python3.9/0081-configure-have-inet-pton.patch @@ -0,0 +1,35 @@ +From 0a9848f4d3bdedb47f2ae47f2b29b936cb6cb42d Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Thu, 17 Jun 2021 18:52:23 +0530 +Subject: [PATCH 81/N] configure have inet pton +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + configure.ac | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 87746f8..d9a30ee 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -4270,10 +4270,14 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + + AC_MSG_CHECKING(for inet_pton) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ++#ifdef _WIN32 ++#include ++#else + #include + #include + #include + #include ++#endif + ]], [[void* p = inet_pton]])], + [AC_DEFINE(HAVE_INET_PTON, 1, Define if you have the 'inet_pton' function.) + AC_MSG_RESULT(yes)], +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0082-fix-msvc9-import.patch b/mingw-w64-python3.9/0082-fix-msvc9-import.patch new file mode 100644 index 0000000000000..c949e7c25f537 --- /dev/null +++ b/mingw-w64-python3.9/0082-fix-msvc9-import.patch @@ -0,0 +1,38 @@ +From d957c00a5e06c6cb841a64f1784ba9db00e9dc17 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Thu, 17 Jun 2021 18:52:24 +0530 +Subject: [PATCH 82/N] fix msvc9 import +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Lib/distutils/msvc9compiler.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Lib/distutils/msvc9compiler.py b/Lib/distutils/msvc9compiler.py +index 6934e96..dddb2fd 100644 +--- a/Lib/distutils/msvc9compiler.py ++++ b/Lib/distutils/msvc9compiler.py +@@ -291,8 +291,6 @@ def query_vcvarsall(version, arch="x86"): + + # More globals + VERSION = get_build_version() +-if VERSION < 8.0: +- raise DistutilsPlatformError("VC %0.1f is not supported by this module" % VERSION) + # MACROS = MacroExpander(VERSION) + + class MSVCCompiler(CCompiler) : +@@ -327,6 +325,8 @@ class MSVCCompiler(CCompiler) : + + def __init__(self, verbose=0, dry_run=0, force=0): + CCompiler.__init__ (self, verbose, dry_run, force) ++ if VERSION < 8.0: ++ raise DistutilsPlatformError("VC %0.1f is not supported by this module" % VERSION) + self.__version = VERSION + self.__root = r"Software\Microsoft\VisualStudio" + # self.__macros = MACROS +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0083-set-venv-activate-path-unix.patch b/mingw-w64-python3.9/0083-set-venv-activate-path-unix.patch new file mode 100644 index 0000000000000..66695eb155f68 --- /dev/null +++ b/mingw-w64-python3.9/0083-set-venv-activate-path-unix.patch @@ -0,0 +1,29 @@ +From d5f60c9e82c5229862b2624833a3b9a8dcf8ce4a Mon Sep 17 00:00:00 2001 +From: Dan Yeaw +Date: Thu, 17 Jun 2021 18:52:25 +0530 +Subject: [PATCH 83/N] set venv activate path unix +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Lib/venv/scripts/common/activate | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Lib/venv/scripts/common/activate b/Lib/venv/scripts/common/activate +index 45af353..877b5d3 100644 +--- a/Lib/venv/scripts/common/activate ++++ b/Lib/venv/scripts/common/activate +@@ -37,7 +37,7 @@ deactivate () { + # unset irrelevant variables + deactivate nondestructive + +-VIRTUAL_ENV="__VENV_DIR__" ++VIRTUAL_ENV=$(cygpath "__VENV_DIR__") + export VIRTUAL_ENV + + _OLD_VIRTUAL_PATH="$PATH" +-- +2.32.0 + diff --git a/mingw-w64-python3.9/2052-venv-creation-fixes.patch b/mingw-w64-python3.9/0084-venv-creation-fixes.patch similarity index 77% rename from mingw-w64-python3.9/2052-venv-creation-fixes.patch rename to mingw-w64-python3.9/0084-venv-creation-fixes.patch index 3c3cc19627543..4ccbbbda36504 100644 --- a/mingw-w64-python3.9/2052-venv-creation-fixes.patch +++ b/mingw-w64-python3.9/0084-venv-creation-fixes.patch @@ -1,19 +1,25 @@ -Don't copy the whole /bin when symlinking. -Also provide python3.exe for backwards compat. -Unset MSYSTEM, to fix some path comparisons due to os.sep differences. -Skip some msvc build specifics -diff -Naur Python-3.8.0-orig/Lib/venv/__init__.py Python-3.8.0/Lib/venv/__init__.py ---- Python-3.8.0-orig/Lib/venv/__init__.py 2019-10-22 10:05:21.691201800 +0300 -+++ Python-3.8.0/Lib/venv/__init__.py 2019-10-22 10:05:25.591208600 +0300 -@@ -11,6 +11,7 @@ +From 155393c4fb3c28969c24e06179d47d59020836b0 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Thu, 17 Jun 2021 18:52:26 +0530 +Subject: [PATCH 84/N] venv creation fixes + +--- + Lib/venv/__init__.py | 19 ++++++++++++++----- + 1 file changed, 14 insertions(+), 5 deletions(-) + +diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py +index 8009deb..b471006 100644 +--- a/Lib/venv/__init__.py ++++ b/Lib/venv/__init__.py +@@ -11,6 +11,7 @@ import subprocess import sys import sysconfig import types +from sysconfig import _POSIX_BUILD - logger = logging.getLogger(__name__) -@@ -110,7 +111,7 @@ + CORE_VENV_DEPS = ('pip', 'setuptools') +@@ -119,7 +120,7 @@ class EnvBuilder: context.executable = executable context.python_dir = dirname context.python_exe = exename @@ -22,7 +28,7 @@ diff -Naur Python-3.8.0-orig/Lib/venv/__init__.py Python-3.8.0/Lib/venv/__init__ binname = 'Scripts' incpath = 'Include' libpath = os.path.join(env_dir, 'Lib', 'site-packages') -@@ -244,7 +244,7 @@ +@@ -252,7 +253,7 @@ class EnvBuilder: if not os.path.islink(path): os.chmod(path, 0o755) else: @@ -31,7 +37,7 @@ diff -Naur Python-3.8.0-orig/Lib/venv/__init__.py Python-3.8.0/Lib/venv/__init__ # For symlinking, we need a complete copy of the root directory # If symlinks fail, you'll get unnecessary copies of files, but # we assume that if you've opted into symlinks on Windows then -@@ -266,7 +267,13 @@ +@@ -275,7 +276,13 @@ class EnvBuilder: if os.path.lexists(src): copier(src, os.path.join(binpath, suffix)) @@ -46,7 +52,7 @@ diff -Naur Python-3.8.0-orig/Lib/venv/__init__.py Python-3.8.0/Lib/venv/__init__ # copy init.tcl for root, dirs, files in os.walk(context.python_dir): if 'init.tcl' in files: -@@ -285,9 +285,11 @@ +@@ -293,9 +300,11 @@ class EnvBuilder: # We run ensurepip in isolated mode to avoid side effects from # environment vars, the current directory and anything else # intended for the global Python environment @@ -60,3 +66,6 @@ diff -Naur Python-3.8.0-orig/Lib/venv/__init__.py Python-3.8.0/Lib/venv/__init__ def setup_scripts(self, context): """ +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0085-pass-gen-profile-ldflags.patch b/mingw-w64-python3.9/0085-pass-gen-profile-ldflags.patch new file mode 100644 index 0000000000000..839e9b448379b --- /dev/null +++ b/mingw-w64-python3.9/0085-pass-gen-profile-ldflags.patch @@ -0,0 +1,29 @@ +From 1895c16630d1f0647588a2f5efb44971ebadbfce Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Thu, 17 Jun 2021 18:52:27 +0530 +Subject: [PATCH 85/N] pass gen profile ldflags +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Makefile.pre.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 499f877..4f3ed6b 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -729,7 +729,7 @@ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \ + $(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS) python_nt.o + if test -n "$(DLLLIBRARY)"; then \ + $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \ +- $(LIBS) $(MODLIBS) $(SYSLIBS) python_nt.o; \ ++ $(LIBS) $(LDFLAGS_NODIST) $(MODLIBS) $(SYSLIBS) python_nt.o; \ + else true; \ + fi + +-- +2.32.0 + diff --git a/mingw-w64-python3.9/2070-distutils-add-windmc-to-cygwinccompiler.patch b/mingw-w64-python3.9/0086-distutils-add-windmc-to-cygwinccompiler.patch similarity index 75% rename from mingw-w64-python3.9/2070-distutils-add-windmc-to-cygwinccompiler.patch rename to mingw-w64-python3.9/0086-distutils-add-windmc-to-cygwinccompiler.patch index 5f81526a1a457..86a5e6fb591a8 100644 --- a/mingw-w64-python3.9/2070-distutils-add-windmc-to-cygwinccompiler.patch +++ b/mingw-w64-python3.9/0086-distutils-add-windmc-to-cygwinccompiler.patch @@ -1,7 +1,18 @@ -diff -Naur Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py Python-3.8.0/Lib/distutils/cygwinccompiler.py ---- Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py 2019-10-22 10:04:07.887472100 +0300 -+++ Python-3.8.0/Lib/distutils/cygwinccompiler.py 2019-10-22 10:05:31.254018600 +0300 -@@ -165,6 +165,28 @@ +From b199aa82b2ca265ebb7bfe6188289a8eee01d84d 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?= + +Date: Thu, 17 Jun 2021 18:52:28 +0530 +Subject: [PATCH 86/N] distutils add windmc to cygwinccompiler + +--- + Lib/distutils/cygwinccompiler.py | 26 ++++++++++++++++++++++++-- + 1 file changed, 24 insertions(+), 2 deletions(-) + +diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py +index 09b6eda..fcba43a 100644 +--- a/Lib/distutils/cygwinccompiler.py ++++ b/Lib/distutils/cygwinccompiler.py +@@ -163,6 +163,28 @@ class CygwinCCompiler(UnixCCompiler): self.spawn(["windres", "-i", src, "-o", obj]) except DistutilsExecError as msg: raise CompileError(msg) @@ -30,7 +41,7 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py Python-3.8.0/Lib/d else: # for other files use the C-compiler try: self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + -@@ -259,9 +281,9 @@ +@@ -257,9 +279,9 @@ class CygwinCCompiler(UnixCCompiler): base, ext = os.path.splitext(src_name) # use 'normcase' only for resource suffixes ext_normcase = os.path.normcase(ext) @@ -42,3 +53,6 @@ diff -Naur Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py Python-3.8.0/Lib/d raise UnknownFileError("unknown file type '%s' (from '%s')" % \ (ext, src_name)) base = os.path.splitdrive(base)[1] # Chop off the drive +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0087-pkg-config-windows-must-link-ext-with-python-lib.patch b/mingw-w64-python3.9/0087-pkg-config-windows-must-link-ext-with-python-lib.patch new file mode 100644 index 0000000000000..7b8d987fefe47 --- /dev/null +++ b/mingw-w64-python3.9/0087-pkg-config-windows-must-link-ext-with-python-lib.patch @@ -0,0 +1,38 @@ +From ff36dc8eed893cf3aabf4ddaf9fe1bb9c6cdecb6 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?= + +Date: Thu, 17 Jun 2021 18:52:29 +0530 +Subject: [PATCH 87/N] pkg config windows must link ext with python lib + +--- + Misc/python.pc.in | 2 +- + configure.ac | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Misc/python.pc.in b/Misc/python.pc.in +index 87e04de..3900190 100644 +--- a/Misc/python.pc.in ++++ b/Misc/python.pc.in +@@ -9,5 +9,5 @@ Description: Build a C extension for Python + Requires: + Version: @VERSION@ + Libs.private: @LIBS@ +-Libs: ++Libs: -L${libdir} -lpython@VERSION@@ABIFLAGS@ + Cflags: -I${includedir}/python@VERSION@@ABIFLAGS@ +diff --git a/configure.ac b/configure.ac +index d9a30ee..610dbb0 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -5130,7 +5130,7 @@ AC_MSG_RESULT($LDVERSION) + + # On Android and Cygwin the shared libraries must be linked with libpython. + AC_SUBST(LIBPYTHON) +-if test -n "$ANDROID_API_LEVEL" -o "$MACHDEP" = "cygwin"; then ++if test -n "$ANDROID_API_LEVEL" -o "$MACHDEP" = "cygwin" -o "$MACHDEP" = "win"; then + LIBPYTHON="-lpython${VERSION}${ABIFLAGS}" + else + LIBPYTHON='' +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0088-importlib-bootstrap-path-sep.patch b/mingw-w64-python3.9/0088-importlib-bootstrap-path-sep.patch new file mode 100644 index 0000000000000..d043d23c8d88b --- /dev/null +++ b/mingw-w64-python3.9/0088-importlib-bootstrap-path-sep.patch @@ -0,0 +1,31 @@ +From 6ae966f872297165132dcc9d4b6983a657ab8eda Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Thu, 17 Jun 2021 18:52:30 +0530 +Subject: [PATCH 88/N] importlib bootstrap path sep +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей +--- + Lib/importlib/_bootstrap_external.py | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py +index 7c41573..c2a20f7 100644 +--- a/Lib/importlib/_bootstrap_external.py ++++ b/Lib/importlib/_bootstrap_external.py +@@ -1674,6 +1674,10 @@ def _setup(_bootstrap_module): + else: + raise ImportError('importlib requires posix or nt') + ++ if 'MSYSTEM' in os_module.environ: ++ path_separators = path_separators[::-1] ++ path_sep = path_separators[0] ++ + setattr(self_module, '_os', os_module) + setattr(self_module, 'path_sep', path_sep) + setattr(self_module, 'path_separators', ''.join(path_separators)) +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0089-pathlib-path-sep.patch b/mingw-w64-python3.9/0089-pathlib-path-sep.patch new file mode 100644 index 0000000000000..e448d3d6fe2fd --- /dev/null +++ b/mingw-w64-python3.9/0089-pathlib-path-sep.patch @@ -0,0 +1,25 @@ +From 20c7a5e3ee78a82547bb81a8397e4debdff743fb Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Thu, 17 Jun 2021 18:52:31 +0530 +Subject: [PATCH 89/N] pathlib path sep + +--- + Lib/pathlib.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Lib/pathlib.py b/Lib/pathlib.py +index 756d389..cbf6921 100644 +--- a/Lib/pathlib.py ++++ b/Lib/pathlib.py +@@ -123,6 +123,8 @@ class _WindowsFlavour(_Flavour): + + sep = '\\' + altsep = '/' ++ if 'MSYSTEM' in os.environ: ++ sep, altsep = altsep, sep + has_drv = True + pathmod = ntpath + +-- +2.32.0 + diff --git a/mingw-w64-python3.9/5000-warnings-fixes.patch b/mingw-w64-python3.9/0090-warnings-fixes.patch similarity index 56% rename from mingw-w64-python3.9/5000-warnings-fixes.patch rename to mingw-w64-python3.9/0090-warnings-fixes.patch index 1961724f8e215..dfb47ece08264 100644 --- a/mingw-w64-python3.9/5000-warnings-fixes.patch +++ b/mingw-w64-python3.9/0090-warnings-fixes.patch @@ -1,7 +1,24 @@ -diff -Naur Python-3.8.0-orig/Modules/_winapi.c Python-3.8.0/Modules/_winapi.c ---- Python-3.8.0-orig/Modules/_winapi.c 2019-10-22 10:01:51.434032500 +0300 -+++ Python-3.8.0/Modules/_winapi.c 2019-10-22 10:05:34.654824500 +0300 -@@ -951,7 +951,7 @@ +From 7c7b892502d138ef7310718a10fef4eb2b6984a7 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?= + +Date: Thu, 17 Jun 2021 18:52:33 +0530 +Subject: [PATCH 90/N] warnings fixes + +--- + Modules/_winapi.c | 2 +- + Modules/posixmodule.c | 6 +++--- + Modules/socketmodule.h | 2 ++ + PC/python_exe.rc | 2 +- + PC/pythonw_exe.rc | 2 +- + PC/winreg.c | 1 + + Python/thread_nt.h | 3 ++- + 7 files changed, 11 insertions(+), 7 deletions(-) + +diff --git a/Modules/_winapi.c b/Modules/_winapi.c +index ba318a1..e4c7d11 100644 +--- a/Modules/_winapi.c ++++ b/Modules/_winapi.c +@@ -950,7 +950,7 @@ getattributelist(PyObject *obj, const char *name, AttributeList *attribute_list) DWORD err; BOOL result; PyObject *value; @@ -10,10 +27,11 @@ diff -Naur Python-3.8.0-orig/Modules/_winapi.c Python-3.8.0/Modules/_winapi.c DWORD attribute_count = 0; SIZE_T attribute_list_size = 0; -diff -Naur Python-3.8.0-orig/Modules/posixmodule.c Python-3.8.0/Modules/posixmodule.c ---- Python-3.8.0-orig/Modules/posixmodule.c 2019-10-22 10:04:46.029539100 +0300 -+++ Python-3.8.0/Modules/posixmodule.c 2019-10-22 10:05:35.076025300 +0300 -@@ -4804,7 +4804,7 @@ +diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c +index bb1b81d..bf19ac8 100644 +--- a/Modules/posixmodule.c ++++ b/Modules/posixmodule.c +@@ -5343,7 +5343,7 @@ os_utime_impl(PyObject *module, path_t *path, PyObject *times, PyObject *ns, /*[clinic end generated code: output=cfcac69d027b82cf input=2fbd62a2f228f8f4]*/ { #ifdef MS_WINDOWS @@ -22,7 +40,7 @@ diff -Naur Python-3.8.0-orig/Modules/posixmodule.c Python-3.8.0/Modules/posixmod FILETIME atime, mtime; #else int result; -@@ -13489,7 +13491,7 @@ +@@ -14360,7 +14360,7 @@ os__add_dll_directory_impl(PyObject *module, path_t *path) loaded. */ Py_BEGIN_ALLOW_THREADS if (!(hKernel32 = GetModuleHandleW(L"kernel32")) || @@ -31,7 +49,7 @@ diff -Naur Python-3.8.0-orig/Modules/posixmodule.c Python-3.8.0/Modules/posixmod hKernel32, "AddDllDirectory")) || !(cookie = (*AddDllDirectory)(path->wide))) { err = GetLastError(); -@@ -13539,7 +13541,7 @@ +@@ -14410,7 +14410,7 @@ os__remove_dll_directory_impl(PyObject *module, PyObject *cookie) loaded. */ Py_BEGIN_ALLOW_THREADS if (!(hKernel32 = GetModuleHandleW(L"kernel32")) || @@ -40,10 +58,11 @@ diff -Naur Python-3.8.0-orig/Modules/posixmodule.c Python-3.8.0/Modules/posixmod hKernel32, "RemoveDllDirectory")) || !(*RemoveDllDirectory)(cookieValue)) { err = GetLastError(); -diff -Naur Python-3.8.0-orig/Modules/socketmodule.h Python-3.8.0/Modules/socketmodule.h ---- Python-3.8.0-orig/Modules/socketmodule.h 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Modules/socketmodule.h 2019-10-22 10:05:35.466026000 +0300 -@@ -29,8 +29,10 @@ +diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h +index ba2c9f5..81bad15 100644 +--- a/Modules/socketmodule.h ++++ b/Modules/socketmodule.h +@@ -70,8 +70,10 @@ struct SOCKADDR_BTH_REDEF { */ # ifdef SIO_GET_MULTICAST_FILTER # include /* for SIO_RCVALL */ @@ -54,9 +73,10 @@ diff -Naur Python-3.8.0-orig/Modules/socketmodule.h Python-3.8.0/Modules/socketm # define HAVE_GETADDRINFO # define HAVE_GETNAMEINFO # define ENABLE_IPV6 -diff -Naur Python-3.8.0-orig/PC/python_exe.rc Python-3.8.0/PC/python_exe.rc ---- Python-3.8.0-orig/PC/python_exe.rc 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/PC/python_exe.rc 2019-10-22 10:05:35.871626700 +0300 +diff --git a/PC/python_exe.rc b/PC/python_exe.rc +index ae0b029..e667ffa 100644 +--- a/PC/python_exe.rc ++++ b/PC/python_exe.rc @@ -7,7 +7,7 @@ #include 1 RT_MANIFEST "python.manifest" @@ -66,9 +86,10 @@ diff -Naur Python-3.8.0-orig/PC/python_exe.rc Python-3.8.0/PC/python_exe.rc ///////////////////////////////////////////////////////////////////////////// -diff -Naur Python-3.8.0-orig/PC/pythonw_exe.rc Python-3.8.0/PC/pythonw_exe.rc ---- Python-3.8.0-orig/PC/pythonw_exe.rc 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/PC/pythonw_exe.rc 2019-10-22 10:05:36.277227400 +0300 +diff --git a/PC/pythonw_exe.rc b/PC/pythonw_exe.rc +index 88bf359..413d7d1 100644 +--- a/PC/pythonw_exe.rc ++++ b/PC/pythonw_exe.rc @@ -7,7 +7,7 @@ #include 1 RT_MANIFEST "python.manifest" @@ -78,10 +99,11 @@ diff -Naur Python-3.8.0-orig/PC/pythonw_exe.rc Python-3.8.0/PC/pythonw_exe.rc ///////////////////////////////////////////////////////////////////////////// -diff -Naur Python-3.8.0-orig/PC/winreg.c Python-3.8.0/PC/winreg.c ---- Python-3.8.0-orig/PC/winreg.c 2019-10-22 10:01:02.698546800 +0300 -+++ Python-3.8.0/PC/winreg.c 2019-10-22 10:05:36.682828100 +0300 -@@ -800,6 +800,7 @@ +diff --git a/PC/winreg.c b/PC/winreg.c +index b6f1a8f..19cc104 100644 +--- a/PC/winreg.c ++++ b/PC/winreg.c +@@ -809,6 +809,7 @@ Reg2Py(BYTE *retDataBuf, DWORD retDataSize, DWORD typ) case REG_BINARY: /* ALSO handle ALL unknown data types here. Even if we can't support it natively, we should handle the bits. */ @@ -89,10 +111,11 @@ diff -Naur Python-3.8.0-orig/PC/winreg.c Python-3.8.0/PC/winreg.c default: if (retDataSize == 0) { Py_INCREF(Py_None); -diff -Naur Python-3.8.0-orig/Python/thread_nt.h Python-3.8.0/Python/thread_nt.h ---- Python-3.8.0-orig/Python/thread_nt.h 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Python/thread_nt.h 2019-10-22 10:05:37.088428800 +0300 -@@ -342,8 +342,9 @@ +diff --git a/Python/thread_nt.h b/Python/thread_nt.h +index 05b982d..e16311f 100644 +--- a/Python/thread_nt.h ++++ b/Python/thread_nt.h +@@ -343,8 +343,9 @@ PyThread_release_lock(PyThread_type_lock aLock) { dprintf(("%lu: PyThread_release_lock(%p) called\n", PyThread_get_thread_ident(),aLock)); @@ -103,3 +126,6 @@ diff -Naur Python-3.8.0-orig/Python/thread_nt.h Python-3.8.0/Python/thread_nt.h } /* minimum/maximum thread stack sizes supported */ +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0091-fix-build-testinternalcapi.patch b/mingw-w64-python3.9/0091-fix-build-testinternalcapi.patch new file mode 100644 index 0000000000000..b15647c7d5a31 --- /dev/null +++ b/mingw-w64-python3.9/0091-fix-build-testinternalcapi.patch @@ -0,0 +1,28 @@ +From f86726755971a0f674b929e8c58585c4c5ac13d9 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Thu, 17 Jun 2021 18:52:34 +0530 +Subject: [PATCH 91/N] fix build testinternalcapi + +--- + setup.py | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/setup.py b/setup.py +index 14e1396..0ce4714 100644 +--- a/setup.py ++++ b/setup.py +@@ -978,7 +978,11 @@ class PyBuildExt(build_ext): + depends=['testcapi_long.h'])) + + # Python Internal C API test module ++ macros = [] ++ if MS_WINDOWS: ++ macros.append(('PY3_DLLNAME', 'L"%s"' % sysconfig.get_config_var('DLLLIBRARY'))) + self.add(Extension('_testinternalcapi', ['_testinternalcapi.c'], ++ define_macros=macros, + extra_compile_args=['-DPy_BUILD_CORE_MODULE'])) + + # Python PEP-3118 (buffer protocol) test module +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0092-extend-MS_WINDOWS-flag.patch b/mingw-w64-python3.9/0092-extend-MS_WINDOWS-flag.patch new file mode 100644 index 0000000000000..1e47409c8ab1d --- /dev/null +++ b/mingw-w64-python3.9/0092-extend-MS_WINDOWS-flag.patch @@ -0,0 +1,25 @@ +From 00c28115bc3a33be2cb9343f56de779bf43270e3 Mon Sep 17 00:00:00 2001 +From: Long Nguyen +Date: Thu, 17 Jun 2021 18:52:34 +0530 +Subject: [PATCH 92/N] extend MS_WINDOWS flag + +--- + setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index 0ce4714..a2d5656 100644 +--- a/setup.py ++++ b/setup.py +@@ -71,7 +71,7 @@ if sys.platform == "win32" and "MSYSTEM" in os.environ: + + CROSS_COMPILING = ("_PYTHON_HOST_PLATFORM" in os.environ) + HOST_PLATFORM = get_platform() +-MS_WINDOWS = (HOST_PLATFORM == 'win32') ++MS_WINDOWS = (HOST_PLATFORM == 'win32' or HOST_PLATFORM == 'mingw') + CYGWIN = (HOST_PLATFORM == 'cygwin') + MACOS = (HOST_PLATFORM == 'darwin') + AIX = (HOST_PLATFORM.startswith('aix')) +-- +2.32.0 + diff --git a/mingw-w64-python3.9/4000-clang-arm64.patch b/mingw-w64-python3.9/0093-clang-arm64.patch similarity index 64% rename from mingw-w64-python3.9/4000-clang-arm64.patch rename to mingw-w64-python3.9/0093-clang-arm64.patch index 10e5d021e5162..959810007f2fa 100644 --- a/mingw-w64-python3.9/4000-clang-arm64.patch +++ b/mingw-w64-python3.9/0093-clang-arm64.patch @@ -1,5 +1,30 @@ ---- Python-3.8.7/Python/getcompiler.c.orig 2021-01-21 00:00:29.237009400 -0800 -+++ Python-3.8.7/Python/getcompiler.c 2021-01-21 00:08:07.812256200 -0800 +From 1c04ca989eb4a31a2fbf1831b03fb93816c25f59 Mon Sep 17 00:00:00 2001 +From: jeremyd2019 <4524874+jeremyd2019@users.noreply.github.com> +Date: Thu, 17 Jun 2021 18:52:36 +0530 +Subject: [PATCH 93/N] clang arm64 + +--- + Lib/distutils/cygwinccompiler.py | 2 +- + Python/getcompiler.c | 11 ++++++++++- + 2 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py +index fcba43a..0c063a8 100644 +--- a/Lib/distutils/cygwinccompiler.py ++++ b/Lib/distutils/cygwinccompiler.py +@@ -394,7 +394,7 @@ def check_config_h(): + return (CONFIG_H_UNCERTAIN, + "couldn't read '%s': %s" % (fn, exc.strerror)) + +-RE_VERSION = re.compile(br'[\D\s]*(\d+\.\d+(\.\d+)*)[\D\s]*$') ++RE_VERSION = re.compile(br'[\D\s]*(\d+\.\d+(\.\d+)*)[\D\s]*') + + def _find_exe_version(cmd): + """Find the version of an executable by running `cmd` in the shell. +diff --git a/Python/getcompiler.c b/Python/getcompiler.c +index adccaa7..b529e29 100644 +--- a/Python/getcompiler.c ++++ b/Python/getcompiler.c @@ -7,7 +7,7 @@ // Note the __clang__ conditional has to come before the __GNUC__ one because @@ -33,14 +58,6 @@ // Generic fallbacks. #elif defined(__cplusplus) #define COMPILER "[C++]" ---- Python-3.8.7/Lib/distutils/cygwinccompiler.py~ 2021-01-21 00:32:02.844891200 -0800 -+++ Python-3.8.7/Lib/distutils/cygwinccompiler.py 2021-01-21 10:58:17.540398500 -0800 -@@ -396,7 +396,7 @@ - return (CONFIG_H_UNCERTAIN, - "couldn't read '%s': %s" % (fn, exc.strerror)) - --RE_VERSION = re.compile(br'[\D\s]*(\d+\.\d+(\.\d+)*)[\D\s]*$') -+RE_VERSION = re.compile(br'[\D\s]*(\d+\.\d+(\.\d+)*)[\D\s]*') - - def _find_exe_version(cmd): - """Find the version of an executable by running `cmd` in the shell. +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0094-MINGW-stack-reserve.patch b/mingw-w64-python3.9/0094-MINGW-stack-reserve.patch new file mode 100644 index 0000000000000..2cd6a7484bd1e --- /dev/null +++ b/mingw-w64-python3.9/0094-MINGW-stack-reserve.patch @@ -0,0 +1,28 @@ +From 9f8f8e52c51f4f78c7a88fed810bd37cfcd1e669 Mon Sep 17 00:00:00 2001 +From: jeremyd2019 <4524874+jeremyd2019@users.noreply.github.com> +Date: Thu, 17 Jun 2021 18:52:37 +0530 +Subject: [PATCH 94/N] MINGW stack reserve + +--- + configure.ac | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 610dbb0..a1c1c21 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3062,6 +3062,11 @@ then + VxWorks*) + LINKFORSHARED='--export-dynamic';; + esac ++ case $host in ++ *-*-mingw*) ++ # for https://bugs.python.org/issue40458 on MINGW ++ LINKFORSHARED="-Wl,--stack,2000000";; ++ esac + fi + AC_MSG_RESULT($LINKFORSHARED) + +-- +2.32.0 + diff --git a/mingw-w64-python3.9/0001-Add-support-for-Windows-7-Python-3.9.patch b/mingw-w64-python3.9/0095-Add-support-for-Windows-7-Python-3.9.patch similarity index 91% rename from mingw-w64-python3.9/0001-Add-support-for-Windows-7-Python-3.9.patch rename to mingw-w64-python3.9/0095-Add-support-for-Windows-7-Python-3.9.patch index 046e39191f2f6..b3495dbe22061 100644 --- a/mingw-w64-python3.9/0001-Add-support-for-Windows-7-Python-3.9.patch +++ b/mingw-w64-python3.9/0095-Add-support-for-Windows-7-Python-3.9.patch @@ -1,11 +1,8 @@ -From e7fac2a39b90b62eab452597f20a38c41611dd9e Mon Sep 17 00:00:00 2001 -From: Naveen M K -Date: Sat, 5 Jun 2021 20:04:26 +0530 -Subject: [PATCH] Add support for Windows 7 - Python 3.9 Most of these changes - come from 3.8 branch of Python. - https://github.com/python/cpython/blob/4844abdd700120120fc76c29d911bcb547700baf/PC/getpathp.c#L259 +From 89c8d0b78bb3d3db241785853c32afd043e00191 Mon Sep 17 00:00:00 2001 +From: Naveen M K +Date: Thu, 17 Jun 2021 18:52:39 +0530 +Subject: [PATCH 95/N] Add support for Windows 7 Python 3.9 -Signed-off-by: Naveen M K --- Modules/posixmodule.c | 22 +++++++++++------ PC/getpathp.c | 57 +++++++++++++++++++++++++++++++++++++++---- @@ -162,10 +159,10 @@ index 53da3a6..40b0db3 100644 return _PyStatus_OK(); } diff --git a/configure.ac b/configure.ac -index 610dbb0..1e4df4b 100644 +index a1c1c21..ef7ab81 100644 --- a/configure.ac +++ b/configure.ac -@@ -5857,7 +5857,7 @@ AC_MSG_RESULT(done) +@@ -5862,7 +5862,7 @@ AC_MSG_RESULT(done) # For mingw build need additional library for linking case $host in *-*-mingw*) @@ -175,5 +172,5 @@ index 610dbb0..1e4df4b 100644 case $host in i686*) RCFLAGS="$RCFLAGS --target=pe-i386" ;; -- -2.31.1.windows.1 +2.32.0 diff --git a/mingw-w64-python3.9/0110-MINGW-translate-gcc-internal-defines-to-python-platf.patch b/mingw-w64-python3.9/0110-MINGW-translate-gcc-internal-defines-to-python-platf.patch deleted file mode 100644 index 65ab5aa747443..0000000000000 --- a/mingw-w64-python3.9/0110-MINGW-translate-gcc-internal-defines-to-python-platf.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -Naur Python-3.8.0-orig/Include/pyport.h Python-3.8.0/Include/pyport.h ---- Python-3.8.0-orig/Include/pyport.h 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Include/pyport.h 2019-10-22 10:00:36.224300300 +0300 -@@ -26,6 +26,21 @@ - #endif - - -+#ifdef __MINGW32__ -+/* Translate GCC[mingw*] platform specific defines to those -+ * used in python code. -+ */ -+#if !defined(MS_WIN64) && defined(_WIN64) -+# define MS_WIN64 -+#endif -+#if !defined(MS_WIN32) && defined(_WIN32) -+# define MS_WIN32 -+#endif -+#if !defined(MS_WINDOWS) && defined(MS_WIN32) -+# define MS_WINDOWS -+#endif -+#endif /* __MINGW32__*/ -+ - /************************************************************************** - Symbols and macros to supply platform-independent interfaces to basic - C language & library operations whose spellings vary across platforms. diff --git a/mingw-w64-python3.9/0150-MINGW-configure-largefile-support-for-windows-builds.patch b/mingw-w64-python3.9/0150-MINGW-configure-largefile-support-for-windows-builds.patch deleted file mode 100644 index 4874784a8f9ce..0000000000000 --- a/mingw-w64-python3.9/0150-MINGW-configure-largefile-support-for-windows-builds.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac ---- Python-3.8.0-orig/configure.ac 2019-10-22 10:00:45.568716700 +0300 -+++ Python-3.8.0/configure.ac 2019-10-22 10:00:47.456320000 +0300 -@@ -2407,8 +2407,20 @@ - ]) - - AC_MSG_CHECKING(whether to enable large file support) -+have_largefile_support=no - if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ - "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then -+ have_largefile_support=yes -+else -+ case $host in -+ *-*-mingw*) -+ dnl Activate on windows platforms (32&64-bit) where off_t(4) < fpos_t(8) -+ have_largefile_support=yes -+ ;; -+ esac -+fi -+ -+if test $have_largefile_support = yes ; then - AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1, - [Defined to enable large file support when an off_t is bigger than a long - and long long is at least as big as an off_t. You may need diff --git a/mingw-w64-python3.9/0210-MINGW-determine-if-pwdmodule-should-be-used.patch b/mingw-w64-python3.9/0210-MINGW-determine-if-pwdmodule-should-be-used.patch deleted file mode 100644 index fc37f869fdbbc..0000000000000 --- a/mingw-w64-python3.9/0210-MINGW-determine-if-pwdmodule-should-be-used.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac ---- Python-3.8.0-orig/configure.ac 2019-10-22 10:01:01.887345400 +0300 -+++ Python-3.8.0/configure.ac 2019-10-22 10:01:03.821748800 +0300 -@@ -3188,6 +3188,13 @@ - *-*-mingw*) USE_WIN32_MODULE=;; - esac - -+# Determine if pwdmodule should be used. -+AC_SUBST(USE_PWD_MODULE) -+USE_PWD_MODULE= -+case $host in -+ *-*-mingw*) USE_PWD_MODULE='#';; -+esac -+ - # Templates for things AC_DEFINEd more than once. - # For a single AC_DEFINE, no template is needed. - AH_TEMPLATE(_REENTRANT, -diff -Naur Python-3.8.0-orig/Modules/Setup Python-3.8.0/Modules/Setup ---- Python-3.8.0-orig/Modules/Setup 2019-10-22 10:00:57.394537500 +0300 -+++ Python-3.8.0/Modules/Setup 2019-10-22 10:01:04.227349500 +0300 -@@ -102,8 +102,6 @@ - # setup.py script in the root of the Python source tree. - - errno errnomodule.c # posix (UNIX) errno values --pwd pwdmodule.c # this is needed to find out the user's home dir -- # if $HOME is not set - _sre _sre.c # Fredrik Lundh's new regular expressions - _codecs _codecsmodule.c # access to the builtin codecs and codec registry - _weakref _weakref.c # weak references -diff -Naur Python-3.8.0-orig/Modules/Setup.config.in Python-3.8.0/Modules/Setup.config.in ---- Python-3.8.0-orig/Modules/Setup.config.in 2019-10-22 10:01:02.292946100 +0300 -+++ Python-3.8.0/Modules/Setup.config.in 2019-10-22 10:01:05.038550900 +0300 -@@ -6,6 +6,9 @@ - # init system calls(posix/nt/...) for INITFUNC (used by makesetup) - @INITSYS@ -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal posixmodule.c - -+# This is needed to find out the user's home dir if $HOME is not set -+@USE_PWD_MODULE@pwd pwdmodule.c -+ - # build-in modules for windows platform: - @USE_WIN32_MODULE@winreg ../PC/winreg.c - diff --git a/mingw-w64-python3.9/0330-MINGW-ignore-main-program-for-frozen-scripts.patch b/mingw-w64-python3.9/0330-MINGW-ignore-main-program-for-frozen-scripts.patch deleted file mode 100644 index b58c402d34bd2..0000000000000 --- a/mingw-w64-python3.9/0330-MINGW-ignore-main-program-for-frozen-scripts.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac ---- Python-3.8.0-orig/configure.ac 2019-10-22 10:01:23.898984100 +0300 -+++ Python-3.8.0/configure.ac 2019-10-22 10:01:25.833387400 +0300 -@@ -5515,6 +5515,16 @@ - ;; - esac - -+dnl Python interpreter main program for frozen scripts -+AC_SUBST(PYTHON_OBJS_FROZENMAIN) -+PYTHON_OBJS_FROZENMAIN="Python/frozenmain.o" -+case $host in -+ *-*-mingw*) -+ dnl 'PC/frozen_dllmain.c' - not yet -+ PYTHON_OBJS_FROZENMAIN= -+ ;; -+esac -+ - AC_SUBST(SRCDIRS) - SRCDIRS="Parser Objects Python Modules Modules/_io Programs" - case $host in -diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in ---- Python-3.8.0-orig/Makefile.pre.in 2019-10-22 10:01:24.304584800 +0300 -+++ Python-3.8.0/Makefile.pre.in 2019-10-22 10:01:26.238988200 +0300 -@@ -327,7 +327,7 @@ - Python/context.o \ - Python/dynamic_annotations.o \ - Python/errors.o \ -- Python/frozenmain.o \ -+ @PYTHON_OBJS_FROZENMAIN@ \ - Python/future.o \ - Python/getargs.o \ - Python/getcompiler.o \ diff --git a/mingw-w64-python3.9/0350-MINGW-setup-_multiprocessing-module.patch b/mingw-w64-python3.9/0350-MINGW-setup-_multiprocessing-module.patch deleted file mode 100644 index 3df91065dc46a..0000000000000 --- a/mingw-w64-python3.9/0350-MINGW-setup-_multiprocessing-module.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py ---- Python-3.8.0-orig/setup.py 2019-10-22 10:01:17.378172600 +0300 -+++ Python-3.8.0/setup.py 2019-10-22 10:01:29.904994600 +0300 -@@ -1667,7 +1667,12 @@ - libraries=libs, - include_dirs=["Modules/_multiprocessing"])) - -+ multiprocessing_libs = [] -+ if MS_WINDOWS: -+ multiprocessing_libs += ['ws2_32'] - self.add(Extension('_multiprocessing', multiprocessing_srcs, -+ define_macros={}, -+ libraries=multiprocessing_libs, - include_dirs=["Modules/_multiprocessing"])) - - def detect_uuid(self): diff --git a/mingw-w64-python3.9/0370-MINGW-setup-_ctypes-module-with-system-libffi.patch b/mingw-w64-python3.9/0370-MINGW-setup-_ctypes-module-with-system-libffi.patch deleted file mode 100644 index e7366f0176766..0000000000000 --- a/mingw-w64-python3.9/0370-MINGW-setup-_ctypes-module-with-system-libffi.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py ---- Python-3.8.0-orig/setup.py 2019-10-22 10:01:35.318204100 +0300 -+++ Python-3.8.0/setup.py 2019-10-22 10:01:36.394606000 +0300 -@@ -2043,9 +2043,12 @@ - self.add(ext) - if TEST_EXTENSIONS: - # function my_sqrt() needs libm for sqrt() -+ ffi_test_libs = ['m'] -+ if MS_WINDOWS: -+ ffi_test_libs += ['oleaut32'] - self.add(Extension('_ctypes_test', - sources=['_ctypes/_ctypes_test.c'], -- libraries=['m'])) -+ libraries=ffi_test_libs)) - - ffi_inc_dirs = self.inc_dirs.copy() - if MACOS: -@@ -2073,6 +2076,8 @@ - if ffi_inc and ffi_lib: - ext.include_dirs.extend(ffi_inc) - ext.libraries.append(ffi_lib) -+ if MS_WINDOWS: -+ ext.libraries.extend(['ole32', 'oleaut32', 'uuid']) - self.use_system_libffi = True - - if sysconfig.get_config_var('HAVE_LIBDL'): diff --git a/mingw-w64-python3.9/0430-MINGW-find-import-library.patch b/mingw-w64-python3.9/0430-MINGW-find-import-library.patch deleted file mode 100644 index f9cdb180b4551..0000000000000 --- a/mingw-w64-python3.9/0430-MINGW-find-import-library.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Naur Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py Python-3.8.0/Lib/distutils/cygwinccompiler.py ---- Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py 2019-10-22 10:02:00.856449000 +0300 -+++ Python-3.8.0/Lib/distutils/cygwinccompiler.py 2019-10-22 10:02:01.979651000 +0300 -@@ -93,6 +93,7 @@ - obj_extension = ".o" - static_lib_extension = ".a" - shared_lib_extension = ".dll" -+ dylib_lib_extension = ".dll.a" - static_lib_format = "lib%s%s" - shared_lib_format = "%s%s" - exe_extension = ".exe" diff --git a/mingw-w64-python3.9/0440-MINGW-setup-_ssl-module.patch b/mingw-w64-python3.9/0440-MINGW-setup-_ssl-module.patch deleted file mode 100644 index 8d3fd06b1027a..0000000000000 --- a/mingw-w64-python3.9/0440-MINGW-setup-_ssl-module.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py ---- Python-3.8.0-orig/setup.py 2019-10-22 10:01:52.635234600 +0300 -+++ Python-3.8.0/setup.py 2019-10-22 10:02:04.772055900 +0300 -@@ -2257,6 +2257,8 @@ - openssl_includes = split_var('OPENSSL_INCLUDES', '-I') - openssl_libdirs = split_var('OPENSSL_LDFLAGS', '-L') - openssl_libs = split_var('OPENSSL_LIBS', '-l') -+ if MS_WINDOWS: -+ openssl_libs += tuple(['ws2_32']) - if not openssl_libs: - # libssl and libcrypto not found - self.missing.extend(['_ssl', '_hashlib']) diff --git a/mingw-w64-python3.9/0464-use-replace-instead-rename-to-avoid-failure-on-windo.patch b/mingw-w64-python3.9/0464-use-replace-instead-rename-to-avoid-failure-on-windo.patch deleted file mode 100644 index 36e1e375efa62..0000000000000 --- a/mingw-w64-python3.9/0464-use-replace-instead-rename-to-avoid-failure-on-windo.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py ---- Python-3.8.0-orig/setup.py 2019-10-22 10:02:06.503658900 +0300 -+++ Python-3.8.0/setup.py 2019-10-22 10:02:13.258470800 +0300 -@@ -2434,7 +2434,7 @@ - else: - newfilename = filename + minoronly - log.info('renaming %s to %s', filename, newfilename) -- os.rename(filename, newfilename) -+ os.replace(filename, newfilename) - newoutfiles.append(newfilename) - if filename in updated_files: - newupdated_files.append(newfilename) diff --git a/mingw-w64-python3.9/0470-MINGW-avoid-circular-dependency-from-time-module-dur.patch b/mingw-w64-python3.9/0470-MINGW-avoid-circular-dependency-from-time-module-dur.patch deleted file mode 100644 index 89a9968b7fd5b..0000000000000 --- a/mingw-w64-python3.9/0470-MINGW-avoid-circular-dependency-from-time-module-dur.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -Naur Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py Python-3.8.0/Lib/distutils/cygwinccompiler.py ---- Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py 2019-10-22 10:02:03.680054000 +0300 -+++ Python-3.8.0/Lib/distutils/cygwinccompiler.py 2019-10-22 10:02:16.066475700 +0300 -@@ -48,7 +48,6 @@ - import os - import sys - import copy --from subprocess import Popen, PIPE, check_output - import re - - from distutils.ccompiler import gen_preprocess_options, gen_lib_options -@@ -385,6 +384,7 @@ - executable = cmd.split()[0] - if find_executable(executable) is None: - return None -+ from subprocess import Popen, PIPE - out = Popen(cmd, shell=True, stdout=PIPE).stdout - try: - out_string = out.read() diff --git a/mingw-w64-python3.9/0530-mingw-system-libffi.patch b/mingw-w64-python3.9/0530-mingw-system-libffi.patch deleted file mode 100644 index 932fbf63d2ae6..0000000000000 --- a/mingw-w64-python3.9/0530-mingw-system-libffi.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py ---- Python-3.8.0-orig/setup.py 2019-10-22 10:02:14.974473800 +0300 -+++ Python-3.8.0/setup.py 2019-10-22 10:02:33.866107000 +0300 -@@ -2237,6 +2237,8 @@ - ext.libraries.append(ffi_lib) - if MS_WINDOWS: - ext.libraries.extend(['ole32', 'oleaut32', 'uuid']) -+ ext.export_symbols.extend(['DllGetClassObject PRIVATE', -+ 'DllCanUnloadNow PRIVATE']) - self.use_system_libffi = True - - if sysconfig.get_config_var('HAVE_LIBDL'): diff --git a/mingw-w64-python3.9/0570-mingw-add-BUILDIN_WIN32_MODULEs-time-msvcrt.patch b/mingw-w64-python3.9/0570-mingw-add-BUILDIN_WIN32_MODULEs-time-msvcrt.patch deleted file mode 100644 index ca32a62e8e5d9..0000000000000 --- a/mingw-w64-python3.9/0570-mingw-add-BUILDIN_WIN32_MODULEs-time-msvcrt.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff -Naur Python-3.8.0-orig/Modules/Setup.config.in Python-3.8.0/Modules/Setup.config.in ---- Python-3.8.0-orig/Modules/Setup.config.in 2019-10-22 10:01:08.018156200 +0300 -+++ Python-3.8.0/Modules/Setup.config.in 2019-10-22 10:02:53.303741100 +0300 -@@ -11,4 +11,5 @@ - - # build-in modules for windows platform: - @USE_WIN32_MODULE@winreg ../PC/winreg.c -+@USE_WIN32_MODULE@msvcrt -DPy_BUILD_CORE ../PC/msvcrtmodule.c - diff --git a/mingw-w64-python3.9/0650-cross-dont-add-multiarch-paths-if-cross-compiling.patch b/mingw-w64-python3.9/0650-cross-dont-add-multiarch-paths-if-cross-compiling.patch deleted file mode 100644 index 45aee2d6af50c..0000000000000 --- a/mingw-w64-python3.9/0650-cross-dont-add-multiarch-paths-if-cross-compiling.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py ---- Python-3.8.0-orig/setup.py 2019-10-22 10:03:08.498167800 +0300 -+++ Python-3.8.0/setup.py 2019-10-22 10:03:12.382574600 +0300 -@@ -654,10 +654,10 @@ - if not CROSS_COMPILING: - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') -+ self.add_multiarch_paths() - # only change this for cross builds for 3.3, issues on Mageia - if CROSS_COMPILING: - self.add_cross_compiling_paths() -- self.add_multiarch_paths() - self.add_ldflags_cppflags() - - def init_inc_lib_dirs(self): diff --git a/mingw-w64-python3.9/0660-mingw-use-backslashes-in-compileall-py.patch b/mingw-w64-python3.9/0660-mingw-use-backslashes-in-compileall-py.patch deleted file mode 100644 index a911f301ece0e..0000000000000 --- a/mingw-w64-python3.9/0660-mingw-use-backslashes-in-compileall-py.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur Python-3.8.0-orig/Lib/compileall.py Python-3.8.0/Lib/compileall.py ---- Python-3.8.0-orig/Lib/compileall.py 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Lib/compileall.py 2019-10-22 10:03:15.206179600 +0300 -@@ -36,6 +36,8 @@ - if name == '__pycache__': - continue - fullname = os.path.join(dir, name) -+ if sys.platform == "win32" and sys.version.find("GCC") >= 0: -+ fullname = fullname.replace('\\','/') - if not os.path.isdir(fullname): - yield fullname - elif (maxlevels > 0 and name != os.curdir and name != os.pardir and diff --git a/mingw-w64-python3.9/0720-mingw-pdcurses_ISPAD.patch b/mingw-w64-python3.9/0720-mingw-pdcurses_ISPAD.patch deleted file mode 100644 index e78c029252dc2..0000000000000 --- a/mingw-w64-python3.9/0720-mingw-pdcurses_ISPAD.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -Naur Python-3.8.0-orig/Include/py_curses.h Python-3.8.0/Include/py_curses.h ---- Python-3.8.0-orig/Include/py_curses.h 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Include/py_curses.h 2019-10-22 10:03:25.689398000 +0300 -@@ -36,6 +36,13 @@ - #include - #endif - -+#if defined(__MINGW32__) -+#include -+#if !defined(_ISPAD) -+#define _ISPAD 0x10 -+#endif -+#endif -+ - #ifdef HAVE_NCURSES_H - /* configure was checking , but we will - use , which has some or all these features. */ diff --git a/mingw-w64-python3.9/0740-grammar-fixes.patch b/mingw-w64-python3.9/0740-grammar-fixes.patch deleted file mode 100644 index 2262e145b6a9d..0000000000000 --- a/mingw-w64-python3.9/0740-grammar-fixes.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -Naur Python-3.8.0-orig/Python/graminit.c Python-3.8.0/Python/graminit.c ---- Python-3.8.0-orig/Python/graminit.c 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Python/graminit.c 2019-10-22 10:03:28.497403000 +0300 -@@ -1,7 +1,8 @@ - /* Generated by Parser/pgen */ - - #include "grammar.h" --Py_EXPORTED_SYMBOL grammar _PyParser_Grammar; -+#include "pyport.h" -+PyAPI_DATA(grammar) _PyParser_Grammar; - static const arc arcs_0_0[3] = { - {2, 1}, - {3, 2}, -diff -Naur Python-3.8.0-orig/Modules/parsermodule.c Python-3.8.0/Modules/parsermodule.c ---- Python-3.8.0-orig/Modules/parsermodule.c 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Modules/parsermodule.c 2019-10-22 10:03:28.497403000 +0300 -@@ -38,7 +38,7 @@ - #include "grammar.h" - #include "parsetok.h" - --extern grammar _PyParser_Grammar; /* From graminit.c */ -+PyAPI_DATA(grammar) _PyParser_Grammar; /* From graminit.c */ - - #ifdef lint - #include diff --git a/mingw-w64-python3.9/0810-remove_path_max.default.patch b/mingw-w64-python3.9/0810-remove_path_max.default.patch deleted file mode 100644 index 101b1921d31db..0000000000000 --- a/mingw-w64-python3.9/0810-remove_path_max.default.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Naur Python-3.8.0-orig/Include/osdefs.h Python-3.8.0/Include/osdefs.h ---- Python-3.8.0-orig/Include/osdefs.h 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Include/osdefs.h 2019-10-22 10:03:43.426629200 +0300 -@@ -10,7 +10,6 @@ - #ifdef MS_WINDOWS - #define SEP L'\\' - #define ALTSEP L'/' --#define MAXPATHLEN 256 - #define DELIM L';' - #endif - diff --git a/mingw-w64-python3.9/0820-dont-link-with-gettext.patch b/mingw-w64-python3.9/0820-dont-link-with-gettext.patch deleted file mode 100644 index 50251a2c4b8f6..0000000000000 --- a/mingw-w64-python3.9/0820-dont-link-with-gettext.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac ---- Python-3.8.0-orig/configure.ac 2019-10-22 10:02:59.122551400 +0300 -+++ Python-3.8.0/configure.ac 2019-10-22 10:03:46.312634200 +0300 -@@ -3071,10 +3071,19 @@ - fi - - # check if we need libintl for locale functions -+case $host in -+ *-*-mingw*) -+ dnl Native windows build don't use libintl (see _localemodule.c). -+ dnl Also we don't like setup.py to add "intl" library to the list -+ dnl when build _locale module. -+ ;; -+ *) - AC_CHECK_LIB(intl, textdomain, - [AC_DEFINE(WITH_LIBINTL, 1, - [Define to 1 if libintl is needed for locale functions.]) - LIBS="-lintl $LIBS"]) -+ ;; -+esac - - # checks for system dependent C++ extensions support - case "$ac_sys_system" in -diff -Naur Python-3.8.0-orig/Modules/_localemodule.c Python-3.8.0/Modules/_localemodule.c ---- Python-3.8.0-orig/Modules/_localemodule.c 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Modules/_localemodule.c 2019-10-22 10:03:46.718235000 +0300 -@@ -12,6 +12,13 @@ - #define PY_SSIZE_T_CLEAN - #include "Python.h" - #include "pycore_fileutils.h" -+#ifdef __MINGW32__ -+/* The header libintl.h and library libintl may exist on mingw host. -+ * To be compatible with MSVC build we has to undef some defines. -+ */ -+#undef HAVE_LIBINTL_H -+#undef HAVE_BIND_TEXTDOMAIN_CODESET -+#endif - - #include - #include diff --git a/mingw-w64-python3.9/0830-ctypes-python-dll.patch b/mingw-w64-python3.9/0830-ctypes-python-dll.patch deleted file mode 100644 index ec7985102cd08..0000000000000 --- a/mingw-w64-python3.9/0830-ctypes-python-dll.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -Naur Python-3.8.0-orig/Lib/ctypes/__init__.py Python-3.8.0/Lib/ctypes/__init__.py ---- Python-3.8.0-orig/Lib/ctypes/__init__.py 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Lib/ctypes/__init__.py 2019-10-22 10:03:49.931840600 +0300 -@@ -449,7 +449,9 @@ - cdll = LibraryLoader(CDLL) - pydll = LibraryLoader(PyDLL) - --if _os.name == "nt": -+if _os.name == "nt" and _sys.version.find('GCC') >= 0: -+ pythonapi = PyDLL("libpython%d.%d%s.dll" % (_sys.version_info[:2] + (_sys.abiflags,)), None) -+elif _os.name == "nt": - pythonapi = PyDLL("python dll", None, _sys.dllhandle) - elif _sys.platform == "cygwin": - pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2]) diff --git a/mingw-w64-python3.9/0840-gdbm-module-includes.patch b/mingw-w64-python3.9/0840-gdbm-module-includes.patch deleted file mode 100644 index 7c28266fa85a3..0000000000000 --- a/mingw-w64-python3.9/0840-gdbm-module-includes.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur Python-3.8.0-orig/Modules/_gdbmmodule.c Python-3.8.0/Modules/_gdbmmodule.c ---- Python-3.8.0-orig/Modules/_gdbmmodule.c 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Modules/_gdbmmodule.c 2019-10-22 10:03:53.161046300 +0300 -@@ -11,7 +11,7 @@ - #include - #include "gdbm.h" - --#if defined(WIN32) && !defined(__CYGWIN__) -+#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__) - #include "gdbmerrno.h" - extern const char * gdbm_strerror(gdbm_error); - #endif diff --git a/mingw-w64-python3.9/0870-mingw-fix-ssl-dont-use-enum_certificates.patch b/mingw-w64-python3.9/0870-mingw-fix-ssl-dont-use-enum_certificates.patch deleted file mode 100644 index 67498a7c3b535..0000000000000 --- a/mingw-w64-python3.9/0870-mingw-fix-ssl-dont-use-enum_certificates.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -Naur Python-3.8.0-orig/Lib/ssl.py Python-3.8.0/Lib/ssl.py ---- Python-3.8.0-orig/Lib/ssl.py 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Lib/ssl.py 2019-10-22 10:04:00.493059100 +0300 -@@ -249,7 +249,7 @@ - CHANGE_CIPHER_SPEC = 0x0101 - - --if sys.platform == "win32": -+if sys.platform == "win32" and sys.version.find("GCC") == -1: - from _ssl import enum_certificates, enum_crls - - from socket import socket, AF_INET, SOCK_STREAM, create_connection -@@ -569,7 +569,7 @@ - def load_default_certs(self, purpose=Purpose.SERVER_AUTH): - if not isinstance(purpose, _ASN1Object): - raise TypeError(purpose) -- if sys.platform == "win32": -+ if sys.platform == "win32" and sys.version.find("GCC") == -1: - for storename in self._windows_cert_stores: - self._load_windows_store_certs(storename, purpose) - self.set_default_verify_paths() diff --git a/mingw-w64-python3.9/0890-mingw-build-optimized-ext.patch b/mingw-w64-python3.9/0890-mingw-build-optimized-ext.patch deleted file mode 100644 index 5ba3ad4cca451..0000000000000 --- a/mingw-w64-python3.9/0890-mingw-build-optimized-ext.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -Naur Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py Python-3.8.0/Lib/distutils/cygwinccompiler.py ---- Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py 2019-10-22 10:03:07.686966400 +0300 -+++ Python-3.8.0/Lib/distutils/cygwinccompiler.py 2019-10-22 10:04:03.316664100 +0300 -@@ -305,9 +305,9 @@ - raise CCompilerError( - 'Cygwin gcc cannot be used with --compiler=mingw32') - -- self.set_executables(compiler='gcc -O -Wall', -- compiler_so='gcc -mdll -O -Wall', -- compiler_cxx='g++ -O -Wall', -+ self.set_executables(compiler='gcc -O2 -Wall', -+ compiler_so='gcc -mdll -O2 -Wall', -+ compiler_cxx='g++ -O2 -Wall', - linker_exe='gcc', - linker_so='%s %s %s' - % (self.linker_dll, shared_option, diff --git a/mingw-w64-python3.9/0900-cygwinccompiler-dont-strip-modules-if-pydebug.patch b/mingw-w64-python3.9/0900-cygwinccompiler-dont-strip-modules-if-pydebug.patch deleted file mode 100644 index a002f9866d1c0..0000000000000 --- a/mingw-w64-python3.9/0900-cygwinccompiler-dont-strip-modules-if-pydebug.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py Python-3.8.0/Lib/distutils/cygwinccompiler.py ---- Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py 2019-10-22 10:04:05.048267100 +0300 -+++ Python-3.8.0/Lib/distutils/cygwinccompiler.py 2019-10-22 10:04:06.140269100 +0300 -@@ -238,7 +238,7 @@ - # (On my machine: 10KiB < stripped_file < ??100KiB - # unstripped_file = stripped_file + XXX KiB - # ( XXX=254 for a typical python extension)) -- if not debug: -+ if not debug and not hasattr(sys, 'gettotalrefcount'): - extra_preargs.append("-s") - - UnixCCompiler.link(self, target_desc, objects, output_filename, diff --git a/mingw-w64-python3.9/0910-fix-using-dllhandle-and-winver-mingw.patch b/mingw-w64-python3.9/0910-fix-using-dllhandle-and-winver-mingw.patch deleted file mode 100644 index b2462b7118edc..0000000000000 --- a/mingw-w64-python3.9/0910-fix-using-dllhandle-and-winver-mingw.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -Naur Python-3.8.0-orig/Python/sysmodule.c Python-3.8.0/Python/sysmodule.c ---- Python-3.8.0-orig/Python/sysmodule.c 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Python/sysmodule.c 2019-10-22 10:04:08.995074100 +0300 -@@ -34,7 +34,7 @@ - #include - #endif /* MS_WINDOWS */ - --#ifdef MS_COREDLL -+#if defined(MS_WINDOWS) && defined(Py_ENABLE_SHARED) - extern void *PyWin_DLLhModule; - /* A string loaded from the DLL at startup: */ - extern const char *PyWin_DLLVersionString; -@@ -2694,7 +2694,7 @@ - PyUnicode_FromString("little")); - #endif - --#ifdef MS_COREDLL -+#if defined(MS_WINDOWS) && defined(Py_ENABLE_SHARED) - SET_SYS_FROM_STRING("dllhandle", - PyLong_FromVoidPtr(PyWin_DLLhModule)); - SET_SYS_FROM_STRING("winver", diff --git a/mingw-w64-python3.9/0920-mingw-add-LIBPL-to-library-dirs.patch b/mingw-w64-python3.9/0920-mingw-add-LIBPL-to-library-dirs.patch deleted file mode 100644 index e58e64e3d546c..0000000000000 --- a/mingw-w64-python3.9/0920-mingw-add-LIBPL-to-library-dirs.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur Python-3.8.0-orig/Lib/distutils/command/build_ext.py Python-3.8.0/Lib/distutils/command/build_ext.py ---- Python-3.8.0-orig/Lib/distutils/command/build_ext.py 2019-10-22 10:03:03.194158500 +0300 -+++ Python-3.8.0/Lib/distutils/command/build_ext.py 2019-10-22 10:04:11.803079000 +0300 -@@ -218,7 +218,7 @@ - - # For extensions under Cygwin, Python's library directory must be - # appended to library_dirs -- if sys.platform[:6] == 'cygwin': -+ if sys.platform[:6] == 'cygwin' or self.plat_name.startswith(('mingw')): - if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): - # building third party extensions - config_dir_name = os.path.basename(sysconfig.get_config_var('LIBPL')) diff --git a/mingw-w64-python3.9/0990-MINGW-link-with-additional-library.patch b/mingw-w64-python3.9/0990-MINGW-link-with-additional-library.patch deleted file mode 100644 index 1bee0dbe4f85b..0000000000000 --- a/mingw-w64-python3.9/0990-MINGW-link-with-additional-library.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac ---- Python-3.8.0-orig/configure.ac 2019-10-22 10:03:48.434238000 +0300 -+++ Python-3.8.0/configure.ac 2019-10-22 10:04:20.273893900 +0300 -@@ -5668,6 +5668,15 @@ - done - AC_MSG_RESULT(done) - -+# For mingw build need additional library for linking -+case $host in -+ *-*-mingw*) -+ LIBS="$LIBS -lversion -lshlwapi -lpathcch" -+ ;; -+ *) -+ ;; -+esac -+ - # Availability of -O2: - AC_MSG_CHECKING(for -O2) - saved_cflags="$CFLAGS" diff --git a/mingw-w64-python3.9/1010-install-msilib.patch b/mingw-w64-python3.9/1010-install-msilib.patch deleted file mode 100644 index 65a82a0dc0d26..0000000000000 --- a/mingw-w64-python3.9/1010-install-msilib.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in ---- Python-3.8.0-orig/Makefile.pre.in 2019-10-22 10:03:33.473811700 +0300 -+++ Python-3.8.0/Makefile.pre.in 2019-10-22 10:04:23.315899200 +0300 -@@ -1404,6 +1404,7 @@ - distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \ - test/test_tools test/test_warnings test/test_warnings/data \ - turtledemo \ -+ msilib \ - multiprocessing multiprocessing/dummy \ - unittest unittest/test unittest/test/testmock \ - venv venv/scripts venv/scripts/common venv/scripts/posix \ diff --git a/mingw-w64-python3.9/1060-dont-include-system-ncurses-path.patch b/mingw-w64-python3.9/1060-dont-include-system-ncurses-path.patch deleted file mode 100644 index 99f6a8593a14a..0000000000000 --- a/mingw-w64-python3.9/1060-dont-include-system-ncurses-path.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac ---- Python-3.8.0-orig/configure.ac 2019-10-22 10:04:22.223897300 +0300 -+++ Python-3.8.0/configure.ac 2019-10-22 10:04:26.170704200 +0300 -@@ -5293,9 +5293,15 @@ - - # first curses header check - ac_save_cppflags="$CPPFLAGS" --if test "$cross_compiling" = no; then -- CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" --fi -+case $host_os in -+ mingw*) -+ ;; -+ *) -+ if test "$cross_compiling" = no; then -+ CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" -+ fi -+ ;; -+esac - - AC_CHECK_HEADERS(curses.h ncurses.h) - diff --git a/mingw-w64-python3.9/1620-fix-signal-module-build.patch b/mingw-w64-python3.9/1620-fix-signal-module-build.patch deleted file mode 100644 index a35aeec7ae345..0000000000000 --- a/mingw-w64-python3.9/1620-fix-signal-module-build.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur Python-3.8.0-orig/Modules/Setup Python-3.8.0/Modules/Setup ---- Python-3.8.0-orig/Modules/Setup 2019-10-22 10:01:07.612555400 +0300 -+++ Python-3.8.0/Modules/Setup 2019-10-22 10:04:29.009909200 +0300 -@@ -111,7 +111,7 @@ - _abc _abc.c # Abstract base classes - itertools itertoolsmodule.c # Functions creating iterators for efficient looping - atexit atexitmodule.c # Register functions to be run at interpreter-shutdown --_signal -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal signalmodule.c -+_signal -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal signalmodule.c -lws2_32 - _stat _stat.c # stat.h interface - time -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal timemodule.c # -lm # time operations and variables - _thread -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal _threadmodule.c # low-level threading interface diff --git a/mingw-w64-python3.9/1630-build-winconsoleio.patch b/mingw-w64-python3.9/1630-build-winconsoleio.patch deleted file mode 100644 index 196592ad3ddd8..0000000000000 --- a/mingw-w64-python3.9/1630-build-winconsoleio.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur Python-3.8.0-orig/Modules/Setup Python-3.8.0/Modules/Setup ---- Python-3.8.0-orig/Modules/Setup 2019-10-22 10:04:31.147113000 +0300 -+++ Python-3.8.0/Modules/Setup 2019-10-22 10:04:32.223514900 +0300 -@@ -120,7 +120,7 @@ - _locale -DPy_BUILD_CORE_BUILTIN _localemodule.c # -lintl - - # Standard I/O baseline --_io -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c -+_io -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c _io/winconsoleio.c - - # faulthandler module - faulthandler faulthandler.c diff --git a/mingw-w64-python3.9/1650-expose-sem_unlink.patch b/mingw-w64-python3.9/1650-expose-sem_unlink.patch deleted file mode 100644 index 16c91759f0f18..0000000000000 --- a/mingw-w64-python3.9/1650-expose-sem_unlink.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur Python-3.8.0-orig/Modules/_multiprocessing/multiprocessing.c Python-3.8.0/Modules/_multiprocessing/multiprocessing.c ---- Python-3.8.0-orig/Modules/_multiprocessing/multiprocessing.c 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Modules/_multiprocessing/multiprocessing.c 2019-10-22 10:04:35.437120500 +0300 -@@ -128,7 +128,7 @@ - {"recv", multiprocessing_recv, METH_VARARGS, ""}, - {"send", multiprocessing_send, METH_VARARGS, ""}, - #endif --#if !defined(POSIX_SEMAPHORES_NOT_ENABLED) && !defined(__ANDROID__) -+#if defined(MS_WINDOWS) || (!defined(POSIX_SEMAPHORES_NOT_ENABLED) && !defined(__ANDROID__)) - {"sem_unlink", _PyMp_sem_unlink, METH_VARARGS, ""}, - #endif - {NULL} diff --git a/mingw-w64-python3.9/1701-disable-broken-gdbm-module.patch b/mingw-w64-python3.9/1701-disable-broken-gdbm-module.patch deleted file mode 100644 index bde96857547af..0000000000000 --- a/mingw-w64-python3.9/1701-disable-broken-gdbm-module.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py ---- Python-3.8.0-orig/setup.py 2019-10-22 10:04:16.342687000 +0300 -+++ Python-3.8.0/setup.py 2019-10-22 10:04:48.353943200 +0300 -@@ -1331,7 +1331,7 @@ - if dbm_args: - dbm_order = [arg.split('=')[-1] for arg in dbm_args][-1].split(":") - else: -- dbm_order = "ndbm:gdbm:bdb".split(":") -+ dbm_order = [] - dbmext = None - for cand in dbm_order: - if cand == "ndbm": diff --git a/mingw-w64-python3.9/1810-3.7-mpdec-mingw.patch b/mingw-w64-python3.9/1810-3.7-mpdec-mingw.patch deleted file mode 100644 index 27c1f6bdebff4..0000000000000 --- a/mingw-w64-python3.9/1810-3.7-mpdec-mingw.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py ---- Python-3.8.0-orig/setup.py 2019-10-22 10:04:50.085546300 +0300 -+++ Python-3.8.0/setup.py 2019-10-22 10:04:54.016753200 +0300 -@@ -2165,7 +2165,7 @@ - undef_macros = [] - if '--with-system-libmpdec' in sysconfig.get_config_var("CONFIG_ARGS"): - include_dirs = [] -- libraries = [':libmpdec.so.2'] -+ libraries = [':libmpdec.dll.a'] - sources = ['_decimal/_decimal.c'] - depends = ['_decimal/docstrings.h'] - else: diff --git a/mingw-w64-python3.9/1850-disable-readline.patch b/mingw-w64-python3.9/1850-disable-readline.patch deleted file mode 100644 index 4e0b4193d09db..0000000000000 --- a/mingw-w64-python3.9/1850-disable-readline.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py ---- Python-3.8.0-orig/setup.py 2019-10-22 10:04:55.763956200 +0300 -+++ Python-3.8.0/setup.py 2019-10-22 10:04:59.804363300 +0300 -@@ -911,7 +911,10 @@ - - def detect_readline_curses(self): - # readline -- do_readline = self.compiler.find_library_file(self.lib_dirs, 'readline') -+ if not MS_WINDOWS: -+ do_readline = self.compiler.find_library_file(self.lib_dirs, 'readline') -+ else: -+ do_readline = False - readline_termcap_library = "" - curses_library = "" - # Cannot use os.popen here in py3k. diff --git a/mingw-w64-python3.9/1860-fix-isselectable.patch b/mingw-w64-python3.9/1860-fix-isselectable.patch deleted file mode 100644 index 47ad5c7f69ba2..0000000000000 --- a/mingw-w64-python3.9/1860-fix-isselectable.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur Python-3.8.0-orig/Include/fileobject.h Python-3.8.0/Include/fileobject.h ---- Python-3.8.0-orig/Include/fileobject.h 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Include/fileobject.h 2019-10-22 10:05:02.627968300 +0300 -@@ -23,7 +23,7 @@ - PyAPI_DATA(int) Py_HasFileSystemDefaultEncoding; - - /* A routine to check if a file descriptor can be select()-ed. */ --#ifdef _MSC_VER -+#ifdef MS_WINDOWS - /* On Windows, any socket fd can be select()-ed, no matter how high */ - #define _PyIsSelectable_fd(FD) (1) - #else diff --git a/mingw-w64-python3.9/1870-use-_wcsnicmp-instead-wcsncasecmp.patch b/mingw-w64-python3.9/1870-use-_wcsnicmp-instead-wcsncasecmp.patch deleted file mode 100644 index 201fb8814a243..0000000000000 --- a/mingw-w64-python3.9/1870-use-_wcsnicmp-instead-wcsncasecmp.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur Python-3.9.5-orig/Modules/getpath.c Python-3.9.5/Modules/getpath.c ---- Python-3.9.5-orig/Modules/getpath.c 2019-10-22 10:02:51.821738500 +0300 -+++ Python-3.9.5/Modules/getpath.c 2019-10-22 10:05:05.467173300 +0300 -@@ -418,7 +427,7 @@ - /* Check for already have an executable suffix */ - size_t n = wcslen(progpath); - size_t s = wcslen(EXE_SUFFIX); -- if (wcsncasecmp(EXE_SUFFIX, progpath + n - s, s) == 0) { -+ if (_wcsnicmp(EXE_SUFFIX, progpath + n - s, s) == 0) { - return _PyStatus_OK(); - } - diff --git a/mingw-w64-python3.9/1890-_xxsubinterpretersmodule.patch b/mingw-w64-python3.9/1890-_xxsubinterpretersmodule.patch deleted file mode 100644 index 0366172e30dc1..0000000000000 --- a/mingw-w64-python3.9/1890-_xxsubinterpretersmodule.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- Python-3.8.0/Modules/_xxsubinterpretersmodule.c.orig 2019-10-22 13:34:28.145872500 +0300 -+++ Python-3.8.0/Modules/_xxsubinterpretersmodule.c 2019-10-22 13:34:49.299509600 +0300 -@@ -1749,7 +1749,7 @@ - "A channel ID identifies a channel and may be used as an int."); - - static PyTypeObject ChannelIDtype = { -- PyVarObject_HEAD_INIT(&PyType_Type, 0) -+ PyVarObject_HEAD_INIT(NULL, 0) - "_xxsubinterpreters.ChannelID", /* tp_name */ - sizeof(channelid), /* tp_basicsize */ - 0, /* tp_itemsize */ diff --git a/mingw-w64-python3.9/2010-configure-have-inet-pton.patch b/mingw-w64-python3.9/2010-configure-have-inet-pton.patch deleted file mode 100644 index f7b1d3a220e3d..0000000000000 --- a/mingw-w64-python3.9/2010-configure-have-inet-pton.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac ---- Python-3.8.0-orig/configure.ac 2019-10-22 10:04:27.917907300 +0300 -+++ Python-3.8.0/configure.ac 2019-10-22 10:05:14.312388800 +0300 -@@ -4110,10 +4110,14 @@ - - AC_MSG_CHECKING(for inet_pton) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -+#ifdef _WIN32 -+#include -+#else - #include - #include - #include - #include -+#endif - ]], [[void* p = inet_pton]])], - [AC_DEFINE(HAVE_INET_PTON, 1, Define if you have the 'inet_pton' function.) - AC_MSG_RESULT(yes)], diff --git a/mingw-w64-python3.9/2030-fix-msvc9-import.patch b/mingw-w64-python3.9/2030-fix-msvc9-import.patch deleted file mode 100644 index e2d49816e6679..0000000000000 --- a/mingw-w64-python3.9/2030-fix-msvc9-import.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -Naur Python-3.8.0-orig/Lib/distutils/msvc9compiler.py Python-3.8.0/Lib/distutils/msvc9compiler.py ---- Python-3.8.0-orig/Lib/distutils/msvc9compiler.py 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Lib/distutils/msvc9compiler.py 2019-10-22 10:05:17.120393700 +0300 -@@ -292,8 +292,6 @@ - - # More globals - VERSION = get_build_version() --if VERSION < 8.0: -- raise DistutilsPlatformError("VC %0.1f is not supported by this module" % VERSION) - # MACROS = MacroExpander(VERSION) - - class MSVCCompiler(CCompiler) : -@@ -328,6 +326,8 @@ - - def __init__(self, verbose=0, dry_run=0, force=0): - CCompiler.__init__ (self, verbose, dry_run, force) -+ if VERSION < 8.0: -+ raise DistutilsPlatformError("VC %0.1f is not supported by this module" % VERSION) - self.__version = VERSION - self.__root = r"Software\Microsoft\VisualStudio" - # self.__macros = MACROS diff --git a/mingw-w64-python3.9/2051-set-venv-activate-path-unix.patch b/mingw-w64-python3.9/2051-set-venv-activate-path-unix.patch deleted file mode 100644 index 269582db89146..0000000000000 --- a/mingw-w64-python3.9/2051-set-venv-activate-path-unix.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur Python-3.8.0-orig/Lib/venv/scripts/common/activate Python-3.8.0/Lib/venv/scripts/common/activate ---- Python-3.8.0-orig/Lib/venv/scripts/common/activate 2019-10-14 16:34:47.000000000 +0300 -+++ Python-3.8.0/Lib/venv/scripts/common/activate 2019-10-22 10:05:22.783203700 +0300 -@@ -37,7 +37,7 @@ - # unset irrelevant variables - deactivate nondestructive - --VIRTUAL_ENV="__VENV_DIR__" -+VIRTUAL_ENV=$(cygpath "__VENV_DIR__") - export VIRTUAL_ENV - - _OLD_VIRTUAL_PATH="$PATH" diff --git a/mingw-w64-python3.9/2060-pass-gen-profile-ldflags.patch b/mingw-w64-python3.9/2060-pass-gen-profile-ldflags.patch deleted file mode 100644 index c033a9d221417..0000000000000 --- a/mingw-w64-python3.9/2060-pass-gen-profile-ldflags.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in ---- Python-3.8.0-orig/Makefile.pre.in 2019-10-22 10:05:10.396781900 +0300 -+++ Python-3.8.0/Makefile.pre.in 2019-10-22 10:05:28.430413600 +0300 -@@ -699,7 +699,7 @@ - $(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS) python_nt.o - if test -n "$(DLLLIBRARY)"; then \ - $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \ -- $(LIBS) $(MODLIBS) $(SYSLIBS) python_nt.o; \ -+ $(LIBS) $(LDFLAGS_NODIST) $(MODLIBS) $(SYSLIBS) python_nt.o; \ - else true; \ - fi - diff --git a/mingw-w64-python3.9/2080-pkg-config-windows-must-link-ext-with-python-lib.patch b/mingw-w64-python3.9/2080-pkg-config-windows-must-link-ext-with-python-lib.patch deleted file mode 100644 index af2751206c5fa..0000000000000 --- a/mingw-w64-python3.9/2080-pkg-config-windows-must-link-ext-with-python-lib.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- Python-3.8.0/configure.ac.orig 2019-10-24 13:55:46.684382200 +0300 -+++ Python-3.8.0/configure.ac 2019-10-24 13:55:55.334394400 +0300 -@@ -4990,7 +4990,7 @@ - - # On Android and Cygwin the shared libraries must be linked with libpython. - AC_SUBST(LIBPYTHON) --if test -n "$ANDROID_API_LEVEL" -o "$MACHDEP" = "cygwin"; then -+if test -n "$ANDROID_API_LEVEL" -o "$MACHDEP" = "cygwin" -o "$MACHDEP" = "win"; then - LIBPYTHON="-lpython${VERSION}${ABIFLAGS}" - else - LIBPYTHON='' ---- Python-3.8.0/Misc/python.pc.in.orig 2019-10-24 13:55:46.684382200 +0300 -+++ Python-3.8.0/Misc/python.pc.in 2019-10-24 13:55:55.334394400 +0300 -@@ -9,5 +9,5 @@ - Requires: - Version: @VERSION@ - Libs.private: @LIBS@ --Libs: -+Libs: -L${libdir} -lpython@VERSION@@ABIFLAGS@ - Cflags: -I${includedir}/python@VERSION@@ABIFLAGS@ diff --git a/mingw-w64-python3.9/3000-importlib-bootstrap-path-sep.patch b/mingw-w64-python3.9/3000-importlib-bootstrap-path-sep.patch deleted file mode 100644 index b77fbf78a74b6..0000000000000 --- a/mingw-w64-python3.9/3000-importlib-bootstrap-path-sep.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- Python-3.9.4/Lib/importlib/_bootstrap_external.py.orig 2021-04-07 19:17:30 +0000 -+++ Python-3.9.4/Lib/importlib/_bootstrap_external.py 2021-04-07 19:19:46 +0000 -@@ -1604,6 +1604,10 @@ - else: - raise ImportError('importlib requires posix or nt') - -+ if 'MSYSTEM' in os_module.environ: -+ path_separators = path_separators[::-1] -+ path_sep = path_separators[0] -+ - setattr(self_module, '_os', os_module) - setattr(self_module, 'path_sep', path_sep) - setattr(self_module, 'path_separators', ''.join(path_separators)) diff --git a/mingw-w64-python3.9/3001-pathlib-path-sep.patch b/mingw-w64-python3.9/3001-pathlib-path-sep.patch deleted file mode 100644 index be5d188e26e2f..0000000000000 --- a/mingw-w64-python3.9/3001-pathlib-path-sep.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- Python-3.8.1/Lib/pathlib.py.orig 2019-12-18 18:21:23.000000000 +0100 -+++ Python-3.8.1/Lib/pathlib.py 2019-12-23 11:17:46.731915100 +0100 -@@ -122,6 +122,8 @@ - - sep = '\\' - altsep = '/' -+ if 'MSYSTEM' in os.environ: -+ sep, altsep = altsep, sep - has_drv = True - pathmod = ntpath - diff --git a/mingw-w64-python3.9/3011-fix-build-testinternalcapi.patch b/mingw-w64-python3.9/3011-fix-build-testinternalcapi.patch deleted file mode 100644 index d06b0ffef36de..0000000000000 --- a/mingw-w64-python3.9/3011-fix-build-testinternalcapi.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- Python-3.8.7/setup.py.orig 2020-12-26 07:15:03.663309900 +0100 -+++ Python-3.8.7/setup.py 2020-12-26 07:51:28.765752400 +0100 -@@ -892,7 +892,11 @@ - depends=['testcapi_long.h'])) - - # Python Internal C API test module -+ macros = [] -+ if MS_WINDOWS: -+ macros.append(('PY3_DLLNAME', 'L"%s"' % sysconfig.get_config_var('DLLLIBRARY'))) - self.add(Extension('_testinternalcapi', ['_testinternalcapi.c'], -+ define_macros=macros, - extra_compile_args=['-DPy_BUILD_CORE_MODULE'])) - - # Python PEP-3118 (buffer protocol) test module \ No newline at end of file diff --git a/mingw-w64-python3.9/3020-extend-MS_WINDOWS-flag.patch b/mingw-w64-python3.9/3020-extend-MS_WINDOWS-flag.patch deleted file mode 100644 index 07ec022943f71..0000000000000 --- a/mingw-w64-python3.9/3020-extend-MS_WINDOWS-flag.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- cpython-msys2/setup.py 2021-01-24 12:00:01.170000000 +0700 -+++ cpython/setup.py 2021-01-24 10:50:57.710000000 +0700 -@@ -51,7 +51,7 @@ - - CROSS_COMPILING = ("_PYTHON_HOST_PLATFORM" in os.environ) - HOST_PLATFORM = get_platform() --MS_WINDOWS = (HOST_PLATFORM == 'win32') -+MS_WINDOWS = (HOST_PLATFORM == 'win32' or HOST_PLATFORM == 'mingw') - CYGWIN = (HOST_PLATFORM == 'cygwin') - MACOS = (HOST_PLATFORM == 'darwin') - AIX = (HOST_PLATFORM.startswith('aix')) diff --git a/mingw-w64-python3.9/4010-MINGW-stack-reserve.patch b/mingw-w64-python3.9/4010-MINGW-stack-reserve.patch deleted file mode 100644 index aaed84dde86cb..0000000000000 --- a/mingw-w64-python3.9/4010-MINGW-stack-reserve.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- Python-3.9.5/configure.ac.orig 2021-06-03 15:49:37.703127100 -0700 -+++ Python-3.9.5/configure.ac 2021-06-03 16:28:45.151498200 -0700 -@@ -3062,6 +3062,11 @@ - VxWorks*) - LINKFORSHARED='--export-dynamic';; - esac -+ case $host in -+ *-*-mingw*) -+ # for https://bugs.python.org/issue40458 on MINGW -+ LINKFORSHARED="-Wl,--stack,2000000";; -+ esac - fi - AC_MSG_RESULT($LINKFORSHARED) - diff --git a/mingw-w64-python3.9/PKGBUILD b/mingw-w64-python3.9/PKGBUILD index 23173c5ed6480..a8d8330df47a7 100644 --- a/mingw-w64-python3.9/PKGBUILD +++ b/mingw-w64-python3.9/PKGBUILD @@ -54,102 +54,102 @@ makedepends=( ) options=('makeflags') # 'debug' '!strip') source=("https://www.python.org/ftp/python/${pkgver%rc?}/Python-${pkgver}.tar.xz" - 0000-make-_sysconfigdata.py-relocatable.patch + "smoketests.py" + 0001-make-_sysconfigdata.py-relocatable.patch 0002-restore-setup-config.patch - 0100-MINGW-BASE-use-NT-thread-model.patch - 0110-MINGW-translate-gcc-internal-defines-to-python-platf.patch - 0130-MINGW-configure-MACHDEP-and-platform-for-build.patch - 0140-MINGW-preset-configure-defaults.patch - 0150-MINGW-configure-largefile-support-for-windows-builds.patch - 0170-MINGW-add-srcdir-PC-to-CPPFLAGS.patch - 0180-MINGW-init-system-calls.patch - 0200-MINGW-build-in-windows-modules-winreg.patch - 0210-MINGW-determine-if-pwdmodule-should-be-used.patch - 0250-MINGW-compiler-customize-mingw-cygwin-compilers.patch - 0260-MINGW-compiler-enable-new-dtags.patch - 0290-issue6672-v2-Add-Mingw-recognition-to-pyport.h-to-al.patch - 0300-MINGW-configure-for-shared-build.patch - 0310-MINGW-dynamic-loading-support.patch - 0330-MINGW-ignore-main-program-for-frozen-scripts.patch - 0350-MINGW-setup-_multiprocessing-module.patch - 0360-MINGW-setup-select-module.patch - 0370-MINGW-setup-_ctypes-module-with-system-libffi.patch - 0380-MINGW-defect-winsock2-and-setup-_socket-module.patch - 0390-MINGW-exclude-unix-only-modules.patch - 0400-MINGW-setup-msvcrt-and-_winapi-modules.patch - 0410-MINGW-build-extensions-with-GCC.patch - 0420-MINGW-use-Mingw32CCompiler-as-default-compiler-for-m.patch - 0430-MINGW-find-import-library.patch - 0440-MINGW-setup-_ssl-module.patch - 0460-MINGW-generalization-of-posix-build-in-sysconfig.py.patch - 0462-MINGW-support-stdcall-without-underscore.patch - 0464-use-replace-instead-rename-to-avoid-failure-on-windo.patch - 0470-MINGW-avoid-circular-dependency-from-time-module-dur.patch - 0480-MINGW-generalization-of-posix-build-in-distutils-sys.patch - 0490-MINGW-customize-site.patch - 0500-add-python-config-sh.patch - 0510-cross-darwin-feature.patch - 0520-py3k-mingw-ntthreads-vs-pthreads.patch - 0530-mingw-system-libffi.patch - 0555-msys-mingw-prefer-unix-sep-if-MSYSTEM.patch - 0560-mingw-use-posix-getpath.patch - 0565-mingw-add-ModuleFileName-dir-to-PATH.patch - 0570-mingw-add-BUILDIN_WIN32_MODULEs-time-msvcrt.patch - 0610-msys-cygwin-semi-native-build-sysconfig.patch - 0620-mingw-sysconfig-like-posix.patch - 0630-mingw-_winapi_as_builtin_for_Popen_in_cygwinccompiler.patch - 0650-cross-dont-add-multiarch-paths-if-cross-compiling.patch - 0660-mingw-use-backslashes-in-compileall-py.patch - 0670-msys-convert_path-fix-and-root-hack.patch - 0690-allow-static-tcltk.patch - 0720-mingw-pdcurses_ISPAD.patch - 0740-grammar-fixes.patch - 0750-builddir-fixes.patch - 0760-msys-monkeypatch-os-system-via-sh-exe.patch - 0770-msys-replace-slashes-used-in-io-redirection.patch - 0800-mingw-install-layout-as-posix.patch - 0810-remove_path_max.default.patch - 0820-dont-link-with-gettext.patch - 0830-ctypes-python-dll.patch - 0840-gdbm-module-includes.patch - 0850-use-gnu_printf-in-format.patch - 0870-mingw-fix-ssl-dont-use-enum_certificates.patch - 0890-mingw-build-optimized-ext.patch - 0900-cygwinccompiler-dont-strip-modules-if-pydebug.patch - 0910-fix-using-dllhandle-and-winver-mingw.patch - 0920-mingw-add-LIBPL-to-library-dirs.patch - 0970-Add-AMD64-to-sys-config-so-msvccompiler-get_build_version-works.patch - 0990-MINGW-link-with-additional-library.patch - 1010-install-msilib.patch - 1060-dont-include-system-ncurses-path.patch - 1620-fix-signal-module-build.patch - 1630-build-winconsoleio.patch - 1650-expose-sem_unlink.patch - 1700-cygpty-isatty.patch - 1701-disable-broken-gdbm-module.patch - 1800-link-win-resource-files-and-build-pythonw.patch - 1810-3.7-mpdec-mingw.patch - 1850-disable-readline.patch - 1860-fix-isselectable.patch - 1870-use-_wcsnicmp-instead-wcsncasecmp.patch - 1890-_xxsubinterpretersmodule.patch - 1891-sqlite3-module-defines.patch - 2010-configure-have-inet-pton.patch - 2030-fix-msvc9-import.patch - 2051-set-venv-activate-path-unix.patch - 2052-venv-creation-fixes.patch - 2060-pass-gen-profile-ldflags.patch - 2070-distutils-add-windmc-to-cygwinccompiler.patch - 2080-pkg-config-windows-must-link-ext-with-python-lib.patch - 3000-importlib-bootstrap-path-sep.patch - 3001-pathlib-path-sep.patch - 3011-fix-build-testinternalcapi.patch - 3020-extend-MS_WINDOWS-flag.patch - 4000-clang-arm64.patch - 4010-MINGW-stack-reserve.patch - 5000-warnings-fixes.patch - 0001-Add-support-for-Windows-7-Python-3.9.patch - smoketests.py) + 0003-MINGW-BASE-use-NT-thread-model.patch + 0004-MINGW-translate-gcc-internal-defines-to-python-platf.patch + 0005-MINGW-configure-MACHDEP-and-platform-for-build.patch + 0006-MINGW-preset-configure-defaults.patch + 0007-MINGW-configure-largefile-support-for-windows-builds.patch + 0008-MINGW-add-srcdir-PC-to-CPPFLAGS.patch + 0009-MINGW-init-system-calls.patch + 0010-MINGW-build-in-windows-modules-winreg.patch + 0011-MINGW-determine-if-pwdmodule-should-be-used.patch + 0012-MINGW-compiler-customize-mingw-cygwin-compilers.patch + 0013-MINGW-compiler-enable-new-dtags.patch + 0014-issue6672-v2-Add-Mingw-recognition-to-pyport.h-to-al.patch + 0015-MINGW-configure-for-shared-build.patch + 0016-MINGW-dynamic-loading-support.patch + 0017-MINGW-ignore-main-program-for-frozen-scripts.patch + 0018-MINGW-setup-_multiprocessing-module.patch + 0019-MINGW-setup-select-module.patch + 0020-MINGW-setup-_ctypes-module-with-system-libffi.patch + 0021-MINGW-defect-winsock2-and-setup-_socket-module.patch + 0022-MINGW-exclude-unix-only-modules.patch + 0023-MINGW-setup-msvcrt-and-_winapi-modules.patch + 0024-MINGW-build-extensions-with-GCC.patch + 0025-MINGW-use-Mingw32CCompiler-as-default-compiler-for-m.patch + 0026-MINGW-find-import-library.patch + 0027-MINGW-setup-_ssl-module.patch + 0028-MINGW-generalization-of-posix-build-in-sysconfig.py.patch + 0029-MINGW-support-stdcall-without-underscore.patch + 0030-use-replace-instead-rename-to-avoid-failure-on-windo.patch + 0031-MINGW-avoid-circular-dependency-from-time-module-dur.patch + 0032-MINGW-generalization-of-posix-build-in-distutils-sys.patch + 0033-MINGW-customize-site.patch + 0034-add-python-config-sh.patch + 0035-cross-darwin-feature.patch + 0036-py3k-mingw-ntthreads-vs-pthreads.patch + 0037-mingw-system-libffi.patch + 0038-msys-mingw-prefer-unix-sep-if-MSYSTEM.patch + 0039-mingw-use-posix-getpath.patch + 0040-mingw-add-ModuleFileName-dir-to-PATH.patch + 0041-mingw-add-BUILDIN_WIN32_MODULEs-time-msvcrt.patch + 0042-msys-cygwin-semi-native-build-sysconfig.patch + 0043-mingw-sysconfig-like-posix.patch + 0044-mingw-_winapi_as_builtin_for_Popen_in_cygwinccompile.patch + 0045-cross-dont-add-multiarch-paths-if-cross-compiling.patch + 0046-mingw-use-backslashes-in-compileall-py.patch + 0047-msys-convert_path-fix-and-root-hack.patch + 0048-allow-static-tcltk.patch + 0049-mingw-pdcurses_ISPAD.patch + 0050-grammar-fixes.patch + 0051-builddir-fixes.patch + 0052-msys-monkeypatch-os-system-via-sh-exe.patch + 0053-msys-replace-slashes-used-in-io-redirection.patch + 0054-mingw-install-layout-as-posix.patch + 0055-remove_path_max.default.patch + 0056-dont-link-with-gettext.patch + 0057-ctypes-python-dll.patch + 0058-gdbm-module-includes.patch + 0059-use-gnu_printf-in-format.patch + 0060-mingw-fix-ssl-dont-use-enum_certificates.patch + 0061-mingw-build-optimized-ext.patch + 0062-cygwinccompiler-dont-strip-modules-if-pydebug.patch + 0063-fix-using-dllhandle-and-winver-mingw.patch + 0064-mingw-add-LIBPL-to-library-dirs.patch + 0065-Add-AMD64-to-sys-config-so-msvccompiler-get_build_ve.patch + 0066-MINGW-link-with-additional-library.patch + 0067-install-msilib.patch + 0068-dont-include-system-ncurses-path.patch + 0069-fix-signal-module-build.patch + 0070-build-winconsoleio.patch + 0071-expose-sem_unlink.patch + 0072-cygpty-isatty.patch + 0073-disable-broken-gdbm-module.patch + 0074-link-win-resource-files-and-build-pythonw.patch + 0075-3.7-mpdec-mingw.patch + 0076-disable-readline.patch + 0077-fix-isselectable.patch + 0078-use-_wcsnicmp-instead-wcsncasecmp.patch + 0079-_xxsubinterpretersmodule.patch + 0080-sqlite3-module-defines.patch + 0081-configure-have-inet-pton.patch + 0082-fix-msvc9-import.patch + 0083-set-venv-activate-path-unix.patch + 0084-venv-creation-fixes.patch + 0085-pass-gen-profile-ldflags.patch + 0086-distutils-add-windmc-to-cygwinccompiler.patch + 0087-pkg-config-windows-must-link-ext-with-python-lib.patch + 0088-importlib-bootstrap-path-sep.patch + 0089-pathlib-path-sep.patch + 0090-warnings-fixes.patch + 0091-fix-build-testinternalcapi.patch + 0092-extend-MS_WINDOWS-flag.patch + 0093-clang-arm64.patch + 0094-MINGW-stack-reserve.patch + 0095-Add-support-for-Windows-7-Python-3.9.patch) # Helper macros to help make tasks easier # apply_patch_with_msg() { @@ -160,169 +160,105 @@ apply_patch_with_msg() { done } -del_file_exists() { - for _fname in "$@" - do - if [ -f ${_fname} ]; then - rm -rf ${_fname} - fi - done -} -# =========================================== # - prepare() { cd "${srcdir}/Python-${pkgver}" - plain "Apply Ray Donnelly's should-be-upstreamed patches" - apply_patch_with_msg \ - 0000-make-_sysconfigdata.py-relocatable.patch \ - 0002-restore-setup-config.patch - - plain "Apply Roumen Petrov's core patches (10)" - apply_patch_with_msg \ - 0100-MINGW-BASE-use-NT-thread-model.patch \ - 0110-MINGW-translate-gcc-internal-defines-to-python-platf.patch \ - 0130-MINGW-configure-MACHDEP-and-platform-for-build.patch \ - 0140-MINGW-preset-configure-defaults.patch \ - 0150-MINGW-configure-largefile-support-for-windows-builds.patch \ - 0170-MINGW-add-srcdir-PC-to-CPPFLAGS.patch \ - 0180-MINGW-init-system-calls.patch \ - 0200-MINGW-build-in-windows-modules-winreg.patch \ - 0210-MINGW-determine-if-pwdmodule-should-be-used.patch - - plain "Apply Roumen Petrov's compiler patch (2)" - apply_patch_with_msg \ - 0250-MINGW-compiler-customize-mingw-cygwin-compilers.patch \ - 0260-MINGW-compiler-enable-new-dtags.patch - - plain "Apply Roumen Petrov's extensions patches (21)" - apply_patch_with_msg \ - 0290-issue6672-v2-Add-Mingw-recognition-to-pyport.h-to-al.patch \ - 0300-MINGW-configure-for-shared-build.patch \ - 0310-MINGW-dynamic-loading-support.patch \ - 0330-MINGW-ignore-main-program-for-frozen-scripts.patch \ - 0350-MINGW-setup-_multiprocessing-module.patch \ - 0360-MINGW-setup-select-module.patch \ - 0370-MINGW-setup-_ctypes-module-with-system-libffi.patch \ - 0380-MINGW-defect-winsock2-and-setup-_socket-module.patch \ - 0390-MINGW-exclude-unix-only-modules.patch \ - 0400-MINGW-setup-msvcrt-and-_winapi-modules.patch \ - 0410-MINGW-build-extensions-with-GCC.patch \ - 0420-MINGW-use-Mingw32CCompiler-as-default-compiler-for-m.patch \ - 0430-MINGW-find-import-library.patch \ - 0440-MINGW-setup-_ssl-module.patch \ - 0460-MINGW-generalization-of-posix-build-in-sysconfig.py.patch \ - 0462-MINGW-support-stdcall-without-underscore.patch \ - 0464-use-replace-instead-rename-to-avoid-failure-on-windo.patch \ - 0470-MINGW-avoid-circular-dependency-from-time-module-dur.patch \ - 0480-MINGW-generalization-of-posix-build-in-distutils-sys.patch \ - 0490-MINGW-customize-site.patch - - plain "Apply Ray Donnelly's general/cross patches (42)" - apply_patch_with_msg \ - 0500-add-python-config-sh.patch \ - 0510-cross-darwin-feature.patch \ - 0520-py3k-mingw-ntthreads-vs-pthreads.patch \ - 0530-mingw-system-libffi.patch \ - 0555-msys-mingw-prefer-unix-sep-if-MSYSTEM.patch \ - 0560-mingw-use-posix-getpath.patch \ - 0565-mingw-add-ModuleFileName-dir-to-PATH.patch \ - 0570-mingw-add-BUILDIN_WIN32_MODULEs-time-msvcrt.patch - - apply_patch_with_msg \ - 0610-msys-cygwin-semi-native-build-sysconfig.patch \ - 0620-mingw-sysconfig-like-posix.patch \ - 0630-mingw-_winapi_as_builtin_for_Popen_in_cygwinccompiler.patch \ - 0650-cross-dont-add-multiarch-paths-if-cross-compiling.patch \ - 0660-mingw-use-backslashes-in-compileall-py.patch \ - 0670-msys-convert_path-fix-and-root-hack.patch \ - 0690-allow-static-tcltk.patch - - apply_patch_with_msg \ - 0720-mingw-pdcurses_ISPAD.patch \ - 0740-grammar-fixes.patch \ - 0750-builddir-fixes.patch \ - 0760-msys-monkeypatch-os-system-via-sh-exe.patch \ - 0770-msys-replace-slashes-used-in-io-redirection.patch \ - 0800-mingw-install-layout-as-posix.patch \ - 0810-remove_path_max.default.patch \ - 0820-dont-link-with-gettext.patch \ - 0830-ctypes-python-dll.patch \ - 0840-gdbm-module-includes.patch \ - 0850-use-gnu_printf-in-format.patch \ - 0870-mingw-fix-ssl-dont-use-enum_certificates.patch \ - 0890-mingw-build-optimized-ext.patch \ - 0900-cygwinccompiler-dont-strip-modules-if-pydebug.patch \ - 0910-fix-using-dllhandle-and-winver-mingw.patch \ - 0920-mingw-add-LIBPL-to-library-dirs.patch \ - 0970-Add-AMD64-to-sys-config-so-msvccompiler-get_build_version-works.patch \ - 0990-MINGW-link-with-additional-library.patch \ - 1010-install-msilib.patch \ - 1060-dont-include-system-ncurses-path.patch - - plain "New patches added for the update from 3.5.3 to 3.6.1" - apply_patch_with_msg \ - 1620-fix-signal-module-build.patch \ - 1630-build-winconsoleio.patch \ - 1650-expose-sem_unlink.patch - - # Extend some isatty calls to check for mintty when checking for - # a terminal output. - # https://github.com/Alexpux/MINGW-packages/issues/2645 - apply_patch_with_msg \ - 1700-cygpty-isatty.patch - - # gdbm is broken and as a result breaks dbm/shelve. - # Don't include it so the dbm.dumb backend is used instead, - # like with the official CPython build. - apply_patch_with_msg \ - 1701-disable-broken-gdbm-module.patch - - # https://github.com/Alexpux/MINGW-packages/issues/3139 - apply_patch_with_msg \ - 1800-link-win-resource-files-and-build-pythonw.patch - - apply_patch_with_msg \ - 1810-3.7-mpdec-mingw.patch \ - 1850-disable-readline.patch \ - 1860-fix-isselectable.patch \ - 1870-use-_wcsnicmp-instead-wcsncasecmp.patch \ - 1890-_xxsubinterpretersmodule.patch \ - 1891-sqlite3-module-defines.patch - - # https://github.com/msys2/MINGW-packages/issues/5184 - apply_patch_with_msg 2010-configure-have-inet-pton.patch - - # https://github.com/msys2/MINGW-packages/issues/5155 - apply_patch_with_msg 2030-fix-msvc9-import.patch - - # https://github.com/msys2/MINGW-packages/issues/5001 - apply_patch_with_msg 2051-set-venv-activate-path-unix.patch - apply_patch_with_msg 2052-venv-creation-fixes.patch - - apply_patch_with_msg 2060-pass-gen-profile-ldflags.patch - - apply_patch_with_msg 2070-distutils-add-windmc-to-cygwinccompiler.patch - apply_patch_with_msg 2080-pkg-config-windows-must-link-ext-with-python-lib.patch - - # https://github.com/msys2/MINGW-packages/issues/6035 - apply_patch_with_msg 3000-importlib-bootstrap-path-sep.patch - apply_patch_with_msg 3001-pathlib-path-sep.patch - - apply_patch_with_msg 5000-warnings-fixes.patch - - apply_patch_with_msg 3011-fix-build-testinternalcapi.patch - - apply_patch_with_msg 3020-extend-MS_WINDOWS-flag.patch - - apply_patch_with_msg 4000-clang-arm64.patch - - # https://bugs.python.org/issue40458 - apply_patch_with_msg 4010-MINGW-stack-reserve.patch - - plain "Add Windows 7 support Patch" - apply_patch_with_msg 0001-Add-support-for-Windows-7-Python-3.9.patch - + apply_patch_with_msg 0001-make-_sysconfigdata.py-relocatable.patch \ + 0002-restore-setup-config.patch \ + 0003-MINGW-BASE-use-NT-thread-model.patch \ + 0004-MINGW-translate-gcc-internal-defines-to-python-platf.patch \ + 0005-MINGW-configure-MACHDEP-and-platform-for-build.patch \ + 0006-MINGW-preset-configure-defaults.patch \ + 0007-MINGW-configure-largefile-support-for-windows-builds.patch \ + 0008-MINGW-add-srcdir-PC-to-CPPFLAGS.patch \ + 0009-MINGW-init-system-calls.patch \ + 0010-MINGW-build-in-windows-modules-winreg.patch \ + 0011-MINGW-determine-if-pwdmodule-should-be-used.patch \ + 0012-MINGW-compiler-customize-mingw-cygwin-compilers.patch \ + 0013-MINGW-compiler-enable-new-dtags.patch \ + 0014-issue6672-v2-Add-Mingw-recognition-to-pyport.h-to-al.patch \ + 0015-MINGW-configure-for-shared-build.patch \ + 0016-MINGW-dynamic-loading-support.patch \ + 0017-MINGW-ignore-main-program-for-frozen-scripts.patch \ + 0018-MINGW-setup-_multiprocessing-module.patch \ + 0019-MINGW-setup-select-module.patch \ + 0020-MINGW-setup-_ctypes-module-with-system-libffi.patch \ + 0021-MINGW-defect-winsock2-and-setup-_socket-module.patch \ + 0022-MINGW-exclude-unix-only-modules.patch \ + 0023-MINGW-setup-msvcrt-and-_winapi-modules.patch \ + 0024-MINGW-build-extensions-with-GCC.patch \ + 0025-MINGW-use-Mingw32CCompiler-as-default-compiler-for-m.patch \ + 0026-MINGW-find-import-library.patch \ + 0027-MINGW-setup-_ssl-module.patch \ + 0028-MINGW-generalization-of-posix-build-in-sysconfig.py.patch \ + 0029-MINGW-support-stdcall-without-underscore.patch \ + 0030-use-replace-instead-rename-to-avoid-failure-on-windo.patch \ + 0031-MINGW-avoid-circular-dependency-from-time-module-dur.patch \ + 0032-MINGW-generalization-of-posix-build-in-distutils-sys.patch \ + 0033-MINGW-customize-site.patch \ + 0034-add-python-config-sh.patch \ + 0035-cross-darwin-feature.patch \ + 0036-py3k-mingw-ntthreads-vs-pthreads.patch \ + 0037-mingw-system-libffi.patch \ + 0038-msys-mingw-prefer-unix-sep-if-MSYSTEM.patch \ + 0039-mingw-use-posix-getpath.patch \ + 0040-mingw-add-ModuleFileName-dir-to-PATH.patch \ + 0041-mingw-add-BUILDIN_WIN32_MODULEs-time-msvcrt.patch \ + 0042-msys-cygwin-semi-native-build-sysconfig.patch \ + 0043-mingw-sysconfig-like-posix.patch \ + 0044-mingw-_winapi_as_builtin_for_Popen_in_cygwinccompile.patch \ + 0045-cross-dont-add-multiarch-paths-if-cross-compiling.patch \ + 0046-mingw-use-backslashes-in-compileall-py.patch \ + 0047-msys-convert_path-fix-and-root-hack.patch \ + 0048-allow-static-tcltk.patch \ + 0049-mingw-pdcurses_ISPAD.patch \ + 0050-grammar-fixes.patch \ + 0051-builddir-fixes.patch \ + 0052-msys-monkeypatch-os-system-via-sh-exe.patch \ + 0053-msys-replace-slashes-used-in-io-redirection.patch \ + 0054-mingw-install-layout-as-posix.patch \ + 0055-remove_path_max.default.patch \ + 0056-dont-link-with-gettext.patch \ + 0057-ctypes-python-dll.patch \ + 0058-gdbm-module-includes.patch \ + 0059-use-gnu_printf-in-format.patch \ + 0060-mingw-fix-ssl-dont-use-enum_certificates.patch \ + 0061-mingw-build-optimized-ext.patch \ + 0062-cygwinccompiler-dont-strip-modules-if-pydebug.patch \ + 0063-fix-using-dllhandle-and-winver-mingw.patch \ + 0064-mingw-add-LIBPL-to-library-dirs.patch \ + 0065-Add-AMD64-to-sys-config-so-msvccompiler-get_build_ve.patch \ + 0066-MINGW-link-with-additional-library.patch \ + 0067-install-msilib.patch \ + 0068-dont-include-system-ncurses-path.patch \ + 0069-fix-signal-module-build.patch \ + 0070-build-winconsoleio.patch \ + 0071-expose-sem_unlink.patch \ + 0072-cygpty-isatty.patch \ + 0073-disable-broken-gdbm-module.patch \ + 0074-link-win-resource-files-and-build-pythonw.patch \ + 0075-3.7-mpdec-mingw.patch \ + 0076-disable-readline.patch \ + 0077-fix-isselectable.patch \ + 0078-use-_wcsnicmp-instead-wcsncasecmp.patch \ + 0079-_xxsubinterpretersmodule.patch \ + 0080-sqlite3-module-defines.patch \ + 0081-configure-have-inet-pton.patch \ + 0082-fix-msvc9-import.patch \ + 0083-set-venv-activate-path-unix.patch \ + 0084-venv-creation-fixes.patch \ + 0085-pass-gen-profile-ldflags.patch \ + 0086-distutils-add-windmc-to-cygwinccompiler.patch \ + 0087-pkg-config-windows-must-link-ext-with-python-lib.patch \ + 0088-importlib-bootstrap-path-sep.patch \ + 0089-pathlib-path-sep.patch \ + 0090-warnings-fixes.patch \ + 0091-fix-build-testinternalcapi.patch \ + 0092-extend-MS_WINDOWS-flag.patch \ + 0093-clang-arm64.patch \ + 0094-MINGW-stack-reserve.patch \ + 0095-Add-support-for-Windows-7-Python-3.9.patch + autoreconf -vfi } @@ -523,99 +459,99 @@ package() { } sha256sums=('0c5a140665436ec3dbfbb79e2dfb6d192655f26ef4a29aeffcb6d1820d716d83' - '0ee1acf745d38d41fd098487b9595705fd8f6666d7b154d54ddba32d14f1253b' - 'd2d73d9fb9db48fecb3a6856e4606f444eaac7637fd4f65e192701e53ac422eb' - 'abed03b63e0b498804b44d1cdf8b1ff0c3c4329d3ea9c0323b2512adcacb9b57' - 'c2fb01aacfc5d96bdb69ef37282f300ecd8bfa3e11921caa1fce8e871f5a31f8' - '6446e0a5255d317d93c5c55094d4c797cf68fbd14bb08d38c94d7080837d1380' - '8e90c38ac27316781f8853fcbce300526d92732edf4cd08d1dc2a0438fd2d694' - '36f6e8b4320ee79b6ff7e84aefec3aec57293bcbacf08ea7847f3147d459b4a9' - '2fbb3642720783c0edef2a79755974e9d85e22735885af8797956f56005a846c' - '960f0c795a452d8446b60fd50505c7696c5166b3d0250660f8312d71222baeb7' - '910c84eb01cfe2207ee7fd8549247d9498be8b58c4dbbb6eaa2118037e77730e' - 'da5057e58a4866e20c3c604153febb2b57a089d327a954ee5b51830af8204e17' - '265a3c99923b76210e0401bc0cafa88b99328343aec43d64aa94cb84fcdda6d8' - '4f1db216d6a2dad137b07ccdd4b2d71c37169083706addf90c3b0b850312632a' - '12a93452bac4950baee85baaf95e67e2c63d2f022b0199d0aa4720321189f890' - '9f05613753a8b4ad8c5a6b32c257a318e9ff416345f4ebef3e69f56cf9a51578' - '9269a4d4dab6a0e93b8a0b5ed84c3e93bdfbaf99148e467daf993f6f767c8d45' - '1e89597d37838ad7c18463b83476b3cc6bec1480a052e757b9fbfb3264d4d890' - '03891c0fe4ad90a9926c0e04dc7bb0efbf0022cd6d7746cf2d173dbd739f6142' - '3b85b18922d21e8fc6e07a12e1c8d79c7ec271dddb75ed0fb4f44148b030b360' - '6d0119cd216b944927254598cfec1b85757000ab39f5ba987a86ed2216d6351b' - 'ed8d88979198f3262b74fd3b214e868589251162e073dfd8c801bef93353fcc8' - '9c6e64ba27d72e912be3486a0cc65d9f59f5d7ba71fb634fef0860a00311d12c' - '3842234d2c3aeece0416a670c789801ef76ce31841a9c1bfcbb26340aa346712' - '194ef359356d4d58bb15bafe8738c0586350d26e85cc39f5db833f428d67b41d' - '48d5dac961a363cbd1f3d2acf0100552d5f8b0974ab96ccb3d81058781d6a277' - 'f7729d39c8eadce379b2b21cd253c604bfe3e4293945b4d6def9bf0c9b3c8f4f' - '7bd7cac5cc9424b934ae31e6aebf7a960fca8d6ac82778f107a4b16a4e7865c8' - '0ade7802219389ec80969a934a95e577d4ed03ac705dcaf328c276731de3f7ab' - '4804d854bb9fb3e6ff11c23e420b6ff34266bbc93ce33115129bf838171d49ee' - 'a26997445938dd01a03a16a622d19adbc270e679df195407436c97246c96f99a' - '269fc7d93aeefc286009612604385ac2ec1d0304b97c858ffe123c282be8d94c' - '20743252b0f3ec2a1ba7bdfaa6f3164fc262a50b806ce38d77ee14d48b029ee1' - '059b2eff79cb071b45d7c9d054c9954df2f828ae84bb064a4fa04f27def8a4fd' - '1b3a27ea33b66efe3131dcb9951030aa7d4c18f9ec851e89a4582b69f8e673e7' - '60a6f06c9346fad616e1b204f610edae24ba1182bd803492899bd9fbc5c4b605' - '840cbf8fafa2cc230dd8a9f667dbad80d54ad573f929f9970252722b9183688b' - '75dee4296d425f9d090130b76efd0a8f25704650241e77f690e3898511e23efe' - '226625cf55d9cd6db68030c6b82943fb18a343ae763ab035cb55b4ac3ae3453f' - 'db13ff9d60ebac17e712609e6d7edfdc7301501116622320ea3cf2caf82af36d' - '253f3286e3c34d1da938b82671c73b9b3c8b8e484905a1d042bd8996274d0a34' - '65aff7e831f3bb4b37ed5d4db5dfa75ab6bd582d132dd197e658ccb699dbfac7' - 'f2a7b6dce11311e3d318d5729258935a520dcb7ce4dc879ecb1738a2f8bfe434' - '0a81aa7fd5fa0b511fda81ce3345f3199d3be1c83fc660f7f365ef4ede88f3f7' - '27122f9db1be8b1efbccd6ab263313aa66c97dfcd0acb9499434a1fa4ecbb2bd' - 'cef46c7e1afcaf9b6bacf723d5ae22f3f42045eb93bbd9bf5d2b1dba7638028a' - '4a5867faabf973e96e195427097f8d34b5e4776c3af9598e15c21957f366b9eb' - 'f33d70071a232a2a3930aa0a2b3f032ef6a17e07acc7412000ceb25bdd339ade' - '5c56aa13fd3f18bd4b327d8cd540ff7fd9e0145e6358d6330103938655d3dfd7' - 'ca3eea7fac20d160d9aa3a8e17c0b9ab169cfe16a685f78d2c4d1fd52f8f6784' - '5184144968a2e354bf6acf3a8c73c353fa705e3f9f5fe8d8cf7e82241eb74d85' - 'a55bd3b222d08dc6bb68d4e30ec3e544b303d93330131a310f3a2e20ca93f4b9' - '2b4e223aed8ec9df431806c54bd3df923dbd34805e311006aba3f62682eeca56' - '1cb05a1596b2ae3a5b9d8f51c1749150d2847a5c60f174ae52538902f38ec2d7' - '5d1a85e93b4c7626aa2cfa68201c2d93574647ab6ef0679d3ff4b4cc5c2ba042' - 'd06065357943599d515b7ea081da99981b68c4c6a9a5e6bb5e0f1019fea80104' - 'b323e44874873591b763b1926cac00d354323d32ff06941eefa415dbdb643cfb' - '26fe3548c0e3997aa09077a5f4d1b4152c98c6c6e7ed64e26557704cc4758f73' - '2b33a669fc281b69d6d3683402ea8d83a86f6bf625a14944d0ac553f414688d3' - 'f55377c77d7345c0064ef4de71303735af9af0fead1eb3dcd701feb7057a117c' - 'd817ee8eeb04450de6c313db4cde76cca92236e14b60fb0fdb30014250b76fdb' - 'a8d7416f819963fb7d2e6800d51d27f5fdc74d804d2b559528eb6867c9e3b88a' - 'a492d1366f130122e4e54bee722b65a3d8a2afb30768026e2922edec0d11c9e4' - '16ab24a074e2e06e6cee4bc06373b2b71e5d7990b71f60fa613a6e9bf55d6c12' - '3245dc7c2e65e15c981b5a9c6372210dae582e7c7dfee632ec92a40868f3a63b' - '168172f22ea13879b958179fee20d0b2d78136bc755501f108840a14a0b521f6' - 'd6aa0cbe43c023cf8ee742b4a1d4527f955193f86c39cc6d518707990e967180' - '84d2457f89057d1f4c48cfe85a1fe4f397eaa6a4f2dd0bad36beccf9dfdb5819' - '8fe0d9cb7b36faa27d2bb41661f4f9ea0298901d261c5daf702e29e97e46bd4c' - '7e2652a26a8e7198b9b6fd2bfd476c514362f347ba75b1dd014faac443266fd7' - '8ea5b335b10bfb4e492646902db043aee06c953941b3eca7fe24603a3238abf8' - 'a9977459a8e6c31f1643da7ede6ac7199dee96559d74188f5c9d3799787ac4fa' - '70b450a5af36b54aed3bbe8704a67a0a2d53e9e729d0f97d1dc1857b03635931' - '551047905350e113384f99e0e929e9381dc0a4ed514ca4ebe279dcdad798edce' - 'bf204c06af11615f00fa5aaecf0012b6993b0264f17ebffa47f9c558299a9a8a' - 'fc6164a90f0ca2a9341aaf4448b4334c3393459ca5cbad6d7149f8bcf70da5fe' - '181672743d9e2449064a1b18764fa400af5d3cd268098e7b7e5069d0b128caa2' - '6f2032347bb40e2ebe9b3a03062147ffa2f656d47c87821623c3b7d46dc15ddb' - '0218d68cb27f34ab0a7a21728f91cf0e91ab4becedc494bde48632f85adc1817' - '17bf1ea04f476ee66555bc4386ffbebfe6be6f75e67947b7f85511241ac46407' - '9e049d49f160fece88887f8e72366f63ba19dbc4d886f68a1c887e134eef5e21' - '0ded9e2792b95902d898aba91020103875f2987a9566b353f3e6988b08848f4a' - 'd3a0669c83e4df5d33606b4c3443d2c6c71b76cb4f6421d6d54ee630023be6c2' - 'a7fbf65a86889f95138360ca4dbd4e51de2e214384ee39740d9c6c381ff997d9' - 'ac0400fd7c9ceada1356fe4b7eae3892f35652f09f488b31fd011e0642d373a3' - '6f1a48380445406709ba5c6b4b9c6f0301ea645324feb429f3719dc29b8f28ff' - 'b2f4083ada35c18876edf38220d84ca757cf710bc5c2d80ee8b5083dc6c2609f' - '487c92837717975ad6c63fe2a1f8e8c5c9e0554e96000102d83c82f4a77fd9bd' - 'ef4c4e4eccf7178c2b4bee12d4b7ae45c83dd7f0e0708c9ad668d7da7746338e' - '6efc39323d14239f2a55576a8b3f32cb79eeefdd5881ba813493c14be2939f3c' - '005381222cfef42ccc21151845b6d43d25c861f35c2192e5e23c2a14df7938f0' - 'b6b3f8f2c809dc7ef43bc26306516edf4a5d1e038343ad8c7a45f666011c2e8b' - '717167e9ca5563e04103871a3e489dd1cef77a83c5c6d20e7bda6dced7f3fc42' - '1b774cdd7d0999cbd6a20c490f1eebe24c25ce8618845ce0fc41f8447008aec7' - '07877afd83c941c125064bebea8bdf6f94c15b24ebceaf1e100c05a4f93d782b' - '0046c4900d808ab30816a2e931f31962c0429f6099bc36eec667ad503b65dfae' - '7188e017a1efba4a87cb64a38b63ed2d8a469e2e74c3fd35b6538d5bc6e370e5') + '7188e017a1efba4a87cb64a38b63ed2d8a469e2e74c3fd35b6538d5bc6e370e5' + '66adf9f19a9606f547e4f8321c7764bdf6b91fdbbe53f51723d3adc058bb7563' + 'ef3deb1b637c43479407fe71250a3c7974147b99eea730873690807392f15e8d' + 'd564854a00a95b07526785c463d33bab2adb1e283e7c0754469ed0df41912629' + '81f67ec38d89f5dcf99e25965c0d3d66407e111258f327547e3d37893f106c6a' + 'd847a3fadaef56ee7ba0850ade77710af8167a7f670c97f1a56f5c837656fd0e' + 'ea5aaaf05b9b08c21e25f8b8f0da9206614f58ce1eed1cebe7e91788d01e3e28' + 'c895125e645db6e1031588bbf18f9ec874fa69385543ef13c0468a17dfdce269' + 'af68cbaef348ad9081ae5b4ee81ebaaaae48c3f1f91e5a80613e02e8f979137e' + '84aeb6e5c04ca2f7b4f5e6938982c04857f2640569d35c5aa8e1c180c48bcb54' + 'bb82242e6c13ebd2bee6cbcd6f544c55f460d0ba97e97851c05f68a440afa46f' + '699947a594e47074d8589d60f8950743a12fe95f563e2d509b09fe09fbfa6c7f' + '257504364591601beac8d0e18c1e03c60125ad16a81e5b31da02689818c0a52e' + '927d4afe0e4c6d59d552b10f0fc482c101d18f091a807e0b1281695b990754d8' + 'a611744f9b2dbb8ce79503d470e3a5bf6ad3d36231cf6261b4f9088141ddd156' + '65ad3aa8c6441cc4f497a39b641f70f09d59e1f0b13c8efdcd1970ffcbaf054b' + 'b0a9118076b33d4413e34c58279b9b90d33f4efddff4f84069922f6a7efec4f8' + '1e61e37e1f7a2ab3e80db34d98adce409b7cdfb87340d13fd021aa97d0a0ea10' + '2154a458bdc8349e92ffe3416e100f787b3aeb25449b403ac020754c715bbe96' + '1792869cfcc6d60e5a23b13fd46f52459e02de82c641cb5c81ebcfa11616a28e' + '31495362de653e99359306c3283686339d2d16f03a68b43631cc16832c582297' + '393a751e0a955049fa6fcbd45151c5e97bee0a1c0e465d6c33eea2fb1310b4af' + '26fe798cf62804d02492094875308115d9f3768d570442b8a4ef03ee27941707' + 'b5a00d9da7c44a1b28d0ae9cd0933d0f52653798a1a837aa725524342017205c' + 'd8c1a86a04ad2d1797d9d25b59261107d7a21090b53ee37c3bdc72d132c7d5d1' + '87f66e5426d9fe20a6ace9b2ef0e432b0dc5a6869e50192a07dc2e9c16433a86' + 'c9d2dc586608c18edb9f595d51310e594abeb87b3434ace8f4007c11b24f813f' + '84497e6d50bd8675d97274ee907eb356dbaae679e7ec77e76f64a74abf195615' + 'e9a7620ef55f25a977d81f1b38c85ab9240c1c5c8bd5230473fb91c736ac4661' + '7f857123db502e9b23c1945b91b8f35c63f6d2d8c42e2a722ddf78716d0330be' + 'ccc785c921310f5002e439060c879cb793a62496d7728afcb24fb18b505e09ab' + '3ed699efd2406dd669a700b9fb8586caa44fa6c206c7f9ceb3aba095bb1feade' + 'f56e7b3294c018985aaff327ad0bb01978a3a5d69f626815ff4b7232bd556e52' + 'b6e68bd82748296e8dc8fee29cd30ec2b4c552807717b148f58112b8f42ff10f' + '811299bca7af708ff0fd8b1fdb424b2dd456133e2ccb441e1c1b64778435d05d' + '0134d1099488e26259db43136cfd5a57c87c167537dce271220e5c1abea080a5' + '8fda3a8c098412f8af4e09f4c925ad6479f709014215eee7b314f25048f7cb5e' + 'b2676f4762aca6860f6de6b693bf1052d4e4b39f49fd8de9edd078f3c9021d38' + '2bc7dcb3204c78f2df1a2d383f2ec6688b6671b4a03772bee8f6a564ac17570d' + 'fe0bc26e8633239cea2cd9eda342aadbc4bd5722bc43258c05c8a37a0df8fc27' + '54e74c08dfaaa74d9b5e7a1cd3a126f0492214f51a7a91b63f62c8a1ce0b6d2e' + 'adf488d166961d636fa66d9b93e3ec7c12b688c30414105c8b9b2327735b138f' + '8cdcfa195e10799f70c38e8607b94259f792225cd3ced7e31f13d6c159928584' + 'd98c085b9d4cb3dc5a8d041274282b7f62197384a3302cf81d2fa00ee6ea0950' + '0bae3eba3556e4ff7b43409413709b0f4ebd1d01b5b77090cfdee1a623af6493' + 'f3b54b5b550f3af812f4ed5761ee06546ca2a7ae8de78eae28c428d481f608a6' + 'b4183edd909ee9ab21ff7d86d8076287cb7ead28b6223a8c4d5c2b472c093529' + 'cc0e6810d35f0790173278d4e4edf28446f3f9fcdb08f67f9158f0be5c62b40d' + '6962e2487cfd17ea56a99609b3326137a0ca9cb9d2ffe4149953da96a0f92790' + 'a78627e5429685035a910bded9927ac666293a9f5be3ac3546e8147dcfd6ed33' + '52920c7115562ac76bba8accfd46e8c1407c2e56ebdbed14709a5be138febaef' + '589af966aec648adab9e847c03d48047454d232987e64de93dd91d637306af77' + 'e5554b33128f2e859df0494da1903667e9d19021c2a5fd8b7cf072e965d97bee' + 'ddb7aa2e617fe3b9a38ee420687359fb841095eb7bcf9bfc8cde5cd1432bb72f' + 'f11779027b111d123cc913885cec1fc2ef52c9abc3f875cdca7387ab25720f1b' + '59af1095b5655efec7cf50c010b50515561642475b74bc3bc1b2a755b426644e' + 'f7461c5d9d569814eec3cbac5dc5a336fb20d1b71bd3860c5cc27b28a7192c25' + '4a8e57ffa76d62d9140406a2b3387773179f3eb3a20a58db6e8aef931255322c' + '31465a5bc37f162366792b53f9c68723661270a6d65ac132fc5c1e579e2d6878' + 'e6501ae503547f1b3337c6f3099b8eeda25af430ac907fde86fd0b2131afe3b3' + 'be920ebc6947cc7e21f60c91dce5b3a4a59a014bf118bdbd9b0dcae9811802be' + '0025307cd07430344e8cfa1dddbfd799fccaa833cfda263a749d3bed500038fc' + 'a270da6640c472efae0c86bb7fd3262625aca2a55517ca0fe2a951533bebd5a0' + 'bf2e597f564ddc592fcd8a281df7022c26904a703da030f421705ef484a78a7d' + 'e38343393bd9bf7a72a54dc14b4065b17f30d03571400e2d0ca86bdd883040f0' + 'b816cfd2af5606fe8f4dd5a6068cee18bf5e59ae915c4cdad0bf215652ca03e0' + '213eacb5e6665f6055c66e3bcc3ce3035b37e3d654336c1c0f25b333aa332f8f' + 'b76a466c65907b469f30e731f18210de04553a250eb7dafb0a69fbf7cf562642' + '5b1c881e4698631510214b79b96a1c086bd4dc2990cc21b91bf010c36fd49028' + '604b170401995d4e22d673e49b34b12b55733babcbd5f88ba7b3cc94c55b9a8d' + '619195b5db09ca724bb1bccfbb0d9dc93af71c90324a726a7a652e74a58c7e6c' + 'cfe95c0dc6f72b60bfc4b20d2033df29876934145dfb3c5654ace9cf50e6e6c9' + '0ec0ac8bcbda3f14e369352c9953e2896184c562791d053bf378b6ddafc3edd9' + 'f9376a82889bc514b517da4c9f175f729e416b6fb5bc320f9902d382219593b6' + '146955d4ad5b0c83721920b6ba88579e04b03b16924231e3aa6cee7dd4ea3b07' + '0ded4269a5693b4892fad3d97317557f5ca8e9365f5bb6437eb0265bbfc5c148' + '149e2311c226d565394f50560266dc398d9db1b241a3c9dab18115f44fd5d97c' + '63cc9f97610c1b45005d9808fd9be72a50a2f637ede2a9c0241fa3749ae29d10' + 'e6a248f85220110ffa7ddf98aa3912ffa02226f331da3445f3232e53b1c9364e' + '84981d45ae129d593e76e07f6723a0ccd1faaa6412ae238dc8d72636b98b5f19' + 'f4f9383f4da59bd4f51d5e9ae515bb1a4f5b2b94e07715de48362eb0d8b2dbe1' + '204531d10461451457f5dfaf65af308a8e2748f3d1904086186d6cde45826132' + '6c2ee73dac4f3c98bc7e9fc147042d30f9ab2fd9337d38ac2fc79b8960215f4a' + '6101368f3c103928685c1036553f438c85d1d213155d14d4668c89df871ff2a6' + '103338e750ec523a594d4a3ce2be9714735699684d650683ed124b6d7309a98e' + '6b36bb875748287a61707bcb86dec67c5644ce807155ac0c3e151b33c28404fc' + '032193dafd72a88bb24da9fda03baf78be8450ad756febc178566a54237a8596' + '6b98b84a9fd9c71b4a9fee6601af41d27206155a3fbd7466b42ce52da2f5b63f' + '9ab5206f2a5eac22711de0960493447e7154f000cab9cc9722e24c5661ff0009' + 'a7049c69c4b0774e64e785b08d48b95ad5efb57a52bae4c2749e832dc4e9e004' + '2267c8e135fae0b3730b5779088fccbda324507a3413ffa8ac0e64f9ea4e5bc2' + '347830b787c1421be60060afcdbb1a266692013749e9626e8e7b25b8c06094eb' + 'ae1436987fca13801dc65ac1f0a03a8a4cbb684f625ec6f0ccb56e7cfb482a21' + '07baf5fe0a1fbf65f123de722635b51d8e9306287fa99ca6aea16853fa184663' + '378ae3dcdce2fdb8f598548c83b0ca39d02dac8f3c7128c455c770cf718bc6bc' + '0d131c6dc8689786a8c1c824e844e836e509fb9b0e4c8057fcb2fcb225e417bc') diff --git a/mingw-w64-python3.9/README.md b/mingw-w64-python3.9/README.md new file mode 100644 index 0000000000000..858c558d9c274 --- /dev/null +++ b/mingw-w64-python3.9/README.md @@ -0,0 +1,4 @@ +The patches for this package are auto generated and managed in git: +https://github.com/msys2-contrib/cpython-mingw + +Run `./update-patches.sh` to re-create the patches. diff --git a/mingw-w64-python3.9/update-patches.sh b/mingw-w64-python3.9/update-patches.sh new file mode 100644 index 0000000000000..89a246320c860 --- /dev/null +++ b/mingw-w64-python3.9/update-patches.sh @@ -0,0 +1,75 @@ +#!/bin/bash + +set -e + +die () { + echo "$*" >&2 + exit 1 +} + +cd "$(dirname "$0")" || +die "Could not cd to mingw-w64-python3.9/" + +git rev-parse --verify HEAD >/dev/null && +git update-index -q --ignore-submodules --refresh && +git diff-files --quiet --ignore-submodules && +git diff-index --cached --quiet --ignore-submodules HEAD -- || +die "Clean worktree required" + +git rm 0*.patch || +die "Could not remove previous patches" + +source PKGBUILD || die "Can't source PKGBUILD" + +base_tag=refs/tags/v$pkgver +msys2_branch=mingw-$_pybasever +url=https://github.com/msys2-contrib/cpython-mingw +upstream_url=https://github.com/python/cpython + +test -d cpython || +git clone --bare $url cpython --depth=1000 --branch=$msys2_branch || +die "Could not clone cpython" + +git -C cpython fetch --no-tags $url $msys2_branch:$msys2_branch --depth=1000 +git -C cpython fetch --no-tags $upstream_url $base_tag:$base_tag --depth=1000 + +git -c core.abbrev=7 \ + -c diff.renames=true \ + -c format.from=false \ + -c format.numbered=auto \ + -c format.useAutoBase=false \ + -C cpython \ + format-patch \ + --topo-order \ + --diff-algorithm=default \ + --no-attach \ + --no-add-header \ + --no-cover-letter \ + --no-thread \ + --suffix=.patch \ + --subject-prefix=PATCH \ + --output-directory .. \ + $base_tag..$msys2_branch || +die "Could not generate new patch set" + +patches="$(ls -1 0*.patch)" && +for p in $patches +do + sed -i 's/^\(Subject: \[PATCH [0-9]*\/\)[1-9][0-9]*/\1N/' $p || + die "Could not fix Subject: line in $p" +done && +git add $patches || +die "Could not stage new patch set" + +in_sources="$(echo "$patches" | sed "{s/^/ /;:1;N;s/\\n/\\\\n /;b1}")" +in_prepare="$(echo "$patches" | tr '\n' '\\' | sed -e 's/\\$//' -e 's/\\/ &&&n /g')" +sed -i -e "/^ 0.*\.patch$/{:1;N;/[^)]$/b1;s|.*|$in_sources)|}" \ + -e "/^ *apply_patch_with_msg /{:2;N;/[^}]$/b2;s|.*| apply_patch_with_msg $in_prepare\\n\\ \n autoreconf -vfi\n}|}" \ + PKGBUILD || +die "Could not update the patch set in PKGBUILD" + +updpkgsums || +die "Could not update the patch set checksums in PKGBUILD" + +git add PKGBUILD || +die "Could not stage updates in PKGBUILD" From bcad2500cded7bee3cb97c06a9f5f3fdf03cead0 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Fri, 18 Jun 2021 11:16:19 +0530 Subject: [PATCH 2/2] bump pkgrel --- mingw-w64-python3.9/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-python3.9/PKGBUILD b/mingw-w64-python3.9/PKGBUILD index a8d8330df47a7..36d7f3e5e868d 100644 --- a/mingw-w64-python3.9/PKGBUILD +++ b/mingw-w64-python3.9/PKGBUILD @@ -29,7 +29,7 @@ else pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}${_pybasever}") fi pkgver=${_pybasever}.5 -pkgrel=4 +pkgrel=5 pkgdesc="A high-level scripting language (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64')