From 5ad95a1644b2a932addd922b95777f88cf8627cf Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 7 Jun 2024 23:27:50 +0200 Subject: [PATCH] pcre2: work around incorrect assumptions in the test suite The tests verify that a certain amount of memory is allocated for given patterns. The way those tests are implemented, these sizes are hardcoded, and they work well as long as the code is compiled using a 64-bit CPU architecture. However, when compiling for i686, all of those numbers are off by 24. Work around this for now. Signed-off-by: Johannes Schindelin --- mingw-w64-pcre2/PKGBUILD | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/mingw-w64-pcre2/PKGBUILD b/mingw-w64-pcre2/PKGBUILD index 9df9ae7b7f1f7..37bd24c58f29c 100644 --- a/mingw-w64-pcre2/PKGBUILD +++ b/mingw-w64-pcre2/PKGBUILD @@ -73,7 +73,25 @@ build() { check() { cd "${srcdir}/build-${MSYSTEM}" - make check + + # Work around bug in PCRE2 10.44 + case "${MINGW_CHOST}" in + *-w64-mingw32) + for f in testdata/testoutput8-8-2 testdata/testoutput8-16-2 testdata/testoutput8-32-2 + do + cp cd "../${_realname}-${pkgver}/$f" "../${_realname}-${pkgver}/$f.backup" + perl -pi -e 's{^(Memory allocation - compiled block : )(\d+)$}{$1 . ($2 - 24)}e' "../${_realname}-${pkgver}/$f" + done + ;; + esac + + make check || return 1 + + for f in testdata/testoutput8-8-2 testdata/testoutput8-16-2 testdata/testoutput8-32-2 + do + test ! -f "../${_realname}-${pkgver}/$f.backup" || + mv "../${_realname}-${pkgver}/$f.backup" "../${_realname}-${pkgver}/$f" + done } package() {