From ad0d9325a9b809e5539a30c0fc2a39577ee96578 Mon Sep 17 00:00:00 2001 From: badaix Date: Thu, 12 Apr 2018 23:45:01 +0200 Subject: [PATCH] update build process for Android --- README.md | 2 +- client/build_android.sh | 19 +++++++++---------- client/build_android_all.sh | 2 +- doc/build.md | 4 ++-- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 12081a58..219ae8ea 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ Snapcast can be controlled using a [JSON-RPC API](doc/json_rpc_api/v2_0_0.md): * Assign a client to a stream * ... -There is an Android client available in [Releases](https://github.com/badaix/snapcast/releases/latest) +There is an Android client [snapdroid](https://github.com/badaix/snapdroid) available in [Releases](https://github.com/badaix/snapdroid/releases/latest) ![Snapcast for Android](https://raw.githubusercontent.com/badaix/snapcast/master/doc/snapcast_android_scaled.png) diff --git a/client/build_android.sh b/client/build_android.sh index cfcc6f69..1c5a7efe 100755 --- a/client/build_android.sh +++ b/client/build_android.sh @@ -1,24 +1,23 @@ #/bin/sh -if [ -z "$NDK_DIR_ARM" ] && [ -z "$NDK_DIR_MIPS" ] && [ -z "$NDK_DIR_X86" ]; then - echo "Specify at least one NDK_DIR_[ARM|MIPS|X86]" +if [ -z "$NDK_DIR_ARM" ] && [ -z "$NDK_DIR_X86" ]; then + echo "Specify at least one NDK_DIR_[ARM|X86]" + exit +fi + +if [ -z "$ASSETS_DIR" ]; then + echo "Specify the snapdroid assets root dir ASSETS_DIR" exit fi if [ -n "$NDK_DIR_ARM" ]; then export NDK_DIR="$NDK_DIR_ARM" export ARCH=arm - make clean; make TARGET=ANDROID -j 4; mv ./snapclient ../android/Snapcast/src/main/assets/bin/armeabi/ -fi - -if [ -n "$NDK_DIR_MIPS" ]; then - export NDK_DIR="$NDK_DIR_MIPS" - export ARCH=mips - make clean; make TARGET=ANDROID -j 4; mv ./snapclient ../android/Snapcast/src/main/assets/bin/mips/ + make clean; make TARGET=ANDROID -j 4; mv ./snapclient "$ASSETS_DIR/bin/armeabi/" fi if [ -n "$NDK_DIR_X86" ]; then export NDK_DIR="$NDK_DIR_X86" export ARCH=x86 - make clean; make TARGET=ANDROID -j 4; mv ./snapclient ../android/Snapcast/src/main/assets/bin/x86/ + make clean; make TARGET=ANDROID -j 4; mv ./snapclient "$ASSETS_DIR/bin/x86/" fi diff --git a/client/build_android_all.sh b/client/build_android_all.sh index 1eea9214..21ff1751 100755 --- a/client/build_android_all.sh +++ b/client/build_android_all.sh @@ -1,7 +1,7 @@ #/bin/sh export NDK_DIR_ARM="$1-arm" -#export NDK_DIR_MIPS="$1-mips" export NDK_DIR_X86="$1-x86" +export ASSETS_DIR="$2" ./build_android.sh diff --git a/doc/build.md b/doc/build.md index cc0c0208..b462f939 100644 --- a/doc/build.md +++ b/doc/build.md @@ -161,9 +161,9 @@ Cross compile and install FLAC, ogg, and tremor (only needed once): Compile the Snapclient: $ cd /client - $ ./build_android_all.sh + $ ./build_android_all.sh -The binaries for `armeabi` and `x86` will be copied into the Android's assets directory (`/android/Snapcast/src/main/assets/bin/`) and so will be bundled with the Snapcast App. +The binaries for `armeabi` and `x86` will be copied into the Android's assets directory (`/bin/`) and so will be bundled with the Snapcast App. ## OpenWrt/LEDE (Cross compile)