Skip to content

Commit

Permalink
Update build-syncthing.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Catfriend1 committed Dec 7, 2022
1 parent 33112df commit be639d9
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions syncthing/build-syncthing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
]

Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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()
Expand All @@ -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)

Expand Down

0 comments on commit be639d9

Please sign in to comment.