From f1cd70d8a850a0f1b59d53be8ee8fc09abfdf154 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 26 Jul 2019 14:13:31 +0200 Subject: [PATCH] Fix some instructions and build process. --- Telegram/Patches/qtbase_5_6_2.diff | 63 +++++++++++++++++++++++++++++- Telegram/build/build.sh | 5 ++- docs/building-msvc.md | 2 +- docs/building-xcode-old.md | 11 +++--- 4 files changed, 72 insertions(+), 9 deletions(-) diff --git a/Telegram/Patches/qtbase_5_6_2.diff b/Telegram/Patches/qtbase_5_6_2.diff index 683b76ca55..2da9a6a5f4 100644 --- a/Telegram/Patches/qtbase_5_6_2.diff +++ b/Telegram/Patches/qtbase_5_6_2.diff @@ -92,6 +92,67 @@ index bcd29b6fe1..bcb0672f69 100644 if (QPlatformCursor *platformCursor = q->screen()->handle()->cursor()) { QCursor *c = QGuiApplication::overrideCursor(); if (!c && hasCursor) +diff --git a/src/gui/painting/qbezier.cpp b/src/gui/painting/qbezier.cpp +index 8e0e76f787..a61bd62834 100644 +--- a/src/gui/painting/qbezier.cpp ++++ b/src/gui/painting/qbezier.cpp +@@ -45,6 +45,34 @@ QT_BEGIN_NAMESPACE + + //#define QDEBUG_BEZIER + ++// Patch: Workaround VS2019 compiler bug, see QTBUG-75280. ++#ifdef Q_OS_WIN ++Q_NEVER_INLINE void QBezier::split(QBezier *firstHalf, QBezier *secondHalf) const ++{ ++ Q_ASSERT(firstHalf); ++ Q_ASSERT(secondHalf); ++ ++ qreal c = (x2 + x3)*.5; ++ firstHalf->x2 = (x1 + x2)*.5; ++ secondHalf->x3 = (x3 + x4)*.5; ++ firstHalf->x1 = x1; ++ secondHalf->x4 = x4; ++ firstHalf->x3 = (firstHalf->x2 + c)*.5; ++ secondHalf->x2 = (secondHalf->x3 + c)*.5; ++ firstHalf->x4 = secondHalf->x1 = (firstHalf->x3 + secondHalf->x2)*.5; ++ ++ c = (y2 + y3)/2; ++ firstHalf->y2 = (y1 + y2)*.5; ++ secondHalf->y3 = (y3 + y4)*.5; ++ firstHalf->y1 = y1; ++ secondHalf->y4 = y4; ++ firstHalf->y3 = (firstHalf->y2 + c)*.5; ++ secondHalf->y2 = (secondHalf->y3 + c)*.5; ++ firstHalf->y4 = secondHalf->y1 = (firstHalf->y3 + secondHalf->y2)*.5; ++} ++// Patch: Workaround VS2019 compiler bug, see QTBUG-75280. ++#endif // Q_OS_WIN ++ + /*! + \internal + */ +diff --git a/src/gui/painting/qbezier_p.h b/src/gui/painting/qbezier_p.h +index dd1cd94acf..aedc8b6a4b 100644 +--- a/src/gui/painting/qbezier_p.h ++++ b/src/gui/painting/qbezier_p.h +@@ -215,6 +215,8 @@ inline QPointF QBezier::secondDerivedAt(qreal t) const + a * y1 + b * y2 + c * y3 + d * y4); + } + ++// Patch: Workaround VS2019 compiler bug, see QTBUG-75280. ++#ifndef Q_OS_WIN + inline void QBezier::split(QBezier *firstHalf, QBezier *secondHalf) const + { + Q_ASSERT(firstHalf); +@@ -238,6 +240,8 @@ inline void QBezier::split(QBezier *firstHalf, QBezier *secondHalf) const + secondHalf->y2 = (secondHalf->y3 + c)*.5; + firstHalf->y4 = secondHalf->y1 = (firstHalf->y3 + secondHalf->y2)*.5; + } ++// Patch: Workaround VS2019 compiler bug, see QTBUG-75280. ++#endif // Q_OS_WIN + + inline void QBezier::parameterSplitLeft(qreal t, QBezier *left) + { diff --git a/src/gui/painting/qpaintengine_p.h b/src/gui/painting/qpaintengine_p.h index 918c98997b..4158259743 100644 --- a/src/gui/painting/qpaintengine_p.h @@ -253,7 +314,7 @@ index 41834b21ae..8cdf4ab145 100644 setError(QAbstractSocket::NetworkError, AddressNotAvailableErrorString); socketState = QAbstractSocket::UnconnectedState; diff --git a/src/platformsupport/cglconvenience/cglconvenience.mm b/src/platformsupport/cglconvenience/cglconvenience.mm -index fb609ae485..7cca45ded4 100644 +index fb609ae485..ef1c638d91 100644 --- a/src/platformsupport/cglconvenience/cglconvenience.mm +++ b/src/platformsupport/cglconvenience/cglconvenience.mm @@ -128,7 +128,12 @@ void *qcgl_createNSOpenGLPixelFormat(const QSurfaceFormat &format) diff --git a/Telegram/build/build.sh b/Telegram/build/build.sh index 061a72c007..02cc9e6394 100755 --- a/Telegram/build/build.sh +++ b/Telegram/build/build.sh @@ -369,7 +369,9 @@ if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ] || [ "$BuildTarg fi if [ "$BuildTarget" == "mac" ]; then echo "Beginning notarization process." + set +e xcrun altool --notarize-app --primary-bundle-id "com.tdesktop.Telegram" --username "$AC_USERNAME" --password "@keychain:AC_PASSWORD" --file "$SetupFile" 2> request_uuid.txt + set -e while IFS='' read -r line || [[ -n "$line" ]]; do Prefix=$(echo $line | cut -d' ' -f 1) Value=$(echo $line | cut -d' ' -f 3) @@ -378,7 +380,8 @@ if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ] || [ "$BuildTarg fi done < "request_uuid.txt" if [ "$RequestUUID" == "" ]; then - Error "Could not extract Request UUID. See request_uuid.txt for more information." + cat request_uuid.txt + Error "Could not extract Request UUID." fi echo "Request UUID: $RequestUUID" rm request_uuid.txt diff --git a/docs/building-msvc.md b/docs/building-msvc.md index 65564f122c..f233105c73 100644 --- a/docs/building-msvc.md +++ b/docs/building-msvc.md @@ -141,7 +141,7 @@ Open **x86 Native Tools Command Prompt for VS 2019.bat**, go to ***BuildPath*** git apply ../../../tdesktop/Telegram/Patches/qtbase_5_6_2.diff cd .. - configure -debug-and-release -force-debug-info -opensource -confirm-license -static -I "%cd%\..\openssl\Release\include" -no-opengl -openssl-linked OPENSSL_LIBS_DEBUG="%cd%\..\openssl\Debug\lib\ssleay32.lib %cd%\..\openssl\Debug\lib\libeay32.lib" OPENSSL_LIBS_RELEASE="%cd%\..\openssl\Release\lib\ssleay32.lib %cd%\..\openssl\Release\lib\libeay32.lib" -mp -nomake examples -nomake tests -platform win32-msvc2015 + configure -debug-and-release -force-debug-info -opensource -confirm-license -static -I "%cd%\..\openssl\inc32" -no-opengl -openssl-linked OPENSSL_LIBS_DEBUG="%cd%\..\openssl\out32.dbg\ssleay32.lib %cd%\..\openssl\out32.dbg\libeay32.lib" OPENSSL_LIBS_RELEASE="%cd%\..\openssl\out32\ssleay32.lib %cd%\..\openssl\out32\libeay32.lib" -mp -nomake examples -nomake tests -platform win32-msvc2015 jom -j4 jom -j4 install diff --git a/docs/building-xcode-old.md b/docs/building-xcode-old.md index 0fd5e01a53..694614d6a5 100644 --- a/docs/building-xcode-old.md +++ b/docs/building-xcode-old.md @@ -17,16 +17,15 @@ Go to ***BuildPath*** and run cd Libraries/macold - 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 + git clone https://github.com/llvm/llvm-project.git llvm + cd llvm + git checkout release/7.x cd ../../ mkdir libcxxabi cd libcxxabi - LDFLAGS="-isysroot / -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/" 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/ + LDFLAGS="-isysroot / -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/" cmake -G "Unix Makefiles" -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.6 -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/macold -DLLVM_PATH=../llvm -DLIBCXXABI_LIBCXX_PATH=../llvm/libcxx -DLIBCXXABI_LIBCXX_INCLUDES=../llvm/libcxx/include ../llvm/libcxxabi/ make $MAKE_THREADS_CNT sudo make install cd ../ @@ -34,7 +33,7 @@ Go to ***BuildPath*** and run mkdir libcxx cd libcxx - LDFLAGS="-isysroot / -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/" 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/ + LDFLAGS="-isysroot / -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/" 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/libcxx/ make $MAKE_THREADS_CNT sudo make install cd ../