With this patch, qemu requires keyboard-config when libxkbcommon is found on the system. So if the qemu is configured when libxkbcommon is installed but not keyboard-config, the configure stage will produce an error message, thus avoid coredump in the build stage.
From e0b1e479e8a82f7a7940ca70b5136bf10e36756b Mon Sep 17 00:00:00 2001
From: Zhang Wen <zhw2101...@gmail.com>
Date: Fri, 26 Jan 2024 17:09:10 +0800
Subject: [PATCH] requires xkeyboard-config when libxkbcommon is available to
 avoid build error

Signed-off-by: Zhang Wen <zhw2101...@gmail.com>
---
 meson.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index d0329966f1..233c006754 100644
--- a/meson.build
+++ b/meson.build
@@ -1093,6 +1093,7 @@ else
   xkbcommon = dependency('xkbcommon', required: get_option('xkbcommon'),
                          method: 'pkg-config')
 endif
+xkeyboard_config = dependency('xkeyboard-config')
 
 slirp = not_found
 if not get_option('slirp').auto() or have_system
@@ -3978,7 +3979,7 @@ subdir('qga')
 if xkbcommon.found()
   # used for the update-keymaps target, so include rules even if !have_tools
   qemu_keymap = executable('qemu-keymap', files('qemu-keymap.c', 
'ui/input-keymap.c') + genh,
-                           dependencies: [qemuutil, xkbcommon], install: 
have_tools)
+                           dependencies: [qemuutil, xkbcommon, 
xkeyboard_config], install: have_tools)
 endif
 
 if have_tools
-- 
2.43.0

Reply via email to