From 55e08cdf4bd5b6c7e6de64a860725f87a8bdbb67 Mon Sep 17 00:00:00 2001 From: Tee KOBAYASHI Date: Fri, 23 Dec 2022 12:34:05 +0900 Subject: [PATCH] pcre2: Add SOVERSION guard %ci:no-build --- packages/pcre2/build.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/pcre2/build.sh b/packages/pcre2/build.sh index 2c076b3fa0..6cf6c39699 100644 --- a/packages/pcre2/build.sh +++ b/packages/pcre2/build.sh @@ -18,3 +18,20 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --enable-pcre2-16 --enable-pcre2-32 " +termux_step_post_get_source() { + # Do not forget to bump revision of reverse dependencies and rebuild them + # after SOVERSION is changed. + local _SOVER_libpcre2_8=0 + local _SOVER_libpcre2_16=0 + local _SOVER_libpcre2_32=0 + local _SOVER_libpcre2_posix=3 + + local a + for a in libpcre2_{8,16,32,posix}; do + local e=$(sed -En 's/^m4_define\('"${a}"'_version,\s*\[([0-9]+):([0-9]+):([0-9]+)\].*/\1-\3/p' \ + configure.ac) + if [ ! "${e}" ] || [ "$(eval echo \$_SOVER_${a})" != "$(( "${e}" ))" ]; then + termux_error_exit "SOVERSION guard check failed for ${a/_/-}.so." + fi + done +}