From 957e8a06f282d4f1a52f07f429fe00b9d20c60af Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 20 Oct 2015 00:16:25 +0200 Subject: [PATCH 1/3] added renamed Build.bat script and _openssl_patch to git --- Telegram/Build.bat | 123 +++++++++++++++++++++++++++++++++++ Telegram/_openssl_patch.diff | 13 ++++ 2 files changed, 136 insertions(+) create mode 100644 Telegram/Build.bat create mode 100644 Telegram/_openssl_patch.diff diff --git a/Telegram/Build.bat b/Telegram/Build.bat new file mode 100644 index 0000000000..e0a9d9ac3b --- /dev/null +++ b/Telegram/Build.bat @@ -0,0 +1,123 @@ +@echo OFF +FOR /F "tokens=1,2* delims= " %%i in (Version) do set "%%i=%%j" + +if %DevChannel% neq 0 goto preparedev + +set "DevParam=" +set "AppVersionStrFull=%AppVersionStr%" +goto devprepared + +:preparedev + +set "DevParam=-dev" +set "AppVersionStrFull=%AppVersionStr%.dev" + +:devprepared + +echo. +echo Building version %AppVersionStrFull% for Windows.. +echo. + +if exist ..\Win32\Deploy\deploy\%AppVersionStrMajor%\%AppVersionStr%\ goto error_exist1 +if exist ..\Win32\Deploy\deploy\%AppVersionStrMajor%\%AppVersionStr%.dev\ goto error_exist2 +if exist ..\Win32\Deploy\tupdate%AppVersion% goto error_exist3 + +cd SourceFiles\ +copy telegram.qrc /B+,,/Y +cd ..\ +if %errorlevel% neq 0 goto error + +cd ..\ +MSBuild Telegram.sln /property:Configuration=Deploy +if %errorlevel% neq 0 goto error0 + +echo . +echo Version %AppVersionStrFull% build successfull! Preparing.. +echo . + +set "PATH=%PATH%;C:\Program Files\7-Zip;C:\Program Files (x86)\Inno Setup 5" +cd Win32\Deploy\ + +call ..\..\..\TelegramPrivate\Sign.bat Telegram.exe +if %errorlevel% neq 0 goto error1 + +call ..\..\..\TelegramPrivate\Sign.bat Updater.exe +if %errorlevel% neq 0 goto error1 + +iscc /dMyAppVersion=%AppVersionStrSmall% /dMyAppVersionZero=%AppVersionStr% /dMyAppVersionFull=%AppVersionStrFull% ..\..\Telegram\Setup.iss +if %errorlevel% neq 0 goto error1 + +call ..\..\..\TelegramPrivate\Sign.bat tsetup.%AppVersionStrFull%.exe +if %errorlevel% neq 0 goto error1 + +call Packer.exe -version %AppVersion% -path Telegram.exe -path Updater.exe %DevParam% +if %errorlevel% neq 0 goto error1 + +if not exist deploy mkdir deploy +if not exist deploy\%AppVersionStrMajor% mkdir deploy\%AppVersionStrMajor% +mkdir deploy\%AppVersionStrMajor%\%AppVersionStrFull% +mkdir deploy\%AppVersionStrMajor%\%AppVersionStrFull%\Telegram +if %errorlevel% neq 0 goto error1 + +move Telegram.exe deploy\%AppVersionStrMajor%\%AppVersionStrFull%\Telegram\ +move Updater.exe deploy\%AppVersionStrMajor%\%AppVersionStrFull%\ +move Telegram.pdb deploy\%AppVersionStrMajor%\%AppVersionStrFull%\ +move Updater.pdb deploy\%AppVersionStrMajor%\%AppVersionStrFull%\ +move tsetup.%AppVersionStrFull%.exe deploy\%AppVersionStrMajor%\%AppVersionStrFull%\ +move tupdate%AppVersion% deploy\%AppVersionStrMajor%\%AppVersionStrFull%\ +if %errorlevel% neq 0 goto error1 + +cd deploy\%AppVersionStrMajor%\%AppVersionStrFull%\ +7z a -mx9 tportable.%AppVersionStrFull%.zip Telegram\ +if %errorlevel% neq 0 goto error2 + +echo . +echo Version %AppVersionStrFull% is ready for deploy! +echo . + +if not exist tupdate%AppVersion% goto error2 +if not exist tportable.%AppVersionStrFull%.zip goto error2 +if not exist tsetup.%AppVersionStrFull%.exe goto error2 +if not exist Telegram.pdb goto error2 +if not exist Updater.exe goto error2 +if not exist Updater.pdb goto error2 +if not exist Z:\TBuild\tother\tsetup\%AppVersionStrMajor% mkdir Z:\TBuild\tother\tsetup\%AppVersionStrMajor% +if not exist Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull% mkdir Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull% + +xcopy tupdate%AppVersion% Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull%\ +xcopy tportable.%AppVersionStrFull%.zip Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull%\ +xcopy tsetup.%AppVersionStrFull%.exe Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull%\ +xcopy Telegram.pdb Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull%\ +xcopy Updater.exe Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull%\ +xcopy Updater.pdb Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull%\ + +echo Version %AppVersionStrFull% is ready! + +cd ..\..\..\..\..\Telegram\ +goto eof + +:error2 +cd ..\..\..\ +:error1 +cd ..\..\ +:error0 +cd Telegram\ +goto error + +:error_exist1 +echo Deploy folder for version %AppVersionStr% already exists! +exit /b 1 + +:error_exist2 +echo Deploy folder for version %AppVersionStr%.dev already exists! +exit /b 1 + +:error_exist3 +echo Update file for version %AppVersion% already exists! +exit /b 1 + +:error +echo ERROR occured! +exit /b %errorlevel% + +:eof diff --git a/Telegram/_openssl_patch.diff b/Telegram/_openssl_patch.diff new file mode 100644 index 0000000000..51df18a67d --- /dev/null +++ b/Telegram/_openssl_patch.diff @@ -0,0 +1,13 @@ +diff --git a/e_os.h b/e_os.h +index 7584485..0b37c94 100644 +--- a/e_os.h ++++ b/e_os.h +@@ -315,7 +315,7 @@ static __inline unsigned int _strlen31(const char *str) + # undef isxdigit + # endif + # if defined(_MSC_VER) && !defined(_DLL) && defined(stdin) +-# if _MSC_VER>=1300 ++# if (_MSC_VER>=1300) && (_MSC_VER<=1800) + # undef stdin + # undef stdout + # undef stderr From 2b36f4d23a3efc1fc98545f8d7daaed55903e7f5 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 20 Oct 2015 00:41:37 +0200 Subject: [PATCH 2/3] added one letter to diacritics filter --- Telegram/SourceFiles/gui/text.h | 2 +- Telegram/Telegram.vcxproj | 3 ++ Telegram/Telegram.vcxproj.filters | 59 ++++++++++++++++++++++++------- 3 files changed, 50 insertions(+), 14 deletions(-) diff --git a/Telegram/SourceFiles/gui/text.h b/Telegram/SourceFiles/gui/text.h index ef0b81d823..8c78bcb905 100644 --- a/Telegram/SourceFiles/gui/text.h +++ b/Telegram/SourceFiles/gui/text.h @@ -676,7 +676,7 @@ inline bool chIsTrimmed(QChar ch, bool rich = false) { } inline bool chIsDiac(QChar ch) { // diac and variation selectors QChar::Category c = ch.category(); - return (c == QChar::Mark_NonSpacing); + return (c == QChar::Mark_NonSpacing) || (ch.unicode() == 1652); } inline int32 chMaxDiacAfterSymbol() { return 2; diff --git a/Telegram/Telegram.vcxproj b/Telegram/Telegram.vcxproj index cc22e26c2d..2f5fd505dd 100644 --- a/Telegram/Telegram.vcxproj +++ b/Telegram/Telegram.vcxproj @@ -2119,6 +2119,9 @@ true true + + + diff --git a/Telegram/Telegram.vcxproj.filters b/Telegram/Telegram.vcxproj.filters index 47eb598686..ef06d3cd25 100644 --- a/Telegram/Telegram.vcxproj.filters +++ b/Telegram/Telegram.vcxproj.filters @@ -40,6 +40,12 @@ {67311646-a8af-4626-976d-0a5733bf90e8} + + {df139398-6d5d-4bd5-8abe-b509b102f5d8} + + + {9d7bbb7d-817b-4f19-a719-74e674bdc84b} + @@ -1006,8 +1012,6 @@ gui - - gui @@ -1143,10 +1147,6 @@ Source Files - - - - boxes @@ -1189,13 +1189,27 @@ Source Files - - - - - - - + + Resources + + + Resources + + + Resources + + + Resources + + + Resources + + + Resources + + + Resources + @@ -1219,5 +1233,24 @@ Source Files + + Version + + + Version + + + Version + + + + + Resources + + + + + Version + \ No newline at end of file From ee5f393009c2569e70c78a7b7ea73ec8dd934199 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 20 Oct 2015 11:27:41 +0200 Subject: [PATCH 3/3] libpng used from Qt bundle --- Telegram/FixMake.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/Telegram/FixMake.sh b/Telegram/FixMake.sh index da1e041c05..77a933e1a1 100755 --- a/Telegram/FixMake.sh +++ b/Telegram/FixMake.sh @@ -21,7 +21,6 @@ Replace '\-lSM' '\/usr\/lib\/x86_64\-linux\-gnu\/libSM\.a' Replace '\-lICE' '\/usr\/lib\/x86_64\-linux\-gnu\/libICE\.a' Replace '\-lfontconfig' '\/usr\/lib\/x86_64\-linux\-gnu\/libfontconfig\.a \/usr\/lib\/x86_64\-linux\-gnu\/libexpat\.a' Replace '\-lfreetype' '\/usr\/lib\/x86_64\-linux\-gnu\/libfreetype\.a' -Replace '\-lpng' '\/usr\/lib\/x86_64\-linux\-gnu\/libpng\.a' Replace '\-lXext' '\/usr\/lib\/x86_64\-linux\-gnu\/libXext\.a' Replace '\-lopus' '\/usr\/local\/lib\/libopus\.a' Replace '\-lopenal' '\/usr\/local\/lib\/libopenal\.a'