From: Carlos Santos <casan...@redhat.com>
There are situatuions in which the keyboard maps are not necessary (e.g.
when building only tools or linux-user emulator). Add an option to avoid
installing them, as already possible to do with firmware blobs.
Signed-off-by: Carlos Santos <casan...@redhat.com>
---
configure | 2 ++
meson_options.txt | 2 ++
pc-bios/keymaps/meson.build | 6 ++++--
scripts/meson-buildoptions.sh | 4 ++++
4 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 789a4f6cc9..c6ed6a23d0 100755
--- a/configure
+++ b/configure
@@ -889,6 +889,8 @@ for opt do
;;
--disable-blobs) meson_option_parse --disable-install-blobs ""
;;
+ --disable-keymaps) meson_option_parse --disable-install-keymaps ""
+ ;;
--enable-vfio-user-server) vfio_user_server="enabled"
;;
--disable-vfio-user-server) vfio_user_server="disabled"
diff --git a/meson_options.txt b/meson_options.txt
index 559a571b6b..be27137e98 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -48,6 +48,8 @@ option('module_upgrades', type : 'boolean', value : false,
description: 'try to load modules from alternate paths for upgrades')
option('install_blobs', type : 'boolean', value : true,
description: 'install provided firmware blobs')
+option('install_keymaps', type : 'boolean', value : true,
+ description: 'install provided keyboard maps')
option('sparse', type : 'feature', value : 'auto',
description: 'sparse checker')
option('guest_agent', type : 'feature', value : 'auto',
diff --git a/pc-bios/keymaps/meson.build b/pc-bios/keymaps/meson.build
index 06c75e646b..7d80c23005 100644
--- a/pc-bios/keymaps/meson.build
+++ b/pc-bios/keymaps/meson.build
@@ -47,7 +47,7 @@ if native_qemu_keymap.found()
build_by_default: true,
output: km,
command: [native_qemu_keymap, '-f', '@OUTPUT@',
args.split()],
- install: true,
+ install: get_option('install_keymaps'),
install_dir: qemu_datadir / 'keymaps')
endforeach
@@ -56,4 +56,6 @@ else
install_data(keymaps.keys(), install_dir: qemu_datadir / 'keymaps')
endif
-install_data(['sl', 'sv'], install_dir: qemu_datadir / 'keymaps')
+if get_option('install_keymaps')
+ install_data(['sl', 'sv'], install_dir: qemu_datadir / 'keymaps')
+endif
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index aa6e30ea91..f17d9c196e 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -11,6 +11,8 @@ meson_options_help() {
printf "%s\n" ' --datadir=VALUE Data file directory [share]'
printf "%s\n" ' --disable-coroutine-pool coroutine freelist (better
performance)'
printf "%s\n" ' --disable-install-blobs install provided firmware blobs'
+ printf "%s\n" ' --disable-install-keymaps'
+ printf "%s\n" ' install provided keyboard maps'
printf "%s\n" ' --docdir=VALUE Base directory for documentation
installation'
printf "%s\n" ' (can be empty) [share/doc]'
printf "%s\n" ' --enable-block-drv-whitelist-in-tools'
@@ -291,6 +293,8 @@ _meson_option_parse() {
--includedir=*) quote_sh "-Dincludedir=$2" ;;
--enable-install-blobs) printf "%s" -Dinstall_blobs=true ;;
--disable-install-blobs) printf "%s" -Dinstall_blobs=false ;;
+ --enable-install-keymaps) printf "%s" -Dinstall_keymaps=true ;;
+ --disable-install-keymaps) printf "%s" -Dinstall_keymaps=false ;;
--interp-prefix=*) quote_sh "-Dinterp_prefix=$2" ;;
--enable-jack) printf "%s" -Djack=enabled ;;
--disable-jack) printf "%s" -Djack=disabled ;;
--
2.31.1