**Ring relies on various components which interact together.** ![Ring-layers](/uploads/ccc91eff2ab16cb68c6c51dd6fad0f63/Ring-layers.png) They are divided into three main layers: 1\. **LibRing** (or Daemon) is the core of Ring. It does not interact with users but it is involved in every command. 2\. **LibRingClient** (or LRC) is written in QtCore and facilitates clients' portability between operating systems. It does not interact with the Android client. 3\. The **Client** layer formalizes the use-case on GNU/Linux (Gnome), Windows, Mac OS X and Android. To fully build Ring, you must build each of these components in order, unless you choose to build Ring easily and quickly. How to Build Ring Easily and Quickly =============================================================== We use a GIT repository to manage sources. On shell based platform you can fetch your private copy using following command: ```bash git clone https://gerrit-ring.savoirfairelinux.com/ring-project ``` Ring installer uses **python3**. If it's not installed, please install it: ```bash cd ring-project/ ./make-ring.py --init ``` On GNU/Linux --------------------------------------- **Build and install all the dependencies**: Your distro package manager will be used. ```bash ./make-ring.py --dependencies ``` **Build and install locally** ```bash ./make-ring.py --install ``` **Run LibRing *(daemon)* and client that were installed locally** ```bash ./make-ring.py --run ``` You can then stop the processes with `CTRL-C`. You can also run them in the background with the `--background` argument and then use the `--stop` command to stop them. Use `Stdout` and `stderr` to go to daemon.log and client-gnome.log. **Install globally for all users instead** ```bash ./make-ring.py --install --global-install ``` **Run global install**: This already starts LibRing *(the daemon)* automatically for us. ```bash gnome-ring ``` **Uninstall the global install** ```bash ./make-ring.py --uninstall ``` On Mac OS X -------------------------------------- + You need to setup [Homebrew](http://brew.sh/) since there is no built-in package manager on OSX. **Build and install all the dependencies** ```bash ./make-ring.py --dependencies ``` **Build and install locally** ```bash ./make-ring.py --install ``` **Output**: You can find the *.app* file in the *./install/client-macosx* folder. On Android ------------------------------------- + Please make sure Android SDK and NDK are installed, and their paths are properly set. If you need more information, please visit #### Prepare environment - Install Java JDK 7 or 8: - Install Android Studio: - Install the Android NDK: - Install required tools (on Ubuntu, check equivalent if you use a different distro) ```bash sudo apt install autoconf automake libtool autopoint ``` Add these variables to your bash profile: ```bash export JAVA_HOME= export ANDROID_HOME= export ANDROID_SDK=$ANDROID_HOME export ANDROID_NDK= export ANDROID_NDK_ROOT=$ANDROID_NDK export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_NDK:$JAVA_HOME/bin ``` ie for Ubuntu : ```bash export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/ export ANDROID_HOME=/home/{username}/Android/Sdk export ANDROID_SDK=/home/{username}/Android/Sdk export ANDROID_NDK_ROOT=/home/{username}/Android/Sdk/ndk-bundle/ export ANDROID_NDK=/home/{username}/Android/Sdk/ndk-bundle/ export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_NDK:$JAVA_HOME/bin ``` #### Build and install locally- - Clone whole project repository ```bash git clone --recurse-submodules https://gerrit-ring.savoirfairelinux.com/ring-project ``` - Initialize project ```bash cd ring-project ./make-ring.py --init --distribution=Android ``` - Compile ```bash ./make-ring.py --install --distribution=Android ``` **Output**: You can find the *.apk* file in the *./client-android/ring-android/app/build/outputs* folder. #### Troubleshooting - Check case in your sdk path. Since api 26, /home/user/Android/**s**dk have become /home/user/Android/**S**dk - You can check each path with *echo*. e.g : echo \$JAVA\_HOME - `sudo` will use root's bash profile. And you don't need it. How to Build LibRing (or Daemon) =========================================================== First thing you need to do is buildind LibRing (or Daemon). Here are the instructions to build chapters for your platform. Getting LibRing Source Code (all platforms) ---------------------------------------------------------------------- We use a GIT repository to manage LibRing sources. On shell based platform you can fetch your private copy using following command: ```bash git clone https://gerrit-ring.savoirfairelinux.com/ring-daemon ``` Notice that direct push are blocked. See below how to contribute to the daemon sending us patches. How to Build LibRing (binary and SDK) ---------------------------------------------------------------- Following platforms are officialy supported : GNU/Linux | Windows | Mac OS X #### On GNU/Linux **Build environment** Dependencies LibRing : Fedora ```bash sudo yum groupinstall group "Development Tools" "Development Libraries" sudo yum install gcc-c++ yasm intltool libyaml-devel alsa-lib-devel pulseaudio-libs-devel libsamplerate-devel dbus-c++-devel pcre-devel gsm-devel speex-devel speexdsp-devel expat-devel libsndfile-devel gnutls-devel gettext-devel cmake libtool systemd-devel uuid-devel libXfixes-devel jsoncpp-devel autoconf-archive ``` For video support, you'll also need ffmpeg, which is only available in the RPMfusion repository as described here Then install ffmpeg: ```bash sudo yum install ffmpeg-devel ``` To build and run the tests with make check, you'll also need ```bash sudo yum install cppunit-devel cppcheck sipp dbus ``` :\*Dependencies LibRing : Debian-based Building dependencies/instructions for Debian, Ubuntu, Crunchbang Linux, etc. ```bash sudo apt-get install autoconf autoconf-archive automake autopoint cmake libpulse-dev libsamplerate0-dev libgsm1-dev libspeex-dev libtool libdbus-1-dev libasound2-dev libopus-dev libspeexdsp-dev libexpat1-dev libpcre3-dev libyaml-cpp-dev libboost-dev libdbus-c++-dev libsndfile1-dev libsrtp-dev libjack-dev libupnp-dev libavcodec-dev libavformat-dev libswscale-dev libavdevice-dev libudev-dev yasm uuid-dev libgnutls-dev libjsoncpp-dev libvdpau-dev libva-dev ``` If you want to run tests (e.g. when setting up a new VM on Jenkins), you must install cppunit and sipp ```bash sudo apt-get install libcppunit-dev sip-tester dbus ``` For H.264 support, you'll need ```bash sudo apt-get install libavcodec-extra-* ``` **Compile LibRing's dependencies** ```bash RING=$PWD/ring-daemon cd $RING/contrib mkdir build cd build ../bootstrap make # That's all ! # Optionally, you may also type : make list # or # make .packge? # to force using downloaded packages, not system locally installed. make .gnutls .upnp ... ``` Note: if compiling **libav** in contrib (you can see the list of dependencies which will be compiled by running 'make list' in \$RING/contrib/build) on Linux, you will likely first need to install **libx11-dev libxext-dev libxfixes-dev** due to the '--enable-x11grab' configure option. **Build LibRing** ```bash cd $RING # Now generate autotools configuration files ./autogen.sh # Create Makefiles and config.h files for your build target ./configure --prefix=/usr --disable-shared # Build make # Install sudo make install ``` #### On Windows For the moment only 32-bit MinGW build can be compiled. ##### Cross-compiling on Linux **Build environment**: MinGW-w64 | mingw-w64-pkg-config | gettext-devel | yasm | cmake | patch | libtool | automake | autoconf-archive starting directory: ring-project/ **Fetch and build LibRing's dependencies** ```bash cd ring-daemon/contrib mkdir native cd native ../bootstrap --host=i686-w64-mingw32 make ``` **Build LibRing** ```bash cd ../.. ./autogen.sh mkdir -p "build" cd build ../configure --host=i686-w64-mingw32 --without-dbus --prefix=( default=_win32) rsync -a ../src/buildinfo.cpp ./src/buildinfo.cpp make (-jX) install ``` ##### Native compiling on Windows **MSVC**: Microsoft Visual C++ 2015 CTP is still lacking some C++11 features needed to compile the daemon (e.g. constexpr is only partially supported). **MinGW**: TODO #### On Mac OS X **Build Tools**: Use your favorite package manager to install the necessary tools (HomeBrew or MacPorts) automake, libtool, gettext, libtoolize, yasm, autoconf, pkg-config. If you don't use a package manager: ```bash cd extras/tools ./bootstrap make export PATH=$PATH:$RING/extras/tools/build/bin ``` **Compile LibRing's dependencies** ```bash cd contrib mkdir build cd build ../bootstrap make -j3 ``` **Build LibRing**: If you want to link against libringclient and native client, easiest way is to add `--prefix` to configure and then run make install ```bash cd ../../ ./autogen.sh ./configure --without-dbus --prefix= make install ``` If you do not want to install LibRing, you will have to use -DRING\_BUILD\_DIR=/src as a cmake argument for LibRingClient. **Common Issues**: "Autopoint not found" When using Homebrew, autopoint is not found even when gettext is installed, because symlinks are not created. To fixt it, run: ```bash brew link --force gettext ``` Contributing to LibRing Source Code -------------------------------------------------------------- First read our LibRing Coding Rules page before sending us any patches. Gerrit is used as code review / integration tool. Register your ID (you need a Google/GitHUB OAuth2 account) on our public web gerrit service here: This service works for all Ring sub-projects (LibRing, LRC and clients). How to Build LibRingClient (or LRC) ============================================================== + LibRing must be installed first. If you have not already done so, go to the [\#How to Build LibRing (or Daemon)](#How_to_Build_LibRing_(or_Daemon) "wikilink") section. Getting the Source Code -------------------------------------------------- ```bash git clone https://gerrit-ring.savoirfairelinux.com/ring-lrc LIBRINGLIENT=`pwd`/ring-lrc RING=`pwd`/ring-daemon ``` How to Build LibRingClient from Sources ------------------------------------------------------------------ #### Dependencies + Qt5core + **Debian/Ubuntu:** qtbase5-dev + **Fedora:** qt5-qtbase-devel + Qt5Linguist *Tools are needed to enable compiling of translations* + **Debian/Ubuntu:** qttools5-dev and qttools5-dev-tools + **Fedora:** qt5-qttools-devel #### GNU/Linux & Mac OS X ```bash cd $LIBRINGLIENT mkdir build cd build cmake .. -DRING_BUILD_DIR=$RING/src -DCMAKE_INSTALL_PREFIX=/usr make sudo make install ``` For debug symbols add the appropriate cmake option to the cmake configure line, like so: ```bash cmake .. -DRING_BUILD_DIR=$RING/src -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ``` #### Windows ##### Build on Linux with MinGW **Build environment**: minGW-w64 | mingw32-qt5-qtbase | mingw32-qt5-qttools **Build LibRingClient** *LIBRING\_INSTALL\_PREFIX* makes reference to the build directory of LibRing, so it is either ring-daemon/build/\_win32/, or the directory specified via `--prefix` argument defined during LibRing compilation. ```bash cd ring-lrc mkdir -p build cd build export CMAKE_PREFIX_PATH=/usr/i686-w64-mingw32/sys-root/mingw/lib/cmake cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/winBuild.cmake -DRING_BUILD_DIR= -DENABLE_LIBWRAP=true -DCMAKE_INSTALL_PREFIX= .. make [-jX] (for X-way multi-threaded build ) install || exit 1 ``` note:the CMAKE\_INSTALL\_PREFIX **must** be the same as LibRing for building the client ##### Build on Native Windows **MVSC**: Microsoft Visual C++ 2015 CTP is still lacking some C++11 features needed to compile the common library (e.g. constexpr is only partially supported). **MinGW**: TODO Developper ------------------------------------- [KDE Coding Guidelines](KDE_Coding_Guidelines "wikilink") [Rapport de projet de fin d'études (French - 54,866 Mo)](https://projects.savoirfairelinux.com/attachments/download/21218/GTI792_Rapport_finale_LEPE13098909.pdf) Emmanuel Lepage, 2015/04/23 How to Build a Client ================================================ In most of cases you want a client to control the daemon. We provide ready to use clients for major platforms. Choose your client build instructions below Gnome Client for Ring ------------------------------------------------ + LibRing and LibRingClient must be installed first. If you have not already done so, go to the [\#How to Build LibRing (or Daemon)](#How_to_Build_LibRing_(or_Daemon) "wikilink") and [\#How to Build LibRingClient (or LRC)](#How_to_Build_LibRingClient_(or_LRC) "wikilink") sections. #### Getting the Source Code ```bash git clone https://gerrit-ring.savoirfairelinux.com/ring-client-gnome ``` #### Dependencies ##### Building Environment - cmake - C++11 compiler (eg: gcc >= 4.8) - GTK+ >= 3.10 - clutter and clutter-gtk - libRingClient - Qt5Core - gnome-icon-theme-symbolic - X11 - libebook1.2 >= 3.10 or evolution-data-server >= 3.10 *Some distros (Debian/Ubuntu) have separated the EDS APIs into its different client and server components, while others (Fedora) have put everything in one EDS package)* - libnotify (optional for desktop notifications) - gettext (optional for compiling translations) **Debian/Ubuntu** sudo apt-get install g++ cmake libgtk-3-dev qtbase5-dev libclutter-gtk-1.0-dev gnome-icon-theme-symbolic libebook1.2-dev libnotify-dev gettext **Fedora** sudo yum install gcc-c++ cmake gtk3-devel qt5-qtbase-devel clutter-gtk-devel gnome-icon-theme-symbolic evolution-data-server-devel libnotify-devel gettext-devel **Documentation** You may optionally install doxygen to be able to build the documentation via 'make doc' ##### Run-time Environment - GTK+ >= 3.10 - clutter and clutter-gtk - the Ring daemon and libRingClient - Qt5Core (libRingClient uses the Core module of Qt5, thus Qt5Core is required to properly interface between it and GTK) - gnome-icon-theme-symbolic, for the use of certain symbolic icons (this dependency may be dropped in the future) - X11 (this is currently needed for screen area selection during screen sharing, a Wayland (or otherwise) alternative is not currently supported) - libebook1.2 >= 3.10 or evolution-data-server >= 3.10 *Some distros (Debian/Ubuntu) have separated the EDS APIs into its different client and server components, while others (Fedora) have put everything in one EDS package)* - libnotify (optional for desktop notifications) **Debian/Ubuntu** ```bash sudo apt-get install libgtk-3-0 libqt5core5a libclutter-gtk-1.0-0 gnome-icon-theme-symbolic libebook-1.2-14 libnotify4 ``` **Note:** for Debian 9 replace libebook-1.2-14 with libebook-1.2-16 **Fedora** ```bash sudo yum install gtk3 qt5-qtbase clutter-gtk gnome-icon-theme-symbolic evolution-data-server libnotify ``` #### Build Instructions **If LibRing and LibRingClient are already installed on the system (eg: /usr/)** in the gnome-ring project root dir: ```bash mkdir build cd build cmake .. -DCMAKE_INSTALL_PREFIX=/usr make sudo make install ``` **Building without installing LibRing and LibRingClient** This allows you to build every component separately and to run them from their location without having to install them. To do this, you must first build LibRing and then tell LibRingClient where it is located. Then, you build the LibRingClient and tell client-gnome where LibRingClient it is located. Finally, you build client-gnome. 1. Build the daemon as explained above. 2. Configure the build of LibRingClient by specifying the location of the (non-installed) daemon with e.g.: cd build && cmake .. -DRING_BUILD_DIR=$HOME/ring-project/daemon/src -DCMAKE_BUILD_TYPE=Debug 3. Build LibRingClient by running "make". 4. Configure the build of client-gnome by specifying the location of LibRingClient using the specific variable designed for it: cd build && cmake .. -DLibRingClient_PROJECT_DIR=$HOME/ring-project/lrc -DCMAKE_BUILD_TYPE=Debug 5. Build client-gnome by running "make". To run an install-less Ring, you must manually start the daemon and then the client, e.g.: term1: $HOME/ring-project/daemon/bin/dring -cdp term2: $HOME/ring-project/client-gnome/gnome-ring --debug KDE Client for Ring ---------------------------------------------- ![](Caution.png "fig:Caution.png"){width="30"} LibRing and LibRingClient must be installed first. If you have not already done so, go to the [\#How to build LibRing (or Daemon)](#How_to_build_LibRing_(or_Daemon) "wikilink") and [\#How to build LibRingClient (or LRC)](#How_to_build_LibRingClient_(or_LRC) "wikilink") sections. #### Getting the Source Code ```bash git clone git://anongit.kde.org/ring-kde ``` #### Installing Build Dependencies **Debian/Ubuntu** ```bash sudo apt-get install cmake git-core qtbase5-dev extra-cmake-modules libqt5svg5-dev libkf5attica-dev libkf5attica-dev libkf5config-dev libkf5guiaddons-dev libkf5dbusaddons-dev libkf5i18n-dev libkf5windowsystem-dev libkf5xmlgui-dev libkf5iconthemes-dev kinit-dev kio-dev libkf5completion-dev libkf5crash-dev kdelibs5-dev libkf5notifications-dev ``` #### Building Ring-KDE from Sources ```bash cd $RING-KDE mkdir build cd build cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug make sudo make install ``` If LibRing isn't installed, you can use: `-DRING_BUILD_DIR=$RING` Windows Client for Ring -------------------------------------------------- + LibRing and LibRingClient must be installed first. If you have not already done so, go to the [\#How to Build LibRing (or Daemon)](#How_to_Build_LibRing_(or_Daemon) "wikilink") and [\#How to Build LibRingClient (or LRC)](#How_to_Build_LibRingClient_(or_LRC) "wikilink") sections. #### Other Requirements - Mingw-w64 build environment - Qt5 (we link against Qt5Core, Qt5Widgets, Qt5Gui) built with Mingw - Qt5 Svg & Qt5 WinExtras #### Getting the Source Code ```bash git clone https://gerrit-ring.savoirfairelinux.com/ring-client-windows ``` #### Build Instructions **USE THE QMAKE OF Qt BUILT WITH MINGW** (e.g. /usr/bin/i686-w64-mingw32-qmake-qt5) **Windows Client dependencies** The windows client version relies on two git submodules, to update them go to ring-client-windows folder and run: ```bash git submodule update --init cd winsparkle git submodule update --init ``` **Build Windows Client (executable)** ```bash cd ring-client-windows cd winsparkle mkdir -p build && cd build cmake -DCMAKE_TOOLCHAIN_FILE=cmake/winBuild.cmake -DCMAKE_INSTALL_PREFIX=LIBRING_INSTALL_PREFIX (same as for LibRing & LibRingClient) ../cmake make [-jX] (for X-way multi-threaded build ) make install cd ../../libqrencode ./autogen.sh mkdir -p build && cd build ../configure --host=i686-w64-mingw32 --prefix= make [-jX] (for X-way multi-threaded build ) make install cd ../.. && mkdir build && cd build i686-w64-mingw32-qmake-qt5 ../RingWinClient.pro -r -spec win32-g++ RING=LIBRING_INSTALL_PREFIX (same as for LibRing & LibRingClient) make [-jX] (for X-way multi-threaded build ) make install ``` note: an absolute path is a path starting with /, mandatory here; unlike in cmake command lines which allows relative paths. You will find all files in ./release directory. #### Debugging Compile the client with `BUILD=Debug` and compile LibRingClient with `-DCMAKE_BUILD_TYPE=Debug` #### Packaging [Nsis : Nullsoft Scriptable Install System](http://nsis.sourceforge.net/Main_Page) ```bash cd build/release makensis ring.nsi ``` Mac OS X Client for Ring --------------------------------------------------- + LibRing and LibRingClient must be installed first. If you have not already done so, go to the [\#How to Build LibRing (or Daemon)](#How_to_Build_LibRing_(or_Daemon) "wikilink") and [\#How to Build LibRingClient (or LRC)](#How_to_Build_LibRingClient_(or_LRC) "wikilink") sections. #### Other Requirements - Qt5 (we link against Qt5Core, Qt5Widgets, Qt5Gui) - Cocoa framework and Xcode toolchains #### Getting the Source Code ```bash git clone https://gerrit-ring.savoirfairelinux.com/ring-client-macosx ``` #### Build Instructions ```bash mkdir build && cd build export CMAKE_PREFIX_PATH= ``` ##### Setting up Compilation with XCode Generate an Xcode project with CMake: ```bash cmake ../ -DCMAKE_INSTALL_PREFIX= -G Xcode open Ring.xcodeproj/ ``` Build and run it from Xcode. ##### Setting up Compilation by Command Line ```bash cmake ../ -DCMAKE_INSTALL_PREFIX= make open Ring.app/ ``` + The app built using 'make' contains only links to required libraries. To fully build and package as a standalone Bundle, see the **Packaging** section. ##### Debugging For now, the build type of the client is "Debug" by default. However it is useful to also have the debug symbols of LibRingClient. To do this, specify `-DCMAKE_BUILD_TYPE=Debug` when compiling LibRingClient in the cmake options. ##### Packaging To make a standalone Bundle we use a cmake module: [BundleUtilities](https://cmake.org/cmake/help/v3.0/module/BundleUtilities.html). All dependencies are copied inside the Bundle and links are fixed. We can then generate a "DragNDrop" dmg file with [CPack](https://cmake.org/Wiki/CMake:Packaging_With_CPack). ```bash cmake ../ -DCMAKE_INSTALL_PREFIX= make install -j cpack -G DragNDrop Ring ``` iOS Client for Ring ---------------------------------------------- After installing [Brew](https://brew.sh) and Python3 (brew install python3): ```bash git clone https://gerrit-ring.savoirfairelinux.com/ring-project cd ring-project ./make-ring.py --init ./make-ring.py --dependencies --distribution iOS ./make-ring.py --install --distribution iOS cd client-ios/Ring && carthage bootstrap --platform iOS --no-use-binaries --cache-builds && cd .. xcodebuild build -project Ring/Ring.xcodeproj/ -configuration "Release" -arch "x86_64" -destination "platform=iOS Simulator,name=iPhone $DATE,OS=11" -sdk iphonesimulator11.0 VALID_ARCHS="x86_64" it could be useful to do this if an error occurs: ln -s /usr/local/opt/gettext/bin/autopoint /usr/local/bin ```