fix(main/cmus): fix build with NDK r28c

- 0970a2f2d8 patches Termux's `time.h`, but unfortunately, that patch is not compatible with the `-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__` argument internally used by `cmus`, so copying the vanilla `time.h` from its backup folder and using it specifically for only `cmus` is necessary.
This commit is contained in:
termux-pacman-bot
2025-10-14 16:41:13 +00:00
parent 2e8d92edc0
commit 3fa8029645

View File

@@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Small, fast and powerful console music player"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="2.12.0"
TERMUX_PKG_REVISION="4"
TERMUX_PKG_REVISION="5"
TERMUX_PKG_DEPENDS="ffmpeg, libandroid-support, libflac, libiconv, libmad, libmodplug, libvorbis, libwavpack, ncurses, opusfile, pulseaudio, alsa-lib"
TERMUX_PKG_SRCURL=https://github.com/cmus/cmus/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=44b96cd5f84b0d84c33097c48454232d5e6a19cd33b9b6503ba9c13b6686bfc7
@@ -27,6 +27,14 @@ termux_step_pre_configure() {
mkdir -p "${_libdir}"
cp "$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/26/libaaudio.so" "${_libdir}"
LDFLAGS+=" -L${_libdir}"
# this commit https://github.com/termux/termux-packages/commit/0970a2f2d89f64acd7a3fc94845d298bee010cc6 ,
# which was necessary to compile coreutils with NDK 27,
# is, on the other hand, when combined with NDK r28c,
# incompatible with '-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__ -Werror=unguarded-availability,'
# which is used internally by the cmus package,
# so the vanilla header must be used for cmus in order to pass its termux_step_post_massage() successfully.
cp "$HOME/lib/android-ndk-r$TERMUX_NDK_VERSION/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/time.h" "${_libdir}"
CFLAGS+=" -I${_libdir}/"
fi
LD=$CC