项目作者: kovdan01

项目描述 :
A federated messenger
高级语言: C++
项目地址: git://github.com/kovdan01/melon.git
创建时间: 2020-10-22T10:18:32Z
项目社区:https://github.com/kovdan01/melon

开源协议:Apache License 2.0

下载


Melon

A federated messenger.

Build Linux & macOS
Build Windows
Build Android

How to build

Common info

Core libraries, server services and desktop client are written in C++ and are built via CMake. Building server services and desktop client can be disabled with passing the following CMake options during configuration: -DMELON_BUILD_SERVER=OFF -DMELON_BUILD_DESKTOP_CLIENT=OFF.

Android application is written in Java and Kotlin and uses core libraries via JNI.

Here we provide brief build instructions, however, if it is not enough for you, full build scripts are available as GitHub Actions configuration files in .github/workflows.

Unix

  1. Install cmake 3.19 or newer and a compiler with C++20 support.
    Also, PkgConfig is needed to find some libraries.

  2. Install dependency libraries: boost 1.74.0 or newer, cyrus-sasl 2.1.27 or newer, yaml-cpp 0.6.3 or newer, qt 5.15.1 or newer.

    In Arch Linux:

    1. sudo pacman -S boost boost-libs
    2. sudo pacman -S libsasl
    3. sudo pacman -S yaml-cpp
    4. sudo pacman -S qt5-base qt5-tools

    Note that boost 1.74.0 (as well as some other libraries) is not available in some linux distributions yet, that’s why you might want to build such dependencies from sources. See corresponding GitHub Actions configuration files containing build scripts and do not forget to add custom prefixes to CMAKE_PREFIX_PATH later.

  3. Execute the following commands (delete -G Ninja if ninja generator is not available):

    1. mkdir build && cd build
    2. cmake \
    3. -G Ninja \
    4. -D CMAKE_BUILD_TYPE=Release \
    5. /path/to/repository/root
    6. cmake --build . --target all
  4. If you want to run tests, execute ctest command after a successful build.

Windows

Building under Windows is done under MSYS2 MinGW64. Build instructions are identical with the Unix ones.

Android

Core libraries

To build core libraries for aarch64 (or any other supported Android architecture) you need to install Android NDK and build all the dependencies (see building under Unix) with a corresponding cross-compiler. If you don’t want to deal with this mess, a Docker image kovdan01/melon-android-env with prebuilt dependencies for aarch64 is provided. The corresponding Dockerfile can be found in the repository in build-config/android-env/Dockerfile. Further build commands can be found in build-config/android/Dockerfile

Application

Assuming current directory is src/client-andorid, run:

  1. gradle wrapper
  2. ./gradlew :app:packageDebugUniversalApk

An APK file will appear: app/build/outputs/universal_apk/debug/app-debug-universal.apk.