tdesktop/docs/building-linux.md

45 lines
1.7 KiB
Markdown
Raw Normal View History

## Build instructions for Linux using Docker
2016-09-12 11:45:41 +00:00
### Prepare folder
Choose a folder for the future build, for example **/home/user/TBuild**. It will be named ***BuildPath*** in the rest of this document. All commands will be launched from Terminal.
### Obtain your API credentials
2016-09-12 11:45:41 +00:00
You will require **api_id** and **api_hash** to access the Telegram API servers. To learn how to obtain them [click here][api_credentials].
2016-09-12 11:45:41 +00:00
### Clone source code and prepare libraries
2016-09-12 11:45:41 +00:00
Install [poetry](https://python-poetry.org), go to ***BuildPath*** and run
2016-09-12 11:45:41 +00:00
git clone --recursive https://github.com/telegramdesktop/tdesktop.git
./tdesktop/Telegram/build/prepare/linux.sh
2016-09-12 11:45:41 +00:00
### Building the project
2016-09-12 11:45:41 +00:00
Go to ***BuildPath*/tdesktop** and run (using [your **api_id** and **api_hash**](#obtain-your-api-credentials))
docker run --rm -it \
-v $PWD:/usr/src/tdesktop \
tdesktop:centos_env \
/usr/src/tdesktop/Telegram/build/docker/centos_env/build.sh \
-D TDESKTOP_API_ID=YOUR_API_ID \
-D TDESKTOP_API_HASH=YOUR_API_HASH
Or, to create a debug build, run (also using [your **api_id** and **api_hash**](#obtain-your-api-credentials))
docker run --rm -it \
-v $PWD:/usr/src/tdesktop \
-e CONFIG=Debug \
tdesktop:centos_env \
/usr/src/tdesktop/Telegram/build/docker/centos_env/build.sh \
-D TDESKTOP_API_ID=YOUR_API_ID \
-D TDESKTOP_API_HASH=YOUR_API_HASH
If you need a backward compatible binary (running on older OS like the official one), you should build the binary with LTO.
To do this, add `-D CMAKE_INTERPROCEDURAL_OPTIMIZATION=ON` option.
The built files will be in the `out` directory.
2016-09-12 11:45:41 +00:00
[api_credentials]: api_credentials.md