[Android] buildsystem: add an option to use prebuilt contribs if available

Steve Lhomme git at videolan.org
Wed Nov 20 06:47:54 UTC 2024


vlc-android | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Sep  4 13:32:03 2024 +0200| [e9c7dc8f546399fd2336e06342ab94a8f2bd3ef8] | committer: Duncan McNamara

buildsystem: add an option to use prebuilt contribs if available

If the prebuilt tarball is not available, the contribs are built normally.

> https://code.videolan.org/videolan/vlc-android/commit/e9c7dc8f546399fd2336e06342ab94a8f2bd3ef8
---

 buildsystem/compile.sh | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/buildsystem/compile.sh b/buildsystem/compile.sh
index 8a3e7398a8..3edc8455ed 100755
--- a/buildsystem/compile.sh
+++ b/buildsystem/compile.sh
@@ -36,6 +36,7 @@ while [ $# -gt 0 ]; do
             echo "Use -c to get a ChromeOS build"
             echo "Use -l to build only LibVLC"
             echo "Use -b to bypass libvlc source checks (vlc custom sources)"
+            echo "Use -t to use prebuilt contribs for LibVLC"
             echo "Use -m2 to set the maven local repository path to use"
             echo "Use -tv to include the TV module"
             exit 0
@@ -67,6 +68,9 @@ while [ $# -gt 0 ]; do
             BUILD_LIBVLC=1
             NO_ML=1
             ;;
+        -t)
+            PREBUILT_CONTRIBS=1
+            ;;
         -ml)
             BUILD_MEDIALIB=1
             ;;
@@ -116,18 +120,28 @@ fi
 if [ -z "$ANDROID_ABI" ]; then
    diagnostic "*** No ANDROID_ABI defined architecture: using arm64-v8a"
    ANDROID_ABI="arm64-v8a"
+   ARCH="arm64"
+   TRIPLET="aarch64-linux-android"
 fi
 
 if [ "$ANDROID_ABI" = "armeabi-v7a" -o "$ANDROID_ABI" = "arm" ]; then
     ANDROID_ABI="armeabi-v7a"
     GRADLE_ABI="ARMv7"
+    ARCH="arm"
+    TRIPLET="arm-linux-androideabi"
 elif [ "$ANDROID_ABI" = "arm64-v8a" -o "$ANDROID_ABI" = "arm64" ]; then
     ANDROID_ABI="arm64-v8a"
     GRADLE_ABI="ARMv8"
+    ARCH="arm64"
+    TRIPLET="aarch64-linux-android"
 elif [ "$ANDROID_ABI" = "x86" ]; then
     GRADLE_ABI="x86"
+    ARCH="x86"
+    TRIPLET="i686-linux-android"
 elif [ "$ANDROID_ABI" = "x86_64" ]; then
     GRADLE_ABI="x86_64"
+    ARCH="x86_64"
+    TRIPLET="x86_64-linux-android"
 else
     diagnostic "Invalid arch specified: '$ANDROID_ABI'."
     diagnostic "Try --help for more information"
@@ -324,8 +338,16 @@ OUT_DBG_DIR=.dbg/${ANDROID_ABI}
 mkdir -p $OUT_DBG_DIR
 
 if [ "$BUILD_MEDIALIB" != 1 -o ! -d "${VLC_LIBJNI_PATH}/libvlc/jni/libs/" ]; then
-    AVLC_SOURCED=1 . ${VLC_LIBJNI_PATH}/buildsystem/compile-libvlc.sh
-    avlc_build
+    if [ "$PREBUILT_CONTRIBS" = 1 ];then
+        VLC_CONTRIB_SHA="$(cd ${VLC_LIBJNI_PATH}/vlc && extras/ci/get-contrib-sha.sh android-${ARCH})"
+        if [ "$FORCE_VLC_4" = 1 ]; then
+            export VLC_PREBUILT_CONTRIBS_URL="https://artifacts.videolan.org/vlc/android-${ARCH}/vlc-contrib-${TRIPLET}-${VLC_CONTRIB_SHA}.tar.bz2"
+        else
+            export VLC_PREBUILT_CONTRIBS_URL="https://artifacts.videolan.org/vlc-3.0/android-${ARCH}/vlc-contrib-${TRIPLET}-${VLC_CONTRIB_SHA}.tar.bz2"
+        fi
+        if ${VLC_LIBJNI_PATH}/vlc/extras/ci/check-url.sh "$VLC_PREBUILT_CONTRIBS_URL"; then CONTRIB_FLAGS="--with-prebuilt-contribs"; fi
+    fi
+    ${VLC_LIBJNI_PATH}/buildsystem/compile-libvlc.sh -a ${ARCH} ${CONTRIB_FLAGS}
 
     cp -a ${VLC_LIBJNI_PATH}/libvlc/jni/obj/local/${ANDROID_ABI}/*.so ${OUT_DBG_DIR}
 fi



More information about the Android mailing list