# Maintainer: Alexey Pavlov <alexpux@gmail.com>
# Maintainer: Ray Donnelly <mingw.android@gmail.com>
# Maintainer: Naveen M K <naveen521kk@gmail.com>
# Contributor: Saul Ibarra Corretge <saghul@gmail.com>
# Contributor: Frode Solheim <frode@fs-uae.net>

_primary_python="no"
_pybasever=3.13
_realname=python

if [[ "${_primary_python}" == "yes" ]]; then
  pkgbase="mingw-w64-${_realname}"
  pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
  provides=("${MINGW_PACKAGE_PREFIX}-python3"
            "${MINGW_PACKAGE_PREFIX}-python${_pybasever}")
  conflicts=("${MINGW_PACKAGE_PREFIX}-python3"
             "${MINGW_PACKAGE_PREFIX}-python${_pybasever}"
            "${MINGW_PACKAGE_PREFIX}-python2<2.7.16-7")
  replaces=("${MINGW_PACKAGE_PREFIX}-python3"
            "${MINGW_PACKAGE_PREFIX}-python${_pybasever}")
else
  pkgbase="mingw-w64-${_realname}${_pybasever}"
  pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}${_pybasever}")
fi
pkgver=${_pybasever}.7
pkgrel=4
pkgdesc="A high-level scripting language (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
license=('spdx:PSF-2.0')
url="https://www.python.org/"
msys2_repository_url="https://github.com/python/cpython"
msys2_references=(
  "cpe: cpe:/a:python:python"
  "cpe: cpe:/a:python_software_foundation:python"
)
depends=("${MINGW_PACKAGE_PREFIX}-cc-libs"
         "${MINGW_PACKAGE_PREFIX}-expat"
         "${MINGW_PACKAGE_PREFIX}-bzip2"
         "${MINGW_PACKAGE_PREFIX}-libffi"
         "${MINGW_PACKAGE_PREFIX}-mpdecimal"
         "${MINGW_PACKAGE_PREFIX}-ncurses"
         "${MINGW_PACKAGE_PREFIX}-openssl"
         "${MINGW_PACKAGE_PREFIX}-sqlite3"
         "${MINGW_PACKAGE_PREFIX}-tcl"
         "${MINGW_PACKAGE_PREFIX}-tk"
         "${MINGW_PACKAGE_PREFIX}-zlib"
         "${MINGW_PACKAGE_PREFIX}-zlib"
         "${MINGW_PACKAGE_PREFIX}-libb2"
         "${MINGW_PACKAGE_PREFIX}-xz"
         "${MINGW_PACKAGE_PREFIX}-tzdata")
