2017-04-04 09:17:54 +00:00
## Build instructions for Qt Creator 3.5.1 under Ubuntu 12.04
2014-07-14 14:07:37 +00:00
2016-09-12 11:45:41 +00:00
**NB** These are outdated, please refer to [Building using GYP/CMake][cmake] instructions.
2017-04-04 09:17:54 +00:00
### Prepare
2014-07-14 14:07:37 +00:00
* Install git by command **sudo apt-get install git** in Terminal
* Install g++ by command **sudo apt-get install g++** in Terminal
2015-04-25 02:45:34 +00:00
* Install Qt Creator from [**Downloads page** ](https://www.qt.io/download/ )
2014-07-17 09:42:06 +00:00
2016-04-23 11:40:42 +00:00
You need to install g++ version 4.9 manually by such commands
2014-07-17 09:42:06 +00:00
* sudo add-apt-repository ppa:ubuntu-toolchain-r/test
* sudo apt-get update
2016-04-23 11:40:42 +00:00
* sudo apt-get install gcc-4.9 g++-4.9
* sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 21
* sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 21
2014-07-14 14:07:37 +00:00
2017-04-04 09:17:54 +00:00
### Prepare folder
2014-07-14 14:07:37 +00:00
Choose a folder for the future build, for example ** /home/user/TBuild** There you will have two folders, **Libraries** for third-party libs and **tdesktop** (or **tdesktop-master** ) for the app.
2017-04-04 09:17:54 +00:00
### Clone source code
2014-07-14 14:07:37 +00:00
By git – in Terminal go to ** /home/user/TBuild** and run
2017-03-10 11:22:23 +00:00
git clone --recursive https://github.com/telegramdesktop/tdesktop.git
2014-07-14 14:07:37 +00:00
2017-04-04 09:17:54 +00:00
### Prepare libraries
2014-07-14 14:07:37 +00:00
2014-07-17 09:42:06 +00:00
Install dev libraries
2014-07-14 14:07:37 +00:00
2015-01-15 14:22:15 +00:00
sudo apt-get install libexif-dev liblzma-dev libz-dev libssl-dev libappindicator-dev libunity-dev
2014-09-04 19:24:03 +00:00
2017-04-04 09:17:54 +00:00
#### zlib 1.2.8
2016-02-02 12:50:12 +00:00
http://www.zlib.net/ > Download [**zlib source code, version 1.2.8, zipfile format** ](http://zlib.net/zlib128.zip )
Extract to ** /home/user/TBuild/Libraries**
2017-04-04 09:17:54 +00:00
##### Building library
2016-02-02 12:50:12 +00:00
In Terminal go to ** /home/user/TBuild/Libraries/zlib-1.2.8** and run:
./configure
make
sudo make install
2014-09-06 12:35:17 +00:00
Install audio libraries
2017-04-04 09:17:54 +00:00
#### Opus codec 1.1
2014-09-06 12:35:17 +00:00
2015-06-01 12:44:10 +00:00
Download [opus-1.1 sources ](http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz ) from http://www.opus-codec.org/downloads, extract to ** /home/user/TBuild/Libraries**, go to ** /home/user/TBuild/Libraries/opus-1.1** and run
2014-09-06 12:35:17 +00:00
./configure
make
sudo make install
2017-04-04 09:17:54 +00:00
#### FFmpeg
2014-09-06 12:35:17 +00:00
2015-12-24 20:29:33 +00:00
In Terminal go to ** /home/user/TBuild/Libraries** and run
2015-12-24 22:55:00 +00:00
git clone git://anongit.freedesktop.org/git/libva
cd libva
./autogen.sh --enable-static
make
sudo make install
cd ..
2015-12-24 20:29:33 +00:00
git clone https://github.com/FFmpeg/FFmpeg.git ffmpeg
cd ffmpeg
2017-01-05 09:08:16 +00:00
git checkout release/3.2
2014-09-06 12:35:17 +00:00
2015-06-01 12:44:10 +00:00
sudo apt-get update
sudo apt-get -y --force-yes install autoconf automake build-essential libass-dev libfreetype6-dev libgpac-dev libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texi2html zlib1g-dev
sudo apt-get install yasm
2014-09-06 12:35:17 +00:00
2016-07-22 15:01:24 +00:00
./configure --prefix=/usr/local --disable-programs --disable-doc --disable-everything --enable-protocol=file --enable-libopus --enable-decoder=aac --enable-decoder=aac_latm --enable-decoder=aasc --enable-decoder=flac --enable-decoder=gif --enable-decoder=h264 --enable-decoder=h264_vdpau --enable-decoder=mp1 --enable-decoder=mp1float --enable-decoder=mp2 --enable-decoder=mp2float --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mp3adufloat --enable-decoder=mp3float --enable-decoder=mp3on4 --enable-decoder=mp3on4float --enable-decoder=mpeg4 --enable-decoder=mpeg4_vdpau --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=opus --enable-decoder=vorbis --enable-decoder=wavpack --enable-decoder=wmalossless --enable-decoder=wmapro --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmavoice --enable-encoder=libopus --enable-hwaccel=h264_vaapi --enable-hwaccel=h264_vdpau --enable-hwaccel=mpeg4_vaapi --enable-hwaccel=mpeg4_vdpau --enable-parser=aac --enable-parser=aac_latm --enable-parser=flac --enable-parser=h264 --enable-parser=mpeg4video --enable-parser=mpegaudio --enable-parser=opus --enable-parser=vorbis --enable-demuxer=aac --enable-demuxer=flac --enable-demuxer=gif --enable-demuxer=h264 --enable-demuxer=mov --enable-demuxer=mp3 --enable-demuxer=ogg --enable-demuxer=wav --enable-muxer=ogg --enable-muxer=opus
2014-09-06 12:35:17 +00:00
make
sudo make install
2017-04-04 09:17:54 +00:00
#### PortAudio 19
2014-09-06 12:35:17 +00:00
[Download portaudio sources ](http://www.portaudio.com/archives/pa_stable_v19_20140130.tgz ) from **http://www.portaudio.com/download.html** , extract to ** /home/user/TBuild/Libraries**, go to ** /home/user/TBuild/Libraries/portaudio** and run
./configure
make
sudo make install
2017-04-04 09:17:54 +00:00
#### OpenAL Soft
2014-09-04 19:24:03 +00:00
In Terminal go to ** /home/user/TBuild/Libraries** and run
git clone git://repo.or.cz/openal-soft.git
2015-06-01 12:44:10 +00:00
then go to ** /home/user/TBuild/Libraries/openal-soft/build** and run
2014-09-04 19:24:03 +00:00
2014-09-06 12:35:17 +00:00
sudo apt-get install cmake
2014-09-04 19:24:03 +00:00
cmake -D LIBTYPE:STRING=STATIC ..
make
sudo make install
2014-07-14 14:07:37 +00:00
2017-04-04 09:17:54 +00:00
#### OpenSSL
2016-02-21 14:45:07 +00:00
In Terminal go to ** /home/user/TBuild/Libraries** and run
git clone https://github.com/openssl/openssl
cd openssl
git checkout OpenSSL_1_0_1-stable
./config
make
sudo make install
2017-04-04 09:17:54 +00:00
#### libxkbcommon (required for Fcitx Qt plugin)
2015-08-14 15:47:56 +00:00
In Terminal go to ** /home/user/TBuild/Libraries** and run
sudo apt-get install xutils-dev bison python-xcbgen
git clone https://github.com/xkbcommon/libxkbcommon.git
2015-09-06 10:17:09 +00:00
cd libxkbcommon
2015-08-14 15:47:56 +00:00
./autogen.sh --disable-x11
make
sudo make install
2017-04-04 09:17:54 +00:00
#### Qt 5.6.2, slightly patched
2014-07-14 14:07:37 +00:00
2015-10-19 22:13:11 +00:00
In Terminal go to ** /home/user/TBuild/Libraries** and run
2014-07-14 14:07:37 +00:00
2016-10-17 21:33:24 +00:00
git clone git://code.qt.io/qt/qt5.git qt5_6_2
cd qt5_6_2
2015-10-19 22:13:11 +00:00
perl init-repository --module-subset=qtbase,qtimageformats
2016-10-17 21:33:24 +00:00
git checkout v5.6.2
cd qtimageformats & & git checkout v5.6.2 & & cd ..
cd qtbase & & git checkout v5.6.2 & & cd ..
2015-02-11 23:37:30 +00:00
2017-04-04 09:17:54 +00:00
##### Apply the patch
2015-02-11 23:37:30 +00:00
2016-10-17 21:33:24 +00:00
cd qtbase & & git apply ../../../tdesktop/Telegram/Patches/qtbase_5_6_2.diff & & cd ..
2014-07-14 14:07:37 +00:00
2017-04-04 09:17:54 +00:00
##### Building library
2014-07-14 14:07:37 +00:00
2016-10-17 21:33:24 +00:00
Install some packages for Qt (see ** /home/user/TBuild/Libraries/qt5_6_2/qtbase/src/plugins/platforms/xcb/README**)
2014-07-14 14:07:37 +00:00
2015-02-12 11:07:04 +00:00
sudo apt-get install libxcb1-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-icccm4-dev libxcb-render-util0-dev libxcb-util0-dev libxrender-dev libasound-dev libpulse-dev libxcb-sync0-dev libxcb-xfixes0-dev libxcb-randr0-dev libx11-xcb-dev libffi-dev
2014-07-14 14:07:37 +00:00
2016-10-17 21:33:24 +00:00
In Terminal go to ** /home/user/TBuild/Libraries/qt5_6_2** and there run
2014-07-14 14:07:37 +00:00
2016-10-17 21:33:24 +00:00
./configure -prefix "/usr/local/tdesktop/Qt-5.6.2" -release -force-debug-info -opensource -confirm-license -qt-zlib -qt-libpng -qt-libjpeg -qt-freetype -qt-harfbuzz -qt-pcre -qt-xcb -qt-xkbcommon-x11 -no-opengl -no-gtkstyle -static -openssl-linked -nomake examples -nomake tests
2015-10-19 22:13:11 +00:00
make -j4
2016-04-23 11:40:42 +00:00
sudo make install
2014-07-14 14:07:37 +00:00
building (**make** command) will take really long time.
2017-04-04 09:17:54 +00:00
#### Google Breakpad
2016-02-08 12:32:17 +00:00
In Terminal go to ** /home/user/TBuild/Libraries** and run
git clone https://chromium.googlesource.com/breakpad/breakpad
git clone https://chromium.googlesource.com/linux-syscall-support breakpad/src/third_party/lss
cd breakpad
./configure
make
sudo make install
2017-04-04 09:17:54 +00:00
### Building Telegram codegen utilities
2016-04-22 07:25:14 +00:00
In Terminal go to ** /home/user/TBuild/tdesktop** and run
mkdir -p Linux/obj/codegen_style/Debug
cd Linux/obj/codegen_style/Debug
2016-10-17 21:33:24 +00:00
/usr/local/tdesktop/Qt-5.6.2/bin/qmake CONFIG+=debug ../../../../Telegram/build/qmake/codegen_style/codegen_style.pro
2016-04-22 07:25:14 +00:00
make
mkdir -p ../../codegen_numbers/Debug
cd ../../codegen_numbers/Debug
2016-10-17 21:33:24 +00:00
/usr/local/tdesktop/Qt-5.6.2/bin/qmake CONFIG+=debug ../../../../Telegram/build/qmake/codegen_numbers/codegen_numbers.pro
2016-04-22 07:25:14 +00:00
make
2017-04-04 09:17:54 +00:00
### Building Telegram Desktop
2014-07-14 14:07:37 +00:00
* Launch Qt Creator, all projects will be taken from ** /home/user/TBuild/tdesktop/Telegram**
2016-10-17 21:33:24 +00:00
* Tools > Options > Build & Run > Qt Versions tab > Add > File System /usr/local/tdesktop/Qt-5.6.2/bin/qmake > **Qt 5.6.2 (Qt-5.6.2)** > Apply
* Tools > Options > Build & Run > Kits tab > Desktop (default) > change **Qt version** to **Qt 5.6.2 (Qt-5.6.2)** > Apply
2014-07-14 14:07:37 +00:00
* Open MetaLang.pro, configure project with paths ** /home/user/TBuild/tdesktop/Linux/DebugIntermediateLang** and ** /home/user/TBuild/tdesktop/Linux/ReleaseIntermediateLang** and build for Debug
2014-07-18 10:37:34 +00:00
* Open Telegram.pro, configure project with paths ** /home/user/TBuild/tdesktop/Linux/DebugIntermediate** and ** /home/user/TBuild/tdesktop/Linux/ReleaseIntermediate** and build for Debug, if GeneratedFiles are not found click **Run qmake** from **Build** menu and try again
2014-07-14 14:07:37 +00:00
* Open Updater.pro, configure project with paths ** /home/user/TBuild/tdesktop/Linux/DebugIntermediateUpdater** and ** /home/user/TBuild/tdesktop/Linux/ReleaseIntermediateUpdater** and build for Debug
2014-07-18 10:37:34 +00:00
* Release Telegram build will require removing **CUSTOM_API_ID** definition in Telegram.pro project and may require changing paths in ** /home/user/TBuild/tdesktop/Telegram/FixMake.sh** or ** /home/user/TBuild/tdesktop/Telegram/FixMake32.sh** for static library linking fix, static linking applies only on second Release build (first uses old Makefile)
2016-09-12 12:02:52 +00:00
[cmake]: building-cmake.md