On macOS build autoupdates single-arch + universal setup.

This commit is contained in:
John Preston 2021-10-28 16:16:12 +04:00
parent b2d647b579
commit 766b393295
11 changed files with 196 additions and 127 deletions

View file

@ -5,7 +5,7 @@
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL # https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
add_executable(Telegram WIN32 MACOSX_BUNDLE) add_executable(Telegram WIN32 MACOSX_BUNDLE)
init_target(Telegram) init_non_host_target(Telegram)
add_subdirectory(lib_rpl) add_subdirectory(lib_rpl)
add_subdirectory(lib_crl) add_subdirectory(lib_crl)
@ -1280,10 +1280,15 @@ elseif (APPLE)
COMMAND cp ${CMAKE_BINARY_DIR}/lib_ui.rcc $<TARGET_FILE_DIR:Telegram>/../Resources COMMAND cp ${CMAKE_BINARY_DIR}/lib_ui.rcc $<TARGET_FILE_DIR:Telegram>/../Resources
) )
if (NOT DESKTOP_APP_DISABLE_CRASH_REPORTS) if (NOT DESKTOP_APP_DISABLE_CRASH_REPORTS)
if (DESKTOP_APP_MAC_ARCH STREQUAL "x86_64" OR DESKTOP_APP_MAC_ARCH STREQUAL "arm64")
set(crashpad_dir_part ".${DESKTOP_APP_MAC_ARCH}")
else()
set(crashpad_dir_part "")
endif()
add_custom_command(TARGET Telegram add_custom_command(TARGET Telegram
PRE_LINK PRE_LINK
COMMAND mkdir -p $<TARGET_FILE_DIR:Telegram>/../Helpers COMMAND mkdir -p $<TARGET_FILE_DIR:Telegram>/../Helpers
COMMAND cp ${libs_loc}/crashpad/out/$<IF:$<CONFIG:Debug>,Debug,Release>/crashpad_handler $<TARGET_FILE_DIR:Telegram>/../Helpers/ COMMAND cp ${libs_loc}/crashpad/out/$<IF:$<CONFIG:Debug>,Debug,Release>${crashpad_dir_part}/crashpad_handler $<TARGET_FILE_DIR:Telegram>/../Helpers/
) )
endif() endif()
endif() endif()
@ -1411,7 +1416,7 @@ endif()
if ((NOT DESKTOP_APP_DISABLE_AUTOUPDATE OR APPLE) AND NOT build_macstore AND NOT build_winstore) if ((NOT DESKTOP_APP_DISABLE_AUTOUPDATE OR APPLE) AND NOT build_macstore AND NOT build_winstore)
add_executable(Updater WIN32) add_executable(Updater WIN32)
init_target(Updater) init_non_host_target(Updater)
add_dependencies(Telegram Updater) add_dependencies(Telegram Updater)
@ -1423,7 +1428,9 @@ if ((NOT DESKTOP_APP_DISABLE_AUTOUPDATE OR APPLE) AND NOT build_macstore AND NOT
_other/updater.h _other/updater.h
) )
set_target_properties(Updater PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${output_folder}) set_target_properties(Updater PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${output_folder}
)
if (WIN32) if (WIN32)
get_filename_component(lib_base_loc lib_base REALPATH) get_filename_component(lib_base_loc lib_base REALPATH)

View file

