qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Carlos Santos <casantos@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org
Subject: Re: [PATCH] meson: allow disablind the installation of keymaps
Date: Wed, 4 Jan 2023 16:15:34 +0100	[thread overview]
Message-ID: <4c891001-4744-c174-7459-d13903037990@linaro.org> (raw)
In-Reply-To: <CAC1VKkOzUsh-EZfwSRbGRC13auykBL5jmszpStw=GHcgx9G6Vw@mail.gmail.com>

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	other threads:[~2023-01-04 15:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-02 16:19 [PATCH] meson: allow disablind the installation of keymaps casantos
2023-01-04 14:49 ` Carlos Santos
2023-01-04 15:15   ` Philippe Mathieu-Daudé [this message]
2023-01-04 16:48     ` Carlos Santos
2023-03-26 21:10 ` Carlos Santos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4c891001-4744-c174-7459-d13903037990@linaro.org \
    --to=philmd@linaro.org \
    --cc=casantos@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).