- [QT](https://www.qt.io/download-open-source/)(for QT only). Choose one for your platform for android. For example QT 5.6 under Linux would be [this file](http://download.qt.io/official_releases/qt/5.6/5.6.1-1/qt-opensource-linux-x64-android-5.6.1-1.run )
- [SDK](https://developer.android.com/studio/index.html) (choose command line tools only)
Choose one for your platform for android. For example QT 5.6 under Linux would be [this file](http://download.qt.io/official_releases/qt/5.6/5.6.1-1/qt-opensource-linux-x64-android-5.6.1-1.run)
You also need Java JDK and Ant.
QT-Creator (for QT only)
------------------------
Open QT-creator that should be installed with QT.
Open QT-creator that should be installed with QT.
Go to Settings/Anndroid and specify correct paths to SDK and NDK.
If everything is correct you will see two set avaiable:
If everything is correct you will see two set avaiable:
Android for armeabi-v7a (gcc, qt) and Android for x86 (gcc, qt).
Dependencies
--------------
Take following pre-compiled binaries from PurpleI2P's repositories.
- Change line MAIN_PATH = /path/to/libraries to an actual path where you put the dependancies to
- Select appropriate project (usually armeabi-v7a) and build
- You will find an .apk file in android-build/bin folder
- Open `qt/i2pd_qt/i2pd_qt.pro` in the QT-creator
- Change line `MAIN_PATH = /path/to/libraries` to an actual path where you put the dependancies to
- Select appropriate project (usually armeabi-v7a) and build
- You will find an .apk file in `android-build/bin` folder
Building the app without QT
---------------------------
- Change line I2PD_LIBS_PATH in android/jni/Application.mk to an actual path where you put the dependancies to
- Run 'ndk-build -j4' from andorid folder
- Create or edit file 'local.properties'. Place 'sdk.dir=<pathtoSDK>' and 'ndk.dir=<pathtoNDK>'
- Run 'ant clean debug'
- Change line `I2PD_LIBS_PATH` in `android/jni/Application.mk` to an actual path where you put the dependancies to
- Run `ndk-build -j4` from andorid folder
- Create or edit file 'local.properties'. Place 'sdk.dir=<pathtoSDK>' and 'ndk.dir=<pathtoNDK>'
- Run `ant clean debug`
Creating release .apk
----------------------
In order to create release .apk you must obtain a Java keystore file(.jks). Either you have in already, or you can generate it yourself using keytool, or from one of you existing well-know ceritificates. For example, i2pd release are signed with this [certificate](https://github.com/PurpleI2P/i2pd/blob/openssl/contrib/certificates/router/orignal_at_mail.i2p.crt).
Create file 'ant.propeties'
key.store='path to keystore file'
key.alias='alias name'
key.store.password='keystore password'
key.alias.password='alias password'
Run 'ant clean release'
In order to create release .apk you must obtain a Java keystore file(.jks). Either you have in already, or you can generate it yourself using keytool, or from one of you existing well-know ceritificates.
For example, i2pd release are signed with this [certificate](https://github.com/PurpleI2P/i2pd/blob/openssl/contrib/certificates/router/orignal_at_mail.i2p.crt).
* `WITH_STATIC` build static versions of library and i2pd binary
* `WITH_UPNP` build with UPnP support (requires libminiupnp)
* `WITH_AESNI` build with AES-NI support (ON/OFF)
* `WITH_HARDENING` enable hardening features (ON/OFF) (gcc only)
* `WITH_PCH` use pre-compiled header (experimental, speeds up build)
Also there is `-L` flag for CMake that could be used to list current cached options:
cmake -L
Debian/Ubuntu
-------------
You will need a compiler and other tools that could be installed with `build-essential` package:
```bash
sudo apt-get install build-essential
```
sudo apt-get install build-essential
Also you will need a bunch of development libraries:
```bash
sudo apt-get install \
libboost-chrono-dev \
libboost-date-time-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-thread-dev \
libssl-dev
```
If you need UPnP support (don't forget to run CMake with `WITH_UPNP=ON`) miniupnpc development library should be installed:
```bash
sudo apt-get install libminiupnpc-dev
```
sudo apt-get install \
libboost-chrono-dev \
libboost-date-time-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-thread-dev \
libssl-dev
If you need UPnP support miniupnpc development library should be installed (don't forget to rerun CMake with needed option):
sudo apt-get install libminiupnpc-dev
You may also build deb-package with the following:
```bash
sudo apt-get install fakeroot devscripts
cd i2pd
debuild --no-tgz-check
```
sudo apt-get install fakeroot devscripts
cd i2pd
debuild --no-tgz-check
Fedora/Centos
-------------
You will need a compiler and other tools to perform a build:
```bash
sudo yum install make cmake gcc gcc-c++
```
*Latest Fedora system using [DNF](https://en.wikipedia.org/wiki/DNF_(software)) instead of YUM by default, you may prefer to use DNF, but YUM should be ok*
sudo yum install make cmake gcc gcc-c++
Also you will need a bunch of development libraries
```bash
sudo yum install boost-devel openssl-devel
```
If you need UPnP support (don't forget to run CMake with `WITH_UPNP=ON`) miniupnpc development library should be installed:
```bash
miniupnpc-devel
```
> *Centos 7 has CMake 2.8.11 in the official repositories that too old to build i2pd, CMake >=2.8.12 is required.*
>
> But you can use cmake3 from the epel repository:
If you need UPnP support miniupnpc development library should be installed (don't forget to rerun CMake with needed option):
sudo yum install miniupnpc-devel
Latest Fedora systems using [DNF](https://en.wikipedia.org/wiki/DNF_(software)) instead of YUM by default, you may prefer to use DNF, but YUM should be ok
Centos 7 has CMake 2.8.11 in the official repositories that too old to build i2pd, CMake >=2.8.12 is required.
But you can use cmake3 from the epel repository:
yum install epel-release -y
yum install make cmake3 gcc gcc-c++ miniupnpc-devel boost-devel openssl-devel -y
...and then use 'cmake3' instead 'cmake'.
MAC OS X
--------
Requires [homebrew](http://brew.sh/)
Requires [homebrew](http://brew.sh)
```bash
brew install libressl boost
```
brew install boost libressl
Then build:
```bash
make HOMEBREW=1
```
make HOMEBREW=1
FreeBSD
-------
For 10.X use clang. You would also need boost and openssl ports.
For 10.X use clang. You would also need devel/boost-libs, security/openssl and devel/gmake ports.
Type gmake, it invokes Makefile.bsd, make necessary changes there is required.
Branch 9.X has gcc v4.2, that knows nothing about required c++11 standart.
Branch 9.X has gcc v4.2, that is too old (not supports -std=c++11)
you use `make USE_AESNI=1`. No check is done however, it
will compile, but it might crash with `Illegal instruction` if not supported.
If your processor has [AES instruction set](https://en.wikipedia.org/wiki/AES_instruction_set),
use `make USE_AESNI=1` instead just `make`. No check is done however, it will compile,
but it might crash with `Illegal instruction` if this feature is not supported by your processor.
You should be able to run ./i2pd . If you need to start from the new
shell, consider starting *MinGW-w64 Win32 Shell* instead of *MSYS2 Shell* as
it adds`/minw32/bin` to the PATH.
You should be able to run ./i2pd . If you need to start from the new shell,
consider starting *MinGW-w64 Win32 Shell* instead of *MSYS2 Shell*
as it adds`/minw32/bin` to the PATH.
### UPnP
You can install it through the MSYS2
and build with USE_UPNP key.
```bash
pacman -S mingw-w64-i686-miniupnpc
make USE_UPNP=yes
```
or
```bash
pacman -S mingw-w64-x86_64-miniupnpc
make USE_UPNP=yes
```
You can install it through the MSYS2 and build with `USE_UPNP` key.
export ARCH='i686' # or 'x86_64'
pacman -S mingw-w64-$ARCH-miniupnpc
make USE_UPNP=yes
Using Visual Studio
-------------------
@ -112,7 +86,6 @@ Requirements for building:
@@ -112,7 +86,6 @@ Requirements for building:
* [Netwide assembler](http://www.nasm.us/)
* Strawberry Perl or ActiveState Perl, do NOT try msys2 perl, it won't work
### Building Boost
Open a Command Prompt (there is no need to start Visual Studio command
@ -129,11 +102,9 @@ If you are on 64-bit Windows and you want to build 64-bit version as well
@@ -129,11 +102,9 @@ If you are on 64-bit Windows and you want to build 64-bit version as well
After Boost is compiled, set the environment variable `BOOST_ROOT` to
the directory Boost was unpacked to, e.g., C:\dev\boost.
If you are planning on building only particular variant, e.g. Debug
only and static linking, and/or you are out of space/time, you might
consider `--build-type=minimal`. Take a look at
[appveyor.yml](../appveyor.yml) for details on how test builds are done.
If you are planning on building only particular variant, e.g. Debug only and static linking,
and/or you are out of space/time, you might consider `--build-type=minimal`.
Take a look at [appveyor.yml](../appveyor.yml) for details on how test builds are done.
### Building OpenSSL
@ -153,23 +124,19 @@ Now open Visual Studio command prompt and change directory to that with OpenSSL
@@ -153,23 +124,19 @@ Now open Visual Studio command prompt and change directory to that with OpenSSL
You should have it installed into C:\OpenSSL-Win32 by now.
Note that you might consider providing `-DOPENSSL_ROOT_DIR` to CMake
and/or create a symlink (with mklink /J) to C:\OpenSSL if you plan on
maintaining multiple versions, e.g. 64 bit and/or
static/shared. Consult `C:\Program Files
(x86)\CMake\share\cmake-3.3\Modules\FindOpenSSL.cmake` for details.
Note that you might consider providing `-DOPENSSL_ROOT_DIR` to CMake and/or
create a symlink (with mklink /J) to C:\OpenSSL if you plan on maintain
multiple versions, e.g. 64 bit and/or static/shared.
See `C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\FindOpenSSL.cmake` for details.
### Get miniupnpc
If you are behind a UPnP enabled router and don't feel like manually
configuring port forwarding, you should consider using
[MiniUPnP](http://miniupnp.free.fr) client. I2pd can be built capable
of using miniupnpc shared library (DLL) to open up necessary
port. You'd want to have include headers around to build i2pd with
support for this. Unpack client source code in a sibling folder,
e.g. C:\dev\miniupnpc . You may want to remove version number from
folder name included in downloaded archive.
If you are behind a UPnP enabled router and don't feel like manually configuring port forwarding,
you should consider using [MiniUPnP](http://miniupnp.free.fr) client.
I2pd can be built capable of using miniupnpc shared library (DLL) to open up necessary port.
You'd want to have include headers around to build i2pd with support for this.
Unpack client source code to subdir, e.g. `C:\dev\miniupnpc`.
You may want to remove version number from folder name included in downloaded archive.
### Creating Visual Studio project
@ -177,19 +144,16 @@ Start CMake GUI, navigate to i2pd directory, choose building directory, e.g. ./
@@ -177,19 +144,16 @@ Start CMake GUI, navigate to i2pd directory, choose building directory, e.g. ./
Alternatively, if you feel adventurous, try that from the command line
```
cd <i2pd_dir>
mkdir out
cd out
cmake ..\build -G "Visual Studio 12 2013" -DWITH_UPNP=ON -DWITH_PCH=ON -DCMAKE_INSTALL_PREFIX:PATH=C:\dev\Debug_Win32_stage
```
WITH_UPNP will stay off, if necessary files are not found.
mkdir i2pd\out
cd i2pd\out
cmake ..\build -G "Visual Studio 12 2013" -DWITH_UPNP=ON -DWITH_PCH=ON -DCMAKE_INSTALL_PREFIX:PATH=C:\dev\Debug_Win32_stage
If necessary files are not found `WITH_UPNP` will stay off.
### Building i2pd
You can open generated solution/project with Visual Studio and build
from there, alternatively you can use `cmake --build . --config Release --target install` or
You can open generated solution/project with Visual Studio and build from there,
alternatively you can use `cmake --build . --config Release --target install` or