makedepends=(
  "${MINGW_PACKAGE_PREFIX}-cc"
  "${MINGW_PACKAGE_PREFIX}-autotools"
  "autoconf-archive"
)
#options=('debug' '!strip')
source=("https://www.python.org/ftp/python/${pkgver%rc?}/Python-${pkgver}.tar.xz"
        "EXTERNALLY-MANAGED"
        0001-sysconfig-make-_sysconfigdata.py-relocatable.patch
        0002-build-add-with-nt-threads-and-make-it-default-on-min.patch
        0003-Define-MS_WINDOWS-and-others-when-compiling-with-MIN.patch
        0004-configure-add-MACHDEP-and-platform-on-MINGW.patch
        0005-Add-default-configuration-for-MINGW.patch
        0006-configure-enable-largefile-support-by-default-for-Mi.patch
        0007-Add-PC-to-CPPFLAGS-and-to-SRCDIRS-on-Mingw.patch
        0008-posixmodule.c-Define-necessary-headers-for-compiling.patch
        0009-Build-winreg-by-default-when-compiling-for-MINGW.patch
        0010-exports.h-Add-support-for-MINGW.patch
        0011-configure-add-options-so-that-shared-build-is-possib.patch
        0012-Add-dynamic-loading-support-for-MINGW.patch
        0013-Ignore-main-program-for-frozen-scripts-on-MINGW.patch
        0014-Detect-winsock2-and-setup-_socket-module-on-MINGW.patch
        0015-Enable-some-windows-specific-modules.patch
        0016-sysconfig-MINGW-build-extensions-with-GCC.patch
        0017-sysconfig-treat-MINGW-builds-as-POSIX-builds.patch
        0018-Add-support-for-stdcall-without-underscore.patch
        0019-Customize-site-for-MINGW.patch
        0020-add-python-config-sh.patch
        0021-mingw-prefer-unix-sep-if-MSYSTEM-environment-variabl.patch
        0022-msys-cygwin-semi-native-build-sysconfig.patch
        0023-sysconfig-mingw-sysconfig-like-posix.patch
        0024-mingw-use-backslashes-in-compileall-py.patch
        0025-mingw-pdcurses_ISPAD.patch
        0026-remove_path_max.default.patch
        0027-dont-link-with-gettext.patch
        0028-ctypes-python-dll.patch
        0029-gdbm-module-includes.patch
        0030-use-gnu_printf-in-format.patch
        0031-mingw-fix-ssl-dont-use-enum_certificates.patch
        0032-fix-using-dllhandle-and-winver-mingw.patch
        0033-Add-AMD64-to-sys-config-so-msvccompiler-get_build_ve.patch
        0034-MINGW-link-with-additional-library.patch
        0035-install-msilib.patch
        0036-fix-signal-module-build.patch
        0037-build-build-winconsoleio-and-_testconsole.patch
        0038-expose-sem_unlink.patch
        0039-Use-cygpty-while-using-isatty.patch
        0040-build-link-win-resource-files-and-build-pythonw.patch
        0041-fix-isselectable.patch
        0042-configure.ac-fix-inet_pton-check.patch
        0043-pass-gen-profile-ldflags.patch
        0044-pkg-config-windows-must-link-ext-with-python-lib.patch
        0045-importlib-bootstrap-path-sep.patch
        0046-warnings-fixes.patch
        0047-fix-build-testinternalcapi.patch
        0048-clang-arm64.patch
        0049-configure.ac-set-MINGW-stack-reserve.patch
        0050-Don-t-use-os.pathsep-to-find-EOF-not-all-distributio.patch
        0051-Fix-extension-suffix-for-c-extensions-on-mingw.patch
        0052-Change-the-get_platform-method-in-sysconfig.patch
        0053-tests-fix-test_bytes.patch
        0054-time-fix-strftime-not-raising-for-invalid-year-value.patch
        0055-ctypes-find_library-c-should-return-None-with-ucrt.patch
        0056-build-Disable-checks-for-dlopen-dlfcn.patch
        0057-Fix-install-location-of-the-import-library.patch
        0058-build-Integrate-venvlauncher-build-installation-into.patch
        0059-configure.ac-set-_WIN32_WINNT-version.patch
        0060-configure.ac-don-t-check-for-clock_-functions.patch
        0061-expanduser-normpath-paths-coming-from-env-vars.patch
        0062-CI-test-the-build-and-add-some-mingw-specific-tests.patch
        0063-Define-PY3_DLLNAME-to-fix-build.patch
        0064-_testconsole.c-Fix-casing-path-sep.patch
        0065-Return-consistent-architecture-markers-for-python-on.patch
        0066-mingw_smoketests-fix-_UCRT-condition.patch
        0067-Modify-sys.winver-to-match-upstream.patch
        0068-Change-user-site-packages-path-to-include-the-enviro.patch
        0069-configure-Include-a-header-in-the-check-for-_beginth.patch
        0070-configure.ac-Default-to-without-c-locale-coercion-on.patch
        0071-Fix-failing-tests.patch
        0072-Don-t-change-os.sep-with-an-empty-MSYSTEM-env-var-no.patch
        0073-def-VPATH-when-compiling-Python-sysmodule.c.patch
        0074-Make-_Py_CheckPython3-extern.patch
        0075-link-with-bcrypt.patch
        0076-correctly-find-native-python.patch
        0077-Add-extra-flags-for-_bootstrap_python.patch
        0078-posixmodule-undefine-HAVE_OPENDIR.patch
        0079-getpath.py-add-support-for-mingw.patch
        0080-Don-t-build-_posixsubprocess-on-Windows.patch
        0081-_ssl-link-with-ws2_32.patch
        0082-Always-normalize-path-in-abspath.patch
        0083-Include-winsock.h-when-checking-for-netdb-function.patch
        0084-include-_multiprocessing-semaphore.c-on-win32.patch
        0085-configure-build-mmap-module-on-win32.patch
        0086-venv-creation-fixes.patch
        0087-move-the-shutdown-function-where-winsock.h-is-includ.patch
        0088-configure.ac-set-BUILDEXEEXT-and-EXEEXT.patch
        0089-configure.ac-fix-building-some-test-modules.patch
        0090-Don-t-convert-sysconfig.get_config_var-VPATH-to-an-a.patch
        0091-Always-convert-to-before-passing-though-pathcch-func.patch
        0092-Build-venvlauncher.exe-from-PC-launcher.c.patch
        0093-getpath.py-fix-dirname.patch
        0094-getpath-use-normpath-on-all-generated-paths.patch
        0095-pathconfig-normpath-sys.path-0.patch
        0096-smoketests-add-some-tests-for-sys-site-paths.patch
        0097-Search-DLLs-only-on-paths-added-using-add_dll_direct.patch
        0098-Build-and-install-libpython3.dll.patch
        0099-Port-GetPythonImport-to-mingw.patch
        0100-LoadLibraryExW-make-sure-to-only-use-backslashes-for.patch
        0101-mingw_smoketests-add-a-test-to-check-if-sysconfig-re.patch
        0102-Add-missing-library-for-multiprocessing-module.patch
        0103-selectmodule-add-support-for-MINGW.patch
        0104-readline-disable-on-MINGW.patch
        0105-Add-libraries-to-fix-compile-of-ctypes-on-MINGW.patch
        0106-Enable-_uuid-on-MINGW.patch
        0107-Enable-curses-library-on-MINGW.patch
        0108-mingw_smoketests-disable-distutils-related-tests.patch
        0109-configure.ac-use-autoconf-2.69.patch
        0110-CI-clean-up-ignored-tests.patch
        0111-gcc-make-incompatible-pointer-types-as-warning.patch
        0112-test_makefile-normalize-path.patch
        0113-sysconfig.get_platform-use-consistent-naming.patch
        0114-Add-ucrt-to-version-string.patch
        0115-socketmodule-fix-captilization-of-headers.patch
        0116-mingw_smoketests-build-extension-in-a-venv.patch
        0117-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch
        0118-Remove-_POSIX_BUILD-variable.patch
        0119-Add-MINGW-to-version-string.patch
        0120-There-are-no-more-MSI-module.patch
        0121-Disable-__try-__except-for-MINGW.patch
        0122-Add-missing-function-declaration-for-smoke-testing.patch
        0123-Try-fix-venv-setup.patch
        0124-Declare-timeval-for-MINGW.patch
        0125-Fix-format-warning.patch
        0126-Fix-DEBUG-build.-Add-_d-suffix-for-lib-and-modules-e.patch
        0127-Add-ABIFLAGS-to-targets-when-needed-required-for-DEB.patch
        0128-sysconfig-Revert-changes-to-NT-schemes.-Mingw-use-Po.patch
        0129-Fix-python-names-in-smoketests.patch
        0130-Launcher-Skip-find-python-in-Registry-for-mingw-buil.patch
        0131-Fix-pragma-warnings.patch
        0132-ssl-module-Build-with-windows-cert-store-support.-Re.patch
        0133-Fix-variable-size-warning.patch
        0134-Mimic-MSVC-for-timezone-optimized-memcpy-for-hash-ma.patch
        0135-Fix-windows-cert-store-import-in-pythonfiles.patch
        0136-Fix-module-name.patch
        0137-Smoketests-Try-fix-build-extension.patch
        0138-Try-fix-LDFLAGS-passing-via-environment.patch
        0139-Fix-test-for-library-name.patch
        0140-GCC-macro-only-available-for-C-code.patch
        0141-sysconfig-Fix-test-for-mingw.patch
        0142-Makefile-Remove-duplicate-object-from-link.patch
        0143-Fix-compile-warnings.patch
        0144-Try-fix-SOABI-for-mingw-to-match-C-sources.patch
        0145-winreg-Cleanup-build-module.patch
        0146-smoketests-Adjust-SOABI-change.patch
        0147-Fix-timeval-declaration.patch
        0148-dictobject-Calculate-as-MSVC.patch
        0149-Fix-export-Py_GetBuildInfo-symbol.patch
        0150-Allow-profile-tests-failure.patch
        0151-ntpath-Try-fix-concatenate-UNC-paths.patch
        0152-Revert-fix-warning-for-semaphore.patch
        0153-Try-fix-build-C-modules.-Add-WMI-module.-Fix-SOABI-g.patch
        0154-Fix-format-identifier.patch
        0155-Try-fix-building-C-modules-for-Python.-Fixes-for-WMI.patch
        0156-Pass-profile-LDFLAGS-for-C-modules.patch
        0157-Fix-WMI-module-naming.patch
        0158-Install-venv-launchers-with-its-names.patch
        0159-Cleanup-USE_WIN32_MODULE-in-configure.patch
        0160-Update-iscygpty-from-upstream.-Cleanup-changes.patch
        0161-Fix-include-naming-for-cross-build.patch
        0162-Fix-exports-for-_suggestions-module.patch
        0163-sys-module-Implement-flags-is_mingw-and-use_alt_sep.patch
        0164-ntpath-Resolve-cyclic-dependency-with-os-module.patch
        0165-Fix-warning-in-soamphore-module.patch
        0166-smoketests-Use-new-flag-use_alt_sep.patch
        0167-_boostrap_external-Use-new-flag-use_alt_sep.patch
        0168-compileall-Normalize-paths.patch
        0169-Fix-fail-tests.patch
        0170-Revert-fix-warnings-for-semaphore.patch
        0171-Add-more-broken-tests.patch
        0172-Add-flag-for-64-bit-time-in-configure-script.patch
        0173-Try-fix-64-bit-time-support-for-32-bit-build-again.patch
        0174-Do-ne-sys-module-flags-underscored.patch
        0175-Fix-new-variable-name-using.patch
        0176-Add-test-that-fail-time-to-time.patch
        0177-Work-around-broken-pc-file.patch
        0178-restore-versioned-launchers-in-venv-cleanup.patch
        0179-tests-try-to-skip-differently.patch
        0180-soabi-fixes.patch
        0181-smoketests-add-test-for-soabi-fix.patch
        0182-install-versioned-pythonw.patch)

