Merge pull request #110605 from veprbl/pr/qt515_qtwebengine_darwin_patch_update

qt515.qtwebengine: update darwin patches

authored by Dmitry Kalinkin and committed by GitHub 6ba1fbdd 6f7290c8

+58 -28
+4 -1
pkgs/development/libraries/qt-5/5.15/default.nix
··· 84 84 qtscript = [ ./qtscript.patch ]; 85 85 qtserialport = [ ./qtserialport.patch ]; 86 86 qtwebengine = [ ] 87 - ++ optional stdenv.isDarwin ./qtwebengine-darwin-no-platform-check.patch; 87 + ++ optionals stdenv.isDarwin [ 88 + ./qtwebengine-darwin-no-platform-check.patch 89 + ./qtwebengine-mac-dont-set-dsymutil-path.patch 90 + ]; 88 91 qtwebkit = [ 89 92 (fetchpatch { 90 93 name = "qtwebkit-bison-3.7-build.patch";
+27 -23
pkgs/development/libraries/qt-5/5.15/qtwebengine-darwin-no-platform-check.patch
··· 1 - diff --git a/mkspecs/features/platform.prf b/mkspecs/features/platform.prf 2 - --- a/mkspecs/features/platform.prf 3 - +++ b/mkspecs/features/platform.prf 4 - @@ -40,8 +40,6 @@ defineTest(isPlatformSupported) { 5 - } else:osx { 6 - # FIXME: Try to get it back down to 8.2 for building on OS X 10.11 7 - !isMinXcodeVersion(8, 3, 3) { 8 - - skipBuild("Using Xcode version $$QMAKE_XCODE_VERSION, but at least version 8.3.3 is required to build Qt WebEngine.") 9 - - return(false) 1 + diff a/configure.pri b/configure.pri 2 + --- a/configure.pri 3 + +++ b/configure.pri 4 + @@ -439,8 +439,6 @@ defineTest(qtwebengine_isWindowsPlatformSupported) { 5 + 6 + defineTest(qtwebengine_isMacOsPlatformSupported) { 7 + !qtwebengine_isMinXcodeVersion(10, 0, 0) { 8 + - qtwebengine_platformError("requires at least version 10.0.0, but using Xcode version $${QMAKE_XCODE_VERSION}.") 9 + - return(false) 10 10 } 11 11 !clang|intel_icc { 12 - skipBuild("Qt WebEngine on macOS requires Clang.") 13 - @@ -54,8 +52,6 @@ defineTest(isPlatformSupported) { 14 - return(false) 15 - } 16 - !isMinOSXSDKVersion(10, 12): { 17 - - skipBuild("Building Qt WebEngine requires a macOS SDK version of 10.12 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.") 18 - - return(false) 12 + qtwebengine_platformError("requires Clang.") 13 + @@ -449,12 +447,6 @@ defineTest(qtwebengine_isMacOsPlatformSupported) { 14 + # We require macOS 10.13 (darwin version 17.0.0) or newer. 15 + darwin_major_version = $$section(QMAKE_HOST.version, ., 0, 0) 16 + lessThan(darwin_major_version, 17) { 17 + - qtwebengine_platformError("requires macOS version 10.13 or newer.") 18 + - return(false) 19 + - } 20 + - !qtwebengine_isMinOSXSDKVersion(10, 13): { 21 + - qtwebengine_platformError("requires a macOS SDK version of 10.13 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.") 22 + - return(false) 19 23 } 20 - } else { 21 - skipBuild("Unknown platform. Qt WebEngine only supports Linux, Windows, and macOS.") 22 - diff --git a/src/core/config/mac_osx.pri b/src/core/config/mac_osx.pri 23 - --- a/src/core/config/mac_osx.pri 24 - +++ b/src/core/config/mac_osx.pri 24 + return(true) 25 + } 26 + diff a/src/buildtools/config/mac_osx.pri b/src/buildtools/config/mac_osx.pri 27 + --- a/src/buildtools/config/mac_osx.pri 28 + +++ b/src/buildtools/config/mac_osx.pri 25 29 @@ -5,8 +5,6 @@ load(functions) 26 30 # otherwise query for it. 27 31 QMAKE_MAC_SDK_VERSION = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.SDKVersion) ··· 29 33 - QMAKE_MAC_SDK_VERSION = $$system("/usr/bin/xcodebuild -sdk $${QMAKE_MAC_SDK} -version SDKVersion 2>/dev/null") 30 34 - isEmpty(QMAKE_MAC_SDK_VERSION): error("Could not resolve SDK version for \'$${QMAKE_MAC_SDK}\'") 31 35 } 32 - 33 - QMAKE_CLANG_DIR = "/usr" 36 + 37 + # chromium/build/mac/find_sdk.py expects the SDK version (mac_sdk_min) in Major.Minor format.
+12
pkgs/development/libraries/qt-5/5.15/qtwebengine-mac-dont-set-dsymutil-path.patch
··· 1 + diff a/src/3rdparty/chromium/build/toolchain/mac/BUILD.gn b/src/3rdparty/chromium/build/toolchain/mac/BUILD.gn 2 + --- a/src/3rdparty/chromium/build/toolchain/mac/BUILD.gn 3 + +++ b/src/3rdparty/chromium/build/toolchain/mac/BUILD.gn 4 + @@ -184,8 +184,6 @@ template("mac_toolchain") { 5 + # If dSYMs are enabled, this flag will be added to the link tools. 6 + if (_enable_dsyms) { 7 + dsym_switch = " -Wcrl,dsym,{{root_out_dir}} " 8 + - dsym_switch += "-Wcrl,dsymutilpath," + 9 + - "${prefix}dsymutil" + " " 10 + 11 + dsym_output_dir = 12 + "{{root_out_dir}}/{{target_output_name}}{{output_extension}}.dSYM"
+15 -4
pkgs/development/libraries/qt-5/modules/qtwebengine.nix
··· 16 16 , cups, darwin, openbsm, runCommand, xcbuild, writeScriptBin 17 17 , ffmpeg_3 ? null 18 18 , lib, stdenv, fetchpatch 19 + , qtCompatVersion 19 20 }: 20 21 21 22 with lib; ··· 66 67 sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \ 67 68 src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc 68 69 '' 69 - + optionalString stdenv.isDarwin ('' 70 + + optionalString stdenv.isDarwin ( 71 + (if (lib.versionAtLeast qtCompatVersion "5.14") then '' 72 + substituteInPlace src/buildtools/config/mac_osx.pri \ 73 + --replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"' 74 + '' else '' 70 75 substituteInPlace src/core/config/mac_osx.pri \ 71 76 --replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"' 72 - '' 77 + '') 73 78 # Following is required to prevent a build error: 74 79 # 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 75 80 + '' 76 81 substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/BUILD.gn \ 77 82 --replace '$sysroot/usr' "${darwin.xnu}" 78 83 '' 79 - + '' 80 84 # Apple has some secret stuff they don't share with OpenBSM 85 + + (if (lib.versionAtLeast qtCompatVersion "5.14") then '' 86 + substituteInPlace src/3rdparty/chromium/base/mac/mach_port_rendezvous.cc \ 87 + --replace "audit_token_to_pid(request.trailer.msgh_audit)" "request.trailer.msgh_audit.val[5]" 88 + substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/mach/mach_message.cc \ 89 + --replace "audit_token_to_pid(audit_trailer->msgh_audit)" "audit_trailer->msgh_audit.val[5]" 90 + '' else '' 81 91 substituteInPlace src/3rdparty/chromium/base/mac/mach_port_broker.mm \ 82 92 --replace "audit_token_to_pid(msg.trailer.msgh_audit)" "msg.trailer.msgh_audit.val[5]" 83 - 93 + '') 94 + + '' 84 95 substituteInPlace src/3rdparty/chromium/sandbox/mac/BUILD.gn \ 85 96 --replace 'libs = [ "sandbox" ]' 'libs = [ "/usr/lib/libsandbox.1.dylib" ]' 86 97 '');