From 1b4bbe806cd225afeac4ea7c013255df193da5de Mon Sep 17 00:00:00 2001 From: termux-pacman-bot Date: Sat, 8 Mar 2025 14:34:51 +0000 Subject: [PATCH] fix(main/ghostscript): clean up `$CPPFLAGS` and add tested `$TERMUX_ON_DEVICE_BUILD=true` support this package's configure script checks only for $PKGCONFIG, but that variable is currently only set globally in $TERMUX_ON_DEVICE_BUILD=false mode. In $TERMUX_ON_DEVICE_BUILD=true mode, only $PKG_CONFIG is set globally. ld.lld: error: undefined symbol: libiconv many packages manually set this universally without comment, but a pattern can be observed that reverse dependencies of libiconv seem to always require this in $TERMUX_ON_DEVICE_BUILD=true mode, and it gets set whenever someone creates $TERMUX_ON_DEVICE_BUILD=true support for one of them. see the commit message here: https://github.com/termux/termux-packages/commit/bab423c2bdef216da366afac7cdcea095698694b --- packages/ghostscript/build.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/ghostscript/build.sh b/packages/ghostscript/build.sh index 19f5fc2d13..22660ae121 100644 --- a/packages/ghostscript/build.sh +++ b/packages/ghostscript/build.sh @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Interpreter for the PostScript language and for PDF" TERMUX_PKG_LICENSE="AGPL-V3" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION="10.03.1" -TERMUX_PKG_REVISION=2 +TERMUX_PKG_REVISION=3 TERMUX_PKG_SRCURL=https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${TERMUX_PKG_VERSION//.}/ghostpdl-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=8ea9dd8768b64576bc4ee2d79611450c9e1edeb686f7824f3bf94b92457b882a TERMUX_PKG_AUTO_UPDATE=false @@ -29,7 +29,10 @@ termux_step_post_get_source() { } termux_step_pre_configure() { - CPPFLAGS+=" -I${TERMUX_STANDALONE_TOOLCHAIN}/sysroot/usr/include/c++/v1" + if [ "$TERMUX_ON_DEVICE_BUILD" = "true" ]; then + export PKGCONFIG="$PKG_CONFIG" + export LDFLAGS+=" -liconv" + fi if [[ "${TERMUX_ARCH}" == "aarch64" ]]; then # https://github.com/llvm/llvm-project/issues/74361