From be639d9fd79ac85093cc968ea585d4dada9e861d Mon Sep 17 00:00:00 2001 From: Catfriend1 <16361913+Catfriend1@users.noreply.github.com> Date: Wed, 7 Dec 2022 15:05:55 +0100 Subject: [PATCH] Update build-syncthing.py --- syncthing/build-syncthing.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/syncthing/build-syncthing.py b/syncthing/build-syncthing.py index 84433643a..79e72a9f8 100644 --- a/syncthing/build-syncthing.py +++ b/syncthing/build-syncthing.py @@ -34,19 +34,19 @@ 'arch': 'arm', 'goarch': 'arm', 'jni_dir': 'armeabi', - 'clang': 'armv7a-linux-androideabi19-clang', + 'cc': 'armv7a-linux-androideabi{}-clang', }, { 'arch': 'arm64', 'goarch': 'arm64', 'jni_dir': 'arm64-v8a', - 'clang': 'aarch64-linux-android21-clang', + 'cc': 'aarch64-linux-android{}-clang', }, { 'arch': 'x86', 'goarch': '386', 'jni_dir': 'x86', - 'clang': 'i686-linux-android19-clang', + 'cc': 'i686-linux-android{}-clang', } ] @@ -297,6 +297,7 @@ def install_ndk(): project_dir = os.path.realpath(os.path.join(module_dir, '..')) syncthing_dir = os.path.join(module_dir, 'src', 'github.com', 'syncthing', 'syncthing') prerequisite_tools_dir = os.path.dirname(os.path.realpath(__file__)) + os.path.sep + ".." + os.path.sep + ".." + os.path.sep + "syncthing-android-prereq" +min_sdk = get_min_sdk(project_dir) # Check if git is available. git_bin = which("git"); @@ -360,14 +361,14 @@ def install_ndk(): print('') print('*** Building for', target['arch']) - ndk_clang_fullfn = os.path.join( + cc = os.path.join( os.environ['ANDROID_NDK_HOME'], 'toolchains', 'llvm', 'prebuilt', PLATFORM_DIRS[platform.system()], 'bin', - target['clang'], + target['cc'].format(min_sdk), ) environ = os.environ.copy() @@ -379,8 +380,9 @@ def install_ndk(): subprocess.check_call([go_bin, 'mod', 'download'], cwd=syncthing_dir) subprocess.check_call([ - go_bin, 'run', 'build.go', '-goos', 'android', '-goarch', target['goarch'], - '-cc', ndk_clang_fullfn, + go_bin, 'run', 'build.go', '-goos', 'android', + '-goarch', target['goarch'], + '-cc', cc, '-version', syncthingVersion ] + ['-no-upgrade', 'build'], env=environ, cwd=syncthing_dir)