# Helper macros to help make tasks easier #
apply_patch_with_msg() {
  for _patch in "$@"
  do
    msg2 "Applying ${_patch}"
    patch -Nbp1 -i "${srcdir}/${_patch}"
  done
}

prepare() {
  cd "${srcdir}/Python-${pkgver}"

 apply_patch_with_msg 0001-sysconfig-make-_sysconfigdata.py-relocatable.patch \
  0002-build-add-with-nt-threads-and-make-it-default-on-min.patch \
  0003-Define-MS_WINDOWS-and-others-when-compiling-with-MIN.patch \
  0004-configure-add-MACHDEP-and-platform-on-MINGW.patch \
  0005-Add-default-configuration-for-MINGW.patch \
  0006-configure-enable-largefile-support-by-default-for-Mi.patch \
  0007-Add-PC-to-CPPFLAGS-and-to-SRCDIRS-on-Mingw.patch \
  0008-posixmodule.c-Define-necessary-headers-for-compiling.patch \
  0009-Build-winreg-by-default-when-compiling-for-MINGW.patch \
  0010-exports.h-Add-support-for-MINGW.patch \
  0011-configure-add-options-so-that-shared-build-is-possib.patch \
  0012-Add-dynamic-loading-support-for-MINGW.patch \
  0013-Ignore-main-program-for-frozen-scripts-on-MINGW.patch \
  0014-Detect-winsock2-and-setup-_socket-module-on-MINGW.patch \
  0015-Enable-some-windows-specific-modules.patch \
  0016-sysconfig-MINGW-build-extensions-with-GCC.patch \
  0017-sysconfig-treat-MINGW-builds-as-POSIX-builds.patch \
  0018-Add-support-for-stdcall-without-underscore.patch \
  0019-Customize-site-for-MINGW.patch \
  0020-add-python-config-sh.patch \
  0021-mingw-prefer-unix-sep-if-MSYSTEM-environment-variabl.patch \
  0022-msys-cygwin-semi-native-build-sysconfig.patch \
  0023-sysconfig-mingw-sysconfig-like-posix.patch \
  0024-mingw-use-backslashes-in-compileall-py.patch \
  0025-mingw-pdcurses_ISPAD.patch \
  0026-remove_path_max.default.patch \
  0027-dont-link-with-gettext.patch \
  0028-ctypes-python-dll.patch \
  0029-gdbm-module-includes.patch \
  0030-use-gnu_printf-in-format.patch \
  0031-mingw-fix-ssl-dont-use-enum_certificates.patch \
  0032-fix-using-dllhandle-and-winver-mingw.patch \
  0033-Add-AMD64-to-sys-config-so-msvccompiler-get_build_ve.patch \
  0034-MINGW-link-with-additional-library.patch \
  0035-install-msilib.patch \
  0036-fix-signal-module-build.patch \
  0037-build-build-winconsoleio-and-_testconsole.patch \
  0038-expose-sem_unlink.patch \
  0039-Use-cygpty-while-using-isatty.patch \
  0040-build-link-win-resource-files-and-build-pythonw.patch \
  0041-fix-isselectable.patch \
  0042-configure.ac-fix-inet_pton-check.patch \
  0043-pass-gen-profile-ldflags.patch \
  0044-pkg-config-windows-must-link-ext-with-python-lib.patch \
  0045-importlib-bootstrap-path-sep.patch \
  0046-warnings-fixes.patch \
  0047-fix-build-testinternalcapi.patch \
  0048-clang-arm64.patch \
  0049-configure.ac-set-MINGW-stack-reserve.patch \
  0050-Don-t-use-os.pathsep-to-find-EOF-not-all-distributio.patch \
  0051-Fix-extension-suffix-for-c-extensions-on-mingw.patch \
  0052-Change-the-get_platform-method-in-sysconfig.patch \
  0053-tests-fix-test_bytes.patch \
  0054-time-fix-strftime-not-raising-for-invalid-year-value.patch \
  0055-ctypes-find_library-c-should-return-None-with-ucrt.patch \
  0056-build-Disable-checks-for-dlopen-dlfcn.patch \
  0057-Fix-install-location-of-the-import-library.patch \
  0058-build-Integrate-venvlauncher-build-installation-into.patch \
  0059-configure.ac-set-_WIN32_WINNT-version.patch \
  0060-configure.ac-don-t-check-for-clock_-functions.patch \
  0061-expanduser-normpath-paths-coming-from-env-vars.patch \
  0062-CI-test-the-build-and-add-some-mingw-specific-tests.patch \
  0063-Define-PY3_DLLNAME-to-fix-build.patch \
  0064-_testconsole.c-Fix-casing-path-sep.patch \
  0065-Return-consistent-architecture-markers-for-python-on.patch \
  0066-mingw_smoketests-fix-_UCRT-condition.patch \
  0067-Modify-sys.winver-to-match-upstream.patch \
  0068-Change-user-site-packages-path-to-include-the-enviro.patch \
  0069-configure-Include-a-header-in-the-check-for-_beginth.patch \
  0070-configure.ac-Default-to-without-c-locale-coercion-on.patch \
  0071-Fix-failing-tests.patch \
  0072-Don-t-change-os.sep-with-an-empty-MSYSTEM-env-var-no.patch \
  0073-def-VPATH-when-compiling-Python-sysmodule.c.patch \
  0074-Make-_Py_CheckPython3-extern.patch \
  0075-link-with-bcrypt.patch \
  0076-correctly-find-native-python.patch \
  0077-Add-extra-flags-for-_bootstrap_python.patch \
  0078-posixmodule-undefine-HAVE_OPENDIR.patch \
  0079-getpath.py-add-support-for-mingw.patch \
  0080-Don-t-build-_posixsubprocess-on-Windows.patch \
  0081-_ssl-link-with-ws2_32.patch \
  0082-Always-normalize-path-in-abspath.patch \
  0083-Include-winsock.h-when-checking-for-netdb-function.patch \
  0084-include-_multiprocessing-semaphore.c-on-win32.patch \
  0085-configure-build-mmap-module-on-win32.patch \
  0086-venv-creation-fixes.patch \
  0087-move-the-shutdown-function-where-winsock.h-is-includ.patch \
  0088-configure.ac-set-BUILDEXEEXT-and-EXEEXT.patch \
  0089-configure.ac-fix-building-some-test-modules.patch \
  0090-Don-t-convert-sysconfig.get_config_var-VPATH-to-an-a.patch \
  0091-Always-convert-to-before-passing-though-pathcch-func.patch \
  0092-Build-venvlauncher.exe-from-PC-launcher.c.patch \
  0093-getpath.py-fix-dirname.patch \
  0094-getpath-use-normpath-on-all-generated-paths.patch \
  0095-pathconfig-normpath-sys.path-0.patch \
  0096-smoketests-add-some-tests-for-sys-site-paths.patch \
  0097-Search-DLLs-only-on-paths-added-using-add_dll_direct.patch \
  0098-Build-and-install-libpython3.dll.patch \
  0099-Port-GetPythonImport-to-mingw.patch \
  0100-LoadLibraryExW-make-sure-to-only-use-backslashes-for.patch \
  0101-mingw_smoketests-add-a-test-to-check-if-sysconfig-re.patch \
  0102-Add-missing-library-for-multiprocessing-module.patch \
  0103-selectmodule-add-support-for-MINGW.patch \
  0104-readline-disable-on-MINGW.patch \
  0105-Add-libraries-to-fix-compile-of-ctypes-on-MINGW.patch \
  0106-Enable-_uuid-on-MINGW.patch \
  0107-Enable-curses-library-on-MINGW.patch \
  0108-mingw_smoketests-disable-distutils-related-tests.patch \
  0109-configure.ac-use-autoconf-2.69.patch \
  0110-CI-clean-up-ignored-tests.patch \
  0111-gcc-make-incompatible-pointer-types-as-warning.patch \
  0112-test_makefile-normalize-path.patch \
  0113-sysconfig.get_platform-use-consistent-naming.patch \
  0114-Add-ucrt-to-version-string.patch \
  0115-socketmodule-fix-captilization-of-headers.patch \
  0116-mingw_smoketests-build-extension-in-a-venv.patch \
  0117-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch \
  0118-Remove-_POSIX_BUILD-variable.patch \
  0119-Add-MINGW-to-version-string.patch \
  0120-There-are-no-more-MSI-module.patch \
  0121-Disable-__try-__except-for-MINGW.patch \
  0122-Add-missing-function-declaration-for-smoke-testing.patch \
  0123-Try-fix-venv-setup.patch \
  0124-Declare-timeval-for-MINGW.patch \
  0125-Fix-format-warning.patch \
  0126-Fix-DEBUG-build.-Add-_d-suffix-for-lib-and-modules-e.patch \
  0127-Add-ABIFLAGS-to-targets-when-needed-required-for-DEB.patch \
  0128-sysconfig-Revert-changes-to-NT-schemes.-Mingw-use-Po.patch \
  0129-Fix-python-names-in-smoketests.patch \
  0130-Launcher-Skip-find-python-in-Registry-for-mingw-buil.patch \
  0131-Fix-pragma-warnings.patch \
  0132-ssl-module-Build-with-windows-cert-store-support.-Re.patch \
  0133-Fix-variable-size-warning.patch \
  0134-Mimic-MSVC-for-timezone-optimized-memcpy-for-hash-ma.patch \
  0135-Fix-windows-cert-store-import-in-pythonfiles.patch \
  0136-Fix-module-name.patch \
  0137-Smoketests-Try-fix-build-extension.patch \
  0138-Try-fix-LDFLAGS-passing-via-environment.patch \
  0139-Fix-test-for-library-name.patch \
  0140-GCC-macro-only-available-for-C-code.patch \
  0141-sysconfig-Fix-test-for-mingw.patch \
  0142-Makefile-Remove-duplicate-object-from-link.patch \
  0143-Fix-compile-warnings.patch \
  0144-Try-fix-SOABI-for-mingw-to-match-C-sources.patch \
  0145-winreg-Cleanup-build-module.patch \
  0146-smoketests-Adjust-SOABI-change.patch \
  0147-Fix-timeval-declaration.patch \
  0148-dictobject-Calculate-as-MSVC.patch \
  0149-Fix-export-Py_GetBuildInfo-symbol.patch \
  0150-Allow-profile-tests-failure.patch \
  0151-ntpath-Try-fix-concatenate-UNC-paths.patch \
  0152-Revert-fix-warning-for-semaphore.patch \
  0153-Try-fix-build-C-modules.-Add-WMI-module.-Fix-SOABI-g.patch \
  0154-Fix-format-identifier.patch \
  0155-Try-fix-building-C-modules-for-Python.-Fixes-for-WMI.patch \
  0156-Pass-profile-LDFLAGS-for-C-modules.patch \
  0157-Fix-WMI-module-naming.patch \
  0158-Install-venv-launchers-with-its-names.patch \
  0159-Cleanup-USE_WIN32_MODULE-in-configure.patch \
  0160-Update-iscygpty-from-upstream.-Cleanup-changes.patch \
  0161-Fix-include-naming-for-cross-build.patch \
  0162-Fix-exports-for-_suggestions-module.patch \
  0163-sys-module-Implement-flags-is_mingw-and-use_alt_sep.patch \
  0164-ntpath-Resolve-cyclic-dependency-with-os-module.patch \
  0165-Fix-warning-in-soamphore-module.patch \
  0166-smoketests-Use-new-flag-use_alt_sep.patch \
  0167-_boostrap_external-Use-new-flag-use_alt_sep.patch \
  0168-compileall-Normalize-paths.patch \
  0169-Fix-fail-tests.patch \
  0170-Revert-fix-warnings-for-semaphore.patch \
  0171-Add-more-broken-tests.patch \
  0172-Add-flag-for-64-bit-time-in-configure-script.patch \
  0173-Try-fix-64-bit-time-support-for-32-bit-build-again.patch \
  0174-Do-ne-sys-module-flags-underscored.patch \
  0175-Fix-new-variable-name-using.patch \
  0176-Add-test-that-fail-time-to-time.patch \
  0177-Work-around-broken-pc-file.patch \
  0178-restore-versioned-launchers-in-venv-cleanup.patch \
  0179-tests-try-to-skip-differently.patch \
  0180-soabi-fixes.patch \
  0181-smoketests-add-test-for-soabi-fix.patch \
  0182-install-versioned-pythonw.patch
 
  autoreconf -vfi
}

