[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PULL v3 06/15] meson: fix keymaps without qemu-keymap

From: Thomas Huth
Subject: [PULL v3 06/15] meson: fix keymaps without qemu-keymap
Date: Thu, 3 Sep 2020 14:31:30 +0200

From: Gerd Hoffmann <kraxel@redhat.com>

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

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

Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-Id: <20200827102617.14448-1-kraxel@redhat.com>
[thuth: Rebased, changed "config_host['qemu_datadir']" to "qemu_datadir",
        added Gerd's UNLINK fix to configure script]
Signed-off-by: Thomas Huth <thuth@redhat.com>
 configure                   |  9 +++++++++
 pc-bios/keymaps/meson.build | 28 +++++++++++++++++++---------
 2 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index 5645575688..be5434793c 100755
--- a/configure
+++ b/configure
@@ -8065,6 +8065,9 @@ fi
 # so the build tree will be missing the link back to the new file, and
 # tests might fail. Prefer to keep the relevant files in their own
 # directory and symlink the directory instead.
+# UNLINK is used to remove symlinks from older development versions
+# that might get into the way when doing "git update" without doing
+# a "make distclean" in between.
 DIRS="tests tests/tcg tests/tcg/lm32 tests/qapi-schema tests/qtest/libqos"
 DIRS="$DIRS tests/qtest tests/qemu-iotests tests/vm tests/fp tests/qgraph"
 DIRS="$DIRS docs docs/interop fsdev scsi"
@@ -8081,6 +8084,7 @@ LINKS="$LINKS .gdbinit scripts" # scripts needed by 
relative path in .gdbinit
 LINKS="$LINKS tests/acceptance tests/data"
 LINKS="$LINKS tests/qemu-iotests/check"
 LINKS="$LINKS python"
 for bios_file in \
     $source_path/pc-bios/*.bin \
     $source_path/pc-bios/*.elf \
@@ -8101,6 +8105,11 @@ for f in $LINKS ; do
         symlink "$source_path/$f" "$f"
+for f in $UNLINK ; do
+    if [ -L "$f" ]; then
+        rm -f "$f"
+    fi
 (for i in $cross_cc_vars; do
   export $i
diff --git a/pc-bios/keymaps/meson.build b/pc-bios/keymaps/meson.build
index bbac83ece3..2e2e0dfa3b 100644
--- a/pc-bios/keymaps/meson.build
+++ b/pc-bios/keymaps/meson.build
@@ -38,19 +38,29 @@ if meson.is_cross_build() or 'CONFIG_XKBCOMMON' not in 
   native_qemu_keymap = qemu_keymap
 t = []
 foreach km, args: keymaps
-  t += custom_target(km,
-                     build_by_default: true,
-                     output: km,
-                     command: [native_qemu_keymap, '-f', '@OUTPUT@', 
-                     install_dir: 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@', 
+                       install_dir: 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: qemu_datadir / 'keymaps')
+  endif
-if t.length() > 0
+if native_qemu_keymap.found()
   alias_target('update-keymaps', t)
-  # install from the source tree
-  install_data(keymaps.keys(), install_dir: qemu_datadir / 'keymaps')
 install_data(['sl', 'sv'], install_dir: qemu_datadir / 'keymaps')

reply via email to

[Prev in Thread] Current Thread [Next in Thread]