All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] meson: Build qemu-keymap when configured using --disable-tools
@ 2020-08-21 16:07 Philippe Mathieu-Daudé
  2020-08-21 16:07 ` [PATCH v3 1/2] meson: convert pc-bios/keymaps/Makefile Philippe Mathieu-Daudé
  2020-08-21 16:07 ` [PATCH v3 2/2] meson: Do not consider qemu-keymap a 'tool' Philippe Mathieu-Daudé
  0 siblings, 2 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-21 16:07 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Paolo Bonzini, Philippe Mathieu-Daudé, Gerd Hoffmann

Fix --enable-system --disable-tools builds.

Marc-André Lureau (1):
  meson: convert pc-bios/keymaps/Makefile

Philippe Mathieu-Daudé (1):
  meson: Do not consider qemu-keymap a 'tool'

 Makefile                    |  8 ------
 meson.build                 | 11 ++++----
 pc-bios/keymaps/Makefile    | 56 -------------------------------------
 pc-bios/keymaps/meson.build | 56 +++++++++++++++++++++++++++++++++++++
 pc-bios/meson.build         |  1 +
 ui/meson.build              |  2 +-
 6 files changed, 64 insertions(+), 70 deletions(-)
 delete mode 100644 pc-bios/keymaps/Makefile
 create mode 100644 pc-bios/keymaps/meson.build

-- 
2.26.2



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v3 1/2] meson: convert pc-bios/keymaps/Makefile
  2020-08-21 16:07 [PATCH v3 0/2] meson: Build qemu-keymap when configured using --disable-tools Philippe Mathieu-Daudé
