Skip to content

Commit

Permalink
Upgrade to NDK r27c for Android builds on GitHub Actions
Browse files Browse the repository at this point in the history
saudet committed Nov 19, 2024
1 parent f9015bb commit c08e6f0
Showing 4 changed files with 13 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/actions/deploy-ubuntu/action.yml
Original file line number Diff line number Diff line change
@@ -155,9 +155,9 @@ runs:
fi
if [[ $CI_DEPLOY_PLATFORM == android-* ]]; then
curl -LO https://dl.google.com/android/repository/android-ndk-r21e-linux-x86_64.zip
unzip -qq android-ndk-r21e-linux-x86_64.zip
ln -sf android-ndk-r21e android-ndk
curl -LO https://dl.google.com/android/repository/android-ndk-r27c-linux.zip
unzip -qq android-ndk-r27c-linux.zip
ln -sf android-ndk-r27c android-ndk
export MAVEN_OPTIONS="-Djavacpp.platform.root=$(pwd)/android-ndk/ -Djava.library.path="
else
export MAVEN_OPTIONS="-Djavacpp.platform.compiler=$PREFIX-g++ -Djava.library.path=/usr/$PREFIX/lib/:/usr/lib/$PREFIX/:$USERLAND_PATH/build/lib/"
1 change: 1 addition & 0 deletions cppbuild.sh
Original file line number Diff line number Diff line change
@@ -99,6 +99,7 @@ export ANDROID_BIN="$ANDROID_NDK/toolchains/llvm/prebuilt/$KERNEL-$ARCH/"
export ANDROID_CC="$ANDROID_NDK/toolchains/llvm/prebuilt/$KERNEL-$ARCH/bin/clang"
export ANDROID_CPP="$ANDROID_NDK/sources/cxx-stl/llvm-libc++/"
export ANDROID_PREFIX="$ANDROID_BIN/bin/llvm"
export ANDROID_NDK_ROOT="$ANDROID_NDK"
export ANDROID_ROOT=
case $PLATFORM in
android-arm)
10 changes: 5 additions & 5 deletions ffmpeg/cppbuild.sh
Original file line number Diff line number Diff line change
@@ -116,7 +116,7 @@ export PATH=$INSTALL_PATH/bin:$PATH
export PKG_CONFIG_PATH=$INSTALL_PATH/lib/pkgconfig/

patch -Np1 -d $LAME < ../../lame.patch
patch -Np1 -d $OPENSSL < ../../openssl-android.patch
# patch -Np1 -d $OPENSSL < ../../openssl-android.patch
patch -Np1 -d ffmpeg-$FFMPEG_VERSION < ../../ffmpeg.patch
patch -Np1 -d ffmpeg-$FFMPEG_VERSION < ../../ffmpeg-vulkan.patch
# patch -Np1 -d ffmpeg-$FFMPEG_VERSION < ../../ffmpeg-flv-support-hevc-opus.patch
@@ -197,7 +197,7 @@ case $PLATFORM in
make install
cd ../$OPENSSL
PATH="${ANDROID_CC%/*}:$ANDROID_BIN/bin:$PATH" ./Configure --prefix=$INSTALL_PATH --libdir=lib android-arm no-shared no-tests -D__ANDROID_API__=24
ANDROID_DEV="$ANDROID_ROOT/usr" make -s -j $MAKEJ
PATH="${ANDROID_CC%/*}:$ANDROID_BIN/bin:$PATH" ANDROID_DEV="$ANDROID_ROOT/usr" make -s -j $MAKEJ
make install_dev
cd ../srt-$LIBSRT_VERSION
patch -Np1 < ../../../srt-android.patch || true
@@ -353,7 +353,7 @@ EOF
make install
cd ../$OPENSSL
PATH="${ANDROID_CC%/*}:$ANDROID_BIN/bin:$PATH" ./Configure --prefix=$INSTALL_PATH --libdir=lib android-arm64 no-shared no-tests -D__ANDROID_API__=24
ANDROID_DEV="$ANDROID_ROOT/usr" make -s -j $MAKEJ
PATH="${ANDROID_CC%/*}:$ANDROID_BIN/bin:$PATH" ANDROID_DEV="$ANDROID_ROOT/usr" make -s -j $MAKEJ
make install_dev
cd ../srt-$LIBSRT_VERSION
patch -Np1 < ../../../srt-android.patch || true
@@ -508,7 +508,7 @@ EOF
make install
cd ../$OPENSSL
PATH="${ANDROID_CC%/*}:$ANDROID_BIN/bin:$PATH" ./Configure --prefix=$INSTALL_PATH --libdir=lib android-x86 no-shared no-tests -D__ANDROID_API__=24
ANDROID_DEV="$ANDROID_ROOT/usr" make -s -j $MAKEJ
PATH="${ANDROID_CC%/*}:$ANDROID_BIN/bin:$PATH" ANDROID_DEV="$ANDROID_ROOT/usr" make -s -j $MAKEJ
make install_dev
cd ../srt-$LIBSRT_VERSION
patch -Np1 < ../../../srt-android.patch || true
@@ -660,7 +660,7 @@ EOF
make install
cd ../$OPENSSL
PATH="${ANDROID_CC%/*}:$ANDROID_BIN/bin:$PATH" ./Configure --prefix=$INSTALL_PATH --libdir=lib android-x86_64 no-shared no-tests -D__ANDROID_API__=24
ANDROID_DEV="$ANDROID_ROOT/usr" make -s -j $MAKEJ
PATH="${ANDROID_CC%/*}:$ANDROID_BIN/bin:$PATH" ANDROID_DEV="$ANDROID_ROOT/usr" make -s -j $MAKEJ
make install_dev
cd ../srt-$LIBSRT_VERSION
patch -Np1 < ../../../srt-android.patch || true
4 changes: 4 additions & 0 deletions tensorflow-lite/cppbuild.sh
Original file line number Diff line number Diff line change
@@ -49,15 +49,19 @@ cd build

case $PLATFORM in
android-arm)
export AR=ar
export CMAKE_FLAGS="-DCMAKE_TOOLCHAIN_FILE=${PLATFORM_ROOT}/build/cmake/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DANDROID_NATIVE_API_LEVEL=24 $CMAKE_FLAGS"
;;
android-arm64)
export AR=ar
export CMAKE_FLAGS="-DCMAKE_TOOLCHAIN_FILE=${PLATFORM_ROOT}/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NATIVE_API_LEVEL=24 -DXNNPACK_ENABLE_ARM_I8MM=OFF $CMAKE_FLAGS"
;;
android-x86)
export AR=ar
export CMAKE_FLAGS="-DCMAKE_TOOLCHAIN_FILE=${PLATFORM_ROOT}/build/cmake/android.toolchain.cmake -DANDROID_ABI=x86 -DANDROID_NATIVE_API_LEVEL=24 $CMAKE_FLAGS"
;;
android-x86_64)
export AR=ar
export CMAKE_FLAGS="-DCMAKE_TOOLCHAIN_FILE=${PLATFORM_ROOT}/build/cmake/android.toolchain.cmake -DANDROID_ABI=x86_64 -DANDROID_NATIVE_API_LEVEL=24 -DXNNPACK_ENABLE_AVXVNNI=OFF $CMAKE_FLAGS"
;;
linux-armhf)

0 comments on commit c08e6f0

Please sign in to comment.