Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Catfriend1 committed Sep 27, 2021
2 parents 888de72 + ed2d396 commit f13ae5b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ Make sure, git (or git.exe) is installed and available on the PATH environment v

## Build instructions

```
git clone https://github.com/Catfriend1/syncthing-android.git --recursive
```

Edit "App_build_and_release.cmd" and set "SKIP_RELEASE_BUILD=1" if you don't need to upload signed releases to Google Play. This will simplify things for you.

### Build on Linux
Expand All @@ -80,6 +76,10 @@ A Linux VM, for example running Debian, is recommended to build this.

Build SyncthingNative and the Syncthing-Android wrapper using the following commands:
```
apt-get -y install git openjdk-11-jdk
mkdir -p /root/work
git clone https://github.com/Catfriend1/syncthing-android.git --recursive
cd /root/work/syncthing-android
./gradlew buildNative
./gradlew lint assembleDebug
```
Expand All @@ -95,6 +95,7 @@ To clean up all files generated during build, use the following commands:
### Build on Windows

```
git clone https://github.com/Catfriend1/syncthing-android.git --recursive
cd /d "YOUR_CLONED_GIT_ROOT"
SyncthingNative_update_and_build
App_build_and_release
Expand Down
15 changes: 15 additions & 0 deletions syncthing/build-syncthing.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ def install_go():
os.environ["PATH"] += os.pathsep + go_bin_path


def write_file(fullfn, text):
with open(fullfn, 'w') as hFile:
hFile.write(text + '\n')


def install_ndk():
Expand Down Expand Up @@ -265,6 +268,18 @@ def install_ndk():
if platform.system() == 'Linux':
print("Setting permissions on NDK executables ...")
change_permissions_recursive(ndk_home_path, 0o755);
#
# Fix NDK r23 bug with incomplete path and arguments when calling "clang".
ndk_bin_clang = os.path.join(
ndk_home_path,
'toolchains',
'llvm',
'prebuilt',
PLATFORM_DIRS[platform.system()],
'bin',
'clang'
)
write_file (ndk_bin_clang, '`dirname $0`/clang-12 "$@"')

# Add "ANDROID_NDK_HOME" environment variable.
print('Adding ANDROID_NDK_HOME=\'' + ndk_home_path + '\'')
Expand Down
2 changes: 1 addition & 1 deletion syncthing/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
task buildNative(type: Exec) {
inputs.dir("$projectDir/src/")
outputs.dir("$projectDir/../app/src/main/jniLibs/")
executable = 'python'
executable = 'python3'
args = ['-u', './build-syncthing.py']
}

Expand Down

0 comments on commit f13ae5b

Please sign in to comment.