From 8ef67297fa39981f0c0abe45fc87ce9cc05a8de3 Mon Sep 17 00:00:00 2001 From: Erica Marigold Date: Fri, 1 Sep 2023 13:50:08 +0530 Subject: [PATCH] feat: include build script for aarch64-linux-android --- package/android/build.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 package/android/build.sh diff --git a/package/android/build.sh b/package/android/build.sh new file mode 100644 index 0000000..43baea8 --- /dev/null +++ b/package/android/build.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +set -e + +cd lune-src +current_ver=$(git describe --tags --abbrev=0) + +[[ $(cat ../build.VERSION) == $current_ver ]] && echo "[!] Already at latest build, skipping" && exit 0 + +wget https://dl.google.com/android/repository/android-ndk-r25c-linux.zip && unzip android-ndk-*.zip +mv android-ndk-r25c $HOME/android-ndk + +export PATH="$PATH:$HOME/android-ndk" +export ANDROID_NDK=$HOME/android-ndk +export ANDROID_NDK_HOME=$HOME/android-ndk +export PATH="$PATH:$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/" + +cp ../package/android/.cargo/config $HOME/.cargo/config + +rustup toolchain install aarch64-linux-android + +mv $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-clang +mv $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar + +cargo build --release --target aarch64-linux-android + +# Create outputs +cp $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so build/libc++_shared.so +cp target/aarch64-linux-android/release/lune build/lune + +zip "lune-$current_ver-aarch64-linux-android.zip" build/*