Support building macOS version with Qt 6.2.

This commit is contained in:
John Preston 2021-10-21 19:49:44 +04:00
parent 7222bc63f7
commit f7085b40b1
6 changed files with 61 additions and 8 deletions

View File

@ -23,7 +23,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <QtGui/QDesktopServices> #include <QtGui/QDesktopServices>
#include <QtWidgets/QApplication> #include <QtWidgets/QApplication>
#include <QtWidgets/QDesktopWidget>
#include <cstdlib> #include <cstdlib>
#include <execinfo.h> #include <execinfo.h>

View File

@ -192,7 +192,7 @@ TimeId CalculateOnlineTill(not_null<PeerData*> peer) {
rpl::event_stream<not_null<NSEvent*>> _touches; rpl::event_stream<not_null<NSEvent*>> _touches;
rpl::event_stream<not_null<NSPressGestureRecognizer*>> _gestures; rpl::event_stream<not_null<NSPressGestureRecognizer*>> _gestures;
double _r, _g, _b, _a; // The online circle color. CGFloat _r, _g, _b, _a; // The online circle color.
} }
- (void)processHorizontalReorder { - (void)processHorizontalReorder {
@ -710,7 +710,12 @@ TimeId CalculateOnlineTill(not_null<PeerData*> peer) {
}, _lifetime); }, _lifetime);
const auto updateOnlineColor = [=] { 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(); updateOnlineColor();

View File

@ -37,10 +37,18 @@ usedPrefix = libsDir + dirSep + 'local'
processedArgs = [] processedArgs = []
skipReleaseBuilds = False skipReleaseBuilds = False
buildQt5 = True
buildQt6 = False
for arg in sys.argv[1:]: for arg in sys.argv[1:]:
if arg == 'skip-release': if arg == 'skip-release':
processedArgs.append(arg) processedArgs.append(arg)
skipReleaseBuilds = True 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): if not os.path.isdir(libsDir + '/' + keysLoc):
pathlib.Path(libsDir + '/' + keysLoc).mkdir(parents=True, exist_ok=True) pathlib.Path(libsDir + '/' + keysLoc).mkdir(parents=True, exist_ok=True)
@ -379,7 +387,7 @@ def runStages():
stage('patches', """ stage('patches', """
git clone https://github.com/desktop-app/patches.git git clone https://github.com/desktop-app/patches.git
cd patches cd patches
git checkout 5210855985 git checkout 212984972d
""") """)
stage('depot_tools', """ stage('depot_tools', """
@ -798,7 +806,8 @@ release:
cd ..\\..\\.. 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 git clone git://code.qt.io/qt/qt5.git qt_5_15_2
cd qt_5_15_2 cd qt_5_15_2
perl init-repository --module-subset=qtbase,qtimageformats,qtsvg perl init-repository --module-subset=qtbase,qtimageformats,qtsvg
@ -879,6 +888,46 @@ mac:
make install 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', """ stage('tg_owt', """
git clone https://github.com/desktop-app/tg_owt.git git clone https://github.com/desktop-app/tg_owt.git
cd tg_owt cd tg_owt

@ -1 +1 @@
Subproject commit 83aee6211bfe016dc20c8dd9616b1456a9f20c5e Subproject commit a60edf917419407cfe5c6095a56ccf363417ebd8

@ -1 +1 @@
Subproject commit 87b121069f9027a014b499e01b71ddd3180d4f94 Subproject commit 674391524b108cba55aa5ad93c751fc6baf948ee

2
cmake

@ -1 +1 @@
Subproject commit 8540bd0b6007648792e700719b291f83fc75d9da Subproject commit 57ccb6c03c1ff68d294f61e539c34ffbdcc39531