Skip to contentSkip to conversation

meson: fix keymaps witout qemu-keymap

PATCH In review Gerd Hoffmann 3 participants 3 messages Aug 27, 2020 – Aug 31, 2020 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 meson: fix keymaps witout qemu-keymap

In case the qemu-keymap tool generating them is neither installed on the system nor built from sources (due to xkbcommon not being available) qemu will not find the keymaps when started directly from the build tree,

This happens because commit ddcf607fa3d6 ("meson: drop keymaps symlink") removed the symlink to the source tree, and the special handling for install doesn't help in case we do not install qemu.

Lets fix that by simply copying over the file from the source tree as fallback.

---
 pc-bios/keymaps/meson.build | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)
pc-bios/keymaps/meson.build +19 -9
index b737c8223031..e102dd56b454 100644
@@ -38,19 +38,29 @@ if meson.is_cross_build() or 'CONFIG_XKBCOMMON' not in config_host
 else
   native_qemu_keymap = qemu_keymap
 endif
+
 t = []
 foreach km, args: keymaps
-  t += custom_target(km,
-                     build_by_default: true,
-                     output: km,
-                     command: [native_qemu_keymap, '-f', '@OUTPUT@', args.split()],
-                     install_dir: config_host['qemu_datadir'] / 'keymaps')
+  if native_qemu_keymap.found()
+    # generate with qemu-kvm
+    t += custom_target(km,
+                       build_by_default: true,
+                       output: km,
+                       command: [native_qemu_keymap, '-f', '@OUTPUT@', args.split()],
+                       install_dir: config_host['qemu_datadir'] / 'keymaps')
+  else
+    # copy from source tree
+    t += custom_target(km,
+                       build_by_default: true,
+		       input: km,
+                       output: km,
+                       command: ['cp', '@INPUT@', '@OUTPUT@'],
+                       install_dir: config_host['qemu_datadir'] / 'keymaps')
+  endif
 endforeach
-if t.length() > 0
+
+if native_qemu_keymap.found()
   alias_target('update-keymaps', t)
-else
-  # install from the source tree
-  install_data(keymaps.keys(), install_dir: config_host['qemu_datadir'] / 'keymaps')
 endif
 
 install_data(['sl', 'sv'], install_dir: config_host['qemu_datadir'] / 'keymaps')
Signature · 1 line
2.27.0
Tested-by on v1 1/1
#1 lore raw
Quoted 9 lines · Gerd Hoffmann

In case the qemu-keymap tool generating them is neither installed on the system nor built from sources (due to xkbcommon not being available) qemu will not find the keymaps when started directly from the build tree,

This happens because commit ddcf607fa3d6 ("meson: drop keymaps symlink") removed the symlink to the source tree, and the special handling for install doesn't help in case we do not install qemu.

Quoted 8 lines

Lets fix that by simply copying over the file from the source tree as fallback.

---
 pc-bios/keymaps/meson.build | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

Thanks, this fixes the acceptance tests on gitlab-CI for me!

#2 lore raw

Typo "without" in subject.

Quoted 25 lines · Thomas Huth
Quoted 9 lines · Gerd Hoffmann

In case the qemu-keymap tool generating them is neither installed on the system nor built from sources (due to xkbcommon not being available) qemu will not find the keymaps when started directly from the build tree,

This happens because commit ddcf607fa3d6 ("meson: drop keymaps symlink") removed the symlink to the source tree, and the special handling for install doesn't help in case we do not install qemu.

Quoted 8 lines

Lets fix that by simply copying over the file from the source tree as fallback.

---
 pc-bios/keymaps/meson.build | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

Thanks, this fixes the acceptance tests on gitlab-CI for me!