qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] meson: allow disablind the installation of keymaps


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] meson: allow disablind the installation of keymaps
Date: Wed, 4 Jan 2023 16:15:34 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1

On 4/1/23 15:49, Carlos Santos wrote:
On Mon, Jan 2, 2023 at 1:19 PM <casantos@redhat.com> wrote:

From: Carlos Santos <casantos@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 <casantos@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


Thinking a bit more about this patch, I think the correct approach
would be to install blobs and keymaps depending on have_system:

     [...]
     install: have_system,
     [...]

And use the same approach for trace-events-all, in trace/meson.build:

     [...]
     install: have_linux_user or have_bsd_user or have_system,
     [...]

This would prevent installing useless data.

Yes, similar to:
https://lore.kernel.org/qemu-devel/20210323155132.238193-1-f4bug@amsat.org/




reply via email to

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