1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
qTox/INSTALL.md
Anthony Bilinski 3c682abc69
fix(docs): Add brew prefix to macOS build instructions
Update brew's qt5 to qt@5, following brew naming deprecation.
2022-03-04 22:04:26 -08:00

13 KiB
Raw Blame History

Install Instructions

Dependencies

Name Version Modules
Qt >= 5.7.1 concurrent, core, gui, network, opengl, svg, widget, xml
GCC/MinGW >= 4.8 C++11 enabled
toxcore >= 0.2.10 core, av
FFmpeg >= 2.6.0 avformat, avdevice, avcodec, avutil, swscale
CMake >= 3.7.2
OpenAL Soft >= 1.16.0
qrencode >= 3.0.3
sqlcipher >= 3.2.0
pkg-config >= 0.28
snorenotify >= 0.7.0 optional dependency
toxext >= 0.0.3
tox_extension_messages >= 0.0.3

Optional dependencies

They can be disabled/enabled by passing arguments to cmake command when building qTox.

If they are missing, qTox is built without support for the functionality.

Development dependencies

Dependencies needed to run tests / code formatting, etc. Disabled if dependencies are missing.

Name Version
Check >= 0.9

Spell checking support

Name Version
sonnet >= 5.45

Use -DSPELL_CHECK=OFF to disable it.

Note: Specified version was tested and works well. You can try to use older version, but in this case you may have some errors (including a complete lack of spell check).

Linux

Auto-away support

Name Version
libXScrnSaver >= 1.2
libX11 >= 1.6.0

Disabled if dependencies are missing during compilation.

Snorenotify desktop notification backend

Disabled by default

Name Version
snorenotify >= 0.7.0

To enable: -DDESKTOP_NOTIFICATIONS=True

Linux

Simple install

Easy qTox install is provided for variety of distributions:


Arch

PKGBUILD is available in the community repo, to install:

pacman -S qtox

Debian

qTox is available in the Main repo, to install:

sudo apt install qtox

Fedora

qTox is available in the RPM Fusion repo, to install:

dnf install qtox

Gentoo

qTox is available in Gentoo.

To install:

emerge qtox

openSUSE

qTox is available in openSUSE Factory.

To install in openSUSE 15.0 or newer:

zypper in qtox

To install in openSUSE 42.3:

zypper ar -f https://download.opensuse.org/repositories/server:/messaging/openSUSE_Leap_42.3 server:messaging
zypper in qtox

Slackware

qTox SlackBuild and all of its dependencies can be found here: http://slackbuilds.org/repository/14.2/network/qTox/


If your distribution is not listed, or you want / need to compile qTox, there are provided instructions.


Most of the dependencies should be available through your package manager. You may either follow the directions below, or simply run ./simple_make.sh after cloning this repository, which will attempt to automatically download dependencies followed by compilation.

Ubuntu

qTox is available in the Universe repo, to install:

sudo apt install qtox

Install git

In order to clone the qTox repository you need Git.

Arch Linux

sudo pacman -S --needed git

Debian

sudo apt-get install git

Fedora

sudo dnf install git

openSUSE

sudo zypper install git

Ubuntu

sudo apt-get install git

Clone qTox

Afterwards open a new terminal, change to a directory of your choice and clone the repository:

cd /home/$USER
git clone https://github.com/qTox/qTox.git qTox
cd qTox

The following steps assumes that you cloned the repository at /home/$USER/qTox. If you decided to choose another location, replace corresponding parts.

Docker

Development can be done within one of the many provided docker containers. See the available configurations in docker-compose.yml. These docker images have all the required dependencies for development already installed. Run docker compose run --rm ubuntu_lts and proceed to compiling qTox. If you want to avoid compiling as root in the docker image, you can run USER_ID=$(id -u) GROUP_ID=$(id -g) docker compose run --rm ubuntu_lts instead.

NOTE: qtox will not run in the docker container unless your x11 session allows connections from other users. If X11 is giving you issues in the docker image, try xhost + on your host machine

GCC, Qt, FFmpeg, OpenAL Soft and qrencode