@ -161,6 +161,7 @@ int main(int argc, char *argv[])
QString remove; QString remove;
int version = 0; int version = 0;
[[maybe_unused]] bool targetwin64 = false; [[maybe_unused]] bool targetwin64 = false;
[[maybe_unused]] bool targetarmac = false;
QFileInfoList files; QFileInfoList files;
for (int i = 0; i < argc; ++i) { for (int i = 0; i < argc; ++i) {
if (string("-path") == argv[i] && i + 1 < argc) { if (string("-path") == argv[i] && i + 1 < argc) {
@ -170,6 +171,12 @@ int main(int argc, char *argv[])
if (remove.isEmpty()) remove = info.canonicalPath() + "/"; if (remove.isEmpty()) remove = info.canonicalPath() + "/";
} else if (string("-target") == argv[i] && i + 1 < argc) { } else if (string("-target") == argv[i] && i + 1 < argc) {
targetwin64 = (string("win64") == argv[i + 1]); targetwin64 = (string("win64") == argv[i + 1]);
} else if (string("-arch") == argv[i] && i + 1 < argc) {
targetarmac = (string("arm64") == argv[i + 1]);
if (!targetarmac && string("x86_64") != argv[i + 1]) {
cout << "Bad -arch param value passed: " << argv[i + 1] << "\n";
return -1;
}
} else if (string("-version") == argv[i] && i + 1 < argc) { } else if (string("-version") == argv[i] && i + 1 < argc) {
version = QString(argv[i + 1]).toInt(); version = QString(argv[i + 1]).toInt();
} else if (string("-beta") == argv[i]) { } else if (string("-beta") == argv[i]) {
@ -494,7 +501,7 @@ int main(int argc, char *argv[])
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
QString outName((targetwin64 ? QString("tx64upd%1") : QString("tupdate%1")).arg(AlphaVersion ? AlphaVersion : version)); QString outName((targetwin64 ? QString("tx64upd%1") : QString("tupdate%1")).arg(AlphaVersion ? AlphaVersion : version));
#elif defined Q_OS_MAC #elif defined Q_OS_MAC
QString outName(QString("tmacupd%1").arg(AlphaVersion ? AlphaVersion : version)); QString outName((targetarmac ? QString("tarmacupd%1") : QString("tmacupd%1")).arg(AlphaVersion ? AlphaVersion : version));
#elif defined Q_OS_UNIX #elif defined Q_OS_UNIX
QString outName(QString("tlinuxupd%1").arg(AlphaVersion ? AlphaVersion : version)); QString outName(QString("tlinuxupd%1").arg(AlphaVersion ? AlphaVersion : version));
#else #else

View file

@ -244,6 +244,7 @@ QString FindUpdateFile() {
"tupdate|" "tupdate|"
"tx64upd|" "tx64upd|"
"tmacupd|" "tmacupd|"
"tarmacupd|"
"tlinuxupd|" "tlinuxupd|"
")\\d+(_[a-z\\d]+)?$", ")\\d+(_[a-z\\d]+)?$",
QRegularExpression::CaseInsensitiveOption QRegularExpression::CaseInsensitiveOption

View file

@ -4,6 +4,10 @@ pushd `dirname $0` > /dev/null
FullScriptPath=`pwd` FullScriptPath=`pwd`
popd > /dev/null popd > /dev/null
arg1="$1"
arg2="$2"
arg3="$3"
if [ ! -d "$FullScriptPath/../../../DesktopPrivate" ]; then if [ ! -d "$FullScriptPath/../../../DesktopPrivate" ]; then
echo "" echo ""
echo "This script is for building the production version of Telegram Desktop." echo "This script is for building the production version of Telegram Desktop."
@ -13,12 +17,6 @@ if [ ! -d "$FullScriptPath/../../../DesktopPrivate" ]; then
exit exit
fi fi
if [ "$1" == "request_uuid" ]; then
if [ "$2" != "" ]; then
NotarizeRequestId="$2"
fi
fi
Error () { Error () {
cd $FullExecPath cd $FullExecPath
echo "$1" echo "$1"
@ -61,12 +59,36 @@ if [ "$BuildTarget" == "linux" ]; then
ProjectPath="$HomePath/../out" ProjectPath="$HomePath/../out"
ReleasePath="$ProjectPath/Release" ReleasePath="$ProjectPath/Release"
BinaryName="Telegram" BinaryName="Telegram"
elif [ "$BuildTarget" == "mac" ]; then elif [ "$BuildTarget" == "mac" ] ; then
echo "Building version $AppVersionStrFull for macOS 10.12+.." if [ "$arg1" == "x86_64" ] || [ "$arg1" == "arm64" ]; then
echo "Building version $AppVersionStrFull for macOS 10.12+ ($arg1).."
MacArch="$arg1"
if [ "$arg2" == "request_uuid" ] && [ "$arg3" != "" ]; then
NotarizeRequestId="$arg3"
fi
else
echo "Building version $AppVersionStrFull for macOS 10.12+.."
if [ "$arg2" != "" ]; then
if [ "$arg1" == "request_uuid_x86_64" ]; then
NotarizeRequestIdAMD64="$arg2"
elif [ "$arg1" == "request_uuid_arm64" ]; then
NotarizeRequestIdARM64="$arg2"
elif [ "$arg1" == "request_uuid" ]; then
NotarizeRequestId="$arg2"
fi
fi
fi
if [ "$AC_USERNAME" == "" ]; then if [ "$AC_USERNAME" == "" ]; then
Error "AC_USERNAME not found!" Error "AC_USERNAME not found!"
fi fi
UpdateFile="tmacupd$AppVersion" UpdateFileAMD64="tmacupd$AppVersion"
UpdateFileARM64="tarmacupd$AppVersion"
if [ "$MacArch" == "arm64" ]; then
UpdateFile="$UpdateFileARM64"
elif [ "$MacArch" == "x86_64" ]; then
UpdateFile="$UpdateFileAMD64"
fi
SetupFile="tsetup.$AppVersionStrFull.dmg" SetupFile="tsetup.$AppVersionStrFull.dmg"
ProjectPath="$HomePath/../out" ProjectPath="$HomePath/../out"
ReleasePath="$ProjectPath/Release" ReleasePath="$ProjectPath/Release"
@ -77,6 +99,7 @@ elif [ "$BuildTarget" == "macstore" ]; then
fi fi
echo "Building version $AppVersionStrFull for Mac App Store.." echo "Building version $AppVersionStrFull for Mac App Store.."
MacArch="x86_64;arm64"
ProjectPath="$HomePath/../out" ProjectPath="$HomePath/../out"
ReleasePath="$ProjectPath/Release" ReleasePath="$ProjectPath/Release"
BinaryName="Telegram Lite" BinaryName="Telegram Lite"
@ -199,7 +222,20 @@ if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "macstore" ]; then
Error "Backup path not found!" Error "Backup path not found!"
fi fi
if [ "$NotarizeRequestId" == "" ]; then if [ "$MacArch" == "" ]; then
if [ "$NotarizeRequestIdAMD64" == "" ]; then
./$0 arm64 request_uuid $NotarizeRequestIdARM64
fi
./$0 x86_64 request_uuid $NotarizeRequestIdAMD64
cd $ReleasePath
echo "Preparing universal .app.."
lipo -create $BinaryName.arm64.app/Contents/MacOS/$BinaryName $BinaryName.x86_64.app/Contents/MacOS/Telegram -output $BinaryName.app/Contents/MacOS/$BinaryName
lipo -create $BinaryName.arm64.app/Contents/Frameworks/Updater $BinaryName.x86_64.app/Contents/Frameworks/Updater -output $BinaryName.app/Contents/Frameworks/Updater
lipo -create $BinaryName.arm64.app/Contents/Helpers/crashpad_handler $BinaryName.x86_64.app/Contents/Helpers/crashpad_handler -output $BinaryName.app/Contents/Helpers/crashpad_handler
echo "Done!"
elif [ "$NotarizeRequestId" == "" ]; then
if [ -f "$ReleasePath/$BinaryName.app/Contents/Info.plist" ]; then if [ -f "$ReleasePath/$BinaryName.app/Contents/Info.plist" ]; then
rm "$ReleasePath/$BinaryName.app/Contents/Info.plist" rm "$ReleasePath/$BinaryName.app/Contents/Info.plist"
fi fi
@ -208,7 +244,7 @@ if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "macstore" ]; then
fi fi
rm -rf "$ReleasePath/$BinaryName.app/Contents/_CodeSignature" rm -rf "$ReleasePath/$BinaryName.app/Contents/_CodeSignature"
./configure.sh -D CMAKE_OSX_ARCHITECTURES="x86_64;arm64" ./configure.sh -D DESKTOP_APP_QT6=ON -D DESKTOP_APP_MAC_ARCH="$MacArch"
cd $ProjectPath cd $ProjectPath
cmake --build . --config Release --target Telegram cmake --build . --config Release --target Telegram
@ -232,17 +268,42 @@ if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "macstore" ]; then
Error "Breakpad.framework not found!" Error "Breakpad.framework not found!"
fi fi
fi fi
fi
if [ "$NotarizeRequestId" == "" ]; then
if [ "$MacArch" == "x86_64" ] || [ "$MacArch" == "x86_64;arm64" ]; then
echo "Dumping debug symbols x86_64.."
"$HomePath/../../Libraries/breakpad/src/tools/mac/dump_syms/build/Release/dump_syms" "-a" "x86_64" "$ReleasePath/$BinaryName.app/Contents/MacOS/Telegram" > "$ReleasePath/$BinaryName.x86_64.sym" 2>/dev/null
echo "Done!"
echo "Dumping debug symbols x86_64.." SymbolsHashAMD64=`head -n 1 "$ReleasePath/$BinaryName.x86_64.sym" | awk -F " " 'END {print $4}'`
"$HomePath/../../Libraries/breakpad/src/tools/mac/dump_syms/build/Release/dump_syms" "-a" "x86_64" "$ReleasePath/$BinaryName.app/Contents/MacOS/Telegram" > "$ReleasePath/$BinaryName.x86_64.sym" 2>/dev/null echo "Copying $BinaryName.x86_64.sym to $DropboxSymbolsPath/$BinaryName/$SymbolsHashAMD64"
echo "Done!" mkdir -p "$DropboxSymbolsPath/$BinaryName/$SymbolsHashAMD64"
cp "$ReleasePath/$BinaryName.x86_64.sym" "$DropboxSymbolsPath/$BinaryName/$SymbolsHashAMD64/$BinaryName.sym"
echo "Done!"
fi
echo "Dumping debug symbols arm64.." if [ "$MacArch" == "arm64" ] || [ "$MacArch" == "x86_64;arm64" ]; then
"$HomePath/../../Libraries/breakpad/src/tools/mac/dump_syms/build/Release/dump_syms" "-a" "arm64" "$ReleasePath/$BinaryName.app/Contents/MacOS/Telegram" > "$ReleasePath/$BinaryName.arm64.sym" 2>/dev/null echo "Dumping debug symbols arm64.."
echo "Done!" "$HomePath/../../Libraries/breakpad/src/tools/mac/dump_syms/build/Release/dump_syms" "-a" "arm64" "$ReleasePath/$BinaryName.app/Contents/MacOS/Telegram" > "$ReleasePath/$BinaryName.arm64.sym" 2>/dev/null
echo "Done!"
SymbolsHashARM64=`head -n 1 "$ReleasePath/$BinaryName.arm64.sym" | awk -F " " 'END {print $4}'`
echo "Copying $BinaryName.arm64.sym to $DropboxSymbolsPath/$BinaryName/$SymbolsHashARM64"
mkdir -p "$DropboxSymbolsPath/$BinaryName/$SymbolsHashARM64"
cp "$ReleasePath/$BinaryName.arm64.sym" "$DropboxSymbolsPath/$BinaryName/$SymbolsHashARM64/$BinaryName.sym"
echo "Done!"
fi
if [ "$MacArch" == "" ]; then
cp -r "$ReleasePath/$BinaryName.app" "$ReleasePath/$BinaryName.Universal.Unstripped.app"
fi
echo "Stripping the executable.." echo "Stripping the executable.."
strip "$ReleasePath/$BinaryName.app/Contents/MacOS/$BinaryName" strip "$ReleasePath/$BinaryName.app/Contents/MacOS/$BinaryName"
if [ "$BuildTarget" == "mac" ]; then
strip "$ReleasePath/$BinaryName.app/Contents/Frameworks/Updater"
strip "$ReleasePath/$BinaryName.app/Contents/Helpers/crashpad_handler"
fi
echo "Done!" echo "Done!"
echo "Signing the application.." echo "Signing the application.."
@ -267,27 +328,11 @@ if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "macstore" ]; then
Error "$BinaryName signature not found!" Error "$BinaryName signature not found!"
fi fi
if [ "$BuildTarget" == "mac" ]; then if [ "$BuildTarget" == "macstore" ]; then
if [ ! -f "$ReleasePath/$BinaryName.app/Contents/Frameworks/Updater" ]; then
Error "Updater not found in Frameworks!"
fi
elif [ "$BuildTarget" == "macstore" ]; then
if [ ! -f "$ReleasePath/$BinaryName.pkg" ]; then if [ ! -f "$ReleasePath/$BinaryName.pkg" ]; then
Error "$BinaryName.pkg not found!" Error "$BinaryName.pkg not found!"
fi fi
fi fi
SymbolsHashAMD64=`head -n 1 "$ReleasePath/$BinaryName.x86_64.sym" | awk -F " " 'END {print $4}'`
echo "Copying $BinaryName.x86_64.sym to $DropboxSymbolsPath/$BinaryName/$SymbolsHashAMD64"
mkdir -p "$DropboxSymbolsPath/$BinaryName/$SymbolsHashAMD64"
cp "$ReleasePath/$BinaryName.x86_64.sym" "$DropboxSymbolsPath/$BinaryName/$SymbolsHashAMD64/$BinaryName.sym"
echo "Done!"
SymbolsHashARM64=`head -n 1 "$ReleasePath/$BinaryName.arm64.sym" | awk -F " " 'END {print $4}'`
echo "Copying $BinaryName.arm64.sym to $DropboxSymbolsPath/$BinaryName/$SymbolsHashARM64"
mkdir -p "$DropboxSymbolsPath/$BinaryName/$SymbolsHashARM64"
cp "$ReleasePath/$BinaryName.arm64.sym" "$DropboxSymbolsPath/$BinaryName/$SymbolsHashARM64/$BinaryName.sym"
echo "Done!"
fi fi
if [ "$BuildTarget" == "mac" ]; then if [ "$BuildTarget" == "mac" ]; then
@ -317,6 +362,8 @@ if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "macstore" ]; then
done < "$ReleasePath/$AlphaKeyFile" done < "$ReleasePath/$AlphaKeyFile"
UpdateFile="${UpdateFile}_${AlphaSignature}" UpdateFile="${UpdateFile}_${AlphaSignature}"
UpdateFileAMD64="${UpdateFileAMD64}_${AlphaSignature}"
UpdateFileARM64="${UpdateFileARM64}_${AlphaSignature}"
SetupFile="talpha${AlphaVersion}_${AlphaSignature}.zip" SetupFile="talpha${AlphaVersion}_${AlphaSignature}.zip"
if [ "$NotarizeRequestId" == "" ]; then if [ "$NotarizeRequestId" == "" ]; then
@ -330,86 +377,93 @@ if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "macstore" ]; then
cd "$ReleasePath" cd "$ReleasePath"
fi fi
fi fi
if [ "$BuildTarget" == "mac" ]; then if [ "$NotarizeRequestId" == "" ]; then
if [ "$NotarizeRequestId" == "" ]; then echo "Beginning notarization process."
echo "Beginning notarization process." set +e
set +e xcrun altool --notarize-app --primary-bundle-id "com.tdesktop.Telegram" --username "$AC_USERNAME" --password "@keychain:AC_PASSWORD" --file "$SetupFile" > request_uuid.txt
xcrun altool --notarize-app --primary-bundle-id "com.tdesktop.Telegram" --username "$AC_USERNAME" --password "@keychain:AC_PASSWORD" --file "$SetupFile" > request_uuid.txt set -e
set -e while IFS='' read -r line || [[ -n "$line" ]]; do
while IFS='' read -r line || [[ -n "$line" ]]; do Prefix=$(echo $line | cut -d' ' -f 1)
Prefix=$(echo $line | cut -d' ' -f 1) Value=$(echo $line | cut -d' ' -f 3)
Value=$(echo $line | cut -d' ' -f 3) if [ "$Prefix" == "RequestUUID" ]; then
if [ "$Prefix" == "RequestUUID" ]; then RequestUUID=$Value
RequestUUID=$Value
fi
done < "request_uuid.txt"
if [ "$RequestUUID" == "" ]; then
cat request_uuid.txt
Error "Could not extract Request UUID."
fi fi
echo "Request UUID: $RequestUUID" done < "request_uuid.txt"
rm request_uuid.txt if [ "$RequestUUID" == "" ]; then
else cat request_uuid.txt
RequestUUID=$NotarizeRequestId Error "Could not extract Request UUID."
echo "Continue notarization process with Request UUID: $RequestUUID"
fi
RequestStatus=
LogFile=
while [[ "$RequestStatus" == "" ]]; do
sleep 5
xcrun altool --notarization-info "$RequestUUID" --username "$AC_USERNAME" --password "@keychain:AC_PASSWORD" > request_result.txt
while IFS='' read -r line || [[ -n "$line" ]]; do
Prefix=$(echo $line | cut -d' ' -f 1)
Value=$(echo $line | cut -d' ' -f 2)
if [ "$Prefix" == "LogFileURL:" ]; then
LogFile=$Value
fi
if [ "$Prefix" == "Status:" ]; then
if [ "$Value" == "in" ]; then
echo "In progress..."
else
RequestStatus=$Value
echo "Status: $RequestStatus"
fi
fi
done < "request_result.txt"
done
if [ "$RequestStatus" != "success" ]; then
echo "Notarization problems, response:"
cat request_result.txt
if [ "$LogFile" != "" ]; then
echo "Requesting log: $LogFile"
curl $LogFile
fi
Error "Notarization FAILED."
fi
rm request_result.txt
if [ "$LogFile" != "" ]; then
echo "Requesting log: $LogFile"
curl $LogFile > request_log.txt
fi
xcrun stapler staple "$ReleasePath/$BinaryName.app"
if [ "$AlphaVersion" != "0" ]; then
rm -rf "$ReleasePath/AlphaTemp"
mkdir "$ReleasePath/AlphaTemp"
mkdir "$ReleasePath/AlphaTemp/$BinaryName"
cp -r "$ReleasePath/$BinaryName.app" "$ReleasePath/AlphaTemp/$BinaryName/"
cd "$ReleasePath/AlphaTemp"
zip -r "$SetupFile" "$BinaryName"
mv "$SetupFile" "$ReleasePath/"
cd "$ReleasePath"
echo "Alpha archive re-created."
else
xcrun stapler staple "$ReleasePath/$SetupFile"
fi fi
echo "Request UUID: $RequestUUID"
rm request_uuid.txt
else
RequestUUID=$NotarizeRequestId
echo "Continue notarization process with Request UUID: $RequestUUID"
fi fi
"./Packer" -path "$BinaryName.app" -target "$BuildTarget" -version $VersionForPacker $AlphaBetaParam RequestStatus=
echo "Packer done!" LogFile=
while [[ "$RequestStatus" == "" ]]; do
sleep 5
xcrun altool --notarization-info "$RequestUUID" --username "$AC_USERNAME" --password "@keychain:AC_PASSWORD" > request_result.txt
while IFS='' read -r line || [[ -n "$line" ]]; do
Prefix=$(echo $line | cut -d' ' -f 1)
Value=$(echo $line | cut -d' ' -f 2)
if [ "$Prefix" == "LogFileURL:" ]; then
LogFile=$Value
fi
if [ "$Prefix" == "Status:" ]; then
if [ "$Value" == "in" ]; then
echo "In progress..."
else
RequestStatus=$Value
echo "Status: $RequestStatus"
fi
fi
done < "request_result.txt"
done
if [ "$RequestStatus" != "success" ]; then
echo "Notarization problems, response:"
cat request_result.txt
if [ "$LogFile" != "" ]; then
echo "Requesting log: $LogFile"
curl $LogFile
fi
Error "Notarization FAILED."
fi
rm request_result.txt
if [ "$LogFile" != "" ]; then
echo "Requesting log: $LogFile"
curl $LogFile > request_log.txt
fi
xcrun stapler staple "$ReleasePath/$BinaryName.app"
if [ "$MacArch" != "" ]; then
rm -rf "$ReleasePath/$BinaryName.$MacArch.app"
cp -r "$ReleasePath/$BinaryName.app" "$ReleasePath/$BinaryName.$MacArch.app"
echo "Single-arch binary saved to $BinaryName.$MacArch.app."
rm $SetupFile
echo "Setup file $SetupFile removed."
elif [ "$AlphaVersion" != "0" ]; then
rm -rf "$ReleasePath/AlphaTemp"
mkdir "$ReleasePath/AlphaTemp"
mkdir "$ReleasePath/AlphaTemp/$BinaryName"
cp -r "$ReleasePath/$BinaryName.app" "$ReleasePath/AlphaTemp/$BinaryName/"
cd "$ReleasePath/AlphaTemp"
zip -r "$SetupFile" "$BinaryName"
mv "$SetupFile" "$ReleasePath/"
cd "$ReleasePath"
echo "Alpha archive re-created."
else
xcrun stapler staple "$ReleasePath/$SetupFile"
fi
if [ "$MacArch" != "" ]; then
"./Packer" -path "$BinaryName.app" -target "$BuildTarget" -version $VersionForPacker -arch $MacArch $AlphaBetaParam
echo "Packer done!"
exit
fi
fi fi
if [ ! -d "$ReleasePath/deploy" ]; then if [ ! -d "$ReleasePath/deploy" ]; then
@ -421,22 +475,23 @@ if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "macstore" ]; then
fi fi
if [ "$BuildTarget" == "mac" ]; then if [ "$BuildTarget" == "mac" ]; then
echo "Copying $BinaryName.app and $UpdateFile to deploy/$AppVersionStrMajor/$AppVersionStr.."; echo "Copying $BinaryName.app, $UpdateFileAMD64 and $UpdateFileARM64 to deploy/$AppVersionStrMajor/$AppVersionStr..";
mkdir "$DeployPath" mkdir "$DeployPath"
mkdir "$DeployPath/$BinaryName" mkdir "$DeployPath/$BinaryName"
cp -r "$ReleasePath/$BinaryName.app" "$DeployPath/$BinaryName/" cp -r "$ReleasePath/$BinaryName.app" "$DeployPath/$BinaryName/"
if [ "$AlphaVersion" != "0" ]; then if [ "$AlphaVersion" != "0" ]; then
mv "$ReleasePath/$AlphaKeyFile" "$DeployPath/" mv "$ReleasePath/$AlphaKeyFile" "$DeployPath/"
fi fi
mv "$ReleasePath/$BinaryName.app.dSYM" "$DeployPath/"
rm "$ReleasePath/$BinaryName.app/Contents/MacOS/$BinaryName" rm "$ReleasePath/$BinaryName.app/Contents/MacOS/$BinaryName"
rm "$ReleasePath/$BinaryName.app/Contents/Frameworks/Updater" rm "$ReleasePath/$BinaryName.app/Contents/Frameworks/Updater"
mv "$ReleasePath/$UpdateFile" "$DeployPath/" mv "$ReleasePath/$UpdateFileAMD64" "$DeployPath/"
mv "$ReleasePath/$UpdateFileARM64" "$DeployPath/"
mv "$ReleasePath/$SetupFile" "$DeployPath/" mv "$ReleasePath/$SetupFile" "$DeployPath/"
if [ "$BuildTarget" == "mac" ]; then if [ "$BuildTarget" == "mac" ]; then
mkdir -p "$BackupPath/tmac" mkdir -p "$BackupPath/tmac"
cp "$DeployPath/$UpdateFile" "$BackupPath/tmac/" cp "$DeployPath/$UpdateFileAMD64" "$BackupPath/tmac/"
cp "$DeployPath/$UpdateFileARM64" "$BackupPath/tmac/"
cp "$DeployPath/$SetupFile" "$BackupPath/tmac/" cp "$DeployPath/$SetupFile" "$BackupPath/tmac/"
if [ "$AlphaVersion" != "0" ]; then if [ "$AlphaVersion" != "0" ]; then
cp -v "$DeployPath/$AlphaKeyFile" "$BackupPath/tmac/" cp -v "$DeployPath/$AlphaKeyFile" "$BackupPath/tmac/"
@ -447,7 +502,6 @@ if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "macstore" ]; then
mkdir "$DeployPath" mkdir "$DeployPath"
cp -r "$ReleasePath/$BinaryName.app" "$DeployPath/" cp -r "$ReleasePath/$BinaryName.app" "$DeployPath/"
mv "$ReleasePath/$BinaryName.pkg" "$DeployPath/" mv "$ReleasePath/$BinaryName.pkg" "$DeployPath/"
mv "$ReleasePath/$BinaryName.app.dSYM" "$DeployPath/"
rm "$ReleasePath/$BinaryName.app/Contents/MacOS/$BinaryName" rm "$ReleasePath/$BinaryName.app/Contents/MacOS/$BinaryName"
fi fi
fi fi

