diff --git a/app/src/main/jni/Android.mk b/app/src/main/jni/Android.mk index 462689603..f54507585 100644 --- a/app/src/main/jni/Android.mk +++ b/app/src/main/jni/Android.mk @@ -57,6 +57,12 @@ LOCAL_SRC_FILES := $(PREFIX)/lib/$(LOCAL_MODULE).so LOCAL_EXPORT_C_INCLUDES := $(PREFIX)/include include $(PREBUILT_SHARED_LIBRARY) +include $(CLEAR_VARS) +LOCAL_MODULE := libxml2 +LOCAL_SRC_FILES := $(PREFIX)/lib/$(LOCAL_MODULE).so +LOCAL_EXPORT_C_INCLUDES := $(PREFIX)/include +include $(PREBUILT_SHARED_LIBRARY) + include $(CLEAR_VARS) LOCAL_MODULE := libmpv LOCAL_SRC_FILES := $(PREFIX)/lib/libmpv.so diff --git a/buildscripts/include/depinfo.sh b/buildscripts/include/depinfo.sh index 0c08ba88f..84202229b 100755 --- a/buildscripts/include/depinfo.sh +++ b/buildscripts/include/depinfo.sh @@ -15,14 +15,16 @@ v_harfbuzz=12.2.0 v_fribidi=1.0.16 v_freetype=2.14.1 v_mbedtls=3.6.5 +v_libxml2=2.13.5 ## Dependency tree # I would've used a dict but putting arrays in a dict is not a thing dep_mbedtls=() +dep_libxml2=() dep_dav1d=() -dep_ffmpeg=(mbedtls dav1d) +dep_ffmpeg=(mbedtls dav1d libxml2) dep_freetype2=() dep_fribidi=() dep_harfbuzz=() diff --git a/buildscripts/include/download-deps.sh b/buildscripts/include/download-deps.sh index e6fbb23df..3b7c75f66 100755 --- a/buildscripts/include/download-deps.sh +++ b/buildscripts/include/download-deps.sh @@ -14,6 +14,13 @@ if [ ! -d mbedtls ]; then tar -xj -C mbedtls --strip-components=1 fi +# libxml2 +if [ ! -d libxml2 ]; then + mkdir libxml2 + $WGET https://gitlab.gnome.org/GNOME/libxml2/-/archive/v$v_libxml2/libxml2-v$v_libxml2.tar.gz -O - | \ + tar -xz -C libxml2 --strip-components=1 +fi + # dav1d [ ! -d dav1d ] && git clone https://github.com/videolan/dav1d diff --git a/buildscripts/scripts/ffmpeg.sh b/buildscripts/scripts/ffmpeg.sh index c9c73a74b..e90eab9cb 100755 --- a/buildscripts/scripts/ffmpeg.sh +++ b/buildscripts/scripts/ffmpeg.sh @@ -28,19 +28,16 @@ args=( --arch=${ndk_triple%%-*} --cpu=$cpu --extra-cflags="-I$prefix_dir/include $cpuflags" --extra-ldflags="-L$prefix_dir/lib" - --enable-{jni,mediacodec,mbedtls,libdav1d} --disable-vulkan + --enable-{jni,mediacodec,mbedtls,libdav1d,libxml2} --disable-vulkan --disable-static --enable-shared --enable-{gpl,version3} # disable unneeded parts --disable-{stripping,doc,programs} # to keep the build lean we disable some feature quite aggressively: - # - muxers, encoders: mpv-android does not have any way to use these # - devices: no practical use on Android - --disable-{muxers,encoders,devices} + --disable-{encoders,devices} # useful to taking screenshots --enable-encoder=mjpeg,png - # useful for the `dump-cache` command - --enable-muxer=mov,matroska,mpegts ) ../configure "${args[@]}" diff --git a/buildscripts/scripts/libxml2.sh b/buildscripts/scripts/libxml2.sh new file mode 100755 index 000000000..ad2a4e177 --- /dev/null +++ b/buildscripts/scripts/libxml2.sh @@ -0,0 +1,23 @@ +#!/bin/bash -e + +. ../../include/path.sh + +[ -f configure ] || ./autogen.sh --host=$ndk_triple --without-python + +if [ "$1" == "build" ]; then + true +elif [ "$1" == "clean" ]; then + make clean + exit 0 +else + exit 255 +fi + +$0 clean # separate building not supported, always clean + +./configure \ + --host=$ndk_triple \ + --without-python \ + --without-iconv +make -j$cores +make DESTDIR="$prefix_dir" install