GNOME Bugzilla – Bug 373745
Do not use AM_GLIB_DEFINE_LOCALEDIR(GTK_LOCALEDIR) and use gettext instead
Last modified: 2016-05-16 19:50:34 UTC
Hi, Gtk's configure.in relies on a glib-gettext macro to define its localedir, but this macro is borken by design and breaks badly with autoconf 2.60. See bug 343825 for the details. Autoconf's upstream recommends a construct such as the following in your Makefile.am files: AM_CPPFLAGS = -DGTK_LOCALEDIR=\"$(datadir)/locale\" (or some other value) Please note that AM_GLIB_DEFINE_LOCALEDIR will expand to ${datadir}/locale except on Solaris where it expands to ${libdir}/locale. Bye,
Hello Loïc, GTK+ requires autoconf 2.62 since GTK+ 2.20. I can't confirm this bug here, can you? Maybe you can provide a patch to not use AM_GLIB_DEFINE_LOCALEDIR?
As noted in bug #343825, the AM_GLIB_DEFINE_LOCALEDIR macro was fixed for newer autoconfs. It still goes against autoconf's recommendation to use such a macro. The proper fix would be to move to gettext, but this is not a small task and I'm afraid I don't have the time to develop such a patch. Feel free to close this bug if you prefer not to keep the request/suggestion open. Thanks,
Created attachment 323834 [details] [review] Use upstream gettext
Review of attachment 323834 [details] [review]: ::: po-properties/Makevars @@ +9,3 @@ + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --from-code=UTF-8 I'm pretty sure we need something else here. The current code has: XGETTEXT_KEYWORDS = --keyword --keyword=P_ @@ +19,3 @@ +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Free Software Foundation, Inc. This should be something like: GTK+ Team and others. See AUTHORS @@ +26,3 @@ +# detect it automatically by scanning the files in $(top_srcdir) for +# "GNU packagename" string. +PACKAGE_GNU = 'no' here ::: po/Makevars @@ +9,3 @@ + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --from-code=UTF-8 XGETTEXT_KEYWORDS= --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 @@ +19,3 @@ +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Free Software Foundation, Inc. Should be: GTK+ team and others. See AUTHORS @@ +26,3 @@ +# detect it automatically by scanning the files in $(top_srcdir) for +# "GNU packagename" string. +PACKAGE_GNU = Should be: no @@ +52,3 @@ +# package uses functions taking also a message context, like pgettext(), or +# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. +USE_MSGCTXT = no Should be: yes
Looks like a nice cleanup, but lets hold this until 3.21 opens, at this point.
Created attachment 326641 [details] [review] Use upstream gettext.v2 Updated patch against current master
Review of attachment 326641 [details] [review]: ::: po-properties/Makevars @@ +2,3 @@ + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) I would just hardcode gtk30-properties here, $(PACKAGE) is certainly not right @@ +9,3 @@ + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --keyword=P_ --from-code=UTF-8 --keyword=_ here doesn't look right. If you look at the Makefile.in.in you removed, it should be --keyword ::: po/Makevars @@ +2,3 @@ + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) I would just put gtk30 here, I don't think $(PACKAGE) is right
Created attachment 328001 [details] [review] Use upstream gettext.v3
Review of attachment 328001 [details] [review]: With this one fix, looks good to me now ::: po/Makevars @@ +3,3 @@ +# Usually the message domain is the same as the package name. +DOMAIN = gtk3 + This needs to be gtk30, to keep the current domain.
Created attachment 328011 [details] [review] Use upstream gettext.v4
Review of attachment 328011 [details] [review]: commit 101da71ee30e53fe0338bc67605a98527277ee56
Thanks for the reviews!