Browse Source

Make possible to build on Windows with MSYS2

Signed-off-by: R4SAS <r4sas@i2pmail.org>
pull/44/head
R4SAS 2 years ago
parent
commit
470cc90b6a
Signed by: r4sas
GPG Key ID: 66F6C87B98EBCFE2
  1. 12
      README.md
  2. 1
      app/jni/build_miniupnpc.sh
  3. 8
      app/jni/build_openssl.sh

12
README.md

@ -13,6 +13,7 @@ This repository contains Android application sources of i2pd @@ -13,6 +13,7 @@ This repository contains Android application sources of i2pd
## How to build
### Install g++, OpenJDK 11+, gradle 5.1+
```bash
sudo apt-get install g++ openjdk-11-jdk gradle
```
@ -22,6 +23,7 @@ If your system provides gradle with version < 5.1, download it from gradle homep @@ -22,6 +23,7 @@ If your system provides gradle with version < 5.1, download it from gradle homep
https://gradle.org/install/
### Download and prepare Android SDK for building
Android SDK Available here:
https://developer.android.com/studio#downloads
@ -37,11 +39,13 @@ unzip commandlinetools-linux-8092744_latest.zip @@ -37,11 +39,13 @@ unzip commandlinetools-linux-8092744_latest.zip
```
### Clone repository with submodules
```bash
git clone --recurse-submodules https://github.com/PurpleI2P/i2pd-android.git
```
### Compile application
```bash
export ANDROID_SDK_ROOT=/opt/android-sdk
export ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/21.4.7075529
@ -56,3 +60,11 @@ gradle clean assembleDebug @@ -56,3 +60,11 @@ gradle clean assembleDebug
```
You will find APKs in `app/build/outputs/apk`
### Building on Windows
For building on Windows you must use MSYS2 with `mingw64` or `ucrt64` shell and preinstalled `gcc` ( package `mingw-w64-x86_64-gcc` or `mingw-w64-ucrt-x86_64-gcc`).
Download Android SDK command line tools for Windows, unpack and isntall replacing `--sdk_root=` path.
`ANDROID_SDK_ROOT` variable must point to SDK using linux-way path, like `/c/dev/android-sdk` when SDK installed to `C:\dev\android-sdk`.

1
app/jni/build_miniupnpc.sh

@ -9,6 +9,7 @@ function build_one { @@ -9,6 +9,7 @@ function build_one {
cd build
cmake \
-G "Unix Makefiles" \
-DUPNPC_BUILD_SHARED=False \
-DUPNPC_BUILD_TESTS=False \
-DUPNPC_BUILD_SAMPLE=False \

8
app/jni/build_openssl.sh

@ -2,6 +2,8 @@ @@ -2,6 +2,8 @@
set -e
HOST_OS=`uname -a`
function build_one {
mkdir -p out/$CPU
@ -74,7 +76,11 @@ checkPreRequisites @@ -74,7 +76,11 @@ checkPreRequisites
cd openssl
rm -rf out
PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
if [[ "$HOST_OS" == *"_NT-"* ]]; then
PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/windows-x86_64/bin:$PATH
else
PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
fi
if [[ -f 'Makefile' ]]; then
make clean

Loading…
Cancel
Save