[virt-tools-list] [virt-viewer PATCH 01/14] po: provide custom make rules for po file management
Daniel P. Berrangé
berrange at redhat.com
Mon Mar 11 11:27:29 UTC 2019
On Mon, Mar 11, 2019 at 12:05:25PM +0100, Christophe Fergeau wrote:
> Hey,
>
> On Thu, Mar 07, 2019 at 02:42:45PM +0000, Daniel P. Berrangé wrote:
> > After investigating in more detail it seems you can provide custom rules
> > for XML files by setting GETTEXTDATADIR, so I can support mime files with
> > this extra diff:
>
> Ah indeed, nice finding. Seeing what is shipped in
> https://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-tools/its
> (gsettings, glade, ... rules), this mime rule could probably go there as
> well.
>
> >
> > diff --git a/data/Makefile.am b/data/Makefile.am
> > index 0e50f3d..d4089be 100644
> > --- a/data/Makefile.am
> > +++ b/data/Makefile.am
> > @@ -4,6 +4,8 @@ MANUFACTURER = Virt Manager Project
> >
> > EXTRA_DIST = \
> > virt-viewer.wxs.in \
> > + gettext/its/mime.its \
> > + gettext/its/mime.loc \
> > $(NULL)
> >
> > # this make sure those files are regenerated when they change
> > @@ -71,8 +73,11 @@ desktop_DATA = $(DESKTOPFILES:.desktop.in=.desktop)
> > %.desktop: %.desktop.in
> > $(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
> >
> > +MIMEFILES = virt-viewer-mime.xml.in
> > mimedir = $(datadir)/mime/packages
> > mime_DATA = virt-viewer-mime.xml
> > +%-mime.xml: %-mime.xml.in
> > + $(AM_V_GEN)GETTEXTDATADIR=$(srcdir)/gettext $(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
>
> Something I just noticed (but which is related to the initial patch
> rather than this one) is that the .xml.in -> .xml rule is no longer
> triggered when one of the .po file changes (same for the .desktop file).
> I tried adding $(wildcard $(top_srcdir)/po/*.po) as a dependency, and as
> far as I can tell, this is giving the behaviour I want.
Yes, I can see the original rule had such a dep
$ grep XML_RULE /usr/share/aclocal/intltool.m4
INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po)
I'll add this dep before pushing.
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 :|
More information about the virt-tools-list
mailing list