Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qt5: Apple OSs don't require CROSS_COMPILE option #15056

Merged
merged 2 commits into from
Jan 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions recipes/qt/5.x.x/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ sources:
sha256: "5a97827bdf9fd515f43bc7651defaf64fecb7a55e051c79b8f80510d0e990f06"
patches:
"5.15.7":
- patch_file: "patches/337f28c9ab.patch"
base_path: "qt5/qtbase"
- patch_file: "patches/aa2a39dea5.diff"
base_path: "qt5/qtbase"
- patch_file: "patches/c72097e.diff"
Expand All @@ -45,6 +47,8 @@ patches:
- patch_file: "patches/0001-Find-fontconfig-using-pkg-config.patch"
base_path: "qt5/qtwebengine/src/3rdparty"
"5.15.6":
- patch_file: "patches/337f28c9ab.patch"
base_path: "qt5/qtbase"
- patch_file: "patches/aa2a39dea5.diff"
base_path: "qt5/qtbase"
- patch_file: "patches/c72097e.diff"
Expand All @@ -68,6 +72,8 @@ patches:
- patch_file: "patches/0001-Find-fontconfig-using-pkg-config.patch"
base_path: "qt5/qtwebengine/src/3rdparty"
"5.15.5":
- patch_file: "patches/337f28c9ab-5.15.5.patch"
base_path: "qt5/qtbase"
- patch_file: "patches/aa2a39dea5.diff"
base_path: "qt5/qtbase"
- patch_file: "patches/c72097e.diff"
Expand Down
2 changes: 1 addition & 1 deletion recipes/qt/5.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def validate(self):
if self.settings.os in ['Linux', 'FreeBSD'] and self.options.with_gssapi:
raise ConanInvalidConfiguration("gssapi cannot be enabled until conan-io/conan-center-index#4102 is closed")

if cross_building(self) and self.options.cross_compile == "None":
if cross_building(self) and self.options.cross_compile == "None" and not is_apple_os(self):
raise ConanInvalidConfiguration("option cross_compile must be set for cross compilation "
"cf https://doc.qt.io/qt-5/configure-options.html#cross-compilation-options")

Expand Down
40 changes: 40 additions & 0 deletions recipes/qt/5.x.x/patches/337f28c9ab-5.15.5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From 337f28c9abb12f28538cfe2f49e5afc460578b32 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= <tor.arne.vestbo@qt.io>
Date: Tue, 5 Jul 2022 15:38:33 +0200
Subject: Darwin: Replace deprecated symbol kIOMasterPortDefault with
equivalent

We can't use the replacement kIOMainPortDefault yet, as it's not
available in operating system versions we still support, but the
kIOMasterPortDefault documentation explicitly says that passing
NULL as a port argument indicates "use the default".

As the underlying type of a mach_port_t is potentially either
a pointer or an unsigned int, we initialize the default to 0.

Pick-to: 6.2 6.3 6.4 5.15
Change-Id: I288aa94b8f2fbda47fd1cbaf329799db7ab988a0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
---
src/corelib/global/qglobal.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'src/corelib/global/qglobal.cpp')

diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 738e39658f..c894471ad6 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -3059,7 +3059,8 @@ QByteArray QSysInfo::machineUniqueId()
{
#if defined(Q_OS_DARWIN) && __has_include(<IOKit/IOKitLib.h>)
char uuid[UuidStringLen + 1];
- io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice"));
+ static const mach_port_t defaultPort = 0; // Effectively kIOMasterPortDefault/kIOMainPortDefault
+ io_service_t service = IOServiceGetMatchingService(defaultPort, IOServiceMatching("IOPlatformExpertDevice"));
QCFString stringRef = (CFStringRef)IORegistryEntryCreateCFProperty(service, CFSTR(kIOPlatformUUIDKey), kCFAllocatorDefault, 0);
CFStringGetCString(stringRef, uuid, sizeof(uuid), kCFStringEncodingMacRoman);
return QByteArray(uuid);
--
cgit v1.2.1

40 changes: 40 additions & 0 deletions recipes/qt/5.x.x/patches/337f28c9ab.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From 337f28c9abb12f28538cfe2f49e5afc460578b32 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= <tor.arne.vestbo@qt.io>
Date: Tue, 5 Jul 2022 15:38:33 +0200
Subject: Darwin: Replace deprecated symbol kIOMasterPortDefault with
equivalent

We can't use the replacement kIOMainPortDefault yet, as it's not
available in operating system versions we still support, but the
kIOMasterPortDefault documentation explicitly says that passing
NULL as a port argument indicates "use the default".

As the underlying type of a mach_port_t is potentially either
a pointer or an unsigned int, we initialize the default to 0.

Pick-to: 6.2 6.3 6.4 5.15
Change-Id: I288aa94b8f2fbda47fd1cbaf329799db7ab988a0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
---
src/corelib/global/qglobal.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'src/corelib/global/qglobal.cpp')

diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 738e39658f..c894471ad6 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -3067,7 +3067,8 @@ QByteArray QSysInfo::machineUniqueId()
{
#if defined(Q_OS_DARWIN) && __has_include(<IOKit/IOKitLib.h>)
char uuid[UuidStringLen + 1];
- io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice"));
+ static const mach_port_t defaultPort = 0; // Effectively kIOMasterPortDefault/kIOMainPortDefault
+ io_service_t service = IOServiceGetMatchingService(defaultPort, IOServiceMatching("IOPlatformExpertDevice"));
QCFString stringRef = (CFStringRef)IORegistryEntryCreateCFProperty(service, CFSTR(kIOPlatformUUIDKey), kCFAllocatorDefault, 0);
CFStringGetCString(stringRef, uuid, sizeof(uuid), kCFStringEncodingMacRoman);
return QByteArray(uuid);
--
cgit v1.2.1