build() {
  declare -a _extra_config
  if check_option "debug" "n"; then
    _extra_config+=("--enable-optimizations")
    # Upstream defaults to -O3, so we can do too
    CFLAGS+=" -O3"
    # FIXME: https://github.com/msys2-contrib/cpython-mingw/issues/10
    if [[ $MINGW_PACKAGE_PREFIX == *-clang-* ]]; then
      _extra_config+=("--with-lto=full")
    fi
  else
    CFLAGS+=" -O0 -ggdb"
    CXXFLAGS+=" -O0 -ggdb"
    _extra_config+=("--with-pydebug")
  fi

  mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}"

  ../Python-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --host=${MINGW_CHOST} \
    --build=${MINGW_CHOST} \
    --enable-shared \
    --with-system-expat \
    --with-system-ffi \
    --with-system-libmpdec \
    --without-ensurepip \
    --enable-loadable-sqlite-extensions \
    --with-tzpath=${MINGW_PREFIX}/share/zoneinfo \
    "${_extra_config[@]}"

  make
}

check() {
  cd "${srcdir}/build-${MSYSTEM}"

  # Some basic tests to ensure nothing major or MSYS2 specific features are broken
  ./python.exe "../Python-${pkgver}/mingw_smoketests.py"
  MSYSTEM= ./python.exe "../Python-${pkgver}/mingw_smoketests.py"
}

