From aa5781b550081895f016ee9348c73c8db31b039e Mon Sep 17 00:00:00 2001 From: Vasilii Babich Date: Sun, 25 Mar 2018 19:29:38 +0400 Subject: [PATCH] Update some details in Xcode build instructions. --- Telegram/Patches/macold/qtbase_5_3_2.diff | 75 ++++++++++++++++------- docs/building-xcode-old.md | 9 +-- docs/building-xcode.md | 4 +- docs/misc.txt | 9 +++ 4 files changed, 70 insertions(+), 27 deletions(-) create mode 100644 docs/misc.txt diff --git a/Telegram/Patches/macold/qtbase_5_3_2.diff b/Telegram/Patches/macold/qtbase_5_3_2.diff index 5526231487..0ae1bf8ff4 100644 --- a/Telegram/Patches/macold/qtbase_5_3_2.diff +++ b/Telegram/Patches/macold/qtbase_5_3_2.diff @@ -1,5 +1,5 @@ diff --git a/configure b/configure -index cb8d78f..cadb3f0 100755 +index cb8d78fd3c..cadb3f0a88 100755 --- a/configure +++ b/configure @@ -511,7 +511,8 @@ if [ "$BUILD_ON_MAC" = "yes" ]; then @@ -13,7 +13,7 @@ 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..c485967 100644 +index 086510dd96..c485967863 100644 --- a/mkspecs/common/g++-macx.conf +++ b/mkspecs/common/g++-macx.conf @@ -14,7 +14,13 @@ QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -gdwarf-2 @@ -32,7 +32,7 @@ index 086510d..c485967 100644 QMAKE_XCODE_GCC_VERSION = com.apple.compilers.llvmgcc42 diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf -index 0cc8cd6..ca9725b 100644 +index 0cc8cd6dfd..ca9725b779 100644 --- a/mkspecs/features/mac/default_pre.prf +++ b/mkspecs/features/mac/default_pre.prf @@ -12,7 +12,9 @@ isEmpty(QMAKE_XCODE_DEVELOPER_PATH) { @@ -47,7 +47,7 @@ index 0cc8cd6..ca9725b 100644 } diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp -index bb79a13..5d595bc 100644 +index bb79a139b3..5d595bc3b3 100644 --- a/src/gui/image/qbmphandler.cpp +++ b/src/gui/image/qbmphandler.cpp @@ -220,6 +220,10 @@ static bool read_dib_body(QDataStream &s, const BMP_INFOHDR &bi, int offset, int @@ -74,7 +74,7 @@ index bb79a13..5d595bc 100644 if (ncols > 0) { // read color table uchar rgb[4]; diff --git a/src/gui/painting/qpaintengine_p.h b/src/gui/painting/qpaintengine_p.h -index ebff950..4300ca4 100644 +index ebff9509ab..4300ca4c0f 100644 --- a/src/gui/painting/qpaintengine_p.h +++ b/src/gui/painting/qpaintengine_p.h @@ -87,8 +87,18 @@ public: @@ -98,7 +98,7 @@ index ebff950..4300ca4 100644 // Make sure we're inside the viewport. diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp -index 4879ae5..56cdcba 100644 +index 4879ae51d7..56cdcbaf01 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -654,6 +654,9 @@ int QTextLayout::nextCursorPosition(int oldPos, CursorMode mode) const @@ -175,7 +175,7 @@ index 4879ae5..56cdcba 100644 inline void resetRightBearing() diff --git a/src/gui/text/qtextlayout.h b/src/gui/text/qtextlayout.h -index cbe42c3..b273db7 100644 +index cbe42c3844..b273db7e78 100644 --- a/src/gui/text/qtextlayout.h +++ b/src/gui/text/qtextlayout.h @@ -194,6 +194,9 @@ private: @@ -189,7 +189,7 @@ index cbe42c3..b273db7 100644 diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm -index ca7afb7..25ae500 100644 +index ca7afb7d1b..25ae50008d 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -256,6 +256,13 @@ static void getFontDescription(CTFontDescriptorRef font, FontDescription *fd) @@ -207,7 +207,7 @@ index ca7afb7..25ae500 100644 fd->weight = QFont::Normal; fd->style = QFont::StyleNormal; diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm -index 92358ec..694fee7 100644 +index 92358ecc74..694fee7350 100644 --- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm +++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm @@ -213,7 +213,8 @@ static void cleanupCocoaApplicationDelegate() @@ -244,7 +244,7 @@ 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 +index b81b9a0b1c..4e59e833b1 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) @@ -256,8 +256,41 @@ index b81b9a0..4e59e83 100644 CGEventPost(kCGHIDEventTap, e); CFRelease(e); } +diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm +index 9850f83dea..218ed7e81c 100644 +--- a/src/plugins/platforms/cocoa/qcocoahelpers.mm ++++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm +@@ -649,9 +649,10 @@ OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGIm + // Verbatim copy if HIViewDrawCGImage (as shown on Carbon-Dev) + OSStatus err = noErr; + +- require_action(inContext != NULL, InvalidContext, err = paramErr); +- require_action(inBounds != NULL, InvalidBounds, err = paramErr); +- require_action(inImage != NULL, InvalidImage, err = paramErr); ++ // Patch: Fix build on latest Xcode. ++ //require_action(inContext != NULL, InvalidContext, err = paramErr); ++ //require_action(inBounds != NULL, InvalidBounds, err = paramErr); ++ //require_action(inImage != NULL, InvalidImage, err = paramErr); + + CGContextSaveGState( inContext ); + CGContextTranslateCTM (inContext, 0, inBounds->origin.y + CGRectGetMaxY(*inBounds)); +@@ -660,9 +661,11 @@ OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGIm + CGContextDrawImage(inContext, *inBounds, inImage); + + CGContextRestoreGState(inContext); +-InvalidImage: +-InvalidBounds: +-InvalidContext: ++ ++// Patch: Fix build on latest Xcode. ++//InvalidImage: ++//InvalidBounds: ++//InvalidContext: + return err; + } + diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm -index 9fd05a6..dea6072 100644 +index 9fd05a65ee..dea60720e7 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -402,14 +402,24 @@ void QCocoaIntegration::updateScreens() @@ -288,7 +321,7 @@ index 9fd05a6..dea6072 100644 QCocoaScreen *QCocoaIntegration::screenAtIndex(int index) diff --git a/src/plugins/platforms/cocoa/qcocoakeymapper.mm b/src/plugins/platforms/cocoa/qcocoakeymapper.mm -index e46eaff..c62db53 100644 +index e46eaff6be..c62db534a2 100644 --- a/src/plugins/platforms/cocoa/qcocoakeymapper.mm +++ b/src/plugins/platforms/cocoa/qcocoakeymapper.mm @@ -382,6 +382,12 @@ bool QCocoaKeyMapper::updateKeyboard() @@ -315,7 +348,7 @@ index e46eaff..c62db53 100644 } return ret; diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm -index 83c960d..03ae969 100755 +index 83c960d931..03ae9696af 100755 --- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm +++ b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm @@ -102,7 +102,10 @@ QT_USE_NAMESPACE @@ -483,7 +516,7 @@ index 83c960d..03ae969 100755 } @end diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm -index 4d0458a..3357a5e 100644 +index 4d0458a4aa..3357a5ef81 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -167,7 +167,8 @@ static bool isMouseEvent(NSEvent *ev) @@ -546,7 +579,7 @@ index 4d0458a..3357a5e 100644 [iconButton setImage:image]; [image release]; diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm -index a18ee7f..1f91feb 100644 +index a18ee7ff71..1f91feb0ae 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -393,7 +393,9 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil; @@ -615,7 +648,7 @@ index a18ee7f..1f91feb 100644 } return [super performKeyEquivalent:nsevent]; diff --git a/src/tools/qlalr/lalr.cpp b/src/tools/qlalr/lalr.cpp -index c680764..e2a7aaf 100644 +index c68076477f..e2a7aafa58 100644 --- a/src/tools/qlalr/lalr.cpp +++ b/src/tools/qlalr/lalr.cpp @@ -246,11 +246,13 @@ void Grammar::buildExtendedGrammar () @@ -655,7 +688,7 @@ index c680764..e2a7aaf 100644 continue; diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp -index 7396808..7178aec 100644 +index 7396808442..7178aecf80 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -4722,6 +4722,17 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset, @@ -708,7 +741,7 @@ index 7396808..7178aec 100644 || (k->key() == Qt::Key_Tab && (k->modifiers() & Qt::ShiftModifier))) res = focusNextPrevChild(false); diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm -index 0845a5e..5735cb6 100644 +index 0845a5eb02..5735cb6b39 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -3667,9 +3667,11 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter @@ -726,7 +759,7 @@ index 0845a5e..5735cb6 100644 } diff --git a/src/widgets/util/qsystemtrayicon_qpa.cpp b/src/widgets/util/qsystemtrayicon_qpa.cpp -index f98aeaf..00c0734 100644 +index f98aeaf678..00c0734129 100644 --- a/src/widgets/util/qsystemtrayicon_qpa.cpp +++ b/src/widgets/util/qsystemtrayicon_qpa.cpp @@ -99,13 +99,18 @@ void QSystemTrayIconPrivate::updateIcon_sys() @@ -755,7 +788,7 @@ index f98aeaf..00c0734 100644 } diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp -index 75f3059..980f2be 100644 +index 75f30599be..980f2be1e9 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -1867,7 +1867,8 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event) @@ -769,7 +802,7 @@ index 75f3059..980f2be 100644 #ifndef QT_NO_COMPLETER complete(event->key()); diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp -index 96438a0..b0b7206 100644 +index 96438a0bdf..b0b7206405 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -1342,7 +1342,8 @@ void QWidgetTextControlPrivate::keyPressEvent(QKeyEvent *e) diff --git a/docs/building-xcode-old.md b/docs/building-xcode-old.md index f1fad75e0a..186bef2a31 100644 --- a/docs/building-xcode-old.md +++ b/docs/building-xcode-old.md @@ -49,14 +49,15 @@ Go to ***BuildPath*** and run 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 + cd ../ git clone https://github.com/telegramdesktop/zlib.git cd zlib @@ -105,7 +106,7 @@ Go to ***BuildPath*** and run cmake -DLIBTYPE:STRING=STATIC -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.6 -DCMAKE_INSTALL_PREFIX:STRING=/usr/local/macold .. make -j4 sudo make install - cd .. + cd ../.. git clone https://github.com/telegramdesktop/libexif-0.6.20.git cd libexif-0.6.20 @@ -133,7 +134,7 @@ Go to ***BuildPath*** and run ninja -C out/Release cd .. - CurDir = `pwd` + CurDir=`pwd` git clone git://code.qt.io/qt/qt5.git qt5_3_2 cd qt5_3_2 @@ -142,7 +143,7 @@ Go to ***BuildPath*** and run cd qtimageformats && git checkout v5.3.2 && git apply ../../../../tdesktop/Telegram/Patches/macold/qtimageformats_5_3_2.diff && cd .. cd qtbase && git checkout v5.3.2 && git apply ../../../../tdesktop/Telegram/Patches/macold/qtbase_5_3_2.diff && cd .. - OPENSSL_LIBS="$CurDir/macold/openssl/libssl.a $CurDir/macold/openssl/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 "$CurDir/macold/openssl/include" -nomake examples -nomake tests -platform macx-g++ + OPENSSL_LIBS="$CurDir/openssl/libssl.a $CurDir/openssl/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 "$CurDir/openssl/include" -no-glib -nomake examples -nomake tests -platform macx-g++ make -j4 sudo make install diff --git a/docs/building-xcode.md b/docs/building-xcode.md index 2d1d7049bb..75d5bbc057 100644 --- a/docs/building-xcode.md +++ b/docs/building-xcode.md @@ -28,7 +28,7 @@ Go to ***BuildPath*** and run git clone https://github.com/ericniebler/range-v3 cd xz-5.0.5 - ./configure + CFLAGS="-mmacosx-version-min=10.8" LDFLAGS="-mmacosx-version-min=10.8" ./configure make sudo make install cd .. @@ -102,7 +102,7 @@ Go to ***BuildPath*** and run git clone https://chromium.googlesource.com/crashpad/crashpad.git cd crashpad git checkout feb3aa3923 - git apply ../../../tdesktop/Telegram/Patches/crashpad.diff + git apply ../../tdesktop/Telegram/Patches/crashpad.diff cd third_party/mini_chromium git clone https://chromium.googlesource.com/chromium/mini_chromium cd mini_chromium diff --git a/docs/misc.txt b/docs/misc.txt new file mode 100644 index 0000000000..2241ce577f --- /dev/null +++ b/docs/misc.txt @@ -0,0 +1,9 @@ +macOS: + +breakpad - clone breakpad like for msvc, including the patch, open breakpad/src/client/mac/Breakpad.xcodeproj and build Release +dump_syms - open breakpad/src/tools/mac/dump_syms/dump_syms.xcodeproj and build Release, copy dump_syms from ~/Library/Developer/Xcode/DerivedData/dump_syms-[a-z0-9]+/Build/Products/Release/ to BuildPath/Libraries/breakpad/src/tools/mac/dump_syms/build/Release/ + +Windows: + +install InnoSetup +open brekpad/src/tools/windows/dump_syms/dump_syms.vcproj, upgrade, change SDK and build Debug and Release