[PULL 147/150] meson: convert po/

Paolo Bonzini posted 150 patches 5 years, 5 months ago
Maintainers: Max Reitz <mreitz@redhat.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Helge Deller <deller@gmx.de>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Gerd Hoffmann <kraxel@redhat.com>, Thomas Huth <thuth@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>, Amit Shah <amit@kernel.org>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Igor Mammedov <imammedo@redhat.com>, Riku Voipio <riku.voipio@iki.fi>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Halil Pasic <pasic@linux.ibm.com>, "Cédric Le Goater" <clg@kaod.org>, Aurelien Jarno <aurelien@aurel32.net>, Hannes Reinecke <hare@suse.com>, Michael Rolnik <mrolnik@gmail.com>, Cleber Rosa <crosa@redhat.com>, Michael Roth <mdroth@linux.vnet.ibm.com>, Raphael Norwitz <raphael.norwitz@nutanix.com>, Max Filippov <jcmvbkbc@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>, Andrzej Zaborowski <balrogg@gmail.com>, Stefano Stabellini <sstabellini@kernel.org>, Laurent Vivier <laurent@vivier.eu>, Bandan Das <bsd@redhat.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <Alistair.Francis@wdc.com>, Stefan Berger <stefanb@linux.ibm.com>, Richard Henderson <rth@twiddle.net>, Alex Williamson <alex.williamson@redhat.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, Su Hang <suhang16@mails.ucas.ac.cn>, Dmitry Fleytman <dmitry.fleytman@gmail.com>, Christian Schoenebeck <qemu_oss@crudebyte.com>, Joel Stanley <joel@jms.id.au>, Peter Maydell <peter.maydell@linaro.org>, Fam Zheng <fam@euphon.net>, Laurent Vivier <lvivier@redhat.com>, Juan Quintela <quintela@redhat.com>, Jason Wang <jasowang@redhat.com>, David Hildenbrand <david@redhat.com>, Markus Armbruster <armbru@redhat.com>, Laszlo Ersek <lersek@redhat.com>, Keith Busch <kbusch@kernel.org>, Ben Warren <ben@skyportsystems.com>, Christian Borntraeger <borntraeger@de.ibm.com>, "Alex Bennée" <alex.bennee@linaro.org>, Stefan Hajnoczi <stefanha@redhat.com>, Paul Durrant <paul@xen.org>, Greg Kurz <groug@kaod.org>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>, Jiaxun Yang <jiaxun.yang@flygoat.com>, David Gibson <david@gibson.dropbear.id.au>, Paolo Bonzini <pbonzini@redhat.com>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, Sagar Karandikar <sagark@eecs.berkeley.edu>, Sarah Harris <S.E.Harris@kent.ac.uk>, Artyom Tarasenko <atar4qemu@gmail.com>, Yuval Shaia <yuval.shaia.ml@gmail.com>, Anthony Perard <anthony.perard@citrix.com>, Kevin Wolf <kwolf@redhat.com>, Cornelia Huck <cohuck@redhat.com>, John Snow <jsnow@redhat.com>, Alexander Bulekov <alxndr@bu.edu>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Stafford Horne <shorne@gmail.com>, Stefan Weil <sw@weilnetz.de>, Huacai Chen <chenhc@lemote.com>, Eric Blake <eblake@redhat.com>
There is a newer version of this series
[PULL 147/150] meson: convert po/
Posted by Paolo Bonzini 5 years, 5 months ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Meson warns if xgettext is not found.  In the future we may want to add
a required argument to i18n.gettext(); in the meanwhile, I am adding a
--enable-gettext/--disable-gettext option and feature detection in
configure.  This preserves QEMU's default behavior of detecting system
features, without any warning, if neither --enable-* nor --disable-*
is requested.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Makefile          |  5 +---
 configure         | 21 +++++++++++++-
 meson.build       |  3 ++
 meson_options.txt |  1 +
 po/LINGUAS        |  8 +++++
 po/Makefile       | 52 ---------------------------------
 po/POTFILES       |  1 +
 po/meson.build    |  7 +++++
 po/messages.po    | 74 -----------------------------------------------
 tests/vm/freebsd  |  1 +
 tests/vm/netbsd   |  1 +
 tests/vm/openbsd  |  1 +
 12 files changed, 44 insertions(+), 131 deletions(-)
 create mode 100644 po/LINGUAS
 delete mode 100644 po/Makefile
 create mode 100644 po/POTFILES
 create mode 100644 po/meson.build
 delete mode 100644 po/messages.po

