ZaStoGram_desktop/Telegram/build/docker/build.sh
John Preston 001b9a88ae Ship the Linux widget helper in the tarball and updates
Task: 2026/11/14/ship-the-linux-widget-helper-in-the-tarball-and-its-updates
2026-11-19 23:17:09 +04:00

61 lines
1.4 KiB
Shell
Executable file

#!/bin/bash
set -e
FullExecPath=$PWD
pushd `dirname $0` > /dev/null
FullScriptPath=`pwd`
popd > /dev/null
if [ ! -d "$FullScriptPath/../../../../DesktopPrivate" ]; then
echo ""
echo "This script is for building the production version of Telegram Desktop."
echo ""
echo "For building custom versions please visit the build instructions page at:"
echo "https://github.com/telegramdesktop/tdesktop/#build-instructions"
exit
fi
HomePath="$FullScriptPath/../.."
cd $HomePath
ProjectPath="$HomePath/../out"
ReleasePath="$ProjectPath/Release"
BinaryName="Telegram"
if ! command -v cmake >/dev/null 2>&1; then
ln -s cmake3 /usr/bin/cmake
fi
./configure.sh -DDESKTOP_APP_ENABLE_LTO=ON
cd $ProjectPath
cmake --build . --config Release --target Telegram
cd $ReleasePath
echo "$BinaryName build complete!"
Error () {
cd $FullExecPath
echo "$1"
exit 1
}
if [ ! -f "$ReleasePath/$BinaryName" ]; then
Error "$BinaryName not found!"
fi
if [ ! -f "$ReleasePath/Updater" ]; then
Error "Updater not found!"
fi
if [ ! -f "$ReleasePath/TelegramHelpers/TelegramWidgetHelper" ]; then
Error "TelegramWidgetHelper not found!"
fi
rm -rf "$ReleasePath/root"
mkdir "$ReleasePath/root"
mv "$ReleasePath/$BinaryName" "$ReleasePath/root/"
mv "$ReleasePath/Updater" "$ReleasePath/root/"
mv "$ReleasePath/Packer" "$ReleasePath/root/"
mkdir "$ReleasePath/root/TelegramHelpers"
mv "$ReleasePath/TelegramHelpers/TelegramWidgetHelper" "$ReleasePath/root/TelegramHelpers/"