qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, marcandre.lureau@redhat.com
Subject: Re: [PATCH 2/2] meson: use subproject for keycodemapdb
Date: Thu, 18 May 2023 13:55:17 +0100	[thread overview]
Message-ID: <ZGYgNYaS5c4Yq8uh@redhat.com> (raw)
In-Reply-To: <20230518124645.1011316-3-pbonzini@redhat.com>

On Thu, May 18, 2023 at 02:46:45PM +0200, Paolo Bonzini wrote:
> By using a subproject, our own meson.build can use variables from
> the subproject instead of hard-coded paths.  In the future, it may
> also be possible to use wrap to download the submodule.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  .gitmodules                      | 4 ++--
>  configure                        | 4 ++--
>  scripts/archive-source.sh        | 2 +-
>  {ui => subprojects}/keycodemapdb | 0
>  ui/meson.build                   | 6 ++++--
>  5 files changed, 9 insertions(+), 7 deletions(-)
>  rename {ui => subprojects}/keycodemapdb (100%)
> 
> diff --git a/.gitmodules b/.gitmodules
> index 3ed5d073d630..f8b2ddf3877c 100644
> --- a/.gitmodules
> +++ b/.gitmodules
> @@ -25,8 +25,8 @@
>  [submodule "roms/QemuMacDrivers"]
>  	path = roms/QemuMacDrivers
>  	url = https://gitlab.com/qemu-project/QemuMacDrivers.git
> -[submodule "ui/keycodemapdb"]
> -	path = ui/keycodemapdb
> +[submodule "subprojects/keycodemapdb"]
> +	path = subprojects/keycodemapdb
>  	url = https://gitlab.com/qemu-project/keycodemapdb.git
>  [submodule "roms/seabios-hppa"]
>  	path = roms/seabios-hppa
> diff --git a/configure b/configure
> index 5bbca83d9a31..2b6995e16756 100755
> --- a/configure
> +++ b/configure
> @@ -254,7 +254,7 @@ else
>      git_submodules_action="ignore"
>  fi
>  
> -git_submodules="ui/keycodemapdb"
> +git_submodules="subprojects/keycodemapdb"
>  git="git"
>  debug_tcg="no"
>  docs="auto"
> @@ -806,7 +806,7 @@ case $git_submodules_action in
>          fi
>      ;;
>      ignore)
> -        if ! test -f "$source_path/ui/keycodemapdb/README"
> +        if ! test -f "$source_path/subprojects/keycodemapdb/README"
>          then
>              echo
>              echo "ERROR: missing GIT submodules"
> diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh
> index b15f6fe6b8fe..a0a3153faa99 100755
> --- a/scripts/archive-source.sh
> +++ b/scripts/archive-source.sh
> @@ -26,7 +26,7 @@ sub_file="${sub_tdir}/submodule.tar"
>  # independent of what the developer currently has initialized
>  # in their checkout, because the build environment is completely
>  # different to the host OS.
> -submodules="subprojects/dtc meson ui/keycodemapdb"
> +submodules="subprojects/dtc meson subprojects/keycodemapdb"
>  submodules="$submodules tests/fp/berkeley-softfloat-3 tests/fp/berkeley-testfloat-3"
>  sub_deinit=""
>  
> diff --git a/ui/keycodemapdb b/subprojects/keycodemapdb
> similarity index 100%
> rename from ui/keycodemapdb
> rename to subprojects/keycodemapdb
> diff --git a/ui/meson.build b/ui/meson.build
> index 330369707dd7..e24d52b89941 100644
> --- a/ui/meson.build
> +++ b/ui/meson.build
> @@ -162,13 +162,15 @@ keymaps = [
>  ]
>  
>  if have_system or xkbcommon.found()
> +  keycodemapdb_proj = subproject('keycodemapdb', required: true)
> +  keymap_gen = find_program('keymap-gen', required: true)

This variable isn't used, is it ?

>    foreach e : keymaps
>      output = 'input-keymap-@0@-to-@1@.c.inc'.format(e[0], e[1])
>      genh += custom_target(output,
>                    output: output,
>                    capture: true,
> -                  input: files('keycodemapdb/data/keymaps.csv'),
> -                  command: [python, files('keycodemapdb/tools/keymap-gen'),
> +                  input: keycodemapdb_proj.get_variable('keymaps_csv'),
> +                  command: [python, keycodemapdb_proj.get_variable('keymap_gen'),
>                              'code-map',
>                              '--lang', 'glib2',
>                              '--varname', 'qemu_input_map_@0@_to_@1@'.format(e[0], e[1]),


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2023-05-18 12:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18 12:46 [PATCH 0/2] meson: use subprojects for bundled projects Paolo Bonzini
2023-05-18 12:46 ` [PATCH 1/2] meson: use subproject for internal libfdt Paolo Bonzini
2023-05-18 12:46 ` [PATCH 2/2] meson: use subproject for keycodemapdb Paolo Bonzini
2023-05-18 12:55   ` Daniel P. Berrangé [this message]
2023-05-18 13:00     ` Paolo Bonzini
2023-05-18 14:01       ` Daniel P. Berrangé

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=ZGYgNYaS5c4Yq8uh@redhat.com \
    --to=berrange@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@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).