Merge pull request #110605 from veprbl/pr/qt515_qtwebengine_darwin_patch_update

qt515.qtwebengine: update darwin patches
This commit is contained in:
Dmitry Kalinkin 2021-02-02 13:34:18 -05:00 committed by GitHub
commit 6ba1fbdd37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 58 additions and 28 deletions

View File

@ -84,7 +84,10 @@ let
qtscript = [ ./qtscript.patch ]; qtscript = [ ./qtscript.patch ];
qtserialport = [ ./qtserialport.patch ]; qtserialport = [ ./qtserialport.patch ];
qtwebengine = [ ] qtwebengine = [ ]
++ optional stdenv.isDarwin ./qtwebengine-darwin-no-platform-check.patch; ++ optionals stdenv.isDarwin [
./qtwebengine-darwin-no-platform-check.patch
./qtwebengine-mac-dont-set-dsymutil-path.patch
];
qtwebkit = [ qtwebkit = [
(fetchpatch { (fetchpatch {
name = "qtwebkit-bison-3.7-build.patch"; name = "qtwebkit-bison-3.7-build.patch";

View File

@ -1,27 +1,31 @@
diff --git a/mkspecs/features/platform.prf b/mkspecs/features/platform.prf diff a/configure.pri b/configure.pri
--- a/mkspecs/features/platform.prf --- a/configure.pri
+++ b/mkspecs/features/platform.prf +++ b/configure.pri
@@ -40,8 +40,6 @@ defineTest(isPlatformSupported) { @@ -439,8 +439,6 @@ defineTest(qtwebengine_isWindowsPlatformSupported) {
} else:osx {
# FIXME: Try to get it back down to 8.2 for building on OS X 10.11 defineTest(qtwebengine_isMacOsPlatformSupported) {
!isMinXcodeVersion(8, 3, 3) { !qtwebengine_isMinXcodeVersion(10, 0, 0) {
- skipBuild("Using Xcode version $$QMAKE_XCODE_VERSION, but at least version 8.3.3 is required to build Qt WebEngine.") - qtwebengine_platformError("requires at least version 10.0.0, but using Xcode version $${QMAKE_XCODE_VERSION}.")
- return(false) - return(false)
} }
!clang|intel_icc { !clang|intel_icc {
skipBuild("Qt WebEngine on macOS requires Clang.") qtwebengine_platformError("requires Clang.")
@@ -54,8 +52,6 @@ defineTest(isPlatformSupported) { @@ -449,12 +447,6 @@ defineTest(qtwebengine_isMacOsPlatformSupported) {
return(false) # We require macOS 10.13 (darwin version 17.0.0) or newer.
darwin_major_version = $$section(QMAKE_HOST.version, ., 0, 0)
lessThan(darwin_major_version, 17) {
- qtwebengine_platformError("requires macOS version 10.13 or newer.")
- return(false)
- }
- !qtwebengine_isMinOSXSDKVersion(10, 13): {
- qtwebengine_platformError("requires a macOS SDK version of 10.13 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.")
- return(false)
} }
!isMinOSXSDKVersion(10, 12): { return(true)
- skipBuild("Building Qt WebEngine requires a macOS SDK version of 10.12 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.") }
- return(false) diff a/src/buildtools/config/mac_osx.pri b/src/buildtools/config/mac_osx.pri
} --- a/src/buildtools/config/mac_osx.pri
} else { +++ b/src/buildtools/config/mac_osx.pri
skipBuild("Unknown platform. Qt WebEngine only supports Linux, Windows, and macOS.")
diff --git a/src/core/config/mac_osx.pri b/src/core/config/mac_osx.pri
--- a/src/core/config/mac_osx.pri
+++ b/src/core/config/mac_osx.pri
@@ -5,8 +5,6 @@ load(functions) @@ -5,8 +5,6 @@ load(functions)
# otherwise query for it. # otherwise query for it.
QMAKE_MAC_SDK_VERSION = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.SDKVersion) QMAKE_MAC_SDK_VERSION = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.SDKVersion)
@ -29,5 +33,5 @@ diff --git a/src/core/config/mac_osx.pri b/src/core/config/mac_osx.pri
- QMAKE_MAC_SDK_VERSION = $$system("/usr/bin/xcodebuild -sdk $${QMAKE_MAC_SDK} -version SDKVersion 2>/dev/null") - QMAKE_MAC_SDK_VERSION = $$system("/usr/bin/xcodebuild -sdk $${QMAKE_MAC_SDK} -version SDKVersion 2>/dev/null")
- isEmpty(QMAKE_MAC_SDK_VERSION): error("Could not resolve SDK version for \'$${QMAKE_MAC_SDK}\'") - isEmpty(QMAKE_MAC_SDK_VERSION): error("Could not resolve SDK version for \'$${QMAKE_MAC_SDK}\'")
} }
QMAKE_CLANG_DIR = "/usr" # chromium/build/mac/find_sdk.py expects the SDK version (mac_sdk_min) in Major.Minor format.

View File

@ -0,0 +1,12 @@
diff a/src/3rdparty/chromium/build/toolchain/mac/BUILD.gn b/src/3rdparty/chromium/build/toolchain/mac/BUILD.gn
--- a/src/3rdparty/chromium/build/toolchain/mac/BUILD.gn
+++ b/src/3rdparty/chromium/build/toolchain/mac/BUILD.gn
@@ -184,8 +184,6 @@ template("mac_toolchain") {
# If dSYMs are enabled, this flag will be added to the link tools.
if (_enable_dsyms) {
dsym_switch = " -Wcrl,dsym,{{root_out_dir}} "
- dsym_switch += "-Wcrl,dsymutilpath," +
- "${prefix}dsymutil" + " "
dsym_output_dir =
"{{root_out_dir}}/{{target_output_name}}{{output_extension}}.dSYM"

View File

@ -16,6 +16,7 @@
, cups, darwin, openbsm, runCommand, xcbuild, writeScriptBin , cups, darwin, openbsm, runCommand, xcbuild, writeScriptBin
, ffmpeg_3 ? null , ffmpeg_3 ? null
, lib, stdenv, fetchpatch , lib, stdenv, fetchpatch
, qtCompatVersion
}: }:
with lib; with lib;
@ -66,21 +67,31 @@ qtModule {
sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \ sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \
src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc
'' ''
+ optionalString stdenv.isDarwin ('' + optionalString stdenv.isDarwin (
(if (lib.versionAtLeast qtCompatVersion "5.14") then ''
substituteInPlace src/buildtools/config/mac_osx.pri \
--replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"'
'' else ''
substituteInPlace src/core/config/mac_osx.pri \ substituteInPlace src/core/config/mac_osx.pri \
--replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"' --replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"'
'' '')
# Following is required to prevent a build error: # Following is required to prevent a build error:
# ninja: error: '/nix/store/z8z04p0ph48w22rqzx7ql67gy8cyvidi-SDKs/MacOSX10.12.sdk/usr/include/mach/exc.defs', needed by 'gen/third_party/crashpad/crashpad/util/mach/excUser.c', missing and no known rule to make it # ninja: error: '/nix/store/z8z04p0ph48w22rqzx7ql67gy8cyvidi-SDKs/MacOSX10.12.sdk/usr/include/mach/exc.defs', needed by 'gen/third_party/crashpad/crashpad/util/mach/excUser.c', missing and no known rule to make it
+ '' + ''
substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/BUILD.gn \ substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/BUILD.gn \
--replace '$sysroot/usr' "${darwin.xnu}" --replace '$sysroot/usr' "${darwin.xnu}"
'' ''
+ ''
# Apple has some secret stuff they don't share with OpenBSM # Apple has some secret stuff they don't share with OpenBSM
+ (if (lib.versionAtLeast qtCompatVersion "5.14") then ''
substituteInPlace src/3rdparty/chromium/base/mac/mach_port_rendezvous.cc \
--replace "audit_token_to_pid(request.trailer.msgh_audit)" "request.trailer.msgh_audit.val[5]"
substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/mach/mach_message.cc \
--replace "audit_token_to_pid(audit_trailer->msgh_audit)" "audit_trailer->msgh_audit.val[5]"
'' else ''
substituteInPlace src/3rdparty/chromium/base/mac/mach_port_broker.mm \ substituteInPlace src/3rdparty/chromium/base/mac/mach_port_broker.mm \
--replace "audit_token_to_pid(msg.trailer.msgh_audit)" "msg.trailer.msgh_audit.val[5]" --replace "audit_token_to_pid(msg.trailer.msgh_audit)" "msg.trailer.msgh_audit.val[5]"
'')
+ ''
substituteInPlace src/3rdparty/chromium/sandbox/mac/BUILD.gn \ substituteInPlace src/3rdparty/chromium/sandbox/mac/BUILD.gn \
--replace 'libs = [ "sandbox" ]' 'libs = [ "/usr/lib/libsandbox.1.dylib" ]' --replace 'libs = [ "sandbox" ]' 'libs = [ "/usr/lib/libsandbox.1.dylib" ]'
''); '');