diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f6ec0be55..ae7183755 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,6 @@ name: build on: - - push - pull_request jobs: @@ -34,7 +33,7 @@ jobs: - name: Install deps run: | sudo apt-get update - sudo apt-get install autoconf pkgconf libtool ninja-build python3-pip + sudo apt-get install autoconf pkgconf libtool ninja-build python3-pip gperf sudo pip3 install meson - name: Download deps diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index 9f823c19d..aaf7512cb 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -27,7 +27,7 @@ jobs: - name: Install deps run: | sudo apt-get update - sudo apt-get install autoconf pkg-config libtool ninja-build python3-pip + sudo apt-get install autoconf pkg-config libtool ninja-build python3-pip gperf sudo pip3 install meson - name: Build the release artifacts diff --git a/buildscripts/Dockerfile b/buildscripts/Dockerfile index 2ac50aaf6..d3a96c075 100644 --- a/buildscripts/Dockerfile +++ b/buildscripts/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:24.04 +FROM ubuntu:26.04 # Set up environment variables ENV DEBIAN_FRONTEND=noninteractive diff --git a/buildscripts/include/depinfo.sh b/buildscripts/include/depinfo.sh index f73a3865d..f51c65f7b 100755 --- a/buildscripts/include/depinfo.sh +++ b/buildscripts/include/depinfo.sh @@ -15,22 +15,24 @@ v_harfbuzz=13.0.1 v_fribidi=1.0.16 v_freetype=2.14.2 v_mbedtls=3.6.5 -v_libxml2=2.13.5 v_ffmpeg=n7.1 +v_libxml2=2.15.2 +v_fontconfig=2.17.1 ## 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_libxml2=() dep_ffmpeg=(mbedtls dav1d libxml2) dep_freetype2=() +dep_fontconfig=(libxml2 freetype2) dep_fribidi=() dep_harfbuzz=() dep_unibreak=() -dep_libass=(freetype2 fribidi harfbuzz unibreak) +dep_libass=(freetype2 fontconfig fribidi harfbuzz unibreak) dep_lua=() dep_libplacebo=() dep_mpv=(ffmpeg libass lua libplacebo) @@ -43,4 +45,4 @@ dep_mpv_android=(mpv) v_ci_ffmpeg=n8.0 # filename used to uniquely identify a build prefix -ci_tarball="prefix-ndk-${v_ndk}-lua-${v_lua}-unibreak-${v_unibreak}-harfbuzz-${v_harfbuzz}-fribidi-${v_fribidi}-freetype-${v_freetype}-mbedtls-${v_mbedtls}-ffmpeg-${v_ci_ffmpeg}.tgz" +ci_tarball="prefix-ndk-${v_ndk}-lua-${v_lua}-unibreak-${v_unibreak}-harfbuzz-${v_harfbuzz}-fribidi-${v_fribidi}-freetype-${v_freetype}-libxml2-${v_libxml2}-fontconfig-${v_fontconfig}-mbedtls-${v_mbedtls}-ffmpeg-${v_ci_ffmpeg}.tgz" diff --git a/buildscripts/include/download-deps.sh b/buildscripts/include/download-deps.sh index a179c563c..969678e70 100755 --- a/buildscripts/include/download-deps.sh +++ b/buildscripts/include/download-deps.sh @@ -14,13 +14,6 @@ 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 --depth 1 https://github.com/videolan/dav1d @@ -56,6 +49,20 @@ if [ ! -d unibreak ]; then tar -xz -C unibreak --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 + +# fontconfig +if [ ! -d fontconfig ]; then + mkdir fontconfig + $WGET https://gitlab.freedesktop.org/fontconfig/fontconfig/-/archive/${v_fontconfig}/fontconfig-${v_fontconfig}.tar.gz -O - | \ + tar -xz -C fontconfig --strip-components=1 +fi + # libass [ ! -d libass ] && git clone --depth 1 https://github.com/libass/libass diff --git a/buildscripts/include/download-sdk.sh b/buildscripts/include/download-sdk.sh index 5689e2837..bdfa6b05a 100755 --- a/buildscripts/include/download-sdk.sh +++ b/buildscripts/include/download-sdk.sh @@ -11,10 +11,10 @@ if [ "$os" == "linux" ]; then if [ $IN_CI -eq 0 ]; then if hash yum &>/dev/null; then sudo yum install autoconf pkgconfig libtool ninja-build \ - unzip wget meson nasm + unzip wget meson nasm gperf elif apt-get -v &>/dev/null; then sudo apt-get install autoconf pkg-config libtool ninja-build \ - unzip wget meson nasm + unzip wget meson nasm gperf else echo "Note: dependencies were not installed, you have to do that manually." fi @@ -38,7 +38,7 @@ elif [ "$os" == "mac" ]; then fi brew install \ automake autoconf libtool pkg-config \ - coreutils gnu-sed wget meson ninja + coreutils gnu-sed wget meson ninja gperf fi if ! javac -version &>/dev/null; then echo "Error: missing Java Development Kit. Install it manually." diff --git a/buildscripts/scripts/fontconfig.sh b/buildscripts/scripts/fontconfig.sh new file mode 100755 index 000000000..bfcaf3cd2 --- /dev/null +++ b/buildscripts/scripts/fontconfig.sh @@ -0,0 +1,23 @@ +#!/bin/bash -e + +. ../../include/path.sh + +build=_build$ndk_suffix + +if [ "$1" == "build" ]; then + true +elif [ "$1" == "clean" ]; then + rm -rf $build + exit 0 +else + exit 255 +fi + +unset CC CXX # meson wants these unset + +meson setup $build --cross-file "$prefix_dir"/crossfile.txt \ + -D{tests,doc,tools,nls}=disabled \ + -Dxml-backend=libxml2 + +ninja -C $build -j$cores +DESTDIR="$prefix_dir" ninja -C $build install diff --git a/buildscripts/scripts/libass.sh b/buildscripts/scripts/libass.sh index 739916dec..e7991f6b4 100755 --- a/buildscripts/scripts/libass.sh +++ b/buildscripts/scripts/libass.sh @@ -19,7 +19,7 @@ cd _build$ndk_suffix ../configure \ --host=$ndk_triple --with-pic \ --enable-static --disable-shared \ - --enable-libunibreak --disable-require-system-font-provider + --enable-libunibreak --enable-fontconfig make -j$cores make DESTDIR="$prefix_dir" install diff --git a/buildscripts/scripts/libxml2.sh b/buildscripts/scripts/libxml2.sh index ad2a4e177..7a3e7a5a4 100755 --- a/buildscripts/scripts/libxml2.sh +++ b/buildscripts/scripts/libxml2.sh @@ -2,22 +2,22 @@ . ../../include/path.sh -[ -f configure ] || ./autogen.sh --host=$ndk_triple --without-python +build=_build$ndk_suffix if [ "$1" == "build" ]; then true elif [ "$1" == "clean" ]; then - make clean + rm -rf $build exit 0 else exit 255 fi -$0 clean # separate building not supported, always clean +unset CC CXX # meson wants these unset -./configure \ - --host=$ndk_triple \ - --without-python \ - --without-iconv -make -j$cores -make DESTDIR="$prefix_dir" install +meson setup $build --cross-file "$prefix_dir"/crossfile.txt \ + -Dminimum=true -D{push,reader,sax1,iso8859x,pattern}=enabled \ + --default-library=shared + +ninja -C $build -j$cores +DESTDIR="$prefix_dir" ninja -C $build install diff --git a/lib/build.gradle.kts b/lib/build.gradle.kts index baf2fd327..ec8d72a59 100644 --- a/lib/build.gradle.kts +++ b/lib/build.gradle.kts @@ -10,7 +10,7 @@ plugins { val abiCodes = mapOf("armeabi-v7a" to 1, "arm64-v8a" to 2, "x86" to 3, "x86_64" to 4) val universalBase = 8000 -version = "0.1.13" +version = "0.1.14" group = "io.github.secozzi" android { diff --git a/lib/src/main/assets/subfont.ttf b/lib/src/main/assets/subfont.ttf deleted file mode 100644 index 9659afc65..000000000 Binary files a/lib/src/main/assets/subfont.ttf and /dev/null differ diff --git a/lib/src/main/java/is/xyz/mpv/Utils.kt b/lib/src/main/java/is/xyz/mpv/Utils.kt index 7fa045182..743e74202 100644 --- a/lib/src/main/java/is/xyz/mpv/Utils.kt +++ b/lib/src/main/java/is/xyz/mpv/Utils.kt @@ -57,12 +57,15 @@ object Utils { fun copyAssets(context: Context) { val assetManager = context.assets - val files = arrayOf("subfont.ttf", "cacert.pem") + val files = arrayOf("cacert.pem") val configDir = context.filesDir.path for (name in files) { copyAssetFile(assetManager, name, File("$configDir/$name")) } + + // we used to ship this, but it's no longer needed + File("$configDir/subfont.ttf").delete() } fun findRealPath(fd: Int): String? {