1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
qTox/INSTALL.md

242 lines
12 KiB
Markdown
Raw Normal View History

2014-10-01 04:51:03 +08:00
#Install Instructions
- [Dependencies](#dependencies)
- [Windows](#windows)
- [Linux](#linux)
- [OS X](#osx)
<a name="dependencies" />
2014-09-03 20:59:00 +08:00
##Dependencies
2014-09-03 18:54:41 +08:00
2014-11-03 17:26:19 +08:00
| Name | Version | Modules |
|--------------|-------------|------------------------------------- |
| Qt | >= 5.2.0 | core, gui, network, widget, xml, sql |
| GCC/MinGW | >= 4.8 | C++11 enabled |
| Tox Core | most recent | core, av |
| OpenCV | >= 2.4.9 | core, highgui, imgproc |
2014-11-03 17:26:19 +08:00
| OpenAL Soft | >= 1.16.0 | |
2014-09-03 18:54:41 +08:00
2014-10-01 04:51:03 +08:00
<a name="windows" />
2014-09-03 20:59:00 +08:00
##Windows
2014-09-03 18:54:41 +08:00
2014-09-03 20:59:00 +08:00
###Qt
2014-09-03 18:54:41 +08:00
Download the Qt online installer for Windows from [qt-project.org](http://qt-project.org/downloads).
While installation you have to assemble your Qt toolchain. Take the most recent version of Qt compiled with MinGW.
2014-09-08 07:03:05 +08:00
Although the installer provides its own bundled MinGW compiler toolchain its recommend installing it separately because Qt is missing MSYS which is needed to compile and install OpenCV and OpenAL. Thus you can - if needed - deselect the tab "Tools".
The following steps assume that Qt is installed at "C:\Qt". If you decided to choose another location, replace corresponding parts.
2014-09-03 18:54:41 +08:00
2014-09-03 20:59:00 +08:00
###MinGW
2014-09-03 18:54:41 +08:00
Download the MinGW installer for Windows from [sourceforge.net](http://sourceforge.net/projects/mingw/files/Installer/).
Make sure to install MSYS (a set of Unix tools for Windows).
The following steps assume that MinGW is installed at "C:\MinGW". If you decided to choose another location, replace corresponding parts.
2014-09-03 18:54:41 +08:00
###Setting up Path
2014-09-03 18:54:41 +08:00
Add MinGW/MSYS binaries to the system path to make them globally accessible.
Open Control Panel -> System and Security -> System -> Advanced system settings -> Environment Variables...
In the second box search for the PATH variable and press Edit...
The input box "Variable value:" should already contain some directories. Each directory is separated with a semicolon.
Extend the input box by adding ";C:\MinGW\bin;C:\MinGW\msys\1.0\bin". The very first semicolon must only be added if it is missing.
2014-09-03 18:54:41 +08:00
2014-09-03 20:59:00 +08:00
###Cloning the Repository
2014-09-03 18:54:41 +08:00
Clone the repository (https://github.com/tux3/qTox.git) with your preferred Git client. [SmartGit](http://www.syntevo.com/smartgit/) is very nice for this task.
The following steps assume that you cloned the repository at "C:\qTox". If you decided to choose another location, replace corresponding parts.
2014-09-03 18:54:41 +08:00
2014-09-03 20:59:00 +08:00
###Tox Core
2014-09-03 18:54:41 +08:00
2014-09-03 19:02:38 +08:00
[jenkins.libtoxcore.so](http://jenkins.libtoxcore.so/job/libtoxcore-win32-i686/lastSuccessfulBuild/artifact/libtoxcore-win32-i686.zip)
2014-09-03 19:37:29 +08:00
provides a prebuild package of Tox Core. Download this package and extract its content to "C:\qTox\libs". You may have to create the directory "libs".
If you prefer to compile Tox Core on your own follow the instructions at https://github.com/irungentoo/toxcore/blob/master/INSTALL.md#windows
2014-09-03 20:59:00 +08:00
###OpenCV
2014-09-03 19:37:29 +08:00
Unfortunately there are no prebuild packages for OpenCV compiled with MinGW. Thus, you have to create your own.
First of all download and install the most recent version of CMake from
[cmake.org](http://www.cmake.org/cmake/resources/software.html).
2014-09-08 06:35:22 +08:00
Afterwards download OpenCV in version 2.4.9 from [sourceforge.net](http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip/download) and extract the content of the source archive to "C:\qTox\libs". Furthermore, create a new directory named "opencv-build" in "C:\qTox\libs".
Now you should have the two directories "opencv-2.4.9" and "opencv-build" inside your "C:\qTox\libs" directory.
2014-09-05 02:00:19 +08:00
Run CMake (cmake-gui) and set up the input boxes "Where is the source code:" and "Where to build the binaries" with "C:\qTox\libs\opencv-2.4.9" and "C:\qTox\libs\opencv-build". Press configure and choose "MSYS Makefiles" in the drop down menu with "Use default native compilers". To start initial configuration press Finish. Given that qTox only needs some components of OpenCV it's recommended to disable not required modules. Furthermore, this will decrease compilation time of OpenCV dramatically. Each module begins with "BUILD_opencv_" and can be disabled by deselecting its entry. Use the "Search" input box for convenience. Disable all modules except of "core", "highgui" and "imgproc" (highgui depends on imgproc and will automatically be disabled if imgproc is disabled). For maximum performance search for "CMAKE_BUILD_TYPE" and set this value to "Release". Finally, make sure "CMAKE_INSTALL_PREFIX" points to "C:\qTox\libs\opencv-build\install" (should be by default). To update the configuration press Configure again. To generate the Makefiles press Generate.
2014-09-05 02:00:19 +08:00
2014-09-08 01:00:32 +08:00
Open a new command prompt within "C:\qTox\libs\opencv-build" (HINT: Use shift + right click -> "Open command window here" on the directory within Windows Explorer). Compile and install OpenCV with the following command. It's not recommended to use -j for multicore compilation, because it freezes the terminal from time to time.
2014-09-05 02:00:19 +08:00
```bash
make
make install
```
After OpenCV was successfully installed to "C:\qTox\libs\opencv-build\install" copy the dlls "libopencv_core249.dll", "libopencv_highgui249.dll" and "libopencv_imgproc249.dll" located at "C:\qTox\libs\opencv-build\install\x86\mingw\bin" to "C:\qTox\libs\lib". Afterwards copy the content of the directory "C:\qTox\libs\opencv-build\install\include" to "C:\qTox\libs\include". Finally, you have to patch the file "C:\qTox\libs\include\opencv2\opencv.hpp" because it includes all modules of OpenCV regardless of your configuration. Open this file with your preferred text editor and remove all includes except of "opencv2/core/core_c.h", "opencv2/core/core.hpp", "opencv2/imgproc/imgproc_c.h", "opencv2/imgproc/imgproc.hpp", "opencv2/highgui/highgui_c.h" and "opencv2/highgui/highgui.hpp". OpenCV is now ready to use. Feel free to delete the directories "opencv-2.4.9" and "opencv-build", but you don't need to.
2014-09-03 19:37:29 +08:00
2014-09-03 20:59:00 +08:00
###OpenAL Soft
2014-09-08 06:48:12 +08:00
As for OpenCV there are no prebuild packages of OpenAL Softe compiled with MinGW, but the installation process is very similar to OpenCV. Download the most recent source archive of OpenAL Soft from [http://kcat.strangesoft.net](http://kcat.strangesoft.net/openal.html#download). Extract its content to "C:\qTox\libs". Besides the source folder itself you'll find the file "pax_global_header". It is not required and can be deleted. Create the directory "openal-build" next to source folder. Now you should have the two directories "openal-soft-x.y.z" where x.y.z is the version of OpenAL and "openal-build" inside your "C:\qTox\libs" directory. Run CMake (cmake-gui) and setup the source and build location. Run the initial configuration and use "MSYS Makefiles" with "Use default native compilers". The only thing you need to configure is "CMAKE_INSTALL_PREFIX" which does not point to "C:\qTox\libs\openal-build\install" by default. Configure the project and generate the Makefiles. Compile and install OpenAL Soft with:
2014-09-08 01:21:18 +08:00
```bash
make
make install
```
Copy the dll "OpenAL32.dll" located at "C:\qTox\libs\openal-build\install\bin" to "C:\qTox\libs\lib". Finally, copy the directory "AL" located at "C:\qTox\libs\openal-build\install\include" to "C:\qTox\libs\include". Unlike OpenCV you don't need to patch any files. Feel free to delete the directories "openal-soft-x.y.z" and "openal-build", but you don't need to.
2014-09-03 18:54:41 +08:00
2014-10-01 04:51:03 +08:00
<a name="linux" />
2014-09-03 20:59:00 +08:00
##Linux
2014-09-27 06:11:13 +08:00
Most of the dependencies should be available through your package manger. You may either follow the directions below, or simply run `./simple_make.sh` after cloning, which will attempt to automatically download dependencies followed by compilation.
2014-09-03 20:22:00 +08:00
2014-09-04 19:04:53 +08:00
###Cloning the Repository
2014-09-03 20:22:00 +08:00
In order to clone the qTox repository you need Git.
Debian:
```bash
sudo apt-get install git
```
Ubuntu:
```bash
sudo apt-get install git
```
Arch Linux:
```bash
2014-09-08 06:48:12 +08:00
sudo pacman -S --needed git
2014-09-03 20:22:00 +08:00
```
Fedora:
```bash
yum install git
```
2014-09-04 19:04:53 +08:00
Afterwards open a new Terminal, change to a directory of your choice and clone the repository:
2014-09-03 20:40:18 +08:00
```bash
2014-09-04 19:04:53 +08:00
cd /home/user/qTox
2014-09-03 20:40:18 +08:00
git clone https://github.com/tux3/qTox.git qTox
```
The following steps assumes that you cloned the repository at "/home/user/qTox". If you decided to choose another location, replace corresponding parts.
2014-09-03 20:59:00 +08:00
###GCC, Qt, OpenCV and OpanAL Soft
2014-09-03 20:22:00 +08:00
Debian:
```bash
2014-09-03 20:52:09 +08:00
sudo apt-get install build-essential qt5-qmake qt5-default libopenal-dev libopencv-dev
2014-09-03 20:22:00 +08:00
```
Ubuntu:
```bash
2014-11-11 18:14:11 +08:00
sudo apt-get install build-essential qt5-qmake qt5-default qttools5-dev-tools libopenal-dev libopencv-dev
2014-09-03 20:22:00 +08:00
```
Arch Linux:
```bash
2014-09-08 06:48:12 +08:00
sudo pacman -S --needed base-devel qt5 opencv openal
2014-09-03 20:22:00 +08:00
```
Fedora:
```bash
yum groupinstall "Development Tools"
2014-09-03 20:52:09 +08:00
yum install qt-devel qt-doc qt-creator opencv-devel openal-soft-devel
2014-09-03 20:22:00 +08:00
```
2014-09-03 20:59:00 +08:00
###Tox Core
2014-09-03 20:22:00 +08:00
First of all install the dependencies of Tox Core.
Debian:
```bash
2014-09-11 06:36:34 +08:00
sudo apt-get install libtool autotools-dev automake checkinstall check libopus-dev libvpx-dev
2014-09-03 20:22:00 +08:00
```
Ubuntu:
```bash
2014-09-11 06:36:34 +08:00
sudo apt-get install libtool autotools-dev automake checkinstall check libopus-dev libvpx-dev
2014-09-03 20:22:00 +08:00
```
Arch Linux: (Arch Linux provides the package "tox-git" in AUR)
```bash
2014-09-11 06:36:34 +08:00
sudo pacman -S --needed opus vpx
2014-09-03 20:22:00 +08:00
```
Fedora:
```bash
yum install libtool autoconf automake check check-devel
```
2014-09-03 20:40:18 +08:00
2014-09-03 20:22:00 +08:00
Now you can either follow the instructions at https://github.com/irungentoo/toxcore/blob/master/INSTALL.md#unix or use the "bootstrap.sh" script located at "/home/user/qTox".
2014-09-03 20:40:18 +08:00
The script will automatically download and install Tox Core and libsodium to "/home/user/qTox/libs":
```bash
2014-09-03 20:56:45 +08:00
cd /home/user/qTox
2014-09-03 20:40:18 +08:00
./bootstrap.sh # use -h or --help for more information
```
2014-09-27 06:11:13 +08:00
After all the dependencies are thus reeady to go, compiling should be as simple as
```bash
qmake
make
```
2014-09-27 06:06:33 +08:00
###Building packages
2014-09-27 06:11:13 +08:00
Alternately, qTox now has the experimental and probably-dodgy ability to package itself (in .deb
form natively, and .rpm form with <a href="http://joeyh.name/code/alien/">alien</a>).
After installing the required dependencies, run `bootstrap.sh` and then run the
`buildPackages.sh` script, found in the tools folder. It will automatically get the
packages necessary for building .debs, so be prepared to type your password for sudo.
2014-09-27 06:04:01 +08:00
2014-10-01 04:51:03 +08:00
<a name="osx" />
2014-09-27 06:04:01 +08:00
##OS X
###OSX Easy Install
Since https://github.com/ReDetection/homebrew-qtox you can easily install qtox with homebrew
```bash
brew install --HEAD ReDetection/qtox/qtox
```
###OSX Full Install Guide
This guide is intended for people who wish to use an existing or new ProjectTox-Core installation separate to the bundled installation with qTox, if you do not wish to use a separate installation you can skip to the section titled 'Final Steps'.
Installation on OSX, isn't quite straight forward, here is a quick guide on how to install;
2014-09-27 06:11:13 +08:00
Note that qTox now requires OpenCV and OpenAL for video and audio.
2014-09-27 06:06:33 +08:00
2014-09-27 06:04:01 +08:00
The first thing you need to do is install ProjectTox-Core with a/v support. Refer to the INSTALL guide in the PrjectTox-Core github repo.
Next you need to download QtTools (http://qt-project.org/downloads), at the time of writing this is at version .3.0.
Make sure you deselect all the unnecessary components from the 5.3 checkbox (iOS/Android libs) otherwise you will end up with a very large download.
Once that is installed you will most likely need to set the path for qmake. To do this, open up terminal and paste in the following;
```bash
export PATH=/location/to/qmake/binary:$PATH
```
For myself, the qmake binary was located in /Users/mouseym/Qt/5.3/clang_64/bin/.
This is not a permanent change, it will revert when you close the terminal window, to add it permanently you will need to add echo the above line to your .profile/.bash_profile.
Once this is installed, do the following;
```bash
git clone https://github.com/tux3/qTox
cd toxgui
qmake
```
Now, we need to create a symlink to /usr/local/lib/ and /usr/local/include/
```
mkdir -p $HOME/qTox/libs
sudo ln -s /usr/local/lib $HOME/qTox/libs/lib
sudo ln -s /usr/local/include $HOME/qTox/libs/include
```
####Final Steps
The final step is to run
```bash
make
```
in the qTox directory, or if you are using the bundled tox core installation, you can use
```bash
./bootstrap.sh
2014-09-27 06:11:13 +08:00
make
2014-09-27 06:04:01 +08:00
```
Assuming all went well you should now have a qTox.app file within the directory. Double click and it should open!