X-Git-Url: https://git.distorted.org.uk/~mdw/termux-packages/blobdiff_plain/def4744092409e9c95fe6bb76c1ddc1ecbc7a13e..295241d4043c55a41259b4846464e1668b2f6a5f:/packages/mpv/build.sh diff --git a/packages/mpv/build.sh b/packages/mpv/build.sh index f0c7a34e..48db9279 100644 --- a/packages/mpv/build.sh +++ b/packages/mpv/build.sh @@ -1,23 +1,15 @@ -# Does not work with libjpeg-turbo or libpng installed, since -# linking against libOpenSLES causes indirect linkage against -# libskia.so, which links against the platform libjpeg.so and -# libpng.so, which are not compatible with the Termux ones. -# -# On Android N also liblzma seems to conflict. TERMUX_PKG_HOMEPAGE=https://mpv.io/ TERMUX_PKG_DESCRIPTION="Command-line media player" -TERMUX_PKG_VERSION=0.20.0 +TERMUX_PKG_VERSION=0.25.0 TERMUX_PKG_SRCURL=https://github.com/mpv-player/mpv/archive/v${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=07423ffad6921ec4da32f703cd7fbfb27012301dcb736ac8542ac8e6083b0bce TERMUX_PKG_FOLDERNAME=mpv-${TERMUX_PKG_VERSION} TERMUX_PKG_DEPENDS="ffmpeg, openal-soft" +TERMUX_PKG_RM_AFTER_INSTALL="share/icons share/applications" termux_step_make_install () { cd $TERMUX_PKG_SRCDIR - # Setup rst2man for man page generation of mpv.1: - pip install docutils - export RST2MAN=$HOME/.local/bin/rst2man.py - ./bootstrap.py ./waf configure \ @@ -26,7 +18,12 @@ termux_step_make_install () { --disable-jpeg \ --disable-lcms2 \ --disable-libass \ - --enable-openal + --disable-lua \ + --disable-pulse \ + --enable-openal \ + --disable-caca \ + --disable-alsa \ + --disable-x11 ./waf install @@ -35,12 +32,31 @@ termux_step_make_install () { echo "ao=opensles" > $TERMUX_PREFIX/etc/mpv/mpv.conf # Try to work around OpenSL ES library clashes: + # Linking against libOpenSLES causes indirect linkage against + # libskia.so, which links against the platform libjpeg.so and + # libpng.so, which are not compatible with the Termux ones. + # + # On Android N also liblzma seems to conflict. mkdir -p $TERMUX_PREFIX/libexec mv $TERMUX_PREFIX/bin/mpv $TERMUX_PREFIX/libexec local SYSTEM_LIBFOLDER=lib64 if [ $TERMUX_ARCH_BITS = 32 ]; then SYSTEM_LIBFOLDER=lib; fi + echo "#!/bin/sh" > $TERMUX_PREFIX/bin/mpv - echo "LD_LIBRARY_PATH=/system/$SYSTEM_LIBFOLDER:$TERMUX_PREFIX/lib $TERMUX_PREFIX/libexec/mpv \"\$@\"" >> $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_PRELOAD=$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: + 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 }