From 27f015561a3c123ee48bbdd795c319b16968acc2 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 17 Feb 2017 12:48:31 +0300 Subject: [PATCH] Using custom build of libc++ for old OS X version. This will allow us to use C++14 library on all platforms. Patches for macold versions got bigger and are now different for crashpad and mini_chromium, so they were moved to a separate folder. --- Telegram/Patches/macold/crashpad.diff | 20 +++ Telegram/Patches/macold/mini_chromium.diff | 26 ++++ .../Patches/{ => macold}/qtbase_5_3_2.diff | 22 ++- .../{ => macold}/qtimageformats_5_3_2.diff | 0 Telegram/gyp/qt.gypi | 8 +- Telegram/gyp/telegram_mac.gypi | 36 +++-- doc/building-xcode-old.md | 133 +++++++++++++----- doc/building-xcode.md | 14 +- 8 files changed, 197 insertions(+), 62 deletions(-) create mode 100644 Telegram/Patches/macold/crashpad.diff create mode 100644 Telegram/Patches/macold/mini_chromium.diff rename Telegram/Patches/{ => macold}/qtbase_5_3_2.diff (97%) rename Telegram/Patches/{ => macold}/qtimageformats_5_3_2.diff (100%) diff --git a/Telegram/Patches/macold/crashpad.diff b/Telegram/Patches/macold/crashpad.diff new file mode 100644 index 000000000..7aa23102b --- /dev/null +++ b/Telegram/Patches/macold/crashpad.diff @@ -0,0 +1,20 @@ +diff --git a/build/crashpad.gypi b/build/crashpad.gypi +index 027c7b6..4bfdfb5 100644 +--- a/build/crashpad.gypi ++++ b/build/crashpad.gypi +@@ -25,5 +25,15 @@ + 4201, # nonstandard extension used : nameless struct/union. + 4324, # structure was padded due to __declspec(align()). + ], ++ 'xcode_settings': { ++ 'OTHER_CPLUSPLUSFLAGS': [ '-nostdinc++' ], ++ 'OTHER_LDFLAGS': [ ++ '/usr/local/macold/lib/libc++.a', ++ '/usr/local/macold/lib/libc++abi.a', ++ ], ++ }, ++ 'include_dirs': [ ++ '/usr/local/macold/include/c++/v1', ++ ], + }, + } diff --git a/Telegram/Patches/macold/mini_chromium.diff b/Telegram/Patches/macold/mini_chromium.diff new file mode 100644 index 000000000..50aa1dc3e --- /dev/null +++ b/Telegram/Patches/macold/mini_chromium.diff @@ -0,0 +1,26 @@ +diff --git a/build/common.gypi b/build/common.gypi +index 1affc70..c0d2f6a 100644 +--- a/build/common.gypi ++++ b/build/common.gypi +@@ -66,6 +66,11 @@ + 'conditions': [ + ['clang!=0', { + 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11 ++ 'OTHER_CPLUSPLUSFLAGS': [ '-nostdinc++' ], ++ 'OTHER_LDFLAGS': [ ++ '/usr/local/macold/lib/libc++.a', ++ '/usr/local/macold/lib/libc++abi.a', ++ ], + + # Don't link in libarclite_macosx.a, see http://crbug.com/156530. + 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime +@@ -116,6 +121,9 @@ + ], + + }, ++ 'include_dirs': [ ++ '/usr/local/macold/include/c++/v1', ++ ], + }], + + ['OS=="linux"', { diff --git a/Telegram/Patches/qtbase_5_3_2.diff b/Telegram/Patches/macold/qtbase_5_3_2.diff similarity index 97% rename from Telegram/Patches/qtbase_5_3_2.diff rename to Telegram/Patches/macold/qtbase_5_3_2.diff index fb00fd535..549a14341 100644 --- a/Telegram/Patches/qtbase_5_3_2.diff +++ b/Telegram/Patches/macold/qtbase_5_3_2.diff @@ -13,16 +13,21 @@ index cb8d78f..cadb3f0 100755 echo " Xcode not set up properly. You may need to confirm the license" >&2 echo " agreement by running /usr/bin/xcodebuild without arguments." >&2 diff --git a/mkspecs/common/g++-macx.conf b/mkspecs/common/g++-macx.conf -index 086510d..ae4f81a 100644 +index 086510d..c485967 100644 --- a/mkspecs/common/g++-macx.conf +++ b/mkspecs/common/g++-macx.conf -@@ -14,7 +14,8 @@ QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -gdwarf-2 +@@ -14,7 +14,13 @@ QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -gdwarf-2 QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -gdwarf-2 QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO += -g -gdwarf-2 -QMAKE_LFLAGS_STATIC_LIB += -all_load +# Patch: Don't remember :( +#QMAKE_LFLAGS_STATIC_LIB += -all_load ++ ++# Patch: Use C++14 with custom libc++ build. ++QMAKE_CXXFLAGS_CXX11 = -std=c++1y ++QMAKE_CXXFLAGS += -nostdinc++ -I/usr/local/macold/include/c++/v1 ++QMAKE_LFLAGS += /usr/local/macold/lib/libc++.a /usr/local/macold/lib/libc++abi.a QMAKE_XCODE_GCC_VERSION = com.apple.compilers.llvmgcc42 @@ -238,6 +243,19 @@ index 92358ec..694fee7 100644 } - (void)appleEventQuit:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent +diff --git a/src/plugins/platforms/cocoa/qcocoacursor.mm b/src/plugins/platforms/cocoa/qcocoacursor.mm +index b81b9a0..4e59e83 100644 +--- a/src/plugins/platforms/cocoa/qcocoacursor.mm ++++ b/src/plugins/platforms/cocoa/qcocoacursor.mm +@@ -81,7 +81,7 @@ void QCocoaCursor::setPos(const QPoint &position) + pos.x = position.x(); + pos.y = position.y(); + +- CGEventRef e = CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, 0); ++ CGEventRef e = CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, kCGMouseButtonLeft); + CGEventPost(kCGHIDEventTap, e); + CFRelease(e); + } diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index 9fd05a6..dea6072 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm diff --git a/Telegram/Patches/qtimageformats_5_3_2.diff b/Telegram/Patches/macold/qtimageformats_5_3_2.diff similarity index 100% rename from Telegram/Patches/qtimageformats_5_3_2.diff rename to Telegram/Patches/macold/qtimageformats_5_3_2.diff diff --git a/Telegram/gyp/qt.gypi b/Telegram/gyp/qt.gypi index a8adbaa2c..356ea004e 100644 --- a/Telegram/gyp/qt.gypi +++ b/Telegram/gyp/qt.gypi @@ -41,7 +41,13 @@ 'qtharfbuzzng', ], 'qt_version%': '<(qt_version)', - 'linux_path_qt%': '/usr/local/tdesktop/Qt-<(qt_version)', + 'conditions': [ + [ 'build_macold', { + 'linux_path_qt%': '/usr/local/macold/Qt-<(qt_version)', + }, { + 'linux_path_qt%': '/usr/local/tdesktop/Qt-<(qt_version)', + }] + ] }, 'qt_version%': '<(qt_version)', 'qt_loc_unix': '<(linux_path_qt)', diff --git a/Telegram/gyp/telegram_mac.gypi b/Telegram/gyp/telegram_mac.gypi index 38b6aed0b..89037fd70 100644 --- a/Telegram/gyp/telegram_mac.gypi +++ b/Telegram/gyp/telegram_mac.gypi @@ -32,17 +32,13 @@ '-lcrypto', '/usr/local/lib/liblzma.a', '/usr/local/lib/libopus.a', - '/usr/local/lib/libexif.a', ], }, 'include_dirs': [ '/usr/local/include', - '<(libs_loc)/openssl-xcode/include' ], 'library_dirs': [ '/usr/local/lib', - '<(libs_loc)/libexif-0.6.20/libexif/.libs', - '<(libs_loc)/openssl-xcode', ], 'configurations': { 'Debug': { @@ -66,33 +62,43 @@ }], [ 'build_macold', { 'xcode_settings': { 'PRODUCT_BUNDLE_IDENTIFIER': 'com.tdesktop.Telegram', + 'OTHER_CPLUSPLUSFLAGS': [ '-nostdinc++' ], 'OTHER_LDFLAGS': [ - '/usr/local/openal_old/lib/libopenal.a', - '/usr/local/zlib_old/lib/libz.a', + '-lbase', + '-lcrashpad_client', + '-lcrashpad_util', + '/usr/local/macold/lib/libz.a', + '/usr/local/macold/lib/libopenal.a', '/usr/local/iconv_old/lib/libiconv.a', '/usr/local/ffmpeg_old/lib/libavcodec.a', '/usr/local/ffmpeg_old/lib/libavformat.a', '/usr/local/ffmpeg_old/lib/libavutil.a', '/usr/local/ffmpeg_old/lib/libswscale.a', '/usr/local/ffmpeg_old/lib/libswresample.a', - '-lbase', - '-lcrashpad_client', - '-lcrashpad_util', + '/usr/local/macold/lib/libexif.a', + '/usr/local/macold/lib/libc++.a', + '/usr/local/macold/lib/libc++abi.a', ], }, 'include_dirs': [ - '<(libs_loc)/crashpad_oldmac/crashpad', - '<(libs_loc)/crashpad_oldmac/crashpad/third_party/mini_chromium/mini_chromium', + '/usr/local/macold', + '/usr/local/macold/include/c++/v1', + '<(libs_loc)/macold/openssl-1.0.1h/include', + '<(libs_loc)/macold/crashpad', + '<(libs_loc)/macold/crashpad/third_party/mini_chromium/mini_chromium', + ], + 'library_dirs': [ + '<(libs_loc)/macold/openssl-1.0.1h', ], 'configurations': { 'Debug': { 'library_dirs': [ - '<(libs_loc)/crashpad_oldmac/crashpad/out/Debug', + '<(libs_loc)/macold/crashpad/out/Debug', ], }, 'Release': { 'library_dirs': [ - '<(libs_loc)/crashpad_oldmac/crashpad/out/Release', + '<(libs_loc)/macold/crashpad/out/Release', ], }, }, @@ -137,6 +143,10 @@ 'include_dirs': [ '<(libs_loc)/crashpad/crashpad', '<(libs_loc)/crashpad/crashpad/third_party/mini_chromium/mini_chromium', + '<(libs_loc)/openssl-xcode/include' + ], + 'library_dirs': [ + '<(libs_loc)/openssl-xcode', ], 'configurations': { 'Debug': { diff --git a/doc/building-xcode-old.md b/doc/building-xcode-old.md index c0c53b5e4..c779f835d 100644 --- a/doc/building-xcode-old.md +++ b/doc/building-xcode-old.md @@ -14,7 +14,15 @@ By git – in Terminal go to **/Users/user/TBuild** and run then go to **/Users/user/TBuild/tdesktop** and run - git checkout mac32 + git checkout dev + +####Prepare latest cmake + +Download the [latest sources](https://cmake.org/download/) and unpack to **/Users/user/TBuild/Libraries/macold** + + ./bootstrap + make -j4 + sudo make install ###Prepare libraries @@ -24,34 +32,53 @@ In your build Terminal run to set minimal supported OS version to 10.6 for future console builds. +####custom build of libc++ + +From **/Users/user/TBuild/Libraries/macold** run + + svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm + cd llvm/projects + svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx + svn co http://llvm.org/svn/llvm-project/libcxxabi/trunk libcxxabi + + cd ../../ + mkdir libcxxabi + cd libcxxabi + + cmake -G "Unix Makefiles" -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.6 -DCMAKE_BUILD_TYPE:STRING=Release -DLIBCXX_ENABLE_SHARED:BOOL=NO -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/macold -DLLVM_PATH=../llvm -DLIBCXXABI_LIBCXX_PATH=../llvm/projects/libcxx ../llvm/projects/libcxxabi/ + make -j4 + sudo make install + + cd ../ + mkdir libcxx + cd libcxx + + cmake -G "Unix Makefiles" -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.6 -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/macold -DLIBCXX_ENABLE_SHARED:BOOL=NO -DLIBCXX_CXX_ABI:STRING=libstdc++ -DLIBCXX_CXX_ABI_INCLUDE_PATHS="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1/" -DLLVM_PATH=../llvm/ ../llvm/projects/libcxx/ + make -j4 + sudo make install + ####zlib 1.2.8 -http://www.zlib.net/ > Download [**zlib source code, version 1.2.8, zipfile format**](http://zlib.net/zlib128.zip) +http://www.zlib.net/ > Download [**zlib source code, version 1.2.8**](http://www.zlib.net/fossils/zlib-1.2.8.tar.gz) -Extract to **/Users/user/TBuild/Libraries** +Extract to **/Users/user/TBuild/Libraries/macold** #####Building library In Terminal go to **/Users/user/TBuild/Libraries/zlib-1.2.8** and run: - prefix=/usr/local/zlib_old CFLAGS="-mmacosx-version-min=10.6" LDFLAGS="-mmacosx-version-min=10.6" ./configure - make - sudo make install + prefix=/usr/local/macold CFLAGS="-mmacosx-version-min=10.6" LDFLAGS="-mmacosx-version-min=10.6" ./configure + make + sudo make install ####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 - - 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) -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** +Extract openssl-1.0.1h.tar.gz to **/Users/user/TBuild/Libraries/macold/openssl-1.0.1h** -#####Building library - -* Open **/Users/user/TBuild/Libraries/openssl-xcode/openssl.xcodeproj** with Xcode -* Product > Build + ./Configure --install_prefix=/usr/local/macold darwin64-x86_64-cc -static -mmacosx-version-min=10.6 + make build_crypto build_ssl -j4 ####liblzma @@ -67,37 +94,33 @@ In Terminal go to **/Users/user/TBuild/Libraries/xz-5.0.5** and there run make sudo make install -####zlib 1.2.8 - -Using se system lib - ####libexif 0.6.20 -Get sources from https://github.com/telegramdesktop/libexif-0.6.20, by git – in Terminal go to **/Users/user/TBuild/Libraries** and run +Get sources from https://github.com/telegramdesktop/libexif-0.6.20, by git – in Terminal go to **/Users/user/TBuild/Libraries/macold** and run git clone https://github.com/telegramdesktop/libexif-0.6.20.git #####Building library -In Terminal go to **/Users/user/TBuild/Libraries/libexif-0.6.20** and there run +In Terminal go to **/Users/user/TBuild/Libraries/macold/libexif-0.6.20** and there run - ./configure - make + CFLAGS="-mmacosx-version-min=10.6" CPPFLAGS="-mmacosx-version-min=10.6 -nostdinc++" LDFLAGS="-mmacosx-version-min=10.6" ./configure --prefix=/usr/local/macold + make -j4 sudo make install ####OpenAL Soft -Get sources by git – in Terminal go to **/Users/user/TBuild/Libraries** and run +Get sources by git – in Terminal go to **/Users/user/TBuild/Libraries/macold** and run git clone git://repo.or.cz/openal-soft.git -to have **/Users/user/TBuild/Libraries/openal-soft/CMakeLists.txt** +to have **/Users/user/TBuild/Libraries/macold/openal-soft/CMakeLists.txt** #####Building library In Terminal go to **/Users/user/TBuild/Libraries/openal-soft/build** and there run - cmake -D LIBTYPE:STRING=STATIC -D CMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.6 -D CMAKE_INSTALL_PREFIX:STRING=/usr/local/openal_old .. + cmake -DLIBTYPE:STRING=STATIC -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.6 -DCMAKE_INSTALL_PREFIX:STRING=/usr/local/macold .. make sudo make install @@ -123,7 +146,7 @@ then go to **/Users/user/TBuild/Libraries/opus** and there run ####FFmpeg -In Terminal go to **/Users/user/TBuild/Libraries** and run: +In Terminal go to **/Users/user/TBuild/Libraries/macold** and run: git clone https://github.com/FFmpeg/FFmpeg.git ffmpeg cd ffmpeg @@ -131,15 +154,15 @@ In Terminal go to **/Users/user/TBuild/Libraries** and run: #####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 it to **/Users/user/TBuild/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 it to **/Users/user/TBuild/Libraries/macold** -In Termianl go to **/Users/user/TBuild/Libraries/libiconv-1.14** and run +In Termianl go to **/Users/user/TBuild/Libraries/macold/libiconv-1.14** and run - CFLAGS="-mmacosx-version-min=10.6" CPPFLAGS="-mmacosx-version-min=10.6" LDFLAGS="-mmacosx-version-min=10.6" ./configure --enable-static --prefix=/usr/local/iconv_old - make + CFLAGS="-mmacosx-version-min=10.6" CPPFLAGS="-mmacosx-version-min=10.6 -nostdinc++" LDFLAGS="-mmacosx-version-min=10.6" ./configure --enable-static --prefix=/usr/local/macold + make -j4 sudo make install -Then in Terminal go to **/Users/user/TBuild/Libraries/ffmpeg** and run +Then in Terminal go to **/Users/user/TBuild/Libraries/macold/ffmpeg** and run ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" @@ -149,7 +172,7 @@ Then in Terminal go to **/Users/user/TBuild/Libraries/ffmpeg** and run LDFLAGS=`freetype-config --libs` PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig - ./configure --prefix=/usr/local/ffmpeg_old --disable-programs --disable-doc --disable-everything --enable-protocol=file --enable-libopus --enable-decoder=aac --enable-decoder=aac_latm --enable-decoder=aasc --enable-decoder=flac --enable-decoder=gif --enable-decoder=h264 --enable-decoder=mp1 --enable-decoder=mp1float --enable-decoder=mp2 --enable-decoder=mp2float --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mp3adufloat --enable-decoder=mp3float --enable-decoder=mp3on4 --enable-decoder=mp3on4float --enable-decoder=mpeg4 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=opus --enable-decoder=vorbis --enable-decoder=wavpack --enable-decoder=wmalossless --enable-decoder=wmapro --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmavoice --enable-encoder=libopus --enable-parser=aac --enable-parser=aac_latm --enable-parser=flac --enable-parser=h264 --enable-parser=mpeg4video --enable-parser=mpegaudio --enable-parser=opus --enable-parser=vorbis --enable-demuxer=aac --enable-demuxer=flac --enable-demuxer=gif --enable-demuxer=h264 --enable-demuxer=mov --enable-demuxer=mp3 --enable-demuxer=ogg --enable-demuxer=wav --enable-muxer=ogg --enable-muxer=opus --extra-cflags="-mmacosx-version-min=10.6" --extra-cxxflags="-mmacosx-version-min=10.6" --extra-ldflags="-mmacosx-version-min=10.6" + ./configure --prefix=/usr/local/macold --disable-programs --disable-doc --disable-everything --enable-protocol=file --enable-libopus --enable-decoder=aac --enable-decoder=aac_latm --enable-decoder=aasc --enable-decoder=flac --enable-decoder=gif --enable-decoder=h264 --enable-decoder=mp1 --enable-decoder=mp1float --enable-decoder=mp2 --enable-decoder=mp2float --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mp3adufloat --enable-decoder=mp3float --enable-decoder=mp3on4 --enable-decoder=mp3on4float --enable-decoder=mpeg4 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=opus --enable-decoder=vorbis --enable-decoder=wavpack --enable-decoder=wmalossless --enable-decoder=wmapro --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmavoice --enable-encoder=libopus --enable-parser=aac --enable-parser=aac_latm --enable-parser=flac --enable-parser=h264 --enable-parser=mpeg4video --enable-parser=mpegaudio --enable-parser=opus --enable-parser=vorbis --enable-demuxer=aac --enable-demuxer=flac --enable-demuxer=gif --enable-demuxer=h264 --enable-demuxer=mov --enable-demuxer=mp3 --enable-demuxer=ogg --enable-demuxer=wav --enable-muxer=ogg --enable-muxer=opus --extra-cflags="-mmacosx-version-min=10.6" --extra-cxxflags="-mmacosx-version-min=10.6 -nostdinc++" --extra-ldflags="-mmacosx-version-min=10.6" make sudo make install @@ -169,24 +192,56 @@ In Terminal go to **/Users/user/TBuild/Libraries** and run: #####Apply the patch -From **/Users/user/TBuild/Libraries/qt5_3_2/qtbase**, run: +From **/Users/user/TBuild/Libraries/macold/qt5_3_2/qtbase**, run: - git apply ../../../tdesktop/Telegram/Patches/qtbase_5_3_2.diff + git apply ../../../../tdesktop/Telegram/Patches/macold/qtbase_5_3_2.diff -From **/Users/user/TBuild/Libraries/qt5_3_2/qtimageformats**, run: +From **/Users/user/TBuild/Libraries/macold/qt5_3_2/qtimageformats**, run: - git apply ../../../tdesktop/Telegram/Patches/qtimageformats_5_3_2.diff + git apply ../../../../tdesktop/Telegram/Patches/macold/qtimageformats_5_3_2.diff #####Building library -Go to **/Users/user/TBuild/Libraries/qt5_3_2** and run: +Go to **/Users/user/TBuild/Libraries/macold/qt5_3_2** and run: - OPENSSL_LIBS="/Users/user/TBuild/Libraries/openssl-xcode_oldmac/libssl.a /Users/user/TBuild/Libraries/openssl-xcode_oldmac/libcrypto.a" ./configure -prefix "/usr/local/tdesktop/Qt-5.3.2" -debug-and-release -force-debug-info -opensource -confirm-license -static -opengl desktop -openssl-linked -I "/Users/user/TBuild/Libraries/openssl-xcode_oldmac/include" -nomake examples -nomake tests -platform macx-g++ + OPENSSL_LIBS="/Users/user/TBuild/Libraries/macold/openssl-1.0.1h/libssl.a /Users/user/TBuild/Libraries/macold/openssl-1.0.1h/libcrypto.a" ./configure -prefix "/usr/local/macold/Qt-5.3.2" -debug-and-release -force-debug-info -opensource -confirm-license -static -opengl desktop -openssl-linked -I "/Users/user/TBuild/Libraries/macold/openssl-1.0.1h/include" -nomake examples -nomake tests -platform macx-g++ make -j4 sudo make -j4 install building (**make** command) will take really long time. +####Google Crashpad + +#####Install gyp + +.. the same as modern .. + +#####Build crashpad + +In Terminal go to **/Users/user/TBuild/Libraries/macold** and run: + + git clone https://chromium.googlesource.com/crashpad/crashpad.git + cd crashpad + git checkout feb3aa3923 + git apply ../../../tdesktop/Telegram/Patches/macold/crashpad.diff + cd third_party/mini_chromium + git clone https://chromium.googlesource.com/chromium/mini_chromium + cd mini_chromium + git checkout 7c5b0c1ab4 + git apply ../../../../../../tdesktop/Telegram/Patches/macold/mini_chromium.diff + cd ../../gtest + git clone https://chromium.googlesource.com/external/github.com/google/googletest gtest + cd gtest + git checkout d62d6c6556 + + build/gyp_crashpad.py -Dmac_deployment_target=10.6 + ninja -C out/Debug + ninja -C out/Release + +####Prepare GYP + +.. the same as modern .. + ###Building Telegram Desktop * Launch Xcode, all projects will be taken from **/Users/user/TBuild/tdesktop/Telegram** diff --git a/doc/building-xcode.md b/doc/building-xcode.md index 27f7e1a58..14209c8a9 100644 --- a/doc/building-xcode.md +++ b/doc/building-xcode.md @@ -18,13 +18,13 @@ By git – in Terminal go to **/Users/user/TBuild** and 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. ####zlib 1.2.8 -http://www.zlib.net/ > Download [**zlib source code, version 1.2.8, zipfile format**](http://zlib.net/zlib128.zip) +http://www.zlib.net/ > Download [**zlib source code, version 1.2.8**](http://www.zlib.net/fossils/zlib-1.2.8.tar.gz) Extract to **/Users/user/TBuild/Libraries** @@ -32,9 +32,9 @@ Extract to **/Users/user/TBuild/Libraries** In Terminal go to **/Users/user/TBuild/Libraries/zlib-1.2.8** and run: - CFLAGS="-mmacosx-version-min=10.8" LDFLAGS="-mmacosx-version-min=10.8" ./configure - make - sudo make install + CFLAGS="-mmacosx-version-min=10.8" LDFLAGS="-mmacosx-version-min=10.8" ./configure + make + sudo make install ####OpenSSL 1.0.1g @@ -45,7 +45,7 @@ From https://github.com/telegramdesktop/openssl-xcode with git in Terminal: * go to **/Users/user/TBuild/Libraries * run: - git clone https://github.com/telegramdesktop/openssl-xcode.git + git clone https://github.com/telegramdesktop/openssl-xcode.git The path to openssl.xcodeproj should now be: **/Users/user/TBuild/Libraries/openssl-xcode/openssl.xcodeproj** @@ -87,7 +87,7 @@ From https://github.com/telegramdesktop/libexif-0.6.20 with git in Terminal: * go to **/Users/user/TBuild/Libraries** * run: - git clone https://github.com/telegramdesktop/libexif-0.6.20.git + git clone https://github.com/telegramdesktop/libexif-0.6.20.git The folder configure should have this path: **/Users/user/TBuild/Libraries/libexif-0.6.20/configure**