2020-11-04 06:57:03 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-11-04 15:50:17 +00:00
|
|
|
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/../.."
|
2020-11-04 06:57:03 +00:00
|
|
|
cd $HomePath
|
|
|
|
|
|
|
|
ProjectPath="$HomePath/../out"
|
|
|
|
ReleasePath="$ProjectPath/Release"
|
|
|
|
BinaryName="Telegram"
|
|
|
|
|
|
|
|
if [ ! -f "/usr/bin/cmake" ]; then
|
|
|
|
ln -s cmake3 /usr/bin/cmake
|
|
|
|
fi
|
|
|
|
|
2022-11-23 17:10:44 +00:00
|
|
|
./configure.sh
|
2020-11-04 06:57:03 +00:00
|
|
|
|
|
|
|
cd $ProjectPath
|
2022-11-23 17:10:44 +00:00
|
|
|
cmake --build . --config Release --target Telegram
|
2020-11-04 06:57:03 +00:00
|
|
|
cd $ReleasePath
|
|
|
|
|
|
|
|
echo "$BinaryName build complete!"
|
|
|
|
|
|
|
|
if [ ! -f "$ReleasePath/$BinaryName" ]; then
|
|
|
|
Error "$BinaryName not found!"
|
|
|
|
fi
|
|
|
|
|
2021-07-06 17:32:08 +00:00
|
|
|
BadCount=`objdump -T $ReleasePath/$BinaryName | grep GLIBC_2\.1[8-9] | wc -l`
|
|
|
|
if [ "$BadCount" != "0" ]; then
|
|
|
|
Error "Bad GLIBC usages found: $BadCount"
|
|
|
|
fi
|
2020-11-04 06:57:03 +00:00
|
|
|
|
2021-07-06 17:32:08 +00:00
|
|
|
BadCount=`objdump -T $ReleasePath/$BinaryName | grep GLIBC_2\.2[0-9] | wc -l`
|
|
|
|
if [ "$BadCount" != "0" ]; then
|
|
|
|
Error "Bad GLIBC usages found: $BadCount"
|
|
|
|
fi
|
2020-11-04 06:57:03 +00:00
|
|
|
|
|
|
|
BadCount=`objdump -T $ReleasePath/$BinaryName | grep GCC_4\.[3-9] | wc -l`
|
|
|
|
if [ "$BadCount" != "0" ]; then
|
2021-07-06 17:32:08 +00:00
|
|
|
Error "Bad GCC usages found: $BadCount"
|
2020-11-04 06:57:03 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
BadCount=`objdump -T $ReleasePath/$BinaryName | grep GCC_[5-9]\. | wc -l`
|
|
|
|
if [ "$BadCount" != "0" ]; then
|
2021-07-06 17:32:08 +00:00
|
|
|
Error "Bad GCC usages found: $BadCount"
|
2020-11-04 06:57:03 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f "$ReleasePath/Updater" ]; then
|
2021-07-06 17:32:08 +00:00
|
|
|
Error "Updater not found!"
|
2020-11-04 06:57:03 +00:00
|
|
|
fi
|
|
|
|
|
2021-07-06 17:32:08 +00:00
|
|
|
BadCount=`objdump -T $ReleasePath/Updater | grep GLIBC_2\.1[8-9] | wc -l`
|
2020-11-04 06:57:03 +00:00
|
|
|
if [ "$BadCount" != "0" ]; then
|
2021-07-06 17:32:08 +00:00
|
|
|
Error "Bad GLIBC usages found: $BadCount"
|
2020-11-04 06:57:03 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
BadCount=`objdump -T $ReleasePath/Updater | grep GLIBC_2\.2[0-9] | wc -l`
|
|
|
|
if [ "$BadCount" != "0" ]; then
|
2021-07-06 17:32:08 +00:00
|
|
|
Error "Bad GLIBC usages found: $BadCount"
|
2020-11-04 06:57:03 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
BadCount=`objdump -T $ReleasePath/Updater | grep GCC_4\.[3-9] | wc -l`
|
|
|
|
if [ "$BadCount" != "0" ]; then
|
2021-07-06 17:32:08 +00:00
|
|
|
Error "Bad GCC usages found: $BadCount"
|
2020-11-04 06:57:03 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
BadCount=`objdump -T $ReleasePath/Updater | grep GCC_[5-9]\. | wc -l`
|
|
|
|
if [ "$BadCount" != "0" ]; then
|
2021-07-06 17:32:08 +00:00
|
|
|
Error "Bad GCC usages found: $BadCount"
|
2020-11-04 06:57:03 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
rm -rf "$ReleasePath/root"
|
|
|
|
mkdir "$ReleasePath/root"
|
|
|
|
mv "$ReleasePath/$BinaryName" "$ReleasePath/root/"
|
|
|
|
mv "$ReleasePath/Updater" "$ReleasePath/root/"
|
|
|
|
mv "$ReleasePath/Packer" "$ReleasePath/root/"
|