[gupnp-tools] build: Use upstream gettext



commit 03a3615db789ff6d5215718deb51ab17e8488080
Author: Jens Georg <mail jensge org>
Date:   Mon Mar 28 20:19:43 2016 +0200

    build: Use upstream gettext

 .gitignore                            |    2 -
 Makefile.am                           |    2 +
 autogen.sh                            |    7 +---
 configure.ac                          |   10 +---
 data/Makefile.am                      |   15 +++++--
 data/gupnp-universal-cp.desktop.in.in |    2 +-
 po/Makevars                           |   78 +++++++++++++++++++++++++++++++++
 po/POTFILES.in                        |    7 ---
 src/av-cp/Makefile.am                 |    1 +
 src/network-light/Makefile.am         |    1 +
 src/universal-cp/Makefile.am          |    1 +
 11 files changed, 98 insertions(+), 28 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index a2c7b18..22f714e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,14 +28,12 @@ mkinstalldirs
 stamp-*
 INSTALL
 
-m4/intltool.m4
 m4/libtool.m4
 m4/ltoptions.m4
 m4/ltsugar.m4
 m4/ltversion.m4
 m4/lt~obsolete.m4
 
-po/.intltool-merge-cache
 po/Makefile.in.in
 po/POTFILES
 po/*.gmo
diff --git a/Makefile.am b/Makefile.am
index a282df6..4cc9b7a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,6 +9,8 @@ DISTCLEANFILES = \
        intltool-merge \
        intltool-update
 
+EXTRA_DIST = build-aux/config.rpath
+
 dist-hook:
        @if test -d "$(srcdir)/.git"; \
                then \
diff --git a/autogen.sh b/autogen.sh
index 7433ba9..bc1daf6 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -11,13 +11,8 @@ if test -z $AUTORECONF; then
         echo "*** No autoreconf found, please install it ***"
         exit 1
 fi
-INTLTOOLIZE=`which intltoolize`
-if test -z $INTLTOOLIZE; then
-        echo "*** No intltoolize found, please install the intltool package ***"
-        exit 1
-fi
 
-intltoolize --force --copy --automake || exit $?
+aclocal --install || exit 1
 autoreconf --force --install --verbose || exit $?
 
 cd "$olddir"
diff --git a/configure.ac b/configure.ac
index f67e9ec..b0e2d9c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -117,16 +117,13 @@ fi
 AM_CONDITIONAL([UNINSTALLED], [test "x$enable_uninstalled" = "xyes"])
 
 # Gettext
-IT_PROG_INTLTOOL([0.40.6])
+AM_GNU_GETTEXT_VERSION([0.19.7])
+AM_GNU_GETTEXT([external])
 GETTEXT_PACKAGE=gupnp-tools
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], 
   [Define the gettext package to be used])
 
-ALL_LINGUAS=""
-AM_GLIB_GNU_GETTEXT
-AM_GLIB_DEFINE_LOCALEDIR([LOCALEDIR])
-
 AS_AC_EXPAND(PKGDATADIR, "${datadir}/${PACKAGE}")
 
 AC_CONFIG_FILES([
@@ -139,10 +136,7 @@ src/network-light/Makefile
 src/universal-cp/Makefile
 src/upload/Makefile
 data/Makefile
-data/gupnp-universal-cp.desktop.in
-data/gupnp-av-cp.desktop.in
 data/gupnp-av-cp.ui
-data/gupnp-network-light.desktop.in
 data/pixmaps/Makefile
 data/xml/Makefile
 po/Makefile.in
diff --git a/data/Makefile.am b/data/Makefile.am
index 28e25eb..f682cd6 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -8,16 +8,23 @@ dist_shared_DATA = gupnp-universal-cp.ui \
 desktopdir = ${datadir}/applications
 desktop_in_files = gupnp-universal-cp.desktop.in \
                   gupnp-network-light.desktop.in
-desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
 
 if BUILD_AV
-shared_DATA = gupnp-av-cp.ui
+dist_shared_DATA += gupnp-av-cp.ui
 desktop_in_files += gupnp-av-cp.desktop.in
 endif
 
- INTLTOOL_DESKTOP_RULE@
+desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
+desktop_in_in_files = $(desktop_in_files:.desktop.in=.desktop.in.in)
+
+$(desktop_in_files): $(desktop_in_in_files)
+       $(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
+
+# Substitute variables in a Desktop Entry file.
+$(desktop_DATA): $(desktop_in_files)
+       $(AM_V_GEN) $(SED) -e 's|@VERSION[ ]|$(VERSION)|g' $< > $@
 
-EXTRA_DIST = $(desktop_in_files:.desktop.in=.desktop.in.in) gupnp-av-cp.ui.in
+EXTRA_DIST = $(desktop_in_in_files) gupnp-av-cp.ui.in $(desktop_in_files)
 
 CLEANFILES = $(desktop_DATA)
 
diff --git a/data/gupnp-universal-cp.desktop.in.in b/data/gupnp-universal-cp.desktop.in.in
index 4552978..8e05a31 100644
--- a/data/gupnp-universal-cp.desktop.in.in
+++ b/data/gupnp-universal-cp.desktop.in.in
@@ -1,6 +1,6 @@
 [Desktop Entry]
 Encoding=UTF-8
-_Name=UPnP Universal Control Point
+Name=UPnP Universal Control Point
 Categories=GTK;Development;
 Exec=gupnp-universal-cp
 Icon= PKGDATADIR@/pixmaps/universal-cp.png
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..df09a7b
--- /dev/null
+++ b/po/Makevars
@@ -0,0 +1,78 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --from-code=UTF-8
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
+# package.  (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.)  Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright.  The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Free Software Foundation, Inc.
+
+# This tells whether or not to prepend "GNU " prefix to the package
+# name that gets inserted into the header of the $(DOMAIN).pot file.
+# Possible values are "yes", "no", or empty.  If it is empty, try to
+# detect it automatically by scanning the files in $(top_srcdir) for
+# "GNU packagename" string.
+PACKAGE_GNU =
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+#   in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+#   understood.
+# - Strings which make invalid assumptions about notation of date, time or
+#   money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS =
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used.  It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
+
+# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
+# context.  Possible values are "yes" and "no".  Set this to yes if the
+# 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
+
+# These options get passed to msgmerge.
+# Useful options are in particular:
+#   --previous            to keep previous msgids of translated messages,
+#   --quiet               to reduce the verbosity.
+MSGMERGE_OPTIONS =
+
+# These options get passed to msginit.
+# If you want to disable line wrapping when writing PO files, add
+# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
+# MSGINIT_OPTIONS.
+MSGINIT_OPTIONS =
+
+# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
+# has changed.  Possible values are "yes" and "no".  Set this to no if
+# the POT file is checked in the repository and the version control
+# program ignores timestamps.
+PO_DEPENDS_ON_POT = no
+
+# This tells whether or not to forcibly update $(DOMAIN).pot and
+# regenerate PO files on "make dist".  Possible values are "yes" and
+# "no".  Set this to no if the POT file and PO files are maintained
+# externally.
+DIST_DEPENDS_ON_UPDATE_PO = no
diff --git a/po/POTFILES.in b/po/POTFILES.in
index fca083f..239cc05 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,12 +1,5 @@
 # List of source files containing translatable strings.
 # Please keep this file sorted alphabetically.
-[encoding: UTF-8]
-data/gupnp-av-cp.desktop.in.in
-[type: gettext/glade]data/gupnp-av-cp.ui.in
-data/gupnp-network-light.desktop.in.in
-[type: gettext/glade]data/gupnp-network-light.ui
-data/gupnp-universal-cp.desktop.in.in
-[type: gettext/glade]data/gupnp-universal-cp.ui
 src/av-cp/gui.c
 src/av-cp/gui.h
 src/av-cp/main.c
diff --git a/src/av-cp/Makefile.am b/src/av-cp/Makefile.am
index 21e0404..43cb58d 100644
--- a/src/av-cp/Makefile.am
+++ b/src/av-cp/Makefile.am
@@ -10,6 +10,7 @@ AM_CFLAGS = $(LIBGUPNP_CFLAGS) \
            $(GTKSOURCEVIEW_CFLAGS) \
            -I$(top_srcdir) -DDATA_DIR='"$(shareddir)"' \
            -I$(top_srcdir)/src/common \
+           -DLOCALEDIR='"$(localedir)"' \
            $(WARN_CFLAGS)
 
 bin_PROGRAMS = gupnp-av-cp
diff --git a/src/network-light/Makefile.am b/src/network-light/Makefile.am
index 1c6cfb6..c1b3611 100644
--- a/src/network-light/Makefile.am
+++ b/src/network-light/Makefile.am
@@ -10,6 +10,7 @@ AM_CFLAGS = $(LIBGUPNP_CFLAGS) \
            -I$(top_srcdir) \
            -DDATA_DIR='"$(shareddir)"' \
            -I$(top_srcdir)/src/common \
+           -DLOCALEDIR='"$(localedir)"' \
            $(WARN_CFLAGS)
 
 bin_PROGRAMS = gupnp-network-light
diff --git a/src/universal-cp/Makefile.am b/src/universal-cp/Makefile.am
index 23eadd4..5f758f0 100644
--- a/src/universal-cp/Makefile.am
+++ b/src/universal-cp/Makefile.am
@@ -7,6 +7,7 @@ endif
 AM_CFLAGS = $(GTK_CFLAGS) $(LIBGUPNP_CFLAGS) \
            -I$(top_srcdir) -DDATA_DIR='"$(shareddir)"' \
            -I$(top_srcdir)/src/common \
+           -DLOCALEDIR='"$(localedir)"' \
            $(WARN_CFLAGS)
 
 bin_PROGRAMS = gupnp-universal-cp


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]