@ 2020-08-21 16:07 ` Philippe Mathieu-Daudé
  2020-08-24  5:23   ` Gerd Hoffmann
  2020-08-21 16:07 ` [PATCH v3 2/2] meson: Do not consider qemu-keymap a 'tool' Philippe Mathieu-Daudé
  1 sibling, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-21 16:07 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Paolo Bonzini, Philippe Mathieu-Daudé,
	Gerd Hoffmann, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 Makefile                    |  8 ------
 pc-bios/keymaps/Makefile    | 56 -------------------------------------
 pc-bios/keymaps/meson.build | 56 +++++++++++++++++++++++++++++++++++++
 pc-bios/meson.build         |  1 +
 4 files changed, 57 insertions(+), 64 deletions(-)
 delete mode 100644 pc-bios/keymaps/Makefile
 create mode 100644 pc-bios/keymaps/meson.build

diff --git a/Makefile b/Makefile
index 8373ddccc93..ef28ce0361d 100644
--- a/Makefile
+++ b/Makefile
@@ -229,11 +229,6 @@ distclean: clean ninja-distclean
 	rm -f linux-headers/asm
 	rm -Rf .sdk
 
-KEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  no  pt-br  sv \
-ar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
-de-ch  es     fo  fr-ca  hu     ja  mk  pt  sl     tr \
-bepo    cz
-
 ifdef INSTALL_BLOBS
 BLOBS=bios.bin bios-256k.bin bios-microvm.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
 vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin vgabios-virtio.bin \
@@ -298,9 +293,6 @@ endif
 	$(INSTALL_DATA) $(SRC_PATH)/ui/qemu.desktop \
 		"$(DESTDIR)$(qemu_desktopdir)/qemu.desktop"
 	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
-	set -e; for x in $(KEYMAPS); do \
-		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
-	done
 
 ifdef CONFIG_WIN32
 
diff --git a/pc-bios/keymaps/Makefile b/pc-bios/keymaps/Makefile
deleted file mode 100644
index 76217b06896..00000000000
--- a/pc-bios/keymaps/Makefile
+++ /dev/null
@@ -1,56 +0,0 @@
-
-KEYMAP	:= $(shell which qemu-keymap 2>/dev/null)
-
-MAPS	:= ar bepo cz da de de-ch en-us en-gb es et fi fo \
-	   fr fr-be fr-ca fr-ch \
-	   hr hu is it ja lt lv mk nl no pl pt pt-br ru th tr
-
-ar	: MAP_FLAGS :=	-l ar
-bepo	: MAP_FLAGS :=	-l fr -v dvorak
-cz	: MAP_FLAGS :=	-l cz
-da	: MAP_FLAGS :=	-l dk
-de	: MAP_FLAGS :=	-l de -v nodeadkeys
-de-ch	: MAP_FLAGS :=	-l ch
-en-us	: MAP_FLAGS :=	-l us
-en-gb	: MAP_FLAGS :=	-l gb
-es	: MAP_FLAGS :=	-l es
-et	: MAP_FLAGS :=	-l et
-fi	: MAP_FLAGS :=	-l fi
-fo	: MAP_FLAGS :=	-l fo
-fr	: MAP_FLAGS :=	-l fr -v nodeadkeys
-fr-be	: MAP_FLAGS :=	-l be
-fr-ca	: MAP_FLAGS :=	-l ca -v fr
-fr-ch	: MAP_FLAGS :=	-l ch -v fr
-hr	: MAP_FLAGS :=	-l hr
-hu	: MAP_FLAGS :=	-l hu
-is	: MAP_FLAGS :=	-l is
-it	: MAP_FLAGS :=	-l it
-ja	: MAP_FLAGS :=	-l jp -m jp106
-lt	: MAP_FLAGS :=	-l lt
-lv	: MAP_FLAGS :=	-l lv
-mk	: MAP_FLAGS :=	-l mk
-nl	: MAP_FLAGS :=	-l nl
-no	: MAP_FLAGS :=	-l no
-pl	: MAP_FLAGS :=	-l pl
-pt	: MAP_FLAGS :=	-l pt
-pt-br	: MAP_FLAGS :=	-l br
-ru	: MAP_FLAGS :=	-l ru
-th	: MAP_FLAGS :=	-l th
-tr	: MAP_FLAGS :=	-l tr
-
-ifeq ($(KEYMAP),)
-
-all:
-	@echo "nothing to do (qemu-keymap not found)"
-
-else
-
-all: $(MAPS)
-
-clean:
-	rm -f $(MAPS)
-
-$(MAPS): $(KEYMAP) Makefile
-	$(KEYMAP) -f $@ $(MAP_FLAGS)
-
-endif
diff --git a/pc-bios/keymaps/meson.build b/pc-bios/keymaps/meson.build
new file mode 100644
index 00000000000..06fc79b9b3f
--- /dev/null
+++ b/pc-bios/keymaps/meson.build
@@ -0,0 +1,56 @@
+keymaps = {
+  'ar': '-l ar',
+  'bepo': '-l fr -v dvorak',
+  'cz': '-l cz',
+  'da': '-l dk',
+  'de': '-l de -v nodeadkeys',
+  'de-ch': '-l ch',
+  'en-gb': '-l us',
+  'en-us': '-l gb',
+  'es': '-l es',
+  'et': '-l et',
+  'fi': '-l fi',
+  'fo': '-l fo',
+  'fr': '-l fr -v nodeadkeys',
+  'fr-be': '-l be',
+  'fr-ca': '-l ca -v fr',
+  'fr-ch': '-l ch -v fr',
+  'hr': '-l hr',
+  'hu': '-l hu',
+  'is': '-l is',
+  'it': '-l it',
+  'ja': '-l jp -m jp106',
+  'lt': '-l lt',
+  'lv': '-l lv',
+  'mk': '-l mk',
+  'nl': '-l nl',
+  'no': '-l no',
+  'pl': '-l pl',
+  'pt': '-l pt',
+  'pt-br': '-l br',
+  'ru': '-l ru',
+  'sl': '',
+  'sv': '',
+  'th': '-l th',
+  'tr': '-l tr',
+}
+
+if meson.is_cross_build() or 'CONFIG_XKBCOMMON' in config_host
+  native_qemu_keymap = find_program('qemu-keymap', required: false, disabler: true)
+else
+  native_qemu_keymap = qemu_keymap
+endif
+t = []
+foreach km, args: keymaps
+  t += custom_target(km,
+                     build_by_default: true,
+                     output: km,
+                     command: [native_qemu_keymap, '-f', '@OUTPUT@', args.split()],
+                     install_dir: config_host['qemu_datadir'] / 'keymaps')
+endforeach
+if t.length() > 0
+  alias_target('update-keymaps', t)
+else
+  # install from the source tree
+  install_data(keymaps.keys(), install_dir: config_host['qemu_datadir'] / 'keymaps')
+endif
diff --git a/pc-bios/meson.build b/pc-bios/meson.build
index 6e3bfe3ca4e..b6389f5148d 100644
--- a/pc-bios/meson.build
+++ b/pc-bios/meson.build
@@ -25,3 +25,4 @@ if 'DECOMPRESS_EDK2_BLOBS' in config_host
 endif
 
 subdir('descriptors')
+subdir('keymaps')
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v3 2/2] meson: Do not consider qemu-keymap a 'tool'
  2020-08-21 16:07 [PATCH v3 0/2] meson: Build qemu-keymap when configured using --disable-tools Philippe Mathieu-Daudé
  2020-08-21 16:07 ` [PATCH v3 1/2] meson: convert pc-bios/keymaps/Makefile Philippe Mathieu-Daudé
@ 2020-08-21 16:07 ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-21 16:07 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Paolo Bonzini, Philippe Mathieu-Daudé, Gerd Hoffmann

We need qemu-keymap to generate the keymaps.

This fixes when configuring with --disable-tools:

  Compiling C object qemu-keymap.p/qemu-keymap.c.o
  Compiling C object qemu-keymap.p/ui_input-keymap.c.o
  Compiling C object qemu-edid.p/qemu-edid.c.o
  ../ui/input-keymap.c:7:49: fatal error: ui/input-keymap-atset1-to-qcode.c.inc: No such file or directory
  compilation terminated.
  Makefile.ninja:688: recipe for target 'qemu-keymap.p/ui_input-keymap.c.o' failed
  make: *** [qemu-keymap.p/ui_input-keymap.c.o] Error 1

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
v3: Rebased on Marc-André keymap patch

