From c7b433bc65567e864681f669c3338a1d96413223 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Tue, 5 Nov 2019 11:02:24 +0100 Subject: [PATCH] build x86_64 binary to accomodate google play (#1430) --- .travis.yml | 7 ++++--- docker/prebuild.sh | 6 +++++- syncthing/build-syncthing.py | 7 +++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8e19c203..3e938ec5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,9 +14,10 @@ android: # Install Android NDK (apparently there is no easier way to do this) # https://github.com/travis-ci/travis-ci/issues/5395 before_script: - - curl -L https://dl.google.com/android/repository/android-ndk-r15c-linux-x86_64.zip -O - - unzip -q android-ndk-r15c-linux-x86_64.zip - - export ANDROID_NDK_HOME=`pwd`/android-ndk-r15c + - export NDK_VERSION=r20 + - curl -L https://dl.google.com/android/repository/android-ndk-${NDK_VERSION}-linux-x86_64.zip -O + - unzip -q android-ndk-${NDK_VERSION}-linux-x86_64.zip + - export ANDROID_NDK_HOME=`pwd`/android-ndk-${NDK_VERSION} before_install: # Install Go using gimme tool diff --git a/docker/prebuild.sh b/docker/prebuild.sh index b03505ce..219aaa48 100755 --- a/docker/prebuild.sh +++ b/docker/prebuild.sh @@ -2,7 +2,7 @@ [ -z "$SYNCTHING_ANDROID_PREBUILT" ] && echo "Prebuild disabled" && exit 0 -for ARCH in arm x86 arm64; do +for ARCH in arm x86 arm64 x86_64; do GOARCH=${ARCH} SDK=16 case ${ARCH} in @@ -17,6 +17,10 @@ for ARCH in arm x86 arm64; do GOARCH=386 GCC="i686-linux-android-clang" ;; + x86_64) + SDK=21 + GCC="x86_64-linux-android21-clang" + ;; *) echo "Invalid architecture" exit 1 diff --git a/syncthing/build-syncthing.py b/syncthing/build-syncthing.py index b1b2eea0..c13ad1ad 100644 --- a/syncthing/build-syncthing.py +++ b/syncthing/build-syncthing.py @@ -26,6 +26,13 @@ BUILD_TARGETS = [ 'goarch': '386', 'jni_dir': 'x86', 'cc': 'i686-linux-android-clang', + }, + { + 'arch': 'x86_64', + 'goarch': 'amd64', + 'jni_dir': 'x86_64', + 'cc': 'x86_64-linux-android21-clang', + 'min_sdk': 21, } ]