From db4f66cae72963c1da227b9b40b81b66ad821ecd Mon Sep 17 00:00:00 2001 From: fabriceedon Date: Sat, 5 Dec 2015 14:07:40 -0500 Subject: [PATCH 1/5] Fix some format, add warning on file hierarchy, fix typo and create list for readability.Signed-off-by: Fabrice Edon (github: Bl4ck4t) --- XCODE.md | 105 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 75 insertions(+), 30 deletions(-) diff --git a/XCODE.md b/XCODE.md index 9c78f70fd..a9121f3ba 100644 --- a/XCODE.md +++ b/XCODE.md @@ -2,35 +2,59 @@ ###Prepare folder -Choose a folder for the future build, for example **/Users/user/TBuild** There you will have two folders, **Libraries** for third-party libs and **tdesktop** (or **tdesktop-master**) for the app. +Choose a folder for the future build, for example **/Users/user/TBuild** + +There you will have two folders, **Libraries** for third-party libs and **tdesktop** (or **tdesktop-master**) for the app. + +**You will need this hierarchy to be able to follow this README !** ###Clone source code -By git – in Terminal go to **/Users/user/TBuild** and run +By git – in Terminal go to **/Users/user/TBuild** and run: git clone https://github.com/telegramdesktop/tdesktop.git -or download in ZIP and extract to **/Users/user/TBuild** rename **tdesktop-master** to **tdesktop** to have **/Users/user/TBuild/tdesktop/Telegram/Telegram.xcodeproj** project +or: +* download in ZIP and extract to **/Users/user/TBuild** +* rename **tdesktop-master** to **tdesktop**. + +The path to Telegram.xcodeproj should now be: **/Users/user/TBuild/tdesktop/Telegram/Telegram.xcodeproj** ###Prepare libraries -In your build Terminal run +In your build Terminal run: - MACOSX_DEPLOYMENT_TARGET=10.8 + MACOSX_DEPLOYMENT_TARGET=10.8 to set minimal supported OS version to 10.8 for future console builds. ####OpenSSL 1.0.1g -Get sources from https://github.com/telegramdesktop/openssl-xcode, by git – in Terminal go to **/Users/user/TBuild/Libraries** and run +#####Get openssl-xcode project file - git clone https://github.com/telegramdesktop/openssl-xcode.git +From https://github.com/telegramdesktop/openssl-xcode with git in Terminal: -or download in ZIP and extract to **/Users/user/TBuild/Libraries**, rename **openssl-xcode-master** to **openssl-xcode** to have **/Users/user/TBuild/Libraries/openssl-xcode/openssl.xcodeproj** project +* go to **/Users/user/TBuild/Libraries +* run: + + git clone https://github.com/telegramdesktop/openssl-xcode.git -http://www.openssl.org/source/ > Download [**openssl-1.0.1h.tar.gz**](http://www.openssl.org/source/openssl-1.0.1h.tar.gz) (4.3 Mb) +or: -Extract openssl-1.0.1h.tar.gz and copy everything from **openssl-1.0.1h** to **/Users/user/TBuild/Libraries/openssl-xcode** to have **/Users/user/TBuild/Libraries/openssl-xcode/include** +* download in ZIP and extract to **/Users/user/TBuild/Libraries**, +* rename **openssl-xcode-master** to **openssl-xcode** + +The path to openssl.xcodeproj should now be: **/Users/user/TBuild/Libraries/openssl-xcode/openssl.xcodeproj** + +#####Get the source code: + +Download [**openssl-1.0.1h.tar.gz**](http://www.openssl.org/source/openssl-1.0.1h.tar.gz) (4.3 Mb) + +* Extract openssl-1.0.1h.tar.gz +* Copy everything from **openssl-1.0.1h** to **/Users/user/TBuild/Libraries/openssl-xcode** + +The folder include of openssl should be: +**/Users/user/TBuild/Libraries/openssl-xcode/include** #####Building library @@ -38,14 +62,15 @@ Extract openssl-1.0.1h.tar.gz and copy everything from **openssl-1.0.1h** to **/ * Product > Build ####liblzma +#####Get the source code -http://tukaani.org/xz/ > Download [**xz-5.0.5.tar.gz**](http://tukaani.org/xz/xz-5.0.5.tar.gz) +Download [**xz-5.0.5.tar.gz**](http://tukaani.org/xz/xz-5.0.5.tar.gz) Extract to **/Users/user/TBuild/Libraries** #####Building library -In Terminal go to **/Users/user/TBuild/Libraries/xz-5.0.5** and there run +In Terminal go to **/Users/user/TBuild/Libraries/xz-5.0.5** and there run: ./configure make @@ -56,12 +81,23 @@ In Terminal go to **/Users/user/TBuild/Libraries/xz-5.0.5** and there run Using se system lib ####libexif 0.6.20 +#####Get the source code -Get sources from https://github.com/telegramdesktop/libexif-0.6.20, by git – in Terminal go to **/Users/user/TBuild/Libraries** and run +From https://github.com/telegramdesktop/libexif-0.6.20 with git in Terminal: - git clone https://github.com/telegramdesktop/libexif-0.6.20.git +* go to **/Users/user/TBuild/Libraries** +* run: -or download in ZIP and extract to **/Users/user/TBuild/Libraries**, rename **libexif-0.6.20-master** to **libexif-0.6.20** to have **/Users/user/TBuild/Libraries/libexif-0.6.20/configure** script + git clone https://github.com/telegramdesktop/libexif-0.6.20.git + +or: + +* download in ZIP +* extract to **/Users/user/TBuild/Libraries** +* rename **libexif-0.6.20-master** to **libexif-0.6.20** + +The folder configure should have this path: +**/Users/user/TBuild/Libraries/libexif-0.6.20/configure** #####Building library @@ -88,40 +124,46 @@ In Terminal go to **/Users/user/TBuild/Libraries/openal-soft/build** and there r sudo make install ####Opus codec +#####Get the source code -Download sources [opus-1.1.tar.gz](http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz) from http://www.opus-codec.org/downloads/, extract to **/Users/user/TBuild/Libraries** and rename to have **/Users/user/TBuild/Libraries/opus/configure** +* Download sources [opus-1.1.tar.gz](http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz) from http://www.opus-codec.org/downloads/ +* Extract them to **/Users/user/TBuild/Libraries** +* Rename opus-1.1 to opus to have **/Users/user/TBuild/Libraries/opus/configure** -#####Building libraries +#####Building library -Download [pkg-config 0.28](http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz) from http://pkg-config.freedesktop.org, extract it to **/Users/user/TBuild/Libraries** +* Download [pkg-config 0.28](http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz) from http://pkg-config.freedesktop.org +* Extract it to **/Users/user/TBuild/Libraries** -In Terminal go to **/Users/user/TBuild/Libraries/pkg-config-0.28** and run +In Terminal go to **/Users/user/TBuild/Libraries/pkg-config-0.28** and run: ./configure --with-internal-glib make sudo make install -then go to **/Users/user/TBuild/Libraries/opus** and there run +then go to **/Users/user/TBuild/Libraries/opus** and run: ./configure make sudo make install -####FFmpeg +####FFmpeg and Libiconv +#####Get the source code -Download sources [ffmpeg-2.6.3.tar.bz2](http://ffmpeg.org/releases/ffmpeg-2.6.3.tar.bz2) from https://www.ffmpeg.org/download.html, extract to **/Users/user/TBuild/Libraries** to have **/Users/user/TBuild/Libraries/ffmpeg-2.6.3** +* Download sources [ffmpeg-2.6.3.tar.bz2](http://ffmpeg.org/releases/ffmpeg-2.6.3.tar.bz2) from https://www.ffmpeg.org/download.html +* Extract to **/Users/user/TBuild/Libraries** to have **/Users/user/TBuild/Libraries/ffmpeg-2.6.3** -#####Building libraries +* Download [libiconv-1.14](http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz) from http://www.gnu.org/software/libiconv/#downloading +* Extract to **/Users/user/TBuild/Libraries** to have **/Users/user/TBuild/Libraries/ibiconv-1.14 ** -Download [libiconv-1.14](http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz) from http://www.gnu.org/software/libiconv/#downloading, extract it to **/Users/user/TBuild/Libraries** - -In Termianl go to **/Users/user/TBuild/Libraries/libiconv-1.14** and run +#####Building library +In Terminal go to **/Users/user/TBuild/Libraries/libiconv-1.14** and run: ./configure --enable-static make sudo make install -Then in Terminal go to **/Users/user/TBuild/Libraries/ffmpeg-2.6.3** and run +Then in Terminal go to **/Users/user/TBuild/Libraries/ffmpeg-2.6.3** and run: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" @@ -137,8 +179,9 @@ Then in Terminal go to **/Users/user/TBuild/Libraries/ffmpeg-2.6.3** and run sudo make install ####Qt 5.5.1, slightly patched +#####Get the source code -In Terminal go to **/Users/user/TBuild/Libraries** and run +In Terminal go to **/Users/user/TBuild/Libraries** and run: git clone git://code.qt.io/qt/qt5.git QtStatic cd QtStatic @@ -149,16 +192,18 @@ In Terminal go to **/Users/user/TBuild/Libraries** and run cd qtbase && git checkout v5.5.1 && cd .. #####Apply the patch +From **/Users/user/TBuild/Libraries/QtStatic/qtbase**, run: - cd qtbase && git apply ../../../tdesktop/Telegram/_qtbase_5_5_1_patch.diff && cd .. + git apply ../../../tdesktop/Telegram/_qtbase_5_5_1_patch.diff #####Building library +Go to **/Users/user/TBuild/Libraries/QtStatic** and run: ./configure -debug-and-release -opensource -confirm-license -static -opengl desktop -no-openssl -securetransport -nomake examples -nomake tests -platform macx-clang make -j4 sudo make -j4 install -building (**make** command) will take really long time. +Building (**make** command) will take a really long time. ###Building Telegram Desktop From 5aa31b6ad6b676e8a67f4eb2a8d0171a3f2ea8c7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 9 Dec 2015 00:16:14 +0300 Subject: [PATCH 2/5] added new files to Telegram.pro for Linux build --- Telegram/Telegram.pro | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Telegram/Telegram.pro b/Telegram/Telegram.pro index 8c851b7b2..48077b5c4 100644 --- a/Telegram/Telegram.pro +++ b/Telegram/Telegram.pro @@ -89,6 +89,7 @@ SOURCES += \ ./SourceFiles/autoupdater.cpp \ ./SourceFiles/dialogswidget.cpp \ ./SourceFiles/dropdown.cpp \ + ./SourceFiles/facades.cpp \ ./SourceFiles/fileuploader.cpp \ ./SourceFiles/history.cpp \ ./SourceFiles/historywidget.cpp \ @@ -112,6 +113,7 @@ SOURCES += \ ./SourceFiles/types.cpp \ ./SourceFiles/window.cpp \ ./SourceFiles/mtproto/mtp.cpp \ + ./SourceFiles/mtproto/mtpAuthKey.cpp \ ./SourceFiles/mtproto/mtpConnection.cpp \ ./SourceFiles/mtproto/mtpCoreTypes.cpp \ ./SourceFiles/mtproto/mtpDC.cpp \ @@ -175,6 +177,7 @@ HEADERS += \ ./SourceFiles/countries.h \ ./SourceFiles/dialogswidget.h \ ./SourceFiles/dropdown.h \ + ./SourceFiles/facades.h \ ./SourceFiles/fileuploader.h \ ./SourceFiles/history.h \ ./SourceFiles/historywidget.h \ From 2eaa0148d00d8de77da114bf634d132250231bf9 Mon Sep 17 00:00:00 2001 From: telegramdesktop Date: Wed, 9 Dec 2015 18:49:35 +0300 Subject: [PATCH 3/5] fixed some mistakes --- XCODE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XCODE.md b/XCODE.md index a9121f3ba..87c754728 100644 --- a/XCODE.md +++ b/XCODE.md @@ -78,7 +78,7 @@ In Terminal go to **/Users/user/TBuild/Libraries/xz-5.0.5** and there run: ####zlib 1.2.8 -Using se system lib +Using the system lib ####libexif 0.6.20 #####Get the source code @@ -154,7 +154,7 @@ then go to **/Users/user/TBuild/Libraries/opus** and run: * Extract to **/Users/user/TBuild/Libraries** to have **/Users/user/TBuild/Libraries/ffmpeg-2.6.3** * Download [libiconv-1.14](http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz) from http://www.gnu.org/software/libiconv/#downloading -* Extract to **/Users/user/TBuild/Libraries** to have **/Users/user/TBuild/Libraries/ibiconv-1.14 ** +* Extract to **/Users/user/TBuild/Libraries** to have **/Users/user/TBuild/Libraries/ibiconv-1.14** #####Building library In Terminal go to **/Users/user/TBuild/Libraries/libiconv-1.14** and run: From f8e006001bd7165371625ad946d0a1bd1a880b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20S=C3=A1nchez=20Mu=C3=B1oz?= Date: Wed, 9 Dec 2015 16:39:36 +0100 Subject: [PATCH 4/5] Build function countBetaVersionSignature() when autoupdater is disabled because it is needed by boxes/aboutbox.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Eduardo Sánchez Muñoz (github: eduardosm) --- Telegram/SourceFiles/autoupdater.cpp | 4 ++-- Telegram/SourceFiles/autoupdater.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/autoupdater.cpp b/Telegram/SourceFiles/autoupdater.cpp index d560cfbc6..e438ae83d 100644 --- a/Telegram/SourceFiles/autoupdater.cpp +++ b/Telegram/SourceFiles/autoupdater.cpp @@ -569,6 +569,8 @@ bool checkReadyUpdate() { return true; } +#endif + QString countBetaVersionSignature(uint64 version) { // duplicated in packer.cpp if (cBetaPrivateKey().isEmpty()) { LOG(("Error: Trying to count beta version signature without beta private key!")); @@ -612,5 +614,3 @@ QString countBetaVersionSignature(uint64 version) { // duplicated in packer.cpp signature = signature.replace('-', '8').replace('_', 'B'); return QString::fromUtf8(signature.mid(19, 32)); } - -#endif diff --git a/Telegram/SourceFiles/autoupdater.h b/Telegram/SourceFiles/autoupdater.h index 0bee6fae3..e2f2a9ac9 100644 --- a/Telegram/SourceFiles/autoupdater.h +++ b/Telegram/SourceFiles/autoupdater.h @@ -66,6 +66,6 @@ private: bool checkReadyUpdate(); -QString countBetaVersionSignature(uint64 version); - #endif + +QString countBetaVersionSignature(uint64 version); From d6893d09dce3eae0247a8d5db7739cd9eb70738b Mon Sep 17 00:00:00 2001 From: Ali Vakilzade Date: Wed, 9 Dec 2015 22:43:06 +0330 Subject: [PATCH 5/5] force telegram respect my workdir settings Signed-off-by: Ali Vakilzade (github: aliva) --- Telegram/SourceFiles/logs.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index e13de2b27..41529c94a 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -223,7 +223,9 @@ void logsInit() { #ifdef _DEBUG cForceWorkingDir(cExeDir()); #else - cForceWorkingDir(psAppDataPath()); + if(cWorkingDir().isEmpty()){ + cForceWorkingDir(psAppDataPath()); + } #endif #if (defined Q_OS_LINUX && !defined _DEBUG) // fix first version