From 49839c5e23bab598e5b52bee4380cd0abb1b2be2 Mon Sep 17 00:00:00 2001 From: termux-pacman-bot Date: Sun, 23 Oct 2022 13:11:02 +0000 Subject: [PATCH] poppler{,-qt}: Add SOVERSION guard %ci:no-build --- packages/poppler/build.sh | 16 ++++++++++++++++ x11-packages/poppler-qt/build.sh | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/packages/poppler/build.sh b/packages/poppler/build.sh index b1eb268606..40b8938f59 100644 --- a/packages/poppler/build.sh +++ b/packages/poppler/build.sh @@ -2,8 +2,12 @@ TERMUX_PKG_HOMEPAGE=https://poppler.freedesktop.org/ TERMUX_PKG_DESCRIPTION="PDF rendering library" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="@termux" +# Please align the version with `poppler-qt` package. TERMUX_PKG_VERSION=22.04.0 TERMUX_PKG_REVISION=2 +# Do not forget to bump revision of reverse dependencies and rebuild them +# when SOVERSION is changed. +_POPPLER_SOVERSION=120 TERMUX_PKG_SRCURL=https://poppler.freedesktop.org/poppler-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff TERMUX_PKG_DEPENDS="fontconfig, freetype, glib, libc++, libcairo, libcurl, libiconv, libjpeg-turbo, libpng, libtiff, littlecms, openjpeg, openjpeg-tools, zlib" @@ -20,5 +24,17 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" " termux_step_pre_configure() { + if ! test "${_POPPLER_SOVERSION}"; then + termux_error_exit "Please set _POPPLER_SOVERSION variable." + fi + local sover_x11=$(. $TERMUX_SCRIPTDIR/x11-packages/poppler-qt/build.sh; echo $_POPPLER_SOVERSION) + if [ "${sover_x11}" != "${_POPPLER_SOVERSION}" ]; then + termux_error_exit "SOVERSION mismatch with \"poppler-qt\" package." + fi + local sover_cmake=$(sed -En 's/^.*set_target_properties\(poppler PROPERTIES .* SOVERSION ([0-9]+).*$/\1/p' CMakeLists.txt) + if [ "${sover_cmake}" != "${_POPPLER_SOVERSION}" ]; then + termux_error_exit "SOVERSION guard check failed (CMakeLists.txt: \"${sover_cmake}\")." + fi + CPPFLAGS+=" -DCMS_NO_REGISTER_KEYWORD" } diff --git a/x11-packages/poppler-qt/build.sh b/x11-packages/poppler-qt/build.sh index 2e866a36ea..175219cfa8 100644 --- a/x11-packages/poppler-qt/build.sh +++ b/x11-packages/poppler-qt/build.sh @@ -2,8 +2,12 @@ TERMUX_PKG_HOMEPAGE=https://poppler.freedesktop.org/ TERMUX_PKG_DESCRIPTION="PDF rendering library" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="@termux" +# Please align the version with `poppler` package. TERMUX_PKG_VERSION=22.04.0 TERMUX_PKG_REVISION=2 +# Do not forget to bump revision of reverse dependencies and rebuild them +# when SOVERSION is changed. +_POPPLER_SOVERSION=120 TERMUX_PKG_SRCURL=https://poppler.freedesktop.org/poppler-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff TERMUX_PKG_DEPENDS="fontconfig, freetype, glib, libc++, libcairo, libcurl, libiconv, libjpeg-turbo, libpng, libtiff, littlecms, openjpeg, openjpeg-tools, qt5-qtbase, zlib" @@ -23,5 +27,17 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" " termux_step_pre_configure() { + if ! test "${_POPPLER_SOVERSION}"; then + termux_error_exit "Please set _POPPLER_SOVERSION variable." + fi + local sover_main=$(. $TERMUX_SCRIPTDIR/packages/poppler/build.sh; echo $_POPPLER_SOVERSION) + if [ "${sover_main}" != "${_POPPLER_SOVERSION}" ]; then + termux_error_exit "SOVERSION mismatch with \"poppler\" package." + fi + local sover_cmake=$(sed -En 's/^.*set_target_properties\(poppler PROPERTIES .* SOVERSION ([0-9]+).*$/\1/p' CMakeLists.txt) + if [ "${sover_cmake}" != "${_POPPLER_SOVERSION}" ]; then + termux_error_exit "SOVERSION guard check failed (CMakeLists.txt: \"${sover_cmake}\")." + fi + CPPFLAGS+=" -DCMS_NO_REGISTER_KEYWORD" }