[NetworkManager-libreswan/lr/test: 2/6] build: replace intltool with gettext




commit bdae6c76c0d4a75d909f2efaca427e2a8485d6c7
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Mon Jun 27 16:34:14 2022 +0200

    build: replace intltool with gettext
    
    Gettext, since version 0.19, provides infrastructure equivalent to
    intltool (generating po/Makefile and translating .desktop files or .xml).
    
    Also, it seems to work better in that it actually honors MSGFMT_OPTS
    that are determined by the configure script. That one typically ends up
    set to "-c", meaning "check". Without it the bugs in the .po files are
    easy to overlook.

 .gitignore                                        | 24 +++++++++++++++++++++--
 .gitlab-ci.yml                                    |  1 -
 Makefile.am                                       | 15 ++++----------
 appdata/network-manager-libreswan.metainfo.xml.in | 10 +++++-----
 autogen.sh                                        |  2 --
 configure.ac                                      |  6 ++++--
 po/Makevars                                       |  9 +++++++++
 po/POTFILES.in                                    |  2 +-
 8 files changed, 45 insertions(+), 24 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 9ffc5af..958bded 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
 *.o
 *.lo
 *.la
+ABOUT-NLS
 Makefile
 Makefile.in*
 configure
@@ -23,13 +24,31 @@ stamp-*
 .libs
 autom4te.cache
 intltool-*
