From cd376d7da4585441108733206fbd1b8687b0e31d Mon Sep 17 00:00:00 2001 From: Tom Yan Date: Tue, 26 Jun 2018 15:37:17 +0800 Subject: [PATCH] mpv: build with --disable-android Since 0.28 the android build option is used for a few features that are not useful in Termux (as we don't do video output and JNI isn't available) In 0.27 the option is only used to enable some wrapping of strnlen, as it was broken (but also fixed) long time ago in Android. Therefore instead of the extra patching that do us no good, let us simply build with --disable-android and disable the wrapping. Also use vid=no instead of vo=null in mpv.conf, as the latter does not prevent video decoding. --- packages/mpv/build.sh | 4 +++- packages/mpv/mpv.conf | 4 ++-- packages/mpv/strnlen.h.patch | 16 +++++++++++++++ packages/mpv/video-out-gpu.context.c.patch | 13 ------------ packages/mpv/wscript.patch | 23 ---------------------- packages/mpv/wscript_build.py.patch | 12 ----------- 6 files changed, 21 insertions(+), 51 deletions(-) create mode 100644 packages/mpv/strnlen.h.patch delete mode 100644 packages/mpv/video-out-gpu.context.c.patch delete mode 100644 packages/mpv/wscript.patch delete mode 100644 packages/mpv/wscript_build.py.patch diff --git a/packages/mpv/build.sh b/packages/mpv/build.sh index 7a093e3df..5e0b97307 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.28.2 +TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=aada14e025317b5b3e8e58ffaf7902e8b6e4ec347a93d25a7c10d3579426d795 TERMUX_PKG_SRCURL=https://github.com/mpv-player/mpv/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_DEPENDS="ffmpeg, openal-soft, libandroid-glob" @@ -27,7 +28,8 @@ termux_step_make_install () { --enable-openal \ --disable-caca \ --disable-alsa \ - --disable-x11 + --disable-x11 \ + --disable-android ./waf -v install diff --git a/packages/mpv/mpv.conf b/packages/mpv/mpv.conf index 0d030c841..b65a18b00 100644 --- a/packages/mpv/mpv.conf +++ b/packages/mpv/mpv.conf @@ -6,5 +6,5 @@ ao=opensles # Increase audio buffer to help with stuttering with bluetooth devices. See #1127. audio-buffer=0.5 -# Disable Video Output. Termux doesn't support video output (with the exception of "tct"). -vo=null +# Disable Video Decode and Output. Termux doesn't support video output (with the exception of "tct"). +vid=no diff --git a/packages/mpv/strnlen.h.patch b/packages/mpv/strnlen.h.patch new file mode 100644 index 000000000..66c841d76 --- /dev/null +++ b/packages/mpv/strnlen.h.patch @@ -0,0 +1,16 @@ +diff --git a/osdep/strnlen.h b/osdep/strnlen.h +index 0a971d0ab0..9a8b2a104d 100644 +--- a/osdep/strnlen.h ++++ b/osdep/strnlen.h +@@ -19,11 +19,4 @@ + + #ifndef MP_OSDEP_STRNLEN + #define MP_OSDEP_STRNLEN +- +-#ifdef __ANDROID__ +-// strnlen is broken on current android ndk, see https://code.google.com/p/android/issues/detail?id=74741 +-#include "osdep/android/strnlen.h" +-#define strnlen freebsd_strnlen +-#endif +- + #endif diff --git a/packages/mpv/video-out-gpu.context.c.patch b/packages/mpv/video-out-gpu.context.c.patch deleted file mode 100644 index 38bc9ed72..000000000 --- a/packages/mpv/video-out-gpu.context.c.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -u -r ../mpv-0.28.2/video/out/gpu/context.c ./video/out/gpu/context.c ---- ../mpv-0.28.2/video/out/gpu/context.c 2018-02-13 02:07:05.000000000 +0000 -+++ ./video/out/gpu/context.c 2018-06-24 00:34:19.827691478 +0000 -@@ -63,7 +63,9 @@ - - // OpenGL contexts: - #if HAVE_ANDROID -+# if HAVE_GL - &ra_ctx_android, -+# endif - #endif - #if HAVE_RPI - &ra_ctx_rpi, diff --git a/packages/mpv/wscript.patch b/packages/mpv/wscript.patch deleted file mode 100644 index eac9fba73..000000000 --- a/packages/mpv/wscript.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -u -r ../mpv-0.28.2/wscript ./wscript ---- ../mpv-0.28.2/wscript 2018-02-13 03:07:05.000000000 +0100 -+++ ./wscript 2018-06-25 14:48:26.288156610 +0200 -@@ -154,9 +154,7 @@ - 'name': '--android', - 'desc': 'Android environment', - 'func': compose_checks( -- check_statement('android/api-level.h', '(void)__ANDROID__'), # arbitrary android-specific header -- check_cc(lib="android"), -- check_cc(lib="EGL"), -+ check_statement('android/api-level.h', '(void)__ANDROID__') # arbitrary android-specific header - ) - }, { - 'name': 'posix-or-mingw', -@@ -813,7 +811,7 @@ - 'name': 'egl-helpers', - 'desc': 'EGL helper functions', - 'deps': 'egl-x11 || mali-fbdev || rpi || gl-wayland || egl-drm || ' + -- 'egl-angle-win32 || android', -+ 'egl-angle-win32', - 'func': check_true - } - ] diff --git a/packages/mpv/wscript_build.py.patch b/packages/mpv/wscript_build.py.patch deleted file mode 100644 index 8af753ac4..000000000 --- a/packages/mpv/wscript_build.py.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -u -r ../mpv-0.28.2/wscript_build.py ./wscript_build.py ---- ../mpv-0.28.2/wscript_build.py 2018-02-13 02:07:05.000000000 +0000 -+++ ./wscript_build.py 2018-06-24 00:28:49.967625363 +0000 -@@ -409,7 +409,7 @@ - ( "video/out/opengl/context_drm_egl.c", "egl-drm" ), - ( "video/out/opengl/context_dxinterop.c","gl-dxinterop" ), - ( "video/out/opengl/context_mali_fbdev.c","mali-fbdev" ), -- ( "video/out/opengl/context_android.c", "android" ), -+ ( "video/out/opengl/context_android.c", "android && gl" ), - ( "video/out/opengl/context_rpi.c", "rpi" ), - ( "video/out/opengl/context_vdpau.c", "vdpau-gl-x11" ), - ( "video/out/opengl/context_wayland.c", "gl-wayland" ),