From 07dffb948d0f357cc5f5e71719e63fed674b162f Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 2 Sep 2016 01:27:54 -0400 Subject: [PATCH] Closed beta 10002002: testin OS X build by GYP. --- Telegram/Resources/winrc/Telegram.rc | 8 ++++---- Telegram/Resources/winrc/Updater.rc | 8 ++++---- Telegram/SourceFiles/_other/packer.cpp | 12 ------------ Telegram/SourceFiles/_other/updater_osx.m | 8 ++++++++ Telegram/SourceFiles/codegen/style/structure_types.h | 3 ++- Telegram/SourceFiles/core/version.h | 2 +- Telegram/build/build.sh | 2 +- Telegram/build/deploy.sh | 2 +- Telegram/build/version | 2 +- Telegram/gyp/common_executable.gypi | 6 ++++++ Telegram/gyp/settings_win.gypi | 2 -- 11 files changed, 28 insertions(+), 27 deletions(-) diff --git a/Telegram/Resources/winrc/Telegram.rc b/Telegram/Resources/winrc/Telegram.rc index 8b635743b..ecbbcc24d 100644 --- a/Telegram/Resources/winrc/Telegram.rc +++ b/Telegram/Resources/winrc/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,10,2,1 - PRODUCTVERSION 0,10,2,1 + FILEVERSION 0,10,2,2 + PRODUCTVERSION 0,10,2,2 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.10.2.1" + VALUE "FileVersion", "0.10.2.2" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.10.2.1" + VALUE "ProductVersion", "0.10.2.2" END END BLOCK "VarFileInfo" diff --git a/Telegram/Resources/winrc/Updater.rc b/Telegram/Resources/winrc/Updater.rc index afb6ca25f..81d85e37f 100644 --- a/Telegram/Resources/winrc/Updater.rc +++ b/Telegram/Resources/winrc/Updater.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,10,2,1 - PRODUCTVERSION 0,10,2,1 + FILEVERSION 0,10,2,2 + PRODUCTVERSION 0,10,2,2 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -43,10 +43,10 @@ BEGIN BEGIN VALUE "CompanyName", "Telegram Messenger LLP" VALUE "FileDescription", "Telegram Updater" - VALUE "FileVersion", "0.10.2.1" + VALUE "FileVersion", "0.10.2.2" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.10.2.1" + VALUE "ProductVersion", "0.10.2.2" END END BLOCK "VarFileInfo" diff --git a/Telegram/SourceFiles/_other/packer.cpp b/Telegram/SourceFiles/_other/packer.cpp index 95acbaea3..78e51bd26 100644 --- a/Telegram/SourceFiles/_other/packer.cpp +++ b/Telegram/SourceFiles/_other/packer.cpp @@ -138,18 +138,6 @@ QString BetaSignature; int main(int argc, char *argv[]) { QString workDir; -#ifdef Q_OS_MAC - if (QDir(QString()).absolutePath() == "/") { - QString first = argc ? QString::fromLocal8Bit(argv[0]) : QString(); - if (!first.isEmpty()) { - QFileInfo info(first); - if (info.exists()) { - QDir result(info.absolutePath() + "/../../.."); - workDir = result.absolutePath() + '/'; - } - } - } -#endif QString remove; int version = 0; diff --git a/Telegram/SourceFiles/_other/updater_osx.m b/Telegram/SourceFiles/_other/updater_osx.m index ef13dfc06..2c532fdd5 100644 --- a/Telegram/SourceFiles/_other/updater_osx.m +++ b/Telegram/SourceFiles/_other/updater_osx.m @@ -160,6 +160,14 @@ int main(int argc, const char * argv[]) { writeLog([@"Starting update files iteration, path: " stringByAppendingString: srcEnum]); + NSString *contentsPath = [appDirFull stringByAppendingString: @"/Contents"]; + writeLog([[NSArray arrayWithObjects: @"Clearing dir ", contentsPath, nil] componentsJoinedByString:@""]); + if (![fileManager removeItemAtPath:contentsPath error:nil]) { + writeLog([@"Failed to clear path for directory " stringByAppendingString:contentsPath]); + delFolder(); + return -1; + } + NSArray *keys = [NSArray arrayWithObject:NSURLIsDirectoryKey]; NSDirectoryEnumerator *enumerator = [fileManager enumeratorAtURL:[NSURL fileURLWithPath:srcEnum] diff --git a/Telegram/SourceFiles/codegen/style/structure_types.h b/Telegram/SourceFiles/codegen/style/structure_types.h index 131706b33..848acb32a 100644 --- a/Telegram/SourceFiles/codegen/style/structure_types.h +++ b/Telegram/SourceFiles/codegen/style/structure_types.h @@ -24,6 +24,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include #include #include +#include namespace codegen { namespace style { @@ -78,7 +79,7 @@ inline int pxAdjust(int value, int scale) { if (value < 0) { return -pxAdjust(-value, scale); } - return static_cast(std::floor((value * scale / 4.) + 0.1)); + return qFloor((value * scale / 4.) + 0.1); } struct point { diff --git a/Telegram/SourceFiles/core/version.h b/Telegram/SourceFiles/core/version.h index 8ff546895..6927a792c 100644 --- a/Telegram/SourceFiles/core/version.h +++ b/Telegram/SourceFiles/core/version.h @@ -22,7 +22,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "core/basic_types.h" -#define BETA_VERSION_MACRO (10002001ULL) +#define BETA_VERSION_MACRO (10002002ULL) constexpr int AppVersion = 10002; constexpr str_const AppVersionStr = "0.10.2"; diff --git a/Telegram/build/build.sh b/Telegram/build/build.sh index bc3538f7d..f1ae6b432 100755 --- a/Telegram/build/build.sh +++ b/Telegram/build/build.sh @@ -301,7 +301,7 @@ if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ] || [ "$BuildTarg hdiutil convert tsetup.dmg -format UDZO -imagekey zlib-level=9 -ov -o "$SetupFile" fi cd "$ReleasePath" - "./Packer.app/Contents/MacOS/Packer" -path "$BinaryName.app" -version $VersionForPacker $AlphaBetaParam + "./Packer" -path "$BinaryName.app" -version $VersionForPacker $AlphaBetaParam echo "Packer done!" if [ "$BetaVersion" != "0" ]; then diff --git a/Telegram/build/deploy.sh b/Telegram/build/deploy.sh index 1e9195b3b..ed3ec3dae 100755 --- a/Telegram/build/deploy.sh +++ b/Telegram/build/deploy.sh @@ -83,7 +83,7 @@ elif [ "$BuildTarget" == "mac" ]; then fi UpdateFile="tmacupd$AppVersion" SetupFile="tsetup.$AppVersionStrFull.dmg" - ReleasePath="$HomePath/../Mac/Release" + ReleasePath="$HomePath/../out/Release" RemoteFolder="tmac" Mac32DeployPath="$HomePath/../../tother/tmac32/$AppVersionStrMajor/$AppVersionStrFull" Mac32UpdateFile="tmac32upd$AppVersion" diff --git a/Telegram/build/version b/Telegram/build/version index 329387da5..fde6760f2 100644 --- a/Telegram/build/version +++ b/Telegram/build/version @@ -3,4 +3,4 @@ AppVersionStrMajor 0.10 AppVersionStrSmall 0.10.2 AppVersionStr 0.10.2 AlphaChannel 0 -BetaVersion 10002001 +BetaVersion 10002002 diff --git a/Telegram/gyp/common_executable.gypi b/Telegram/gyp/common_executable.gypi index 36aa2a083..da6e2af17 100644 --- a/Telegram/gyp/common_executable.gypi +++ b/Telegram/gyp/common_executable.gypi @@ -25,4 +25,10 @@ 'includes': [ 'common.gypi', ], + 'msvs_settings': { + 'VCLinkerTool': { + 'SubSystem': '<(win_subsystem)', + 'ImportLibrary': '<(PRODUCT_DIR)/<(_target_name).lib', + }, + }, } diff --git a/Telegram/gyp/settings_win.gypi b/Telegram/gyp/settings_win.gypi index 19136e791..45faf0313 100644 --- a/Telegram/gyp/settings_win.gypi +++ b/Telegram/gyp/settings_win.gypi @@ -42,10 +42,8 @@ 'TreatWChar_tAsBuiltInType': 'false', }, 'VCLinkerTool': { - 'SubSystem': '<(win_subsystem)', 'MinimumRequiredVersion': '5.01', 'ImageHasSafeExceptionHandlers': 'false', # Disable /SAFESEH - 'ImportLibrary': '<(PRODUCT_DIR)/<(_target_name).lib', }, }, 'libraries': [