AyuGramDesktop/docs/building-linux.md
ZavaruKitsu 43b0df3f94 Merge tag 'v4.15.0' into dev
# Conflicts:
#	Telegram/Resources/winrc/Telegram.rc
#	Telegram/Resources/winrc/Updater.rc
#	Telegram/SourceFiles/core/version.h
#	Telegram/SourceFiles/dialogs/dialogs_row.cpp
#	Telegram/SourceFiles/dialogs/dialogs_widget.cpp
#	Telegram/SourceFiles/history/view/history_view_message.cpp
#	Telegram/SourceFiles/info/profile/info_profile_actions.cpp
#	Telegram/lib_ui
#	snap/snapcraft.yaml
2024-02-18 21:37:55 +03:00

44 lines
1.7 KiB
Markdown

## Build instructions for Linux using Docker
### 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.
### Clone source code and prepare libraries
Install [poetry](https://python-poetry.org), go to ***BuildPath*** and run
git clone --recursive https://github.com/AyuGram/AyuGramDesktop.git tdesktop
./tdesktop/Telegram/build/prepare/linux.sh
### Building the project
Go to ***BuildPath*/tdesktop** and run
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=2040 \
-D TDESKTOP_API_HASH=b18441a1ff607e10a989891a5462e627 \
-D CMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
Or, to create a debug build, run
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=2040 \
-D TDESKTOP_API_HASH=b18441a1ff607e10a989891a5462e627 \
-D CMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
**P. S. If docker image build takes too long, cherry-pick [this](https://github.com/TDesktop-x64/tdesktop/commit/b99c084862053f441caa6525837a7e193cc671f7) commit.**
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.
You can use `strip` command to reduce binary size.