From f7085b40b1005042d39b0bb8705cff88904b8b71 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 21 Oct 2021 19:49:44 +0400 Subject: [PATCH] Support building macOS version with Qt 6.2. --- .../SourceFiles/platform/mac/specific_mac.mm | 1 - .../touchbar/items/mac_pinned_chats_item.mm | 9 +++- Telegram/build/prepare/prepare.py | 53 ++++++++++++++++++- Telegram/codegen | 2 +- Telegram/lib_ui | 2 +- cmake | 2 +- 6 files changed, 61 insertions(+), 8 deletions(-) diff --git a/Telegram/SourceFiles/platform/mac/specific_mac.mm b/Telegram/SourceFiles/platform/mac/specific_mac.mm index 3b4395ae3d..c6f212c6ef 100644 --- a/Telegram/SourceFiles/platform/mac/specific_mac.mm +++ b/Telegram/SourceFiles/platform/mac/specific_mac.mm @@ -23,7 +23,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include #include -#include #include #include diff --git a/Telegram/SourceFiles/platform/mac/touchbar/items/mac_pinned_chats_item.mm b/Telegram/SourceFiles/platform/mac/touchbar/items/mac_pinned_chats_item.mm index 2d5e8b4957..3e57fa79b8 100644 --- a/Telegram/SourceFiles/platform/mac/touchbar/items/mac_pinned_chats_item.mm +++ b/Telegram/SourceFiles/platform/mac/touchbar/items/mac_pinned_chats_item.mm @@ -192,7 +192,7 @@ TimeId CalculateOnlineTill(not_null peer) { rpl::event_stream> _touches; rpl::event_stream> _gestures; - double _r, _g, _b, _a; // The online circle color. + CGFloat _r, _g, _b, _a; // The online circle color. } - (void)processHorizontalReorder { @@ -710,7 +710,12 @@ TimeId CalculateOnlineTill(not_null peer) { }, _lifetime); const auto updateOnlineColor = [=] { - st::dialogsOnlineBadgeFg->c.getRgbF(&_r, &_g, &_b, &_a); + auto r = 0, g = 0, b = 0, a = 0; + st::dialogsOnlineBadgeFg->c.getRgb(&r, &g, &b, &a); + _r = r / 255.; + _g = g / 255.; + _b = b / 255.; + _a = a / 255.; }; updateOnlineColor(); diff --git a/Telegram/build/prepare/prepare.py b/Telegram/build/prepare/prepare.py index 44d36d285e..205ba34604 100644 --- a/Telegram/build/prepare/prepare.py +++ b/Telegram/build/prepare/prepare.py @@ -37,10 +37,18 @@ usedPrefix = libsDir + dirSep + 'local' processedArgs = [] skipReleaseBuilds = False +buildQt5 = True +buildQt6 = False for arg in sys.argv[1:]: if arg == 'skip-release': processedArgs.append(arg) skipReleaseBuilds = True + elif arg == 'qt6': + processedArgs.append(arg) + buildQt6 = True + elif arg == 'skip-qt5': + processedArgs.append(arg) + buildQt5 = False if not os.path.isdir(libsDir + '/' + keysLoc): pathlib.Path(libsDir + '/' + keysLoc).mkdir(parents=True, exist_ok=True) @@ -379,7 +387,7 @@ def runStages(): stage('patches', """ git clone https://github.com/desktop-app/patches.git cd patches - git checkout 5210855985 + git checkout 212984972d """) stage('depot_tools', """ @@ -798,7 +806,8 @@ release: cd ..\\..\\.. """) -stage('qt_5_15_2', """ +if buildQt5: + stage('qt_5_15_2', """ git clone git://code.qt.io/qt/qt5.git qt_5_15_2 cd qt_5_15_2 perl init-repository --module-subset=qtbase,qtimageformats,qtsvg @@ -879,6 +888,46 @@ mac: make install """) +if buildQt6: + stage('qt_6_2_0', """ +mac: + git clone -b v6.2.0 git://code.qt.io/qt/qt5.git qt_6_2_0 + cd qt_6_2_0 + perl init-repository --module-subset=qtbase,qtimageformats,qtsvg,qt5compat +depends:patches/qtbase_6_2_0/*.patch + cd qtbase + + find ../../patches/qtbase_6_2_0 -type f -print0 | sort -z | xargs -0 git apply + cd .. + +depends:patches/qt5compat_6_2_0/*.patch + cd qt5compat + + find ../../patches/qt5compat_6_2_0 -type f -print0 | sort -z | xargs -0 git apply + cd .. + + CONFIGURATIONS=-debug +release: + CONFIGURATIONS=-debug-and-release +mac: + ./configure -prefix "$USED_PREFIX/Qt-6.2.0" \ + $CONFIGURATIONS \ + -force-debug-info \ + -opensource \ + -confirm-license \ + -static \ + -opengl desktop \ + -no-openssl \ + -securetransport \ + -I "$USED_PREFIX/include" \ + -nomake examples \ + -nomake tests \ + -platform macx-clang + + ninja + ninja install +""") + stage('tg_owt', """ git clone https://github.com/desktop-app/tg_owt.git cd tg_owt diff --git a/Telegram/codegen b/Telegram/codegen index 83aee6211b..a60edf9174 160000 --- a/Telegram/codegen +++ b/Telegram/codegen @@ -1 +1 @@ -Subproject commit 83aee6211bfe016dc20c8dd9616b1456a9f20c5e +Subproject commit a60edf917419407cfe5c6095a56ccf363417ebd8 diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 87b121069f..674391524b 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 87b121069f9027a014b499e01b71ddd3180d4f94 +Subproject commit 674391524b108cba55aa5ad93c751fc6baf948ee diff --git a/cmake b/cmake index 8540bd0b60..57ccb6c03c 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 8540bd0b6007648792e700719b291f83fc75d9da +Subproject commit 57ccb6c03c1ff68d294f61e539c34ffbdcc39531