# 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="yes"
_pybasever=3.12
_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}.11
pkgrel=1
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_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}-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-pyport.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.patch
        0051-Fix-extension-suffix-for-c-extensions-on-mingw.patch
        0052-Change-the-get_platform-method-in-sysconfig.patch
        0053-build-Fix-ncursesw-include-lookup.patch
        0054-tests-fix-test_bytes.patch
        0055-time-fix-strftime-not-raising-for-invalid-year-value.patch
        0056-ctypes-find_library-c-should-return-None-with-ucrt.patch
        0057-build-Disable-checks-for-dlopen-dlfcn.patch
        0058-Fix-install-location-of-the-import-library.patch
        0059-build-Integrate-venvlauncher-build-installation-into.patch
        0060-configure.ac-set-_WIN32_WINNT-version.patch
        0061-configure.ac-don-t-check-for-clock_-functions.patch
        0062-expanduser-normpath-paths-coming-from-env-vars.patch
        0063-CI-test-the-build-and-add-some-mingw-specific-tests.patch
        0064-Define-PY3_DLLNAME-to-fix-build.patch
        0065-_testconsole.c-Fix-casing-path-sep.patch
        0066-Return-consistent-architecture-markers-for-python-on.patch
        0067-handle-ncursesw-pkg-config-when-cross-compiling.patch
        0068-mingw_smoketests-fix-_UCRT-condition.patch
        0069-Modify-sys.winver-to-match-upstream.patch
        0070-Change-user-site-packages-path-to-include-the-enviro.patch
        0071-configure-Include-a-header-in-the-check-for-_beginth.patch
        0072-configure.ac-Default-to-without-c-locale-coercion-on.patch
        0073-Fix-failing-tests.patch
        0074-Don-t-change-os.sep-with-an-empty-MSYSTEM-env-var-no.patch
        0075-def-VPATH-when-compiling-Python-sysmodule.c.patch
        0076-Make-_Py_CheckPython3-extern.patch
        0077-link-with-bcrypt.patch
        0078-correctly-find-native-python.patch
        0079-Add-extra-flags-for-_bootstrap_python.patch
        0080-posixmodule-undefine-HAVE_OPENDIR.patch
        0081-getpath.py-add-support-for-mingw.patch
        0082-Don-t-build-_posixsubprocess-on-Windows.patch
        0083-_ssl-link-with-ws2_32.patch
        0084-Always-normalize-path-in-abspath.patch
        0085-Include-winsock.h-when-checking-for-netdb-function.patch
        0086-include-_multiprocessing-semaphore.c-on-win32.patch
        0087-configure-build-mmap-module-on-win32.patch
        0088-venv-creation-fixes.patch
        0089-move-the-shutdown-function-where-winsock.h-is-includ.patch
        0090-configure.ac-set-BUILDEXEEXT-and-EXEEXT.patch
        0091-configure.ac-fix-building-some-test-modules.patch
        0092-Don-t-convert-sysconfig.get_config_var-VPATH-to-an-a.patch
        0093-Always-convert-to-before-passing-though-pathcch-func.patch
        0094-Build-venvlauncher.exe-from-PC-launcher.c.patch
        0095-getpath.py-fix-dirname.patch
        0096-getpath-use-normpath-on-all-generated-paths.patch
        0097-pathconfig-normpath-sys.path-0.patch
        0098-smoketests-add-some-tests-for-sys-site-paths.patch
        0099-Search-DLLs-only-on-paths-added-using-add_dll_direct.patch
        0100-Build-and-install-libpython3.dll.patch
        0101-Port-GetPythonImport-to-mingw.patch
        0102-LoadLibraryExW-make-sure-to-only-use-backslashes-for.patch
        0103-mingw_smoketests-add-a-test-to-check-if-sysconfig-re.patch
        0104-Add-missing-library-for-multiprocessing-module.patch
        0105-selectmodule-add-support-for-MINGW.patch
        0106-readline-disable-on-MINGW.patch
        0107-Add-libraries-to-fix-compile-of-ctypes-on-MINGW.patch
        0108-Add-lpython-version-while-linking-stdlib.patch
        0109-Enable-_uuid-on-MINGW.patch
        0110-Enable-curses-library-on-MINGW.patch
        0111-mingw_smoketests-disable-distutils-related-tests.patch
        0112-configure.ac-use-autoconf-2.69.patch
        0113-CI-clean-up-ignored-tests.patch
        0114-gcc-make-incompatible-pointer-types-as-warning.patch
        0115-test_makefile-normalize-path.patch
        0116-sysconfig.get_platform-use-consistent-naming.patch
        0117-Add-ucrt-to-version-string.patch
        0118-socketmodule-fix-captilization-of-headers.patch
        0119-mingw_smoketests-build-extension-in-a-venv.patch
        0120-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch
        0121-CI-update-actions.patch
        0122-CI-test-CLANGARM64.patch
        0123-CI-disable-pkg-config.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-pyport.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.patch \
  0051-Fix-extension-suffix-for-c-extensions-on-mingw.patch \
  0052-Change-the-get_platform-method-in-sysconfig.patch \
  0053-build-Fix-ncursesw-include-lookup.patch \
  0054-tests-fix-test_bytes.patch \
  0055-time-fix-strftime-not-raising-for-invalid-year-value.patch \
  0056-ctypes-find_library-c-should-return-None-with-ucrt.patch \
  0057-build-Disable-checks-for-dlopen-dlfcn.patch \
  0058-Fix-install-location-of-the-import-library.patch \
  0059-build-Integrate-venvlauncher-build-installation-into.patch \
  0060-configure.ac-set-_WIN32_WINNT-version.patch \
  0061-configure.ac-don-t-check-for-clock_-functions.patch \
  0062-expanduser-normpath-paths-coming-from-env-vars.patch \
  0063-CI-test-the-build-and-add-some-mingw-specific-tests.patch \
  0064-Define-PY3_DLLNAME-to-fix-build.patch \
  0065-_testconsole.c-Fix-casing-path-sep.patch \
  0066-Return-consistent-architecture-markers-for-python-on.patch \
  0067-handle-ncursesw-pkg-config-when-cross-compiling.patch \
  0068-mingw_smoketests-fix-_UCRT-condition.patch \
  0069-Modify-sys.winver-to-match-upstream.patch \
  0070-Change-user-site-packages-path-to-include-the-enviro.patch \
  0071-configure-Include-a-header-in-the-check-for-_beginth.patch \
  0072-configure.ac-Default-to-without-c-locale-coercion-on.patch \
  0073-Fix-failing-tests.patch \
  0074-Don-t-change-os.sep-with-an-empty-MSYSTEM-env-var-no.patch \
  0075-def-VPATH-when-compiling-Python-sysmodule.c.patch \
  0076-Make-_Py_CheckPython3-extern.patch \
  0077-link-with-bcrypt.patch \
  0078-correctly-find-native-python.patch \
  0079-Add-extra-flags-for-_bootstrap_python.patch \
  0080-posixmodule-undefine-HAVE_OPENDIR.patch \
  0081-getpath.py-add-support-for-mingw.patch \
  0082-Don-t-build-_posixsubprocess-on-Windows.patch \
  0083-_ssl-link-with-ws2_32.patch \
  0084-Always-normalize-path-in-abspath.patch \
  0085-Include-winsock.h-when-checking-for-netdb-function.patch \
  0086-include-_multiprocessing-semaphore.c-on-win32.patch \
  0087-configure-build-mmap-module-on-win32.patch \
  0088-venv-creation-fixes.patch \
  0089-move-the-shutdown-function-where-winsock.h-is-includ.patch \
  0090-configure.ac-set-BUILDEXEEXT-and-EXEEXT.patch \
  0091-configure.ac-fix-building-some-test-modules.patch \
  0092-Don-t-convert-sysconfig.get_config_var-VPATH-to-an-a.patch \
  0093-Always-convert-to-before-passing-though-pathcch-func.patch \
  0094-Build-venvlauncher.exe-from-PC-launcher.c.patch \
  0095-getpath.py-fix-dirname.patch \
  0096-getpath-use-normpath-on-all-generated-paths.patch \
  0097-pathconfig-normpath-sys.path-0.patch \
  0098-smoketests-add-some-tests-for-sys-site-paths.patch \
  0099-Search-DLLs-only-on-paths-added-using-add_dll_direct.patch \
  0100-Build-and-install-libpython3.dll.patch \
  0101-Port-GetPythonImport-to-mingw.patch \
  0102-LoadLibraryExW-make-sure-to-only-use-backslashes-for.patch \
  0103-mingw_smoketests-add-a-test-to-check-if-sysconfig-re.patch \
  0104-Add-missing-library-for-multiprocessing-module.patch \
  0105-selectmodule-add-support-for-MINGW.patch \
  0106-readline-disable-on-MINGW.patch \
  0107-Add-libraries-to-fix-compile-of-ctypes-on-MINGW.patch \
  0108-Add-lpython-version-while-linking-stdlib.patch \
  0109-Enable-_uuid-on-MINGW.patch \
  0110-Enable-curses-library-on-MINGW.patch \
  0111-mingw_smoketests-disable-distutils-related-tests.patch \
  0112-configure.ac-use-autoconf-2.69.patch \
  0113-CI-clean-up-ignored-tests.patch \
  0114-gcc-make-incompatible-pointer-types-as-warning.patch \
  0115-test_makefile-normalize-path.patch \
  0116-sysconfig.get_platform-use-consistent-naming.patch \
  0117-Add-ucrt-to-version-string.patch \
  0118-socketmodule-fix-captilization-of-headers.patch \
  0119-mingw_smoketests-build-extension-in-a-venv.patch \
  0120-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch \
  0121-CI-update-actions.patch \
  0122-CI-test-CLANGARM64.patch \
  0123-CI-disable-pkg-config.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

  case "${CARCH}" in
    i686)
      LDFLAGS+=" -Wl,--large-address-aware"
    ;;
  esac

  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 2to3 2to3-${_pybasever} 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/2to3
    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=('c30bb24b7f1e9a19b11b55a546434f74e739bb4c271a3e3a80ff4380d49f7adb'
            '3981fed74ee7d43ad69bd67e634e03d7bf6890558a87062380112e195688728a'
            'a3771e363eb95a940118612d51210ad03b655bb7c2228aa0771400f6230c5bea'
            '45b3c3d6df21f927d47135edd5f768cf9ace70328bbd04e63219c882ca7d9786'
            '52deb3dd8c8c1b24e714bc63f531f0ce1b19c26f46454b194d3ef4ba5de9f415'
            'febb83a995d769a578a49eedd1b9ed55a23488b1413ca9e60160fcb093734662'
            '4d73e0c5ddf5e1e42adf5a1e83f2377ca8a7e20e39ad43bd32dff693b6a8d0a2'
            'd860fa5b7db46c8f3f1267cc702037b463ecfb316cd07ca0bc0623513c312d33'
            '997897579a7ffc75f043d93abae2a431c2c89d852a60fcb62312b1a76a0dac1d'
            '42f113d250ff43ee4ba29d0da42d8f47f5726c4c4e23f0cef88f5688e049443f'
            '1a8f84a83d028ddab4e1c6a7094a1dd5152f5b4f204afae23de4b0f6f7cc51cd'
            '029ed2c62cb7ee5b29d6c17186f7fb065e1e3893ddf0e94d8620f225899b97a4'
            '3c92ba92d2ad4cdcfffb63bb072347fb13d112bf9aa4a39c15fea622a0086161'
            'b2b9c52ff8da7f8866e873446763a3ce904939ae87f2135646442ab9a9b5b7ba'
            'd255c0e8944f6a0114278c9f80a7d0091267d0250781b55a766e6b9d96bf9e76'
            'aeb903ecc2c9870f312c1ef5e852f7b6f630d5082971ccfecf42b45ea7f20581'
            'bc2cd4a9cb4c2c3deea5662202ce21b596c465490367ffebd37b574c6c236508'
            'ba020ebcbad77527827bcf3f208d2ae7f8554b14efde5e3ab2a324e19bb09e5e'
            '547d5812e6fc88df46bd9df655a956f5e5f79b8aba59d80c85e6e0ad2356df7a'
            '7cd458937ea4429d3ac14f147167709c918d9ac81163431d29479890a18c3737'
            '5e83800918046008ab29668f87dc695d1171ef8c83c77b7aa6b0d5e3eca3526f'
            '1d7c2685e631f5d78ddce4a541bf354f43dd0def9811a683f8655a5f7b52a85d'
            'ca61b52afed6f1bf5d90c1724747bc344cf1bd24c705f2e06596a283c32a24ed'
            '39b9858d5e83e06e7fc7d5a02caf6d8a90769b72cbd902d0fc307a9a590a8174'
            '14241055edac6629daa26a934f89f58e8baaf0883c8b5af094bba82f57a42c09'
            'a536dd0ee786bef4490d2226f0e739d472447bd4f9d4e6d1acb119daa8d25b3a'
            '0e731421c580416294db7b7faaf161f3e332e6b4a8c0ce9abfef0dbbc8d2648b'
            '1960a3b93e44511c70d2bb6ec5030aefeacb3922e26dacdd244c79f87dadff54'
            '7dd1085b94f9defcd16a86ef3db699f2a0e12d3d5c943ecc5e575176ce88b20d'
            'c23f81708a027359493ae2a768c013584e3de6ae25812742f393bdaf587f4dbe'
            'e6be67be8c9473bdfe2645a7fd784c94da5b20bdb5a13ab4960b44372d1263a5'
            '74e55b80993aafe55664cf5459f00de08ce7ad4ab80ae8f385f26b690e1f3715'
            'a2b7ffe96bf940769fca412fda132d3f739bc8f4b086c1ab548c1ee2591559a3'
            '52291d9b52f0cc70a9a1bb9e9145b72548cb6e2d9c7bccb50372701973bf5fc4'
            'e8433f3ff0967e329d673c450fe0ffafa25033238366a1197db6dad18352bb1a'
            'dad87df02b596edd52b9501944ab7df2c8dbc9330c167aea17d2fd8ba80d0378'
            '640a6d805d70fb4445bac37866ac88cfaae44d9a3f2273858243cb496af0c83b'
            'acf992ed39820118a552d685eaef7a99567fb2ac6e029bf5d1019be14ba3ca4f'
            'bd3fbfa9ba925e41ba488e48a39044e9e8b51dd0ca19e9c8cf8a73b24312a4fc'
            '1066ee1296af528c4cf4a3e370badcd940d319e57a5b45a3fe3897d308919474'
            '52fd2d0b64604ceaf2b5faa26d4308917f3e3b6779f5e34b6158e7ad2ed3b607'
            '72c6a6fb6c26dda7a00051c7c69e48c8675dff466ef3611402f544e69e22a14d'
            'e203432c20d52c10d6ab542bf13b2b2ab38ec754bddd1224247aa12ebe68d267'
            '037585e470575729fe4987e69b3388dc23f987bb7ae1456e1e18fd0417102d24'
            'd429d755463b69960c010012b02a4b35703473de5ce05a94c35daeca9d0b93a1'
            'd150092f34ce1a5f8ff15c7532a38d6577effca2fe6a03b01c05d407bfefe062'
            '5c0b9ef931bf37096502d393f67e7082eb8dc9e205daa62def2be9807250e218'
            '2d961b7e6cd1f28d28cfee62e3caab89156de35a3defb3de681baf1c4eb7a8b4'
            '1507e9cd95e19d594c5195069834f421371ef9318150667ef1c5763ff621b1a2'
            '5cd8ce1ea80b77119de809e1577586c4712f8d31494629a39adf4af663a50e3b'
            'beee74685ab8b4e4a74d4430c107dc6bee88dd1e4b8b51563cac030a40c5ada7'
            '90ad174198458613b82e85d66904435128ce9c70b8da874a9831e9efcb79ff5c'
            '7bedcfe69c345dc22e17a1eac030e5f12d361683092d5dac5a4b51e8e3b63f83'
            'c11dab03b93ac386f22492de0ecda27b25d28ff550ecb7d7b9e218f521873c0d'
            'b2431680baaa2d680532cbc9bfb5c44146922bbc53f428540179d980e22d74aa'
            '21ae46adf24f04d04c745e6a160186e457608faa2e16c17a405de10d1d085ae2'
            'c22eb05e1be0aeca2ece9351f9504c6335bfca4593ded077651ec5f5f5db6f98'
            '987d21b59efbcab70687a36b6788f181d6593c33c491a541e68973fb726a828e'
            '062d14df31a50e7cfd145dc7627e7b0f5d7d669ee4f699657ebb5423c8934af8'
            'c38cc149fbdd4a41fade0eaa6ca7342bde96963b7a6eb5b9a7788ef8c3834d95'
            'c36646f5f9ea9636e29b14f3c06804c9862d045bae40ac88f7338868093d303a'
            'cee211e00a139182038bb3fe5f4d976d1e083eea40cd074cb14a23cfe41eeeb8'
            'e30596e4050dac809ff632a79f5348b5b400e178b43055f1fcd493de5a389839'
            '7edf09502d5ebaba821b8fabd6204d755e822ad9b7b99abe0daf605d8e8f3af8'
            '0c6b54323e8fdc27f0d9f976c3c747d597ba2416737795dd00875e64cb67beed'
            'b26b22e8c6b02c0d2e778a1829157035f89ed02f2c96a5e9d99139ee01eadced'
            'd7f254555bd18f92bdc2ca0f82310d5e89c6b748349703c0216dce00088b3426'
            '491566f7fba757bf92dae1393deb6f0d5c9a6d559f1212ed145b4ec4b01befd0'
            'e6af93c72adef0a94061a9c9f861603944fdc91bf509a99cc71bb6d6561ce961'
            'ee2e94968554debf55931dbdee8483b8976c773b37879d875998e8ba76b1e516'
            'befa01929584472019dd10de858cbccd7fc550e61c955511584e6820aa6ad463'
            'e21af203cdb8c84937a5b3fc3a8db65cb07aa5785beb65152ddb6444ae4303f0'
            'e805835ec3337e0e023287f225cf043d91035131896aa7037f704893a66c1761'
            'b7867b345cb04a005f523e236c35aa87a057d42ef6352df875a21ba7ddb3cf87'
            '1a342658c906e22d6bda26396d3b1065b842bcc1b0cbbd18d7e1e3c264178a2d'
            '538ff83c7dba155ac8c2edbbd80a894015b9e903d603a4fd43996a6272432ece'
            'acafa3707be046827e98cde1839d9eb779c361c424dae247b0a4db96038c3bc7'
            '8240ce341303625959709623f6bfcaa7c95f8874d51af1cbfbff9834b8ff0db1'
            '2c2622a0c4883f016a3db7ec523a7a8231e5efdf3e0ffb2f35b559d48a659721'
            'd00d9bbdfe8d2429fee583079de5187bbf3cdb5b409296006187b7ed99d970b6'
            'c720e58458e4d9f7ad86d91b10fb444516a9ba1643ad685e92f00452b2f873e3'
            '4bbf48aaf24900b2e0f5e1c4ad170565411ea6bd52d2a7d1d2ec46a5696f7ec0'
            '2c522a25f45bcbb2f8c11afcbf95d6c63762de903c6f58b4c2619a008be67888'
            'ac5e566b53438a513bcb47b9a65e3400562536b7550056adb4a35f1189eaa0ed'
            'b05cd29200b3a339eca82bc605c6bbef8f272ad4054dc2abcb3ff3a6c364704a'
            'fcd810d0cac2b0a9a9c1becf0765f3b298a3e02846d4a356eb607f1e8fe867f8'
            '4b9daa1cb25441c447de651a5004968801b7dd13c8e7b5279a8a0c2788e950c3'
            '819153a0f311eb855da2b89191fe4d40a2dd6c85884a542165628c9e4052b72b'
            '389edaa0e238234fc837961bfd6d197695e796cf72f261c03dd1a657c393ce88'
            '78f2fd595bb7bbda4ce56a37fcef6b55784f72a5a00eab840a3d4ce9e0fb9804'
            '14ce01cb626bf240c8283b6cb4b9cda5defed26acee39c5509e19a7b045eef48'
            'fc467edbe50d17a989c44d79cd81b18d63a8c6f8b8c46d8726a12aa20d1fbf26'
            'a428142257957de9bf2f26ecafc11f34357a150ac183e1c72ad67c863757bebe'
            '7f37df0f26c35a4accfaf695ef388202c283995410375a76f624f68ab56e64d2'
            'de31fa7ce4b9d57a75a0d242a8865b4cfeace86c759e4ae9fceeee159194985d'
            'ac0b6ab52b5b10f45898590aa1eb4a3f51377d6507fa758b7721cb0d0d2423ca'
            'b2ec302c400add6926a856221279bf33e52b20714c93cfc6c4b1063df302f133'
            '743b211d4bfc41cb1e65a67a03b5c9d19eb3b591a97b9e6cd264b258000bc623'
            '609655d5717624fda192024a83a9dbedf2c907f26c8ad68047c32543be1f1bc7'
            'c3352bdff3562730e025fd64ee6f57dcfa5f3c75f69a29a1372a669d2a5bd675'
            '00ea0ae05e909527c864177dc4bf40998f2f5c43f9f57db46794dbe1bd764315'
            'f99612c3e1caed34fcbf7b71d2cbe89e37d84604dbf3f0ae938230d3133ec9e4'
            '6bf79ffada87905665ab4aaa4f3ba45f1a3514227ef02f9f5a402a9865ac0f41'
            'c772bf426307f8333b7df06a5a6d85fc4d31d16c5fc3eba64c84aa243ddfa1e7'
            '83e96909ce29992057eaa802ceec757d8887c0602d8cf42730bdc780450ea93e'
            'bb33e8e9a0c7fdadf56a351f0ee08f420eea0e3669c6a6d95e3c6e0388bcc091'
            '445c238bcaae79cc422ec0618b1f4e84d32017c002acbde27fa2018a8ef9fb70'
            '5992cb0cb0906d714ad27bbd2136a1c95d72604a96fea944a40a1cde6b434cfe'
            'e1ddd2e0f4d2bb68776bcc538077f88af1b7a221b6cb081909660e6d4b6dee9c'
            '04e36867d57f3847485c7359be6f08d1c180b89f04d7ca535fc48e378b434417'
            'b101fbe155eb153a260104498f2074323168fe5ae561d35fbb3e8139de5361ab'
            '65b55c242af5871558078ade1e13e8958b51695529029b3818ce2bc57da690b2'
            '7f73cd534aaaceffa745f6d1d0a29c0c1bf6565aea66ad2e4ab5347d482b97e9'
            '7aa06b18f146a9cc4d528d10a40be8b959e56e4478786f6aa2910fb690e10142'
            '7b206cc24945139376ffc416fc3d86397383b956a20447f3e4c4009d4bf786f6'
            'ae5d445ffe01a4ed1ea883f6fb6ff0c664fb8a19fa01c0479dd305d416581e3e'
            '873aba7087d88ae72948f467d0e4b8f0870c90c81a9c3c1c580aa8d109a1f8d4'
            '62ff8158cca6aaf557410ea7874bd85803d521ee1561f9a6d37a3df1152a6616'
            '9d61bce251853c7581b7bb58e6a063bcbfc1e87296ed10644a9b17652f2d9b3c'
            'bcb39c5830351f5011d5aece24b77d0e293be8953e3fc421182da181e921c147'
            'bcc212e62f2cadc25207796fdc1252fc8080de36dc63b4eecee0e640537ef03e'
            '6fecfcf29a1fddddd33399c0fd6513a76af4b0ace9bc43fe06165b7e41d7a23f'
            'b22f550bf3ffb3478550e776928aa6d37edafabc7961db8370892a84a33661c3'
            '766e87ec4319e35bd162a6eafafa0bf0c32b3c6c661b2e517860902d89bd50df'
            'f31dafd21aae96bddd53a3fbb0963ee048f973375cf19833c30458cbb10ade19')
