HAVE_INET_PTON is hardcoded to 1 in the official Windows build. Since we use autotools
we need to make the check work on Windows.
This makes socket.inet_ntop() and socket.inet_pton() available like with the official build.
Add code at the end of `_sysconfigdata.py` that modifys `build_time_vars` at
module load time with python syntax.
Remove all the sed replaces from PKGBUILD because its hard to review and prone to breakage
Finally a test is added to detect syntax errors next time early on
Fixes https://github.com/msys2/MINGW-packages/issues/5048
python uses _POSIX_THREADS to decide if it uses posix or nt threads,
but _POSIX_THREADS get included all the time by header includes
(pthread, unistd) in mingw. This was already patched but py3.7 added a new
header with a similar check which was missing.
This resulted in a mix of ntthread/posix api usage an crashes.
With non-mingw builds POSIX_SEMAPHORES_NOT_ENABLED is not enabled and
sem_unlink is a no-op. Change it to always be provided on Windows instead.
This adds a minimal test suite which makes it easier to catch regressions
in the future for common MSYS2 related bugs.