Please see buildscripts/docker/Dockerfile... for your distribution for an up to date list of commands to set up your build environment

Compile dependencies

Compile toxcore

Provided that you have all required dependencies installed, you can simply run:

git clone https://github.com/toktok/c-toxcore.git toxcore
cd toxcore
# Note: See buildscirpts/download/download_toxcore.sh for which version should be checked out
cmake . -DBOOTSTRAP_DAEMON=OFF
make -j$(nproc)
sudo make install

# we don't know what whether user runs 64 or 32 bits, and on some distros
# (Fedora, openSUSE) lib/ doesn't link to lib64/, so add both
echo '/usr/local/lib64/' | sudo tee -a /etc/ld.so.conf.d/locallib.conf
echo '/usr/local/lib/' | sudo tee -a /etc/ld.so.conf.d/locallib.conf
sudo ldconfig

Compile extensions

qTox uses the toxext library and some of the extensions that go with it.

You will likely have to compile these yourself.

git clone https://github.com/toxext/toxext.git toxext
cd toxext
# Note: See buildscirpts/download/download_toxext.sh for which version should be checked out
cmake .
make -j$(nproc)
sudo make install
git clone https://github.com/toxext/tox_extension_messages.git tox_extension_messages
cd tox_extension_messages
# Note: See buildscirpts/download/download_toxext_messages.sh for which version should be checked out
cmake .
make -j$(nproc)
sudo make install

Compile qTox

Make sure that all the dependencies are installed. If you experience problems with compiling, it's most likely due to missing dependencies, so please make sure that you did install all of them.

If you are compiling on Fedora 25, you must add libtoxcore to the PKG_CONFIG_PATH environment variable manually:

# we don't know what whether user runs 64 or 32 bits, and on some distros
# (Fedora, openSUSE) lib/ doesn't link to lib64/, so add both
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib64/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig"

Run in qTox directory to compile:

cmake .
make -j$(nproc)

Now you can start compiled qTox with ./qtox

Congratulations, you've compiled qTox :)

Debian / Ubuntu / Mint

If the compiling process stops with a missing dependency like: ... libswscale/swscale.h missing try:

apt-file search libswscale/swscale.h

And install the package that provides the missing file. Start make again. Repeat if necessary until all dependencies are installed. If you can, please note down all additional dependencies you had to install that aren't listed here, and let us know what is missing ;)


Security hardening with AppArmor

See AppArmor to enable confinement for increased security.

BSD

FreeBSD

qTox is available as a binary package. To install the qTox package:

pkg install qTox

The qTox port is also available at net-im/qTox. To build and install qTox from sources using the port:

cd /usr/ports/net-im/qTox
make install clean

OS X

Supported OS X versions: >=10.13. (NOTE: only 10.13 is tested during CI)

Compiling qTox on OS X for development requires 2 tools: Xcode and homebrew.

Manual Compiling

Required Libraries

Install homebrew if you don't have it:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

First, clone qTox.

git clone https://github.com/qTox/qTox
cd qTox

Then install required dependencies available via brew.

brew bundle --file osx/Brewfile

Then, install toxcore, ToxExt, and tox_extension_messages(https://github.com/toxext/tox_extension_messages.

buildscripts/build_toxcore_linux.sh

Finally, build qTox.

Compiling

mkdir -p _build
cd _build
cmake .. -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5)
make -j$(sysctl -n hw.ncpu)
make install

Running qTox

qTox.dmg should be in your build directory. You can install qTox from the dmg to your Applications folder, or run qTox directly from the dmg.

Windows

Only cross-compiling from Linux is supported and tested in CI, but building under MSYS should also work.

Cross-compile from Linux

See windows/cross-compile.

Compile-time switches

They are passed as an argument to cmake command. E.g. with a switch SWITCH that has value YES it would be passed to cmake in a following manner:

cmake -DSWITCH=yes

Switches:

  • SMILEYS, values:
    • if not defined or an unsupported value is passed, all emoticon packs are included
    • DISABLED don't include any emoticon packs, custom ones are still loaded
    • MIN minimal support for emoticons, only a single emoticon pack is included