package() {
  cd "${srcdir}/build-${MSYSTEM}"

  make -j1 install DESTDIR="${pkgdir}"

  # gdb pretty printers for debugging Python itself; to use:
  # python
  # sys.path.append('C:/msys64/mingw64/share/gdb/python3')
  # import python_gdb
  # reload(python_gdb)
  # end
  if [[ "${_primary_python}" == "yes" ]]; then
    [[ -d "${pkgdir}${MINGW_PREFIX}"/share/gdb/python3/ ]] || mkdir -p "${pkgdir}${MINGW_PREFIX}"/share/gdb/python3/
    cp -f python.exe-gdb.py "${pkgdir}${MINGW_PREFIX}"/share/gdb/python3/python_gdb.py
  fi

  # some useful "stuff"
  install -dm755 "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/Tools/{i18n,scripts}
  install -m755 "${srcdir}/Python-${pkgver}"/Tools/i18n/{msgfmt,pygettext}.py "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/Tools/i18n/
  install -m755 "${srcdir}/Python-${pkgver}"/Tools/scripts/{README,*py} "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/Tools/scripts/

  # License
  install -Dm644 "${srcdir}/Python-${pkgver}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}${_pybasever}/LICENSE"

  # PEP668
  install -Dm644 "${srcdir}/EXTERNALLY-MANAGED" -t "${pkgdir}${MINGW_PREFIX}/lib/python${_pybasever}/"

  # fixup shebangs
  for fscripts in idle3 idle${_pybasever} pydoc3 pydoc${_pybasever}; do
    sed -e '1 { s|^#!.*$|#!/usr/bin/env python'"${_pybasever}"'.exe| }' -i "${pkgdir}${MINGW_PREFIX}"/bin/${fscripts}
  done

  # default aliases for all scripts/binaries
  if [[ "${_primary_python}" == "yes" ]]; then
    # Default names are aliases for Python now
    cp "${pkgdir}${MINGW_PREFIX}"/bin/python3.exe "${pkgdir}${MINGW_PREFIX}"/bin/python.exe
    cp "${pkgdir}${MINGW_PREFIX}"/bin/python3w.exe "${pkgdir}${MINGW_PREFIX}"/bin/pythonw.exe
    cp "${pkgdir}${MINGW_PREFIX}"/bin/python3-config "${pkgdir}${MINGW_PREFIX}"/bin/python-config
    cp "${pkgdir}${MINGW_PREFIX}"/bin/idle3 "${pkgdir}${MINGW_PREFIX}"/bin/idle
    cp "${pkgdir}${MINGW_PREFIX}"/bin/pydoc3 "${pkgdir}${MINGW_PREFIX}"/bin/pydoc
  fi

  # delete anything that could conflict with the primary Python
  if [[ "${_primary_python}" != "yes" ]]; then
    rm "${pkgdir}${MINGW_PREFIX}"/bin/python3.exe
    rm "${pkgdir}${MINGW_PREFIX}"/bin/python3w.exe
    rm "${pkgdir}${MINGW_PREFIX}"/bin/python3-config
    rm "${pkgdir}${MINGW_PREFIX}"/bin/idle3
    rm "${pkgdir}${MINGW_PREFIX}"/bin/pydoc3
    rm "${pkgdir}${MINGW_PREFIX}"/bin/libpython3.dll
    rm "${pkgdir}${MINGW_PREFIX}"/lib/libpython3.dll.a
    rm "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig/python3-embed.pc
    rm "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig/python3.pc
    rm "${pkgdir}${MINGW_PREFIX}"/share/man/man1/python3.1
  fi
}

