2017-09-28 09:40:26 +00:00
|
|
|
## Build instructions for GYP/CMake under Ubuntu 14.04
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2017-09-28 09:40:26 +00:00
|
|
|
### Prepare folder
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2017-10-13 17:35:29 +00:00
|
|
|
Choose an empty folder for the future build, for example **/home/user/TBuild**. It will be named ***BuildPath*** in the rest of this document.
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2018-11-04 10:29:30 +00:00
|
|
|
### Obtain your API credentials
|
|
|
|
|
|
|
|
You will require **api_id** and **api_hash** to access the Telegram API servers. To learn how to obtain them [click here][api_credentials].
|
|
|
|
|
2017-09-28 09:40:26 +00:00
|
|
|
### Install software and required packages
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2017-09-28 09:40:26 +00:00
|
|
|
You will need GCC 7.2 and CMake 3.2 installed. To install them and all the required dependencies run
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2017-09-28 09:40:26 +00:00
|
|
|
sudo apt-get install software-properties-common
|
|
|
|
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
|
|
|
sudo add-apt-repository ppa:george-edison55/cmake-3.x
|
|
|
|
sudo apt-get update
|
2017-10-13 17:35:29 +00:00
|
|
|
sudo apt-get install gcc-7 g++-7 cmake
|
2017-09-28 09:40:26 +00:00
|
|
|
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60
|
|
|
|
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 60
|
2019-03-07 16:47:19 +00:00
|
|
|
sudo update-alternatives --config gcc
|
2017-10-13 17:35:29 +00:00
|
|
|
sudo add-apt-repository --remove ppa:ubuntu-toolchain-r/test
|
|
|
|
sudo add-apt-repository --remove ppa:george-edison55/cmake-3.x
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2018-12-07 17:59:14 +00:00
|
|
|
sudo apt-get install git libexif-dev liblzma-dev libz-dev libssl-dev libappindicator-dev libicu-dev libdee-dev libdrm-dev dh-autoreconf 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-image0-dev libxcb-shm0-dev libxcb-xfixes0-dev libxcb-keysyms1-dev libxcb-icccm4-dev libxcb-render-util0-dev libxcb-util0-dev libxrender-dev libasound-dev libpulse-dev libxcb-sync0-dev libxcb-randr0-dev libx11-xcb-dev libffi-dev libncurses5-dev pkg-config texi2html zlib1g-dev yasm cmake xutils-dev bison python-xcbgen
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2017-09-28 09:40:26 +00:00
|
|
|
You can set the multithreaded make parameter by running
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2017-09-28 09:40:26 +00:00
|
|
|
MAKE_THREADS_CNT=-j8
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2017-09-28 09:40:26 +00:00
|
|
|
### Clone source code and prepare libraries
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2017-09-28 09:40:26 +00:00
|
|
|
Go to ***BuildPath*** and run
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2017-09-28 09:40:26 +00:00
|
|
|
git clone --recursive https://github.com/telegramdesktop/tdesktop.git
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2017-09-28 09:40:26 +00:00
|
|
|
mkdir Libraries
|
|
|
|
cd Libraries
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2017-11-19 14:37:07 +00:00
|
|
|
git clone https://github.com/ericniebler/range-v3
|
|
|
|
|
2017-09-06 09:12:27 +00:00
|
|
|
git clone https://github.com/telegramdesktop/zlib.git
|
|
|
|
cd zlib
|
2017-05-04 11:15:21 +00:00
|
|
|
./configure
|
2017-09-28 09:40:26 +00:00
|
|
|
make $MAKE_THREADS_CNT
|
2017-05-04 11:15:21 +00:00
|
|
|
sudo make install
|
2017-09-28 09:40:26 +00:00
|
|
|
cd ..
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2017-05-04 11:15:21 +00:00
|
|
|
git clone https://github.com/xiph/opus
|
|
|
|
cd opus
|
2018-11-29 12:33:01 +00:00
|
|
|
git checkout v1.3
|
2017-05-04 11:15:21 +00:00
|
|
|
./autogen.sh
|
2016-09-12 11:45:41 +00:00
|
|
|
./configure
|
2017-09-28 09:40:26 +00:00
|
|
|
make $MAKE_THREADS_CNT
|
2016-09-12 11:45:41 +00:00
|
|
|
sudo make install
|
2017-09-28 09:40:26 +00:00
|
|
|
cd ..
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2017-05-27 07:50:10 +00:00
|
|
|
git clone https://github.com/01org/libva.git
|
2016-09-12 11:45:41 +00:00
|
|
|
cd libva
|
|
|
|
./autogen.sh --enable-static
|
2017-09-28 09:40:26 +00:00
|
|
|
make $MAKE_THREADS_CNT
|
2016-09-12 11:45:41 +00:00
|
|
|
sudo make install
|
|
|
|
cd ..
|
|
|
|
|
2017-01-05 13:46:36 +00:00
|
|
|
git clone git://anongit.freedesktop.org/vdpau/libvdpau
|
|
|
|
cd libvdpau
|
2019-03-05 18:38:03 +00:00
|
|
|
git checkout libvdpau-1.2
|
2017-01-05 13:46:36 +00:00
|
|
|
./autogen.sh --enable-static
|
2017-09-28 09:40:26 +00:00
|
|
|
make $MAKE_THREADS_CNT
|
2017-01-05 13:46:36 +00:00
|
|
|
sudo make install
|
|
|
|
cd ..
|
|
|
|
|
2016-09-12 11:45:41 +00:00
|
|
|
git clone https://github.com/FFmpeg/FFmpeg.git ffmpeg
|
|
|
|
cd ffmpeg
|
2017-11-23 15:00:11 +00:00
|
|
|
git checkout release/3.4
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2019-03-06 10:00:35 +00:00
|
|
|
./configure --prefix=/usr/local \
|
|
|
|
--enable-protocol=file --enable-libopus \
|
|
|
|
--disable-programs \
|
|
|
|
--disable-doc \
|
|
|
|
--disable-network \
|
|
|
|
--disable-everything \
|
|
|
|
--enable-hwaccel=h264_vaapi \
|
|
|
|
--enable-hwaccel=h264_vdpau \
|
|
|
|
--enable-hwaccel=mpeg4_vaapi \
|
|
|
|
--enable-hwaccel=mpeg4_vdpau \
|
|
|
|
--enable-decoder=aac \
|
|
|
|
--enable-decoder=aac_at \
|
|
|
|
--enable-decoder=aac_fixed \
|
|
|
|
--enable-decoder=aac_latm \
|
|
|
|
--enable-decoder=aasc \
|
|
|
|
--enable-decoder=alac \
|
|
|
|
--enable-decoder=alac_at \
|
|
|
|
--enable-decoder=flac \
|
|
|
|
--enable-decoder=gif \
|
|
|
|
--enable-decoder=h264 \
|
|
|
|
--enable-decoder=h264_vdpau \
|
|
|
|
--enable-decoder=hevc \
|
|
|
|
--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=pcm_alaw \
|
|
|
|
--enable-decoder=pcm_alaw_at \
|
|
|
|
--enable-decoder=pcm_f32be \
|
|
|
|
--enable-decoder=pcm_f32le \
|
|
|
|
--enable-decoder=pcm_f64be \
|
|
|
|
--enable-decoder=pcm_f64le \
|
|
|
|
--enable-decoder=pcm_lxf \
|
|
|
|
--enable-decoder=pcm_mulaw \
|
|
|
|
--enable-decoder=pcm_mulaw_at \
|
|
|
|
--enable-decoder=pcm_s16be \
|
|
|
|
--enable-decoder=pcm_s16be_planar \
|
|
|
|
--enable-decoder=pcm_s16le \
|
|
|
|
--enable-decoder=pcm_s16le_planar \
|
|
|
|
--enable-decoder=pcm_s24be \
|
|
|
|
--enable-decoder=pcm_s24daud \
|
|
|
|
--enable-decoder=pcm_s24le \
|
|
|
|
--enable-decoder=pcm_s24le_planar \
|
|
|
|
--enable-decoder=pcm_s32be \
|
|
|
|
--enable-decoder=pcm_s32le \
|
|
|
|
--enable-decoder=pcm_s32le_planar \
|
|
|
|
--enable-decoder=pcm_s64be \
|
|
|
|
--enable-decoder=pcm_s64le \
|
|
|
|
--enable-decoder=pcm_s8 \
|
|
|
|
--enable-decoder=pcm_s8_planar \
|
|
|
|
--enable-decoder=pcm_u16be \
|
|
|
|
--enable-decoder=pcm_u16le \
|
|
|
|
--enable-decoder=pcm_u24be \
|
|
|
|
--enable-decoder=pcm_u24le \
|
|
|
|
--enable-decoder=pcm_u32be \
|
|
|
|
--enable-decoder=pcm_u32le \
|
|
|
|
--enable-decoder=pcm_u8 \
|
|
|
|
--enable-decoder=pcm_zork \
|
|
|
|
--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-parser=aac \
|
|
|
|
--enable-parser=aac_latm \
|
|
|
|
--enable-parser=flac \
|
|
|
|
--enable-parser=h264 \
|
|
|
|
--enable-parser=hevc \
|
|
|
|
--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=hevc \
|
|
|
|
--enable-demuxer=m4v \
|
|
|
|
--enable-demuxer=mov \
|
|
|
|
--enable-demuxer=mp3 \
|
|
|
|
--enable-demuxer=ogg \
|
|
|
|
--enable-demuxer=wav \
|
|
|
|
--enable-muxer=ogg \
|
|
|
|
--enable-muxer=opus
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2017-09-28 09:40:26 +00:00
|
|
|
make $MAKE_THREADS_CNT
|
2016-09-12 11:45:41 +00:00
|
|
|
sudo make install
|
2017-09-28 09:40:26 +00:00
|
|
|
cd ..
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2017-09-28 09:40:26 +00:00
|
|
|
git clone https://git.assembla.com/portaudio.git
|
|
|
|
cd portaudio
|
|
|
|
git checkout 396fe4b669
|
2016-09-12 11:45:41 +00:00
|
|
|
./configure
|
2017-09-28 09:40:26 +00:00
|
|
|
make $MAKE_THREADS_CNT
|
2016-09-12 11:45:41 +00:00
|
|
|
sudo make install
|
2017-09-28 09:40:26 +00:00
|
|
|
cd ..
|
2016-09-12 11:45:41 +00:00
|
|
|
|
|
|
|
git clone git://repo.or.cz/openal-soft.git
|
2018-04-18 18:10:21 +00:00
|
|
|
cd openal-soft
|
2018-11-07 20:01:58 +00:00
|
|
|
git checkout openal-soft-1.19.1
|
2018-04-18 18:10:21 +00:00
|
|
|
cd build
|
2018-11-08 11:26:44 +00:00
|
|
|
if [ `uname -p` == "i686" ]; then
|
|
|
|
cmake -D LIBTYPE:STRING=STATIC -D ALSOFT_UTILS:BOOL=OFF ..
|
|
|
|
else
|
2016-09-12 11:45:41 +00:00
|
|
|
cmake -D LIBTYPE:STRING=STATIC ..
|
2018-11-08 11:26:44 +00:00
|
|
|
fi
|
2017-09-28 09:40:26 +00:00
|
|
|
make $MAKE_THREADS_CNT
|
2016-09-12 11:45:41 +00:00
|
|
|
sudo make install
|
2017-09-28 09:40:26 +00:00
|
|
|
cd ../..
|
2016-09-12 11:45:41 +00:00
|
|
|
|
|
|
|
git clone https://github.com/openssl/openssl
|
|
|
|
cd openssl
|
|
|
|
git checkout OpenSSL_1_0_1-stable
|
|
|
|
./config
|
2017-09-28 09:40:26 +00:00
|
|
|
make $MAKE_THREADS_CNT
|
2016-09-12 11:45:41 +00:00
|
|
|
sudo make install
|
2017-09-28 09:40:26 +00:00
|
|
|
cd ..
|
2016-09-12 11:45:41 +00:00
|
|
|
|
|
|
|
git clone https://github.com/xkbcommon/libxkbcommon.git
|
|
|
|
cd libxkbcommon
|
|
|
|
./autogen.sh --disable-x11
|
2017-09-28 09:40:26 +00:00
|
|
|
make $MAKE_THREADS_CNT
|
2016-09-12 11:45:41 +00:00
|
|
|
sudo make install
|
2017-09-28 09:40:26 +00:00
|
|
|
cd ..
|
2016-09-12 11:45:41 +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
|
2016-09-12 11:45:41 +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 ..
|
|
|
|
cd qtbase && git apply ../../../tdesktop/Telegram/Patches/qtbase_5_6_2.diff && cd ..
|
2017-09-06 09:12:27 +00:00
|
|
|
cd qtbase/src/plugins/platforminputcontexts
|
|
|
|
git clone https://github.com/telegramdesktop/fcitx.git
|
|
|
|
git clone https://github.com/telegramdesktop/hime.git
|
2018-12-06 07:28:24 +00:00
|
|
|
git clone https://github.com/telegramdesktop/nimf.git
|
2017-09-06 09:12:27 +00:00
|
|
|
cd ../../../..
|
|
|
|
|
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
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2017-09-28 09:40:26 +00:00
|
|
|
make $MAKE_THREADS_CNT
|
|
|
|
sudo make install
|
|
|
|
cd ..
|
2016-09-12 11:45:41 +00:00
|
|
|
|
|
|
|
git clone https://chromium.googlesource.com/external/gyp
|
|
|
|
cd gyp
|
2017-09-04 10:19:06 +00:00
|
|
|
git checkout 702ac58e47
|
2016-09-12 11:45:41 +00:00
|
|
|
git apply ../../tdesktop/Telegram/Patches/gyp.diff
|
2017-09-28 09:40:26 +00:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
git clone https://chromium.googlesource.com/breakpad/breakpad
|
|
|
|
cd breakpad
|
2018-03-08 22:55:18 +00:00
|
|
|
git checkout bc8fb886
|
|
|
|
git clone https://chromium.googlesource.com/linux-syscall-support src/third_party/lss
|
|
|
|
cd src/third_party/lss
|
|
|
|
git checkout a91633d1
|
|
|
|
cd ../../..
|
2016-09-12 11:45:41 +00:00
|
|
|
./configure
|
2017-09-28 09:40:26 +00:00
|
|
|
make $MAKE_THREADS_CNT
|
|
|
|
sudo make install
|
2018-03-08 22:55:18 +00:00
|
|
|
cd src/tools
|
2017-09-28 09:40:26 +00:00
|
|
|
../../../gyp/gyp --depth=. --generator-output=.. -Goutput_dir=../out tools.gyp --format=cmake
|
|
|
|
cd ../../out/Default
|
|
|
|
cmake .
|
|
|
|
make $MAKE_THREADS_CNT dump_syms
|
|
|
|
cd ../../..
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2017-09-28 09:40:26 +00:00
|
|
|
### Building the project
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2018-11-04 10:29:30 +00:00
|
|
|
Go to ***BuildPath*/tdesktop/Telegram** and run (using [your **api_id** and **api_hash**](#obtain-your-api-credentials))
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2018-11-04 10:29:30 +00:00
|
|
|
gyp/refresh.sh --api-id YOUR_API_ID --api-hash YOUR_API_HASH
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2017-09-28 09:40:26 +00:00
|
|
|
To make Debug version go to ***BuildPath*/tdesktop/out/Debug** and run
|
|
|
|
|
|
|
|
make $MAKE_THREADS_CNT
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2017-09-28 09:40:26 +00:00
|
|
|
To make Release version go to ***BuildPath*/tdesktop/out/Release** and run
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2017-09-28 09:40:26 +00:00
|
|
|
make $MAKE_THREADS_CNT
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2017-09-28 09:40:26 +00:00
|
|
|
You can debug your builds from Qt Creator, just open **CMakeLists.txt** from ***BuildPath*/tdesktop/out/Debug** and launch with debug.
|
2016-09-12 11:45:41 +00:00
|
|
|
|
2018-11-04 10:29:30 +00:00
|
|
|
[api_credentials]: api_credentials.md
|