-po/*.gmo
 po/.intltool-merge-cache
+po/*.gmo
+po/boldquot.sed
+po/en@boldquot.header
+po/en@quot.header
+po/insert-header.sin
+po/Makevars.template
+po/quot.sed
+po/remove-potcdate.sed
+po/remove-potcdate.sin
+po/Rules-quot
+m4/gettext.m4
 m4/gtk-doc.m4
+m4/host-cpu-c-abi.m4
+m4/iconv.m4
+m4/intlmacosx.m4
 m4/intltool.m4
+m4/lib-ld.m4
+m4/lib-link.m4
+m4/lib-prefix.m4
 m4/libtool.m4
 m4/lt*.m4
-appdata/network-manager-libreswan.metainfo.xml
+m4/nls.m4
+m4/po.m4
+m4/progtest.m4
 /cscope.*
 
 auth-dialog/nm-libreswan-auth-dialog
@@ -44,5 +63,6 @@ properties/resources.c
 properties/resources.h
 gtk4/nm-libreswan-dialog.ui
 gtk4/resources.c
+appdata/network-manager-libreswan.metainfo.xml
 
 /NetworkManager-libreswan*.tar*
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9f16d3f..a8b4016 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -14,7 +14,6 @@
       glib2-devel
       gtk3-devel
       libnl3-devel
-      intltool
       libtool
       libsecret-devel
       libnma-devel
diff --git a/Makefile.am b/Makefile.am
index 8bae961..00385ad 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -386,7 +386,9 @@ if WITH_GNOME
 appdata_DATA = $(appdata_in_files:.xml.in=.xml)
 endif
 appdata_in_files = appdata/network-manager-libreswan.metainfo.xml.in
-@INTLTOOL_XML_RULE@
+
+appdata/network-manager-libreswan.metainfo.xml: appdata/network-manager-libreswan.metainfo.xml.in
+       $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
 
 nm-libreswan-service.name: $(srcdir)/nm-libreswan-service.name.in
        sed -e 's|[@]LIBEXECDIR[@]|$(libexecdir)|g' \
@@ -397,17 +399,8 @@ EXTRA_DIST += \
        nm-libreswan-service.name.in \
        $(dbusservice_DATA)  \
        $(appdata_in_files)  \
-       $(appdata_files)      \
-       intltool-extract.in  \
-       intltool-merge.in    \
-       intltool-update.in
+       $(appdata_files)
 
 CLEANFILES += \
        $(nmvpnservice_DATA) \
        $(appdata_files)
-
-DISTCLEANFILES += \
-       intltool-extract \
-       intltool-merge \
-       intltool-update
-
diff --git a/appdata/network-manager-libreswan.metainfo.xml.in 
b/appdata/network-manager-libreswan.metainfo.xml.in
index fb3afa8..e0b7cec 100644
--- a/appdata/network-manager-libreswan.metainfo.xml.in
+++ b/appdata/network-manager-libreswan.metainfo.xml.in
@@ -7,8 +7,8 @@
   <extends>nm-connection-editor.desktop</extends>
   <extends>org.gnome.Settings.desktop</extends>
   <extends>gnome-control-center.desktop</extends>
-  <_name>IPsec VPN client</_name>
-  <_summary>Libreswan based client for IKEv1 based IPsec virtual private networks</_summary>
+  <name>IPsec VPN client</name>
+  <summary>Libreswan based client for IKEv1 based IPsec virtual private networks</summary>
 
   <keywords>
     <keyword>network</keyword>
@@ -22,8 +22,8 @@
   </keywords>
 
   <description>
-    <_p>Support for configuring IKEv1 based IPsec virtual private network connections.</_p>
-    <_p>Compatible with Libreswan and Cisco IPsec VPN servers.</_p>
+    <p>Support for configuring IKEv1 based IPsec virtual private network connections.</p>
+    <p>Compatible with Libreswan and Cisco IPsec VPN servers.</p>
   </description>
 
   <screenshots>
@@ -36,5 +36,5 @@
   <url type="bugtracker">https://gitlab.gnome.org/GNOME/NetworkManager-libreswan/issues</url>
   <update_contact>networkmanager-maint gnome bugs</update_contact>
   <translation type="gettext">NetworkManager-libreswan</translation>
-  <_developer_name>The NetworkManager Developers</_developer_name>
+  <developer_name>The NetworkManager Developers</developer_name>
 </component>
diff --git a/autogen.sh b/autogen.sh
index 2423c4a..dd5aa3f 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -15,8 +15,6 @@ PKG_NAME=NetworkManager-libreswan
 
 (cd $srcdir;
     autoreconf --install --symlink &&
-    intltoolize --force &&
-    autoreconf &&
     ./configure --enable-maintainer-mode --enable-more-warnings=error $@
 )
 
diff --git a/configure.ac b/configure.ac
index c151c28..e6bd677 100644
--- a/configure.ac
+++ b/configure.ac
@@ -122,8 +122,10 @@ GETTEXT_PACKAGE=NetworkManager-libreswan
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
 
-IT_PROG_INTLTOOL([0.35])
-AM_GLIB_GNU_GETTEXT
+AM_GNU_GETTEXT([external])
+# Remove AM_GNU_GETTEXT_VERSION once autoreconf supports REQUIRE_VERSION
+AM_GNU_GETTEXT_VERSION([0.19])
+AM_GNU_GETTEXT_REQUIRE_VERSION([0.19])
 
 PKG_CHECK_MODULES(GLIB, gio-unix-2.0 >= 2.36)
 GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36"
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..aed76ae
--- /dev/null
+++ b/po/Makevars
@@ -0,0 +1,9 @@
+DOMAIN = $(PACKAGE)
+
+subdir = po
+top_builddir = ..
+
+XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 
--keyword=g_dngettext:2,3 --add-comments
+COPYRIGHT_HOLDER = $(PACKAGE) authors
+MSGID_BUGS_ADDRESS = https://gitlab.gnome.org/GNOME/$(PACKAGE)/
+EXTRA_LOCALE_CATEGORIES =
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 7d394a6..2bf713d 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -8,4 +8,4 @@ src/nm-libreswan-service.c
 shared/utils.c
 shared/nm-utils/nm-shared-utils.c
 shared/nm-utils/nm-vpn-plugin-utils.c
-[type: gettext/glade]properties/nm-libreswan-dialog.ui
+properties/nm-libreswan-dialog.ui


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