diff --git a/pkgs/development/libraries/qt-6/modules/qtwebengine.nix b/pkgs/development/libraries/qt-6/modules/qtwebengine.nix index 3741b7c6b6f0..fadbc5d2bfa3 100644 --- a/pkgs/development/libraries/qt-6/modules/qtwebengine.nix +++ b/pkgs/development/libraries/qt-6/modules/qtwebengine.nix @@ -127,10 +127,14 @@ qtModule { # which cannot be set at the same time as -Wformat-security hardeningDisable = [ "format" ]; - # removes macOS 12+ dependencies patches = [ + # removes macOS 12+ dependencies ../patches/qtwebengine-darwin-no-low-latency-flag.patch ../patches/qtwebengine-darwin-no-copy-certificate-chain.patch + # Don't assume /usr/share/X11, and also respect the XKB_CONFIG_ROOT + # environment variable, since NixOS relies on it working. + # See https://github.com/NixOS/nixpkgs/issues/226484 for more context. + ../patches/qtwebengine-xkb-includes.patch ]; postPatch = '' @@ -161,9 +165,6 @@ qtModule { sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \ src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc - - substituteInPlace src/3rdparty/chromium/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc \ - --replace "/usr/share/X11/xkb" "${xkeyboard_config}/share/X11/xkb" '' + lib.optionalString stdenv.isDarwin '' substituteInPlace configure.cmake \ diff --git a/pkgs/development/libraries/qt-6/patches/qtwebengine-xkb-includes.patch b/pkgs/development/libraries/qt-6/patches/qtwebengine-xkb-includes.patch new file mode 100644 index 000000000000..5056550ccecd --- /dev/null +++ b/pkgs/development/libraries/qt-6/patches/qtwebengine-xkb-includes.patch @@ -0,0 +1,12 @@ +--- a/src/3rdparty/chromium/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc 2023-04-19 21:58:29.127258300 +0900 ++++ b/src/3rdparty/chromium/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc 2023-04-19 22:01:35.860196284 +0900 +@@ -637,8 +637,7 @@ + .variant = layout_variant.c_str(), + .options = ""}; + std::unique_ptr context; +- context.reset(xkb_context_new(XKB_CONTEXT_NO_DEFAULT_INCLUDES)); +- xkb_context_include_path_append(context.get(), "/usr/share/X11/xkb"); ++ context.reset(xkb_context_new(XKB_CONTEXT_NO_FLAGS)); + std::unique_ptr keymap; + keymap.reset(xkb_keymap_new_from_names(context.get(), &names, + XKB_KEYMAP_COMPILE_NO_FLAGS));