sha256sums=('5462f9099dfd30e238def83c71d91897d8caa5ff6ebc7a50f14d4802cdaaa79a'
            '3981fed74ee7d43ad69bd67e634e03d7bf6890558a87062380112e195688728a'
            '4926117e21efbd4e18ba836f38fbbf4448363fd158ce734d269a4e5b891862ad'
            '3c3fb9a9ebb78883042bc9aa6dc11b9d30c57b47632d57fb81c119017f26c68a'
            'dd3e8436f6f0b111eddc4b699b42f9de25f591bc7c8bcd36e4ad530d13332f68'
            '9aed04337b55fd090515917c0885b355b3c0b1ff321840468dbd3993eb905c85'
            '9ea582239d02429eb636427d52380d40b03d0fdcf914dcce32d8a7a395a8596b'
            'a152e21f21fd774728c021bf1f7a49d4e69490b9a365cdda0552d408efb27765'
            '2c2b51af750dd234281d3a05e0a65aa9fe66bd67b4a0a911fee8525c54196e26'
            'a60a73c210474a5a039834fcaa7d10cb35f5fe83642fc97927e06ea347fcde16'
            'bae5ed0c99f727072052789f95cae215e601de382395a21cd75ad87aa13c250f'
            'c30d447f57bf6da831b7d07d9b3cf6cc74526ebe47396b847f1684a8a1b8e81b'
            '060b5dab4e5be1c3851adf16c84734c3ff286519182dd0ca5ea5a883a96baea7'
            '4fcc3d00dc0798752377f7d91420244003d65e3da47506e872e3769802723292'
            '688dc7e3454744d234262c5432ac846845319bfc97ddad84c9cb9ee2506068ea'
            'b715fde3f255abfb951763f9c91b47329e9c123195580fc4666f56a42d266a52'
            'dcfa229b80969419e047f68cf01cda158658d546040734dd2a4698f0190f8051'
            '03c2dbdc8c51e98a3a3c706c92c89092dc9d8dd94cd53561f30a6520e2f6eee0'
            'fbe3c28b7cd87a9e31d7122734a5958d06e72560d4723b1b48e79a78fdba0e73'
            '02494d9672be2a9e48540a1095868bdf134be794d6087b2c9cee01942619a570'
            '6beb04ba39346c30b7295fce41d5b81402525e10b77fc1fe41463571336d69fa'
            'c5b4493e8ef5ff3cee0cde78885006b2c4124e19f96fc83d62f3f542ee063f4e'
            'f19675a801d36a2cab7899ec79553f67f1769231ad54b6e78e2352aa91bbf4f3'
            '7b6983bea8a510f2124549219cb019c9df65fd914521262d4b8dd466027c2f40'
            '5f88be8c5c5d13f1d29e2e396257273730f4f87d01c00aab3972bf06bccf5206'
            '2507e621a9c41fdfd284e7846b8abb78eec8a989a6858f8253c50cc91ef551f3'
            '3917baa5f86472e9ed652da007fcc748235228938d499885a0df47a213bd2e0e'
            '83cc5a52ab1c483d95b4baf271c8776fe9c10dfdcfbc1a9ced3111c350e59898'
            '45897aea36307e0492ce7a16531eb215291f31b907da444ab437d48fa10c9f7c'
            '2c313949952bf3858957734c739e1a3f28c0460434cd1dce1cacb8b32dad865c'
            '16e3ad8c8ce6f84c8d5a11c46a88ad7e6865b347978d0a155cc52c89466c5fbb'
            '9501ffea04c3e3aaab6e0b0eaf9a93947a536c2709466ee4ed15c15e6a652e6d'
            '1772e043c55d5526ff926f18e532eeec71866a60f59e4ba9e1cf0d3efbf00d92'
            '0c6df4aea76c636a792f5bdec0d18c56f61ab2c60d910291ca19d37e8d27d6f2'
            '97d8c8cc796b1f3a35b55da6dedd5c70ee024200e3dd098ab41e7cf0f6563e13'
            '00f78dbeda17d33d04853dc0d3e8b187ba3e8f1d24df3c69ce88a751c9236b51'
            '50018c31d0404b10eb2e9800562a2ccbb2b1eadbfe7f99eff2db27194bf65487'
            'a3d89a433807a00fe97569a71e64379274656999e0770d09b3b0807d5e3c1ad8'
            '020af3c836da56a903e3026c126ca09f0ffb013f6a66c77e9e9f0c0f51d41d80'
            '008be5836f5a9ad4530819e510319464989f306207768cae52fbbc27274d3a40'
            'bc4dcc8f2b388d4b17e16bf875f42383a142a08ff898e9e0f36708648031bcd6'
            '0e7def51f146f5c4c23429d12ab30586816ff773582f440f86c4929e74d204b5'
            '36b58b24380eedfa894b4fcd1a189c8b94a7e6a87a877fc41df8f617c35deff8'
            '2ca747fd0a05c70a33e5f8727c1a92bd828f089ce2351aa4eef0ec7b3f09f9f6'
            '8ab4ce66fe787ad7a8708145e561735c9bbe89b5a8bba290e2431a11fc6968fa'
            'd6c357b4bdbcf12bbd2210ac05c88eff2e6c5ad79670ffeb251f627125a8ff4e'
            '9680a8ebae08681cf02919e7ab7d6a6bbf9779a0f821f47771bfe3d4dbca3a12'
            '000ea1c1cb3103952e3345a71d90cae2f8a7f8ccc27a42b36ff29e85c2f504e7'
            'f595fef0d3d99aef226e90b9e2178c217fd6ff96ec3cfd1527d86f4bc3855593'
            'e8dc2eb1e2d1253134b4870afd4803c47231b66ae9d76899d01cdadc9d17a15f'
            '8ff05db0cf1d5ed8faa45a4bc2d67ae66dc1a10c02e8d1cd756b14434af33a08'
            '90c8c2c4cd182f01d9bacbf86006b912402b7249fe9fedd0ddb1cb03c1a722f0'
            '60ab9e7d8a0e11a6551a054c57b22bc1fcedfb5c7749f73b369412c588a7410e'
            '93cf3cd7b5622d9261fdf76b22832b516497b8e2452140baff94e2e30ae7846f'
            '7e71e5bade019c6d528c551d943f8d98e3fe54144ba4d92a1021a7dd81dae76f'
            '233bc6eafc895ae0e79708f0d26e7a802fe44309c0902e7e41c1ba0808398f98'
            '7832e2fde2c0df08d580595ef7a5692f680de528ec9de175af66254c7ac62e38'
            'bec7da2d46f23f655d5b0231a6d53527e4808eb51c53ed41d47a606f393a5776'
            '03c862fba3db9b64b7a2be875e0b592ec5726a45dd630ce6dad95ebd2dd795a8'
            'b85e7d2a2aed7bfb896512a5a956e4316b80e2d6646ec50075a1b96140d5aab2'
            'fd4826cd9fe2a090a51bf23ae8f707ac98201786c42d16f107523c83e81fd604'
            'cf39aa84d49e24272b95809bcf8657de17e51d6971da916e21faa3dd85c1060b'
            '987713aebebaebd3cd527b8b40b37b102c8cdf6bf6bee92705733b85d37714d3'
            '0f2c2d56ba3fd747162ea921b895bb7b12d804666be474590ea90054226bd5f2'
            'b032437de8362ade334cc08ba20397791ba41730e20d49d48a1898edba04f123'
            'b637755ec47404ef2ae613f0e442e193fff7aa6a5b2ba358bc2f04ae4c9293cc'
            '7211ea91785d107710054d96fcd5ce9bd5d98cb5379538480b76ad0a7ef53311'
            '0fdf03bb663fd7dc878d7f95e2255ae65117e7ff7d60915923939ab0e43ce494'
            '80bb8cee00fa7d8281fdd4bac100b88a5f352c3565a1c95d6dd12689f79a9a0a'
            '1f61236028a7c06f45a4a121737d5951c35d02cfe4ddb138c734b6c8415f95b3'
            '477d89b03af3e17f0901a891a9d2184330a0f43e407f9e39e99f67980759a3a1'
            '79e27beb9a379aa87ebe8646011dd190426bb86505d2e3618bf24e181c0de985'
            '8be6a8b70271f4e138347523a69cc0b6df8f5a7b2c703c9ad3234ff112558a4f'
            '4b750f04a8c2bc4c95dc470672dbc519354ce678f3f6388b89186a83c7753b73'
            '6fb22e489f24783e9a957aebfacad2aeb26de270c5be3efd306516746b0f521b'
            'df32738f679852e2e4e8e2e00f9663de22508af4b4792b16b373a6b3b8e98c55'
            '553bfb1f3b48124072e88cf8ef5ab76edd0593e3b29d3a8b868fe5b6a98ec224'
            'cf034d3e022e5bfde3d402edf9972ebeb9c0ad392bdeb41924b01a4006dd2574'
            '9e9ab5e934a80a771fdb853efaaf8cfee372522efa1b259f0410d6dc3c6793fd'
            '047fd7cf1e70d269ab7958d663b32afe6eca97e4f5bce626f813a0608963f1c7'
            '28a41d71f6dd826bc05537dee62ad9601c1e483e8dbe17989e366d920f34675f'
            'bb405ac045ccada3a3ba6be05cda88316c327a9962caed26f3606f6b90bff32a'
            '6aaed73a768b413d74f450da0140fb7f5781c2b463955b3e4147e1dacf826adf'
            '1b8b09a53a37f9330ab0e50f4253693b21fe28fbe4c2c392ca3ec055f300b630'
            'cba9366554475fa6cc387d9b3c4278f161e4797d62935de3f4662fc53456279e'
            '68b4b1def555b32551b5b489730b96bee5bc17eb92374f7046d73aceb9158ff5'
            '1bff7389f55024afe03792c1f90d3417f0e6997d0e60196211489ca26ff63f0c'
            '0e25431e3c26a2d5e08324fa682d301108f2ce3b5d005675ffcb121a08cc2167'
            'd81ac8aad44c3f395e35db576fa84f6031e4d7e1c1b0385bd0cde31222bf1cd3'
            '6f33a4f09ac27001b2d826f8b014ffb840a530dea3ca2e165bb40ad22463ad5f'
            'cadc6980fd9a2ae00e5117e4f9d8935f91eb6df1c2dc3b04442dd20e6921c5fe'
            'f618c2d633f7dee478f201dd5c30541e4a29c6ee57f11d09e49b6724c17aefeb'
            'bd4ae57c74e30fe52eb9809f4808f081854596b666fe4455acc241d8dfec07b3'
            '06e0e3ec4c0c0b6183908bdf52dac88367ca98dee73672124d0e9b7872e77c9e'
            'ef0d27a0b0cd41051a07eb993d16ed064058cdc032e2cc77b7bdb710f0bea5ab'
            'c2649328f1d088e7fcd4f5c584bc96a8f4294caa4747890baf67b8009f34d9fe'
            '95e1435f70ae6e9468893fe4a828eb63d431619ed85595762cd5d421de0a7dcc'
            'f8ec9384c481cd57092d76f77e2121911b87920b90dacfb1579c37f778334259'
            '96aa73b247fd83d908ed6718e7b000c3db414464eff2207e6f3e3afc59df64aa'
            '7b6dc174605bd8f951f266cb015350d6a9bc04511ad765995d514db8743c07c5'
            '796ba999520774231e2cbff788d223088ea1c158e0cedc6b66af20474c39a26b'
            '8cd49aa1d11818a57907e5aa1fd784cc38134096576477d99933f265427f3959'
            'adb5d6b94bd05f4883abb802c903e47f319dd4f3e0bb2cca8cb585055a164282'
            '11bbb0b4cf4de748f87fecf4e9458b66ee3b76ff49826b35fbc0d54b7effb371'
            '53aab5a20197922be2875831b3e8c1041c7ef092274c77eb25d4e6624a6df8d0'
            'fea2bb9d9ea287ece89f0a59f32857f1eebb62cd18a01a4ef86a10fe1bf463aa'
            '85bd56cfa3cbe2125db7d8bf832b57b8b6ed0c2283ba5efcc4582c64a2d5945b'
            '5676b9f2296109b1585af99455d0fcf88533d7d5fa67a19d7e4bd853bc571058'
            '78c9789d7d6b51eeafd66ce9a029a631fb884ef6f46503f33f792eef7ddd836f'
            'b88bb68befce05542f2e5af960740d00a97a98f7c4f8943a8b77e011dccd489d'
            '6ed4bd6175dbceada2dca32c039408cb62eb6f8ecf1d43a315545572d0ebd3cd'
            'a8e505d9b7465efd1fdd0650943866b245255e45b069350561087d3265f27ff0'
            'f772ddbd4bf59329ada7b5011032809082f0cbe96dc193807914179c10604d62'
            '1e5ef7ff4273ca48553054bb21a3e57edc848fef973a04d00215bda569a86776'
            '9a6bed038eee6227b5a4376811538b6f88da0f12bb871dddac4998f3747dd856'
            'c695472dd7cbd2177549b170523fafdc924d27b0994e6e8b320f05b76d5f7e59'
            '53f803b9fc41746fcc3b9804a4fe11a8264daf2fa98c3887a632f5ec66c711ab'
            '512b930d8c0acc7a6011325fc4028df4db34567cb9551a66b504ca3a8421e631'
            '4ac3f3ef55e8247e79950484c6c0bff41a1d5ad102012bcc7f6852023eca8adc'
            '76da184f30d7b5e0ee425f417567e6206e72bb3299f6450e391c1ddd774d1446'
            'd9700f05b18a8f04f87dce21a9a2004e44f315bed3d9c54934ecd9bcf49d9e45'
            '21c53906b174a1c2cc413479747a8d182860b2b7a86252e005e04888fa9d2178'
            '8402f4c7b9083c2f7b9b4ce4b615a88638030b732c0b828f00f1140c44e56cd2'
            'dde0774af8c96c7241960ff4424c12c0cea3724f5209849afed1f468e5dd37ac'
            'b3dfd13583a3b78671cbce430e99e8f668e97f99f01dfc5282d7b9de0f3c32a9'
            'b701695ed32802d31c7e1cd4ace19fd3ed9f57a7db1469d6e432089684f604df'
            '839d5ebcc09d997fefc67e70c87f81768781d39bc1aa7741518617909fc06ac6'
            '3d37ba94fe5fd03491527d7ed76ac1354d58300f28511cdda3b9b9cc95a3af42'
            '349a86d3794963b89684c5c63382eccef1b808ff4b29899273fabac6f19f9180'
            'e31521114eacee522c6ee10dbd90dffed4c3462e2a1efc20bbbd5ad958865c8b'
            'fcdefaedfe6de12a965b8b5a8b83a609bb459509d9089b10e9f03cc3f8f34561'
            'f78e72d06cb87f0f3079af1c96e9213d3dfe6b81a06568e69684aeeb6f7cf4b4'
            '4198e59cb2f15aebd7e673e2372296645116db1823387c6bfdd35b861ea31d97'
            '29127286f415592031bc2b28779981d2124320a43074ebaa2eab96df3646ac01'
            'd05d5747dcdc53c8ea8b00c4a235b865a3d43c4df2003757ff2391e72f965956'
            '1925723e1ffdc216efe4f4fc4bdb4dfb7daa7747b71bb84095b5ac592a0adeed'
            '9b0d68f513902f046781ef7741a00b5f25323c3e1f704f9810a6297ec4087e09'
            '8f62873bd2386decde1fd20cde19e9ff77ed011402548fb4e12a919d63d75d7d'
            '7c19ea6024a223c0a5a42b4c258904bbcc5ae929a83e96fcac0ffe50c6ca068c'
            '7c3db8e9f9b1cd5c4899d1878dce933e2312d3ea28ccc1e65babac1a39e1cb74'
            '4b8ee449262dfee173a1cc11d4c075265498e81fa7b16592e5f3eb4e9af13c55'
            '1ad47b0e5370380bd6a992d9d0df0f11b0d0bb71c292416539c4f2fa88957942'
            'f6a58faed6e5ed85b227ab136e4e2e9c358004086a2b69069da479bf0908ea80'
            '5ee1db6ab4ff71e73bb97b52d34fff0135de281ca1ac05d4d9b372bd8b65bff4'
            '6815ae5dc1e3d497d34db021df090acec7cdfb79446053243aa19823689de443'
            '39f61bfd85cd4fd9532c1d44deb23d248fd1fb1b0eb1e78599b732e22c815676'
            '2ca82e1eb04cc6886307189be572068d13f9d6e06e9cde1bd5106e35ce6a35bc'
            '0a6bece5120b7bef9a0b31f8bb8319658aab520fe121d121c4d0b46ed69f20c7'
            'cf53f1bb8d67f25c53321801227629aa06b2dfb42177bfe4fb94ee22800068af'
            '587ebc8f0236086eff60ec5df3d5be585139915a75be0f8588e413a947456286'
            '349c5a82ac4dbd1c0c3c91de9e82f459b02724947cb0224bd74ab39693bcac0c'
            'b1e2ae0b8253003659310c7a88dca61f251fca4988e488b5f2f2047ca1fdc88d'
            '1621a94ac5d9ff90a4b9dbdcb04b06d5563f4a109326cf82e8dfd85c1fe0b3eb'
            '52d8e4dcc189bc6ecd7286d8f9864c0dcfa967e0c358e48b45a77b463b8e94b8'
            'bb8cc5c2a0542247d6f9a387cb3e7d45267c62b63e49c394d48ffb3ce8155156'
            '685625f4c6bcfae4ed8ab2a1cbd57cf68e92d3c0197d9f607511dd3b7496dfa8'
            '9dc4ccf7771bdbb4967b6f48fe6aceda4cf6acc2648f4ec179a985949bb5d8cd'
            '5e2f52f8a1cae3b12d31573cad70fcf1e762cfed43237649dcfea7e0ada2de6e'
            '6217f662b4cd292753505c2850c089ebf1d5b283f8fe173d4d73d606ee1d7c2c'
            'dbb59137f4b5ffb5d50ed84938f9317271a4d52766b0daeb581c5ce8537ab3e0'
            '6e070098fb72e6d07a694a74c8fd5ad430544173aec1a4185b82be927b1a5594'
            '97a7b739b286777264b59151d81c88d28a188bd01de54aecb732c81fbd8089df'
            '27dde66518dda597fb847f686908ba9da2d839f52ef9be3835fa619a1d72a177'
            'b70964792cebbcc9faa46576d554d8df9be764bf0b65d3d211bb914415a0de8f'
            '0ccf426f80d3dad951d15f69d4eee4b2360f50196138ea853b78bdc8db56a7c6'
            'daa534ca90d7514a770ddb1a238f9d11233c5cb6f020a28a94a979564d04674f'
            'c51de554e30f2cafe490cb8a758e389b9f2bb33a0d0fa92c74880ac513739756'
            'b6c245e61761bc2a384f880c361633998ede05f127dfacfcf5829818e7564c73'
            '661b8e2039a28ca2c6ab3a3cb6c7b52be12e1f0934843ead82fd62ed82c1d3c9'
            '738ea16bdbdacc7016c2d579a2f7bcf27920e6532b3543aba7f9de84330e2c18'
            '4153c16db851f4d7b20c506e0f0522ce1e27785c16a28f4ea73bc2876ef99b8e'
            '35947a7ba10a00f935dc634cdfd06bbb22605d8e320fc1591f44fef80bf6c773'
            '43f41f0f8afcc4029a03e991eb396a59b8891367a5f811aaf665739fe1d40ed9'
            'f0490ba367762c3b15245024c1b30a28c8a403bc5a671a3e32c31b372b08c6e1'
            '125d7ff9f40bb002af657be94075aad9baf07d0e76882c401f18ebc6a67b313c'
            '4f47b2b045c8dbcbc104b2be46026c5264a56f63359dc488c159c06438f080ae'
            'ae382a101cd938d4a238e39b54516f04fc89c40fb36f5316a185a947ec00fbbe'
            '3192e4b3db5d382245ae6af07d46e8395ce6586755ca0ca06a63d0bc8ca3c436'
            '5ab7b2b056b86e269a1a954c72dbd88c4faaa35fda4d1fd6efc6d63d5557cd36'
            '219eb248f0ad08b2843488b1d7e2752c77c4cad49c35750aa92d388d80f36a29'
            '4e844d076a23dcba9ececf221ed6ed01e8e7edaf17630022186df235ded25236'
            '2640e5776300b28a31385d38cfff6a3170cafdac0ead7938bf5582c02cee602f'
            '54652e002b9be4ad212fd5dbcac8a1eae9ad86467aaa0fbaf60981697669b14e'
            '73724ba0227f868ea6907978bc7bd204814311a2ede7ad0ce6ae3d2cbedc6fd0')
