From a74a1f32517b61107bd28f3b54cd49a6fc8db82c Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 30 Jan 2022 05:47:22 +0000 Subject: [PATCH] webkitgtk: pull upstream fix for gcc-12 Without the change the build will fail on gcc-12 as: Source/WTF/wtf/CompletionHandler.h: In member function 'Out WTF::CompletionHandler::operator()(In ...)': Source/WTF/wtf/CompletionHandler.h:67:21: error: 'exchange' is not a member of 'std' 67 | return std::exchange(m_function, nullptr)(std::forward(in)...); | ^~~~~~~~ --- .../libraries/webkitgtk/default.nix | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pkgs/development/libraries/webkitgtk/default.nix b/pkgs/development/libraries/webkitgtk/default.nix index e9026d46bc69..ad8711cb9dd3 100644 --- a/pkgs/development/libraries/webkitgtk/default.nix +++ b/pkgs/development/libraries/webkitgtk/default.nix @@ -1,6 +1,7 @@ { lib, stdenv , runCommand , fetchurl +, fetchpatch , perl , python3 , ruby @@ -82,6 +83,30 @@ stdenv.mkDerivation rec { inherit (addOpenGLRunpath) driverLink; }) ./libglvnd-headers.patch + + # Pull upstream patches for missing includes on gcc-12: + # https://trac.webkit.org/changeset/288379/webkit + (fetchpatch { + name = "exchange-gcc-12.patch"; + url = "https://github.com/WebKit/WebKit/commit/198b392130b8dd625f4d5d36e652954eececb16b.patch"; + excludes = [ + "Source/JavaScriptCore/ChangeLog" + "Source/WTF/ChangeLog" + "Source/WebCore/ChangeLog" + "Tools/ChangeLog" + + "Tools/ImageDiff/ImageDiff.cpp" + ]; + sha256 = "sha256-D+wxfM8AEMBfvpghrwa5v9cYLyK5+Sab3J0RE/xVar8="; + }) + (fetchpatch { + name = "string-gcc-12.patch"; + url = "https://github.com/WebKit/WebKit/commit/4e3fade6bd89347e041a1938d4ea85fee14e5534.patch"; + excludes = [ + "Source/WTF/ChangeLog" + ]; + sha256 = "sha256-NPqZLfMUR6InQuqfVwNoZwuM3Jtbz5KAbm9SUBaprmc="; + }) ]; preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''