From 6635b731ee9c58acd352eed0d908bc97063fdc86 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Tue, 21 Feb 2017 23:54:52 +0100 Subject: [PATCH] mpv: Add ffmpeg libs to LD_PRELOAD This should fix issues on devices where vendors have ffmpeg libs available in the system lib dir. --- packages/mpv/build.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/mpv/build.sh b/packages/mpv/build.sh index 98c539eb0..c234f5810 100644 --- a/packages/mpv/build.sh +++ b/packages/mpv/build.sh @@ -1,6 +1,7 @@ TERMUX_PKG_HOMEPAGE=https://mpv.io/ TERMUX_PKG_DESCRIPTION="Command-line media player" TERMUX_PKG_VERSION=0.24.0 +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/mpv-player/mpv/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=a41854fa0ac35b9c309ad692aaee67c8d4495c3546f11cb4cdd0a124195d3f15 TERMUX_PKG_FOLDERNAME=mpv-${TERMUX_PKG_VERSION} @@ -40,9 +41,21 @@ termux_step_make_install () { local SYSTEM_LIBFOLDER=lib64 if [ $TERMUX_ARCH_BITS = 32 ]; then SYSTEM_LIBFOLDER=lib; fi + echo "#!/bin/sh" > $TERMUX_PREFIX/bin/mpv + + # Work around issues on devices having ffmpeg libraries + # in a system vendor dir, reported by live_the_dream on #termux: + local FFMPEG_LIBS="" lib + for lib in avcodec avfilter avformat avutil postproc swresample swscale; do + if [ -n "$FFMPEG_LIBS" ]; then FFMPEG_LIBS+=":"; fi + FFMPEG_LIBS+="$TERMUX_PREFIX/lib/lib${lib}.so" + done + echo "export LD_LIBRARY_PATH=$FFMPEG_LIBS" >> $TERMUX_PREFIX/bin/mpv + # /system/vendor/lib(64) needed for libqc-opt.so on - # a xperia z5 c, reported by BrainDamage on #termux. + # a xperia z5 c, reported by BrainDamage on #termux: echo "LD_LIBRARY_PATH=/system/$SYSTEM_LIBFOLDER:/system/vendor/$SYSTEM_LIBFOLDER:$TERMUX_PREFIX/lib $TERMUX_PREFIX/libexec/mpv \"\$@\"" >> $TERMUX_PREFIX/bin/mpv + chmod +x $TERMUX_PREFIX/bin/mpv }