2016-08-23 21:48:58 +02:00
|
|
|
TERMUX_PKG_HOMEPAGE=https://mpv.io/
|
|
|
|
TERMUX_PKG_DESCRIPTION="Command-line media player"
|
2019-01-21 13:53:58 +01:00
|
|
|
TERMUX_PKG_LICENSE="GPL-3.0"
|
2018-10-04 13:49:52 +02:00
|
|
|
TERMUX_PKG_VERSION=0.29.1
|
2018-11-22 20:40:45 +01:00
|
|
|
TERMUX_PKG_REVISION=1
|
2018-10-04 13:49:52 +02:00
|
|
|
TERMUX_PKG_SHA256=f9f9d461d1990f9728660b4ccb0e8cb5dce29ccaa6af567bec481b79291ca623
|
2016-08-23 21:48:58 +02:00
|
|
|
TERMUX_PKG_SRCURL=https://github.com/mpv-player/mpv/archive/v${TERMUX_PKG_VERSION}.tar.gz
|
2019-02-10 21:30:47 +01:00
|
|
|
TERMUX_PKG_DEPENDS="ffmpeg, openal-soft, libandroid-support, libandroid-glob, libpulseaudio"
|
2017-02-04 01:31:44 +01:00
|
|
|
TERMUX_PKG_RM_AFTER_INSTALL="share/icons share/applications"
|
2016-08-23 21:48:58 +02:00
|
|
|
|
2017-07-27 03:18:14 +02:00
|
|
|
termux_step_pre_configure() {
|
|
|
|
LDFLAGS+=" -landroid-glob"
|
|
|
|
}
|
|
|
|
|
2019-02-08 10:37:29 +01:00
|
|
|
termux_step_make_install() {
|
2016-08-23 21:48:58 +02:00
|
|
|
cd $TERMUX_PKG_SRCDIR
|
|
|
|
|
|
|
|
./bootstrap.py
|
|
|
|
|
|
|
|
./waf configure \
|
|
|
|
--prefix=$TERMUX_PREFIX \
|
|
|
|
--disable-gl \
|
|
|
|
--disable-jpeg \
|
|
|
|
--disable-lcms2 \
|
2018-06-26 02:48:48 +02:00
|
|
|
--disable-libarchive \
|
2016-08-27 00:50:24 +02:00
|
|
|
--disable-libass \
|
2017-03-06 03:38:40 +01:00
|
|
|
--disable-lua \
|
2018-08-06 19:41:49 +02:00
|
|
|
--enable-pulse \
|
2016-10-30 15:22:47 +01:00
|
|
|
--enable-openal \
|
2017-02-12 21:01:54 +01:00
|
|
|
--disable-caca \
|
2017-03-01 17:50:58 +01:00
|
|
|
--disable-alsa \
|
2018-07-24 19:32:17 +02:00
|
|
|
--disable-x11
|
2016-08-23 21:48:58 +02:00
|
|
|
|
2018-06-26 02:48:48 +02:00
|
|
|
./waf -v install
|
2016-08-26 11:49:20 +02:00
|
|
|
|
2016-08-27 18:15:46 +02:00
|
|
|
# Use opensles audio out be default:
|
|
|
|
mkdir -p $TERMUX_PREFIX/etc/mpv
|
2017-07-27 09:06:51 +02:00
|
|
|
cp $TERMUX_PKG_BUILDER_DIR/mpv.conf $TERMUX_PREFIX/etc/mpv/mpv.conf
|
2016-08-27 18:15:46 +02:00
|
|
|
|
2016-08-26 11:49:20 +02:00
|
|
|
# Try to work around OpenSL ES library clashes:
|
2016-09-04 00:45:08 +02:00
|
|
|
# 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.
|
2016-08-26 11:49:20 +02:00
|
|
|
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
|
2017-02-21 23:54:52 +01:00
|
|
|
|
2016-08-26 11:49:20 +02:00
|
|
|
echo "#!/bin/sh" > $TERMUX_PREFIX/bin/mpv
|
2017-02-21 23:54:52 +01:00
|
|
|
|
|
|
|
# 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
|
2017-02-22 09:14:31 +01:00
|
|
|
echo "export LD_PRELOAD=$FFMPEG_LIBS" >> $TERMUX_PREFIX/bin/mpv
|
2017-02-21 23:54:52 +01:00
|
|
|
|
2016-11-24 00:47:13 +01:00
|
|
|
# /system/vendor/lib(64) needed for libqc-opt.so on
|
2017-02-21 23:54:52 +01:00
|
|
|
# a xperia z5 c, reported by BrainDamage on #termux:
|
2018-08-24 04:34:59 +02:00
|
|
|
echo "LD_LIBRARY_PATH=/system/$SYSTEM_LIBFOLDER:/system/vendor/$SYSTEM_LIBFOLDER:$TERMUX_PREFIX/lib exec $TERMUX_PREFIX/libexec/mpv \"\$@\"" >> $TERMUX_PREFIX/bin/mpv
|
2017-02-21 23:54:52 +01:00
|
|
|
|
2016-08-26 11:49:20 +02:00
|
|
|
chmod +x $TERMUX_PREFIX/bin/mpv
|
2016-08-23 21:48:58 +02:00
|
|
|
}
|