View file

@ -5,7 +5,7 @@
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL # https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
add_library(td_export OBJECT) add_library(td_export OBJECT)
init_target(td_export) init_non_host_target(td_export)
add_library(tdesktop::td_export ALIAS td_export) add_library(tdesktop::td_export ALIAS td_export)
target_precompile_headers(td_export PRIVATE ${src_loc}/export/export_pch.h) target_precompile_headers(td_export PRIVATE ${src_loc}/export/export_pch.h)

View file

@ -5,7 +5,7 @@
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL # https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
add_library(td_lang OBJECT) add_library(td_lang OBJECT)
init_target(td_lang) init_non_host_target(td_lang)
add_library(tdesktop::td_lang ALIAS td_lang) add_library(tdesktop::td_lang ALIAS td_lang)
include(cmake/generate_lang.cmake) include(cmake/generate_lang.cmake)

View file

@ -5,7 +5,7 @@
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL # https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
add_library(td_mtproto OBJECT) add_library(td_mtproto OBJECT)
init_target(td_mtproto) init_non_host_target(td_mtproto)
add_library(tdesktop::td_mtproto ALIAS td_mtproto) add_library(tdesktop::td_mtproto ALIAS td_mtproto)
target_precompile_headers(td_mtproto PRIVATE ${src_loc}/mtproto/mtproto_pch.h) target_precompile_headers(td_mtproto PRIVATE ${src_loc}/mtproto/mtproto_pch.h)

View file

@ -5,7 +5,7 @@
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL # https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
add_library(td_scheme OBJECT) add_library(td_scheme OBJECT)
init_target(td_scheme) init_non_host_target(td_scheme)
add_library(tdesktop::td_scheme ALIAS td_scheme) add_library(tdesktop::td_scheme ALIAS td_scheme)
include(cmake/generate_scheme.cmake) include(cmake/generate_scheme.cmake)

View file

@ -5,7 +5,7 @@
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL # https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
add_library(td_ui OBJECT) add_library(td_ui OBJECT)
init_target(td_ui) init_non_host_target(td_ui)
add_library(tdesktop::td_ui ALIAS td_ui) add_library(tdesktop::td_ui ALIAS td_ui)
include(lib_ui/cmake/generate_styles.cmake) include(lib_ui/cmake/generate_styles.cmake)

@ -1 +1 @@
Subproject commit 60ec2972a808225458946d044900559556218ca6 Subproject commit 9c466e46be8d8b7063a45d183d98cbc6c7bb02fe

2
cmake

@ -1 +1 @@
Subproject commit 68251bb2f0c132c4f16f5df4a0431452d0222b72 Subproject commit 410223b538e2d49d0b911648694ac878fd0596f9