git: 684427097cfe - main - www/qt6-webengine: Fix hardcoded path

From: Guido Falsi <madpilot_at_FreeBSD.org>
Date: Sun, 15 Jan 2023 20:29:52 UTC
The branch main has been updated by madpilot:

URL: https://cgit.FreeBSD.org/ports/commit/?id=684427097cfe719882adef380fcae0142d375fef

commit 684427097cfe719882adef380fcae0142d375fef
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2023-01-15 20:27:35 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2023-01-15 20:27:35 +0000

    www/qt6-webengine: Fix hardcoded path
    
    Replace hardcoded path causing runtime failures by replacing with
    LOCALBASE.
    
    Approved by:            kde (kai)
    Fixes:                  3227b809dd69aa15c0798b4e5ffaa5adc9fe0b98
    Differential Revision:  https://reviews.freebsd.org/D38067
---
 www/qt6-webengine/Makefile                           |  4 +++-
 ...ozone_layout_xkb_xkb__keyboard__layout__engine.cc | 20 ++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/www/qt6-webengine/Makefile b/www/qt6-webengine/Makefile
index b9a0e87c6be4..af9590a670e6 100644
--- a/www/qt6-webengine/Makefile
+++ b/www/qt6-webengine/Makefile
@@ -15,6 +15,7 @@
 
 PORTNAME=	webengine
 DISTVERSION=	${QT6_VERSION}
+PORTREVISION=	1
 CATEGORIES=	www
 PKGNAMEPREFIX=	qt6-
 
@@ -124,7 +125,8 @@ post-patch:
 		${WRKSRC}/src/host/BUILD.toolchain.gn.in
 	@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \
 		${WRKSRC}/src/3rdparty/chromium/third_party/pdfium/core/fxge/linux/fx_linux_impl.cpp \
-		${WRKSRC}/src/3rdparty/chromium/third_party/wayland/features.gni
+		${WRKSRC}/src/3rdparty/chromium/third_party/wayland/features.gni \
+		${WRKSRC}/src/3rdparty/chromium/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc
 
 pre-configure:
 # We used to remove bundled libraries to be sure that webengine uses
diff --git a/www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_events_ozone_layout_xkb_xkb__keyboard__layout__engine.cc b/www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_events_ozone_layout_xkb_xkb__keyboard__layout__engine.cc
new file mode 100644
index 000000000000..97d3d0c562d1
--- /dev/null
+++ b/www/qt6-webengine/files/patch-src_3rdparty_chromium_ui_events_ozone_layout_xkb_xkb__keyboard__layout__engine.cc
@@ -0,0 +1,20 @@
+--- src/3rdparty/chromium/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc.orig	2022-12-12 18:53:13 UTC
++++ src/3rdparty/chromium/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc
+@@ -638,7 +638,7 @@ void LoadKeymap(const std::string& layout_name,
+                           .options = ""};
+   std::unique_ptr<xkb_context, XkbContextDeleter> context;
+   context.reset(xkb_context_new(XKB_CONTEXT_NO_DEFAULT_INCLUDES));
+-  xkb_context_include_path_append(context.get(), "/usr/share/X11/xkb");
++  xkb_context_include_path_append(context.get(), "%%LOCALBASE%%/share/X11/xkb");
+   std::unique_ptr<xkb_keymap, XkbKeymapDeleter> keymap;
+   keymap.reset(xkb_keymap_new_from_names(context.get(), &names,
+                                          XKB_KEYMAP_COMPILE_NO_FLAGS));
+@@ -672,7 +672,7 @@ XkbKeyboardLayoutEngine::XkbKeyboardLayoutEngine(
+   // TODO: add XKB_CONTEXT_NO_ENVIRONMENT_NAMES
+   xkb_context_.reset(xkb_context_new(XKB_CONTEXT_NO_DEFAULT_INCLUDES));
+   xkb_context_include_path_append(xkb_context_.get(),
+-                                  "/usr/share/X11/xkb");
++                                  "%%LOCALBASE%%/share/X11/xkb");
+ }
+ 
+ XkbKeyboardLayoutEngine::~XkbKeyboardLayoutEngine() {