|
|
|
## Building Procedures
|
|
|
|
|
|
|
|
Project depends on Qt5. Minimal Qt version which the project is tested on is Qt-5.2.1. The project relies on functionality that was first implemented in Qt-5.2.
|
|
|
|
|
|
|
|
### Prerequisites
|
|
|
|
|
|
|
|
* Qt5 (at least version 5.2.0) -- Qt5 must contain sqlite support.
|
|
|
|
* qmake (should be part of some Qt5 development package)
|
|
|
|
* libisds (+ development package)
|
|
|
|
|
|
|
|
### Linux/UNIX
|
|
|
|
|
|
|
|
We don't currently use Autotools. The project directly relies on libisds, OpenSSL and Qt5 which should be installed in the system.
|
|
|
|
|
|
|
|
If you want to compile the application from sources running the following commands should do the trick:
|
|
|
|
``` shell
|
|
|
|
qmake datovka.pro
|
|
|
|
make
|
|
|
|
```
|
|
|
|
You may run also:
|
|
|
|
``` shell
|
|
|
|
make install
|
|
|
|
```
|
|
|
|
|
|
|
|
You may change the prefix by running:
|
|
|
|
``` shell
|
|
|
|
qmake PREFIX="/usr" datovka.pro
|
|
|
|
```
|
|
|
|
|
|
|
|
If you are a package maintainer you may want to disable the default checking for new version on application start-up. This can be achieved by passing the `DISABLE_VERSION_CHECK_BY_DEFAULT` configuration option.
|
|
|
|
``` shell
|
|
|
|
qmake DISABLE_VERSION_CHECK_BY_DEFAULT=1 datovka.pro
|
|
|
|
```
|
|
|
|
|
|
|
|
### OS X
|
|
|
|
|
|
|
|
Currently we use `QT_VER="5.4.2"` with `SDK_VER="10.7"` or `SDK_VER="10.9."`.
|
|
|
|
|
|
|
|
You need Xcode with Command Line Tools in order to compile and build the package. Xcode usually supports two adjacent SDKs (e.g. 10.9 and 10.10). You need to obtain an older Xcode package to achieve older SDKs. Store the SDKs into the directory `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs`.
|
|
|
|
|
|
|
|
A working statically compiled Qt5 (minimal is 5.2.1) is required to be installed in the location `/usr/local/Qt-${QT_VER}-macx-clang-32-macosx${SDK_VER}-static`. Usually, the sources require some patching in order to successfully proceed the compilation process. Also it is recommendable to decrease the pool size in `ExecutableAllocatorFixedVMPool.cpp` (we use 128Mb instead of 2Gb). So far we haven't been able to compile Qt5 using 10.6 SDK.
|
|
|
|
|
|
|
|
All libraries are linked statically into Datovka. In order to build all required libraries (excluding Qt5) you need to run the following command:
|
|
|
|
``` shell
|
|
|
|
cd libs_static
|
|
|
|
./build_libisds_osx.sh ${SDK_VER}
|
|
|
|
```
|
|
|
|
This will compile libisds and other dependencies and store it to a directory where it can be read by the script which compiles and builds the package.
|
|
|
|
|
|
|
|
When you have all static libraries (Qt5, libisds and dependencies) run the following commands. These must be run from a working desktop session on OS X as the scripts accesses some resources that aren't available on a plain terminal session (e.g. when logged-in via ssh).
|
|
|
|
``` shell
|
|
|
|
./scripts/build_osx_dmgs.sh -d -s ${SDK_VER}
|
|
|
|
```
|
|
|
|
Occasionally it happens that the target .dmg file fails to build properly (because of some asynchronous actions). In such cases just re-run:
|
|
|
|
``` shell
|
|
|
|
./scripts/build_osx_dmgs.sh -D -s ${SDK_VER}
|
|
|
|
```
|
|
|
|
This will skip the compilation and will only build the package.
|
|
|
|
|
|
|
|
The following script builds the .dmg package if the application has already been compiled. But you are not expected to run the script manually.
|
|
|
|
``` shell
|
|
|
|
./scripts/build_dmg.sh
|
|
|
|
```
|
|
|
|
|
|
|
|
### WINDOWS - build only Datovka application
|
|
|
|
|
|
|
|
Building of Datovka application for Windows requires:
|
|
|
|
|
|
|
|
* Windows 7 or latest
|
|
|
|
* Qt5.2.1 or latest
|
|
|
|
* Build of libisds and its dependencies with MinGW
|
|
|
|
|
|
|
|
Adding Qt toolchain to PATH Environment Variable in Windows:
|
|
|
|
* C:\Qt\{Qtversion}\mingw{Mingwversion}\bin\
|
|
|
|
* C:\Qt\Tools\mingw{Mingwversion}\bin\
|
|
|
|
|
|
|
|
e.g. for Qt5.4
|
|
|
|
|
|
|
|
* C:\Qt\5.4\mingw491_32\bin\
|
|
|
|
* C:\Qt\Tools\mingw491_32\bin\
|
|
|
|
|
|
|
|
Running the following commands should do the trick:
|
|
|
|
|
|
|
|
The command
|
|
|
|
``` shell
|
|
|
|
qmake.exe datovka.pro -r -spec win32-g++
|
|
|
|
mingw32-make.exe
|
|
|
|
```
|
|
|
|
or
|
|
|
|
|
|
|
|
``` shell
|
|
|
|
qmake.exe datovka.pro PORTABLE_APPLICATION=1 -r -spec win32-g++
|
|
|
|
mingw32-make.exe
|
|
|
|
```
|
|
|
|
for portable version.
|
|
|
|
|
|
|
|
### WINDOWS - build Datovka packages
|
|
|
|
|
|
|
|
Building of Datovka packages for Windows requires:
|
|
|
|
|
|
|
|
* Windows 7 or latest
|
|
|
|
* Qt5.2.1 or latest
|
|
|
|
* NSIS (Nullsoft Scriptable Install System) available on the [http://nsis.sourceforge.net/Main_Page]
|
|
|
|
* 7-Zip archiver available on the [http://www.7-zip.org/]
|
|
|
|
* Build of libisds and its dependencies with MinGW
|
|
|
|
|
|
|
|
1) Create folder "dlls" in the root of project and copy all required dll files (libisds.dll, openssl.dll, ...) here. The list of required files you can see in the "\notes\libdepends.win".
|
|
|
|
|
|
|
|
2) Copy additional NSIS libraries (ReplaceInFile.nsh, StrRep.nsh) from "nsis\nsis-libs\" to c:\Program Files (x86)\NSIS\Include\
|
|
|
|
|
|
|
|
3) Edit "\scripts\make-win.bat" batch file and set correct Qt toolchain, NSIS and 7-Zip paths:
|
|
|
|
* set QTPATH="C:\Qt\{Qtversion}\mingw{Mingwversion}\bin\"
|
|
|
|
* set QTMAKEPATH="C:\Qt\Tools\mingw{Mingwversion}\bin\"
|
|
|
|
* set NSISPATH="C:\Program Files (x86)\NSIS\makensis.exe"
|
|
|
|
* set ZIPPATH="C:\Program Files (x86)\7-Zip\7z.exe"
|
|
|
|
|
|
|
|
4) Run
|
|
|
|
``` shell
|
|
|
|
make-win.bat
|
|
|
|
```
|
|
|
|
5) You have done all packages of Datovka together with portable version in the folder "packages".
|
|
|
|
|
|
|
|
### Additional configuration options.
|
|
|
|
|
|
|
|
The command
|
|
|
|
``` shell
|
|
|
|
qmake PORTABLE_APPLICATION=1 datovka.pro
|
|
|
|
```
|
|
|
|
will configure the sources to build a portable version of Datovka. Portable application searches for the configuration directory in the directory where the executable is located. Also, some parts of the total functionality (e.g. database relocation) are disabled.
|
|
|
|
|
|
|
|
The command
|
|
|
|
``` shell
|
|
|
|
qmake DISABLE_VERSION_CHECK_BY_DEFAULT=1 datovka.pro
|
|
|
|
```
|
|
|
|
disables automatic version checking by default. This function can be re-enabled by the user. Disabling update notifications can be especially useful when building Linux distribution packages. Distribution of binary packages across Linux distributions relies mostly on the package maintainers and can be lagged. |
|
|
|
\ No newline at end of file |