Paolo feel free to improve the subject if qemu-keymap is a tool :)
---
 meson.build    | 11 ++++++-----
 ui/meson.build |  2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/meson.build b/meson.build
index 808f50b07ef..dd8016c9da3 100644
--- a/meson.build
+++ b/meson.build
@@ -1062,6 +1062,12 @@ if 'CONFIG_GUEST_AGENT' in config_host
   subdir('qga')
 endif
 
+if 'CONFIG_XKBCOMMON' in config_host
+  # used for the update-keymaps target, so include rules even if !have_tools
+  qemu_keymap = executable('qemu-keymap', files('qemu-keymap.c', 'ui/input-keymap.c') + genh,
+                           dependencies: [qemuutil, xkbcommon], install: have_tools)
+endif
+
 if have_tools
   qemu_img = executable('qemu-img', [files('qemu-img.c'), hxdep],
              dependencies: [authz, block, crypto, io, qom, qemuutil], install: true)
@@ -1078,11 +1084,6 @@ if have_tools
   subdir('contrib/rdmacm-mux')
   subdir('contrib/elf2dmp')
 
-  if 'CONFIG_XKBCOMMON' in config_host
-    executable('qemu-keymap', files('qemu-keymap.c', 'ui/input-keymap.c'),
-               dependencies: [qemuutil, xkbcommon], install: true)
-  endif
-
   executable('qemu-edid', files('qemu-edid.c', 'hw/display/edid-generate.c'),
              dependencies: qemuutil,
              install: true)
diff --git a/ui/meson.build b/ui/meson.build
index 6f74d30ea06..6bf398213f3 100644
--- a/ui/meson.build
+++ b/ui/meson.build
@@ -95,7 +95,7 @@ keymaps = [
   ['osx', 'qcode'],
 ]
 
-if have_system
+if have_system or have_tools
   foreach e : keymaps
     output = 'input-keymap-@0@-to-@1@.c.inc'.format(e[0], e[1])
     genh += custom_target(output,
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 1/2] meson: convert pc-bios/keymaps/Makefile
  2020-08-21 16:07 ` [PATCH v3 1/2] meson: convert pc-bios/keymaps/Makefile Philippe Mathieu-Daudé
@ 2020-08-24  5:23   ` Gerd Hoffmann
  2020-08-24  6:22     ` Paolo Bonzini
  0 siblings, 1 reply; 5+ messages in thread
From: Gerd Hoffmann @ 2020-08-24  5:23 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-trivial, Paolo Bonzini, qemu-devel, Marc-André Lureau

> --- a/pc-bios/meson.build
> +++ b/pc-bios/meson.build
> @@ -25,3 +25,4 @@ if 'DECOMPRESS_EDK2_BLOBS' in config_host
>  endif
>  
>  subdir('descriptors')
> +subdir('keymaps')

Hmm, this hooks up the keymaps update to the default build.
Not a good plan.  The output is not static, but defaults on
the libxkbcommon version you have installed.  So I end up with
a dirty tree now after each build.

I guess we should either return to the traditional behavior of not
building keymaps by default and have a "make keymaps" or similar for
keymap updates.  Or write the generated maps to the build tree not
the source tree.

take care,
  Gerd



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 1/2] meson: convert pc-bios/keymaps/Makefile
  2020-08-24  5:23   ` Gerd Hoffmann
@ 2020-08-24  6:22     ` Paolo Bonzini
  0 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2020-08-24  6:22 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: qemu-trivial, Marc-André Lureau, Philippe Mathieu-Daudé,
	qemu-devel

[-- Attachment #1: Type: text/plain, Size: 838 bytes --]

I think it should just add build_by_default: false with a comment
explaining why.

Paolo

Il lun 24 ago 2020, 07:23 Gerd Hoffmann <kraxel@redhat.com> ha scritto:

> > --- a/pc-bios/meson.build
> > +++ b/pc-bios/meson.build
> > @@ -25,3 +25,4 @@ if 'DECOMPRESS_EDK2_BLOBS' in config_host
> >  endif
> >
> >  subdir('descriptors')
> > +subdir('keymaps')
>
> Hmm, this hooks up the keymaps update to the default build.
> Not a good plan.  The output is not static, but defaults on
> the libxkbcommon version you have installed.  So I end up with
> a dirty tree now after each build.
>
> I guess we should either return to the traditional behavior of not
> building keymaps by default and have a "make keymaps" or similar for
> keymap updates.  Or write the generated maps to the build tree not
> the source tree.
>
> take care,
>   Gerd
>
>

[-- Attachment #2: Type: text/html, Size: 1272 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-08-24  6:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-21 16:07 [PATCH v3 0/2] meson: Build qemu-keymap when configured using --disable-tools Philippe Mathieu-Daudé
2020-08-21 16:07 ` [PATCH v3 1/2] meson: convert pc-bios/keymaps/Makefile Philippe Mathieu-Daudé
2020-08-24  5:23   ` Gerd Hoffmann
2020-08-24  6:22     ` Paolo Bonzini
2020-08-21 16:07 ` [PATCH v3 2/2] meson: Do not consider qemu-keymap a 'tool' Philippe Mathieu-Daudé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.