diff --git a/Makefile b/Makefile
index bbb27f7981..8ba5990504 100644
--- a/Makefile
+++ b/Makefile
@@ -210,7 +210,7 @@ distclean: clean ninja-distclean
 	rm -f config-host.mak config-host.h*
 	rm -f tests/tcg/config-*.mak
 	rm -f config-all-disas.mak config.status
-	rm -f po/*.mo tests/qemu-iotests/common.env
+	rm -f tests/qemu-iotests/common.env
 	rm -f roms/seabios/config.mak roms/vgabios/config.mak
 	rm -f qemu-plugins-ld.symbols qemu-plugins-ld64.symbols
 	rm -f *-config-target.h *-config-devices.mak *-config-devices.h
@@ -288,9 +288,6 @@ endif
 	mkdir -p "$(DESTDIR)$(qemu_desktopdir)"
 	$(INSTALL_DATA) $(SRC_PATH)/ui/qemu.desktop \
 		"$(DESTDIR)$(qemu_desktopdir)/qemu.desktop"
-ifdef CONFIG_GTK
-	$(MAKE) -C po $@
-endif
 	$(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"; \
diff --git a/configure b/configure
index 86f384be29..0167822204 100755
--- a/configure
+++ b/configure
@@ -522,6 +522,7 @@ rng_none="no"
 secret_keyring=""
 libdaxctl=""
 meson=""
+gettext=""
 
 bogus_os="no"
 malloc_trim=""
@@ -1112,6 +1113,10 @@ for opt do
   ;;
   --enable-vnc) vnc="enabled"
   ;;
+  --disable-gettext) gettext="false"
+  ;;
+  --enable-gettext) gettext="true"
+  ;;
   --oss-lib=*) oss_lib="$optarg"
   ;;
   --audio-drv-list=*) audio_drv_list="$optarg"
@@ -2983,6 +2988,19 @@ if test "$whpx" != "no" ; then
     fi
 fi
 
+##########################################
+# gettext probe
+if test "$gettext" != "false" ; then
+  if has xgettext; then
+    gettext=true
+  else
+    if test "$gettext" = "true" ; then
+      feature_not_found "gettext" "Install xgettext binary"
+    fi
+    gettext=false
+  fi
+fi
+
 ##########################################
 # Sparse probe
 if test "$sparse" != "no" ; then
@@ -8047,7 +8065,7 @@ DIRS="$DIRS docs docs/interop fsdev scsi"
 DIRS="$DIRS pc-bios/optionrom pc-bios/s390-ccw"
 DIRS="$DIRS roms/seabios"
 LINKS="Makefile"
-LINKS="$LINKS tests/tcg/lm32/Makefile po/Makefile"
+LINKS="$LINKS tests/tcg/lm32/Makefile"
 LINKS="$LINKS tests/tcg/Makefile.target"
 LINKS="$LINKS pc-bios/optionrom/Makefile pc-bios/keymaps"
 LINKS="$LINKS pc-bios/s390-ccw/Makefile"
@@ -8179,6 +8197,7 @@ NINJA=$PWD/ninjatool $meson setup \
         -Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \
 	-Dsdl=$sdl -Dsdl_image=$sdl_image \
 	-Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \
+	-Dgettext=$gettext \
         $cross_arg \
         "$PWD" "$source_path"
 
diff --git a/meson.build b/meson.build
index afe684cbad..57cfa8723d 100644
--- a/meson.build
+++ b/meson.build
@@ -1108,6 +1108,9 @@ subdir('tools')
 subdir('pc-bios')
 subdir('tests')
 subdir('docs')
+if 'CONFIG_GTK' in config_host
+  subdir('po')
+endif
 
 if build_docs
   makeinfo = find_program('makeinfo', required: build_docs)
diff --git a/meson_options.txt b/meson_options.txt
index 67455c57bc..e5f45243ce 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,3 +1,4 @@
+option('gettext', type : 'boolean', value : true)
 option('sdl', type : 'feature', value : 'auto')
 option('sdl_image', type : 'feature', value : 'auto')
 option('vnc', type : 'feature', value : 'enabled')
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644
index 0000000000..cc4b5c3b36
--- /dev/null
+++ b/po/LINGUAS
@@ -0,0 +1,8 @@
+bg
+de_DE
+fr_FR
+hu
+it
+sv
+tr
+zh_CN
diff --git a/po/Makefile b/po/Makefile
deleted file mode 100644
index c041f4c858..0000000000
--- a/po/Makefile
+++ /dev/null
@@ -1,52 +0,0 @@
-# This makefile is very special as it's meant to build as part of the build
-# process and also within the source tree to update the translation files.
-
-# Set SRC_PATH for in-tree builds without configuration.
-SRC_PATH=..
-
-# The default target must come before any include statements.
-all:
-
-.PHONY:	all build clean install update
-
-%.mo: %.po
-	$(call quiet-command, msgfmt -o $@ $<,"GEN","$@")
-
--include ../config-host.mak
-include $(SRC_PATH)/rules.mak
-
-PO_PATH=$(SRC_PATH)/po
-
-VERSION=$(shell cat $(SRC_PATH)/VERSION)
-SRCS=$(filter-out $(PO_PATH)/messages.po,$(wildcard $(PO_PATH)/*.po))
-OBJS=$(patsubst $(PO_PATH)/%.po,%.mo,$(SRCS))
-
-vpath %.po $(PO_PATH)
-
-all:
-	@echo "Use 'make update' to update translation files or use 'make build'"
-	@echo "or 'make install' to build and install the translation files."
-
-update: $(SRCS)
-
-build: $(OBJS)
-
-clean:
-	rm -f $(OBJS)
-
-install: $(OBJS)
-	for obj in $(OBJS); do \
-	    base=$$(basename $$obj .mo); \
-	    $(INSTALL) -d $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES; \
-	    $(INSTALL) -m644 $$obj $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES/qemu.mo; \
-	done
-
-$(PO_PATH)/messages.po: $(SRC_PATH)/ui/gtk.c
-	$(call quiet-command, ( cd $(SRC_PATH) && \
-          xgettext -o - --from-code=UTF-8 --foreign-user --no-location \
-	    --package-name=QEMU --package-version=$(VERSION) \
-	    --msgid-bugs-address=qemu-devel@nongnu.org -k_ -C ui/gtk.c | \
-	  sed -e s/CHARSET/UTF-8/) >$@,"GEN","$@")
-
-$(PO_PATH)/%.po: $(PO_PATH)/messages.po
-	$(call quiet-command, msgmerge -q $@ $< > $@.bak && mv $@.bak $@,"GEN","$@")
diff --git a/po/POTFILES b/po/POTFILES
new file mode 100644
index 0000000000..d34d5ed9aa
--- /dev/null
+++ b/po/POTFILES
@@ -0,0 +1 @@
+ui/gtk.c
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000000..1387fd979a
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,7 @@
+i18n = import('i18n')
+
+if get_option('gettext')
+  i18n.gettext(meson.project_name(),
+               args: '--msgid-bugs-address=qemu-devel@nongnu.org',
+               preset: 'glib')
+endif
diff --git a/po/messages.po b/po/messages.po
deleted file mode 100644
index 065bd459a0..0000000000
--- a/po/messages.po
+++ /dev/null
@@ -1,74 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# This file is put in the public domain.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: QEMU 2.12.91\n"
-"Report-Msgid-Bugs-To: qemu-devel@nongnu.org\n"
-"POT-Creation-Date: 2018-07-18 07:56+0200\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-msgid " - Press Ctrl+Alt+G to release grab"
-msgstr ""
-
-msgid " [Paused]"
-msgstr ""
-
-msgid "_Pause"
-msgstr ""
-
-msgid "_Reset"
-msgstr ""
-
-msgid "Power _Down"
-msgstr ""
-
-msgid "_Quit"
-msgstr ""
-
-msgid "_Fullscreen"
-msgstr ""
-
-msgid "_Copy"
-msgstr ""
-
-msgid "Zoom _In"
-msgstr ""
-
-msgid "Zoom _Out"
-msgstr ""
-
-msgid "Best _Fit"
-msgstr ""
-
-msgid "Zoom To _Fit"
-msgstr ""
-
-msgid "Grab On _Hover"
-msgstr ""
-
-msgid "_Grab Input"
-msgstr ""
-
-msgid "Show _Tabs"
-msgstr ""
-
-msgid "Detach Tab"
-msgstr ""
-
-msgid "Show Menubar"
-msgstr ""
-
-msgid "_Machine"
-msgstr ""
-
-msgid "_View"
-msgstr ""
diff --git a/tests/vm/freebsd b/tests/vm/freebsd
index b34b14fc53..5f866e09c4 100755
--- a/tests/vm/freebsd
+++ b/tests/vm/freebsd
@@ -39,6 +39,7 @@ class FreeBSDVM(basevm.BaseVM):
         "bash",
         "gmake",
         "gsed",
+        "gettext",
 
         # libs: crypto
         "gnutls",
diff --git a/tests/vm/netbsd b/tests/vm/netbsd
index 93d48b6fdd..ffb65a89be 100755
--- a/tests/vm/netbsd
+++ b/tests/vm/netbsd
@@ -37,6 +37,7 @@ class NetBSDVM(basevm.BaseVM):
         "bash",
         "gmake",
         "gsed",
+        "gettext",
 
         # libs: crypto
         "gnutls",
diff --git a/tests/vm/openbsd b/tests/vm/openbsd
index 7e27fda642..8356646f21 100755
--- a/tests/vm/openbsd
+++ b/tests/vm/openbsd
@@ -36,6 +36,7 @@ class OpenBSDVM(basevm.BaseVM):
         "bash",
         "gmake",
         "gsed",
+        "gettext",
 
         # libs: usb
         "libusb1",
-- 
2.26.2



Re: [PULL 147/150] meson: convert po/
Posted by Brad Smith 5 years, 5 months ago
On 8/18/2020 10:10 AM, Paolo Bonzini wrote:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Meson warns if xgettext is not found.  In the future we may want to add
> a required argument to i18n.gettext(); in the meanwhile, I am adding a
> --enable-gettext/--disable-gettext option and feature detection in
> configure.  This preserves QEMU's default behavior of detecting system
> features, without any warning, if neither --enable-* nor --disable-*
> is requested.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   Makefile          |  5 +---
>   configure         | 21 +++++++++++++-
>   meson.build       |  3 ++
>   meson_options.txt |  1 +
>   po/LINGUAS        |  8 +++++
>   po/Makefile       | 52 ---------------------------------
>   po/POTFILES       |  1 +
>   po/meson.build    |  7 +++++
>   po/messages.po    | 74 -----------------------------------------------
>   tests/vm/freebsd  |  1 +
>   tests/vm/netbsd   |  1 +
>   tests/vm/openbsd  |  1 +
>   12 files changed, 44 insertions(+), 131 deletions(-)
>   create mode 100644 po/LINGUAS
>   delete mode 100644 po/Makefile
>   create mode 100644 po/POTFILES
>   create mode 100644 po/meson.build
>   delete mode 100644 po/messages.po
>
> diff --git a/Makefile b/Makefile
> index bbb27f7981..8ba5990504 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -210,7 +210,7 @@ distclean: clean ninja-distclean
>   	rm -f config-host.mak config-host.h*
>   	rm -f tests/tcg/config-*.mak
>   	rm -f config-all-disas.mak config.status
> -	rm -f po/*.mo tests/qemu-iotests/common.env
> +	rm -f tests/qemu-iotests/common.env
>   	rm -f roms/seabios/config.mak roms/vgabios/config.mak
>   	rm -f qemu-plugins-ld.symbols qemu-plugins-ld64.symbols
>   	rm -f *-config-target.h *-config-devices.mak *-config-devices.h
> @@ -288,9 +288,6 @@ endif
>   	mkdir -p "$(DESTDIR)$(qemu_desktopdir)"
>   	$(INSTALL_DATA) $(SRC_PATH)/ui/qemu.desktop \
>   		"$(DESTDIR)$(qemu_desktopdir)/qemu.desktop"
> -ifdef CONFIG_GTK
> -	$(MAKE) -C po $@
> -endif
>   	$(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"; \
> diff --git a/configure b/configure
> index 86f384be29..0167822204 100755
> --- a/configure
> +++ b/configure
> @@ -522,6 +522,7 @@ rng_none="no"
>   secret_keyring=""
>   libdaxctl=""
>   meson=""
> +gettext=""
>   
>   bogus_os="no"
>   malloc_trim=""
> @@ -1112,6 +1113,10 @@ for opt do
>     ;;
>     --enable-vnc) vnc="enabled"
>     ;;
> +  --disable-gettext) gettext="false"
> +  ;;
> +  --enable-gettext) gettext="true"
> +  ;;
>     --oss-lib=*) oss_lib="$optarg"
>     ;;
>     --audio-drv-list=*) audio_drv_list="$optarg"
> @@ -2983,6 +2988,19 @@ if test "$whpx" != "no" ; then
>       fi
>   fi
>   
> +##########################################
> +# gettext probe
> +if test "$gettext" != "false" ; then
> +  if has xgettext; then
> +    gettext=true
> +  else
> +    if test "$gettext" = "true" ; then
> +      feature_not_found "gettext" "Install xgettext binary"
> +    fi
> +    gettext=false
> +  fi
> +fi
> +
>   ##########################################
>   # Sparse probe
>   if test "$sparse" != "no" ; then
> @@ -8047,7 +8065,7 @@ DIRS="$DIRS docs docs/interop fsdev scsi"
>   DIRS="$DIRS pc-bios/optionrom pc-bios/s390-ccw"
>   DIRS="$DIRS roms/seabios"
>   LINKS="Makefile"
> -LINKS="$LINKS tests/tcg/lm32/Makefile po/Makefile"
> +LINKS="$LINKS tests/tcg/lm32/Makefile"
>   LINKS="$LINKS tests/tcg/Makefile.target"
>   LINKS="$LINKS pc-bios/optionrom/Makefile pc-bios/keymaps"
>   LINKS="$LINKS pc-bios/s390-ccw/Makefile"
> @@ -8179,6 +8197,7 @@ NINJA=$PWD/ninjatool $meson setup \
>           -Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \
>   	-Dsdl=$sdl -Dsdl_image=$sdl_image \
>   	-Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \
> +	-Dgettext=$gettext \
>           $cross_arg \
>           "$PWD" "$source_path"
>   
> diff --git a/meson.build b/meson.build
> index afe684cbad..57cfa8723d 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -1108,6 +1108,9 @@ subdir('tools')
>   subdir('pc-bios')
>   subdir('tests')
>   subdir('docs')
> +if 'CONFIG_GTK' in config_host
> +  subdir('po')
> +endif
>   
>   if build_docs
>     makeinfo = find_program('makeinfo', required: build_docs)
> diff --git a/meson_options.txt b/meson_options.txt
> index 67455c57bc..e5f45243ce 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -1,3 +1,4 @@
> +option('gettext', type : 'boolean', value : true)
>   option('sdl', type : 'feature', value : 'auto')
>   option('sdl_image', type : 'feature', value : 'auto')
>   option('vnc', type : 'feature', value : 'enabled')
> diff --git a/po/LINGUAS b/po/LINGUAS
> new file mode 100644
> index 0000000000..cc4b5c3b36
> --- /dev/null
> +++ b/po/LINGUAS
> @@ -0,0 +1,8 @@
> +bg
> +de_DE
> +fr_FR
> +hu
> +it
> +sv
> +tr
> +zh_CN
> diff --git a/po/Makefile b/po/Makefile
> deleted file mode 100644
> index c041f4c858..0000000000
> --- a/po/Makefile
> +++ /dev/null
> @@ -1,52 +0,0 @@
> -# This makefile is very special as it's meant to build as part of the build
> -# process and also within the source tree to update the translation files.
> -
> -# Set SRC_PATH for in-tree builds without configuration.
> -SRC_PATH=..
> -
> -# The default target must come before any include statements.
> -all:
> -
> -.PHONY:	all build clean install update
> -
> -%.mo: %.po
> -	$(call quiet-command, msgfmt -o $@ $<,"GEN","$@")
> -
> --include ../config-host.mak
> -include $(SRC_PATH)/rules.mak
> -
> -PO_PATH=$(SRC_PATH)/po
> -
> -VERSION=$(shell cat $(SRC_PATH)/VERSION)
> -SRCS=$(filter-out $(PO_PATH)/messages.po,$(wildcard $(PO_PATH)/*.po))
> -OBJS=$(patsubst $(PO_PATH)/%.po,%.mo,$(SRCS))
> -
> -vpath %.po $(PO_PATH)
> -
> -all:
> -	@echo "Use 'make update' to update translation files or use 'make build'"
> -	@echo "or 'make install' to build and install the translation files."
> -
> -update: $(SRCS)
> -
> -build: $(OBJS)
> -
> -clean:
> -	rm -f $(OBJS)
> -
> -install: $(OBJS)
> -	for obj in $(OBJS); do \
> -	    base=$$(basename $$obj .mo); \
> -	    $(INSTALL) -d $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES; \
> -	    $(INSTALL) -m644 $$obj $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES/qemu.mo; \
> -	done
> -
> -$(PO_PATH)/messages.po: $(SRC_PATH)/ui/gtk.c
> -	$(call quiet-command, ( cd $(SRC_PATH) && \
> -          xgettext -o - --from-code=UTF-8 --foreign-user --no-location \
> -	    --package-name=QEMU --package-version=$(VERSION) \
> -	    --msgid-bugs-address=qemu-devel@nongnu.org -k_ -C ui/gtk.c | \
> -	  sed -e s/CHARSET/UTF-8/) >$@,"GEN","$@")
> -
> -$(PO_PATH)/%.po: $(PO_PATH)/messages.po
> -	$(call quiet-command, msgmerge -q $@ $< > $@.bak && mv $@.bak $@,"GEN","$@")
> diff --git a/po/POTFILES b/po/POTFILES
> new file mode 100644
> index 0000000000..d34d5ed9aa
> --- /dev/null
> +++ b/po/POTFILES
> @@ -0,0 +1 @@
> +ui/gtk.c
> diff --git a/po/meson.build b/po/meson.build
> new file mode 100644
> index 0000000000..1387fd979a
> --- /dev/null
> +++ b/po/meson.build
> @@ -0,0 +1,7 @@
> +i18n = import('i18n')
> +
> +if get_option('gettext')
> +  i18n.gettext(meson.project_name(),
> +               args: '--msgid-bugs-address=qemu-devel@nongnu.org',
> +               preset: 'glib')
> +endif
> diff --git a/po/messages.po b/po/messages.po
> deleted file mode 100644
> index 065bd459a0..0000000000
> --- a/po/messages.po
> +++ /dev/null
> @@ -1,74 +0,0 @@
> -# SOME DESCRIPTIVE TITLE.
> -# This file is put in the public domain.
> -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
> -#
> -#, fuzzy
> -msgid ""
> -msgstr ""
> -"Project-Id-Version: QEMU 2.12.91\n"
> -"Report-Msgid-Bugs-To: qemu-devel@nongnu.org\n"
> -"POT-Creation-Date: 2018-07-18 07:56+0200\n"
> -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
> -"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
> -"Language-Team: LANGUAGE <LL@li.org>\n"
> -"Language: \n"
> -"MIME-Version: 1.0\n"
> -"Content-Type: text/plain; charset=UTF-8\n"
> -"Content-Transfer-Encoding: 8bit\n"
> -
> -msgid " - Press Ctrl+Alt+G to release grab"
> -msgstr ""
> -
> -msgid " [Paused]"
> -msgstr ""
> -
> -msgid "_Pause"
> -msgstr ""
> -
> -msgid "_Reset"
> -msgstr ""
> -
> -msgid "Power _Down"
> -msgstr ""
> -
> -msgid "_Quit"
> -msgstr ""
> -
> -msgid "_Fullscreen"
> -msgstr ""
> -
> -msgid "_Copy"
> -msgstr ""
> -
> -msgid "Zoom _In"
> -msgstr ""
> -
> -msgid "Zoom _Out"
> -msgstr ""
> -
> -msgid "Best _Fit"
> -msgstr ""
> -
> -msgid "Zoom To _Fit"
> -msgstr ""
> -
> -msgid "Grab On _Hover"
> -msgstr ""
> -
> -msgid "_Grab Input"
> -msgstr ""
> -
> -msgid "Show _Tabs"
> -msgstr ""
> -
> -msgid "Detach Tab"
> -msgstr ""
> -
> -msgid "Show Menubar"
> -msgstr ""
> -
> -msgid "_Machine"
> -msgstr ""
> -
> -msgid "_View"
> -msgstr ""


This last part is redundant. If glib2 and/or gtk+3 is installed then gettext
is installed.

The package name is wrong as well as gettext changed from gettext to
gettext-runtime relatively recently.


> diff --git a/tests/vm/freebsd b/tests/vm/freebsd
> index b34b14fc53..5f866e09c4 100755
> --- a/tests/vm/freebsd
> +++ b/tests/vm/freebsd
> @@ -39,6 +39,7 @@ class FreeBSDVM(basevm.BaseVM):
>           "bash",
>           "gmake",
>           "gsed",
> +        "gettext",
>   
>           # libs: crypto
>           "gnutls",
> diff --git a/tests/vm/netbsd b/tests/vm/netbsd
> index 93d48b6fdd..ffb65a89be 100755
> --- a/tests/vm/netbsd
> +++ b/tests/vm/netbsd
> @@ -37,6 +37,7 @@ class NetBSDVM(basevm.BaseVM):
>           "bash",
>           "gmake",
>           "gsed",
> +        "gettext",
>   
>           # libs: crypto
>           "gnutls",
> diff --git a/tests/vm/openbsd b/tests/vm/openbsd
> index 7e27fda642..8356646f21 100755
> --- a/tests/vm/openbsd
> +++ b/tests/vm/openbsd
> @@ -36,6 +36,7 @@ class OpenBSDVM(basevm.BaseVM):
>           "bash",
>           "gmake",
>           "gsed",
> +        "gettext",
>   
>           # libs: usb
>           "libusb1",

Re: [PULL 147/150] meson: convert po/
Posted by Paolo Bonzini 5 years, 5 months ago
On 19/08/20 03:56, Brad Smith wrote:
> 
> 
> This last part is redundant. If glib2 and/or gtk+3 is installed then
> gettext
> is installed.
> 
> The package name is wrong as well as gettext changed from gettext to
> gettext-runtime relatively recently.

Are you sure gettext-runtime includes xgettext, and is installed if
glib2 is?

Paolo

> 
>> diff --git a/tests/vm/freebsd b/tests/vm/freebsd
>> index b34b14fc53..5f866e09c4 100755
>> --- a/tests/vm/freebsd
>> +++ b/tests/vm/freebsd
>> @@ -39,6 +39,7 @@ class FreeBSDVM(basevm.BaseVM):
>>           "bash",
>>           "gmake",
>>           "gsed",
>> +        "gettext",
>>             # libs: crypto
>>           "gnutls",
>> diff --git a/tests/vm/netbsd b/tests/vm/netbsd
>> index 93d48b6fdd..ffb65a89be 100755
>> --- a/tests/vm/netbsd
>> +++ b/tests/vm/netbsd
>> @@ -37,6 +37,7 @@ class NetBSDVM(basevm.BaseVM):
>>           "bash",
>>           "gmake",
>>           "gsed",
>> +        "gettext",
>>             # libs: crypto
>>           "gnutls",
>> diff --git a/tests/vm/openbsd b/tests/vm/openbsd
>> index 7e27fda642..8356646f21 100755
>> --- a/tests/vm/openbsd
>> +++ b/tests/vm/openbsd
>> @@ -36,6 +36,7 @@ class OpenBSDVM(basevm.BaseVM):
>>           "bash",
>>           "gmake",
>>           "gsed",
>> +        "gettext",
>>             # libs: usb
>>           "libusb1",


Re: [PULL 147/150] meson: convert po/
Posted by Brad Smith 5 years, 5 months ago
If you're in need of the tools then the package name needs to be gettext-tools.

On August 19, 2020 4:06:32 a.m. Paolo Bonzini <pbonzini@redhat.com> wrote:

> On 19/08/20 03:56, Brad Smith wrote:
>>
>>
>> This last part is redundant. If glib2 and/or gtk+3 is installed then
>> gettext
>> is installed.
>>
>> The package name is wrong as well as gettext changed from gettext to
>> gettext-runtime relatively recently.
>
> Are you sure gettext-runtime includes xgettext, and is installed if
> glib2 is?
>
> Paolo
>
>>
>>> diff --git a/tests/vm/freebsd b/tests/vm/freebsd
>>> index b34b14fc53..5f866e09c4 100755
>>> --- a/tests/vm/freebsd
>>> +++ b/tests/vm/freebsd
>>> @@ -39,6 +39,7 @@ class FreeBSDVM(basevm.BaseVM):
>>>          "bash",
>>>          "gmake",
>>>          "gsed",
>>> +        "gettext",
>>>            # libs: crypto
>>>          "gnutls",
>>> diff --git a/tests/vm/netbsd b/tests/vm/netbsd
>>> index 93d48b6fdd..ffb65a89be 100755
>>> --- a/tests/vm/netbsd
>>> +++ b/tests/vm/netbsd
>>> @@ -37,6 +37,7 @@ class NetBSDVM(basevm.BaseVM):
>>>          "bash",
>>>          "gmake",
>>>          "gsed",
>>> +        "gettext",
>>>            # libs: crypto
>>>          "gnutls",
>>> diff --git a/tests/vm/openbsd b/tests/vm/openbsd
>>> index 7e27fda642..8356646f21 100755
>>> --- a/tests/vm/openbsd
>>> +++ b/tests/vm/openbsd
>>> @@ -36,6 +36,7 @@ class OpenBSDVM(basevm.BaseVM):
>>>          "bash",
>>>          "gmake",
>>>          "gsed",
>>> +        "gettext",
>>>            # libs: usb
>>>          "libusb1",


Sent with AquaMail for Android
https://www.mobisystems.com/aqua-mail