Skip to content

Commit ec76bad

Browse files
committed
build, qt: Fix static builds on macOS Big Sur
See details and the patch: https://bugreports.qt.io/browse/QTBUG-87014
1 parent ed49203 commit ec76bad

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

depends/packages/qt.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ $(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_no_printer.patch no
1010
$(package)_patches+= fix_android_qmake_conf.patch fix_android_jni_static.patch dont_hardcode_pwd.patch
1111
$(package)_patches+= drop_lrelease_dependency.patch no_sdk_version_check.patch
1212
$(package)_patches+= fix_qpainter_non_determinism.patch fix_lib_paths.patch fix_android_pch.patch
13+
$(package)_patches+= fix_bigsur_drawing.patch
1314

1415
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
1516
$(package)_qttranslations_sha256_hash=e1de58ed108b7e0a138815ea60fd46a2c4e1fc31396a707e5630e92de79c53de
@@ -230,6 +231,7 @@ define $(package)_preprocess_cmds
230231
patch -p1 -i $($(package)_patch_dir)/fix_qpainter_non_determinism.patch &&\
231232
patch -p1 -i $($(package)_patch_dir)/no_sdk_version_check.patch && \
232233
patch -p1 -i $($(package)_patch_dir)/fix_lib_paths.patch && \
234+
patch -p1 -i $($(package)_patch_dir)/fix_bigsur_drawing.patch && \
233235
sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \
234236
mkdir -p qtbase/mkspecs/macx-clang-linux &&\
235237
cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Fix GUI stuck on Big Sur
2+
3+
See:
4+
- https://github.com/bitcoin-core/gui/issues/249
5+
- https://github.com/bitcoin/bitcoin/pull/21495
6+
- https://bugreports.qt.io/browse/QTBUG-87014
7+
8+
We should be able to drop this once we are using one of the following versions:
9+
- Qt 5.12.11 or later, see upstream commit: c5d904639dbd690a36306e2b455610029704d821
10+
- Qt 5.15.3 or later, see upstream commit: 2cae34354bd41ae286258c7a6b3653b746e786ae
11+
12+
--- a/qtbase/src/plugins/platforms/cocoa/qnsview_drawing.mm
13+
+++ b/qtbase/src/plugins/platforms/cocoa/qnsview_drawing.mm
14+
@@ -95,8 +95,15 @@
15+
// by AppKit at a point where we've already set up other parts of the platform plugin
16+
// based on the presence of layers or not. Once we've rewritten these parts to support
17+
// dynamically picking up layer enablement we can let AppKit do its thing.
18+
- return QMacVersion::buildSDK() >= QOperatingSystemVersion::MacOSMojave
19+
- && QMacVersion::currentRuntime() >= QOperatingSystemVersion::MacOSMojave;
20+
+
21+
+ if (QMacVersion::currentRuntime() >= QOperatingSystemVersion::MacOSBigSur)
22+
+ return true; // Big Sur always enables layer-backing, regardless of SDK
23+
+
24+
+ if (QMacVersion::currentRuntime() >= QOperatingSystemVersion::MacOSMojave
25+
+ && QMacVersion::buildSDK() >= QOperatingSystemVersion::MacOSMojave)
26+
+ return true; // Mojave and Catalina enable layers based on the app's SDK
27+
+
28+
+ return false; // Prior versions needed explicitly enabled layer backing
29+
}
30+
31+
- (BOOL)layerExplicitlyRequested

0 commit comments

Comments
 (0)