summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChoe Hwanjin <choe.hwanjin@gmail.com>2019-03-23 09:44:43 +0900
committerChoe Hwanjin <choe.hwanjin@gmail.com>2019-03-23 09:49:11 +0900
commit2656ad9b14e51870c064f560d27ee344c6f54e06 (patch)
treeda3019e353448a591033a9105ad5c3c961e53d8b
parent10c479525e694d0a32fdccaa5d909f9fa1495925 (diff)
parent8745e3f2630cdad6b1715b4a074e4efc4db14534 (diff)
downloadibus-hangul-2656ad9b14e51870c064f560d27ee344c6f54e06.tar.gz
Merge pull request #81 from 'tchaik/gettext-migration'
of https://github.com/t-chaik/ibus-hangul merge: 8745e3f build: Prefer gettext over intltool 23c22e5 build: Prefer autoreconf over gnome-autogen.sh https://github.com/libhangul/ibus-hangul/pull/81
-rw-r--r--.gitignore4
-rwxr-xr-xautogen.sh40
-rw-r--r--configure.ac14
-rw-r--r--data/Makefile.am7
-rw-r--r--data/org.freedesktop.ibus.engine.hangul.metainfo.xml.in6
-rw-r--r--m4/Makefile.am8
-rw-r--r--po/Makevars39
-rw-r--r--po/POTFILES.in4
-rw-r--r--po/POTFILES.skip2
-rw-r--r--setup/Makefile.am7
-rw-r--r--setup/ibus-setup-hangul.desktop.in4
11 files changed, 101 insertions, 34 deletions
diff --git a/.gitignore b/.gitignore
index ab40040..381fc2f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,9 +35,6 @@ stamp-h1
py-compile
ibus-hangul*.tar.*
ibus-hangul.spec
-intltool-extract.in
-intltool-merge.in
-intltool-update.in
# vim temp backup file
.*.swp
@@ -49,7 +46,6 @@ data/org.freedesktop.ibus.engine.hangul.metainfo.xml.h
# files for po
po/*.gmo
po/*.pot
-po/.intltool-merge-cache
po/stamp-po
po/stamp-it
diff --git a/autogen.sh b/autogen.sh
index c741591..d05c799 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,24 +1,40 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
+test -n "$srcdir" || srcdir=$(dirname "$0")
+test -n "$srcdir" || srcdir=.
-srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
+olddir=$(pwd)
-PKG_NAME="ibus-hangul"
+cd "$srcdir"
-(test -f $srcdir/configure.ac \
- && test -f $srcdir/README ) || {
+(test -f configure.ac) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level $PKG_NAME directory"
exit 1
}
-which gnome-autogen.sh || {
- echo "You need to install gnome-common from the GNOME CVS"
- exit 1
-}
+# shellcheck disable=SC2016
+PKG_NAME=$(autoconf --trace 'AC_INIT:$1' configure.ac)
+
+if [ "$#" = 0 -a "x$NOCONFIGURE" = "x" ]; then
+ echo "*** WARNING: I am going to run 'configure' with no arguments." >&2
+ echo "*** If you wish to pass any to it, please specify them on the" >&2
+ echo "*** '$0' command line." >&2
+ echo "" >&2
+fi
+
+aclocal --install || exit 1
+autoreconf --verbose --force --install || exit 1
-ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I m4"
-REQUIRED_AUTOMAKE_VERSION=1.8
+cd "$olddir"
+if [ "$NOCONFIGURE" = "" ]; then
+ $srcdir/configure "$@" || exit 1
-. gnome-autogen.sh
+ if [ "$1" = "--help" ]; then
+ exit 0
+ else
+ echo "Now type 'make' to compile $PKG_NAME" || exit 1
+ fi
+else
+ echo "Skipping configure process."
+fi
diff --git a/configure.ac b/configure.ac
index 2e1177d..932fa67 100644
--- a/configure.ac
+++ b/configure.ac
@@ -51,7 +51,8 @@ AC_ISC_POSIX
AC_HEADER_STDC
AM_PROG_LIBTOOL
-IT_PROG_INTLTOOL([0.35.0])
+AM_GNU_GETTEXT_VERSION([0.19.8])
+AM_GNU_GETTEXT([external])
# check ibus
PKG_CHECK_MODULES(IBUS, [
@@ -76,13 +77,16 @@ AC_ARG_WITH(python,
AM_PATH_PYTHON([2.5])
# define GETTEXT_* variables
-GETTEXT_PACKAGE=ibus-hangul
+GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define to the read-only architecture-independent data directory.])
-
+AC_DEFINE_UNQUOTED(
+ GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
+ [Define to the read-only architecture-independent data directory.]
+)
# OUTPUT files
-AC_CONFIG_FILES([ po/Makefile.in
+AC_CONFIG_FILES([
+po/Makefile.in
Makefile
ibus-hangul.spec
src/Makefile
diff --git a/data/Makefile.am b/data/Makefile.am
index dbd73f9..fc04996 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -32,9 +32,12 @@ symboltable_DATA = \
symboltabledir = $(datadir)/ibus-hangul/data
appstream_in_files = org.freedesktop.ibus.engine.hangul.metainfo.xml.in
-appstream_DATA = $(appstream_in_files:.xml.in=.xml)
+appstream_files = $(appstream_in_files:.xml.in=.xml)
+appstream_DATA = $(appstream_files)
appstreamdir=$(datadir)/metainfo
-@INTLTOOL_XML_RULE@
+
+$(appstream_files): $(appstream_in_files) Makefile
+ $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
install-data-hook:
if test -z "$(DESTDIR)"; then \
diff --git a/data/org.freedesktop.ibus.engine.hangul.metainfo.xml.in b/data/org.freedesktop.ibus.engine.hangul.metainfo.xml.in
index 7a31585..05e6c8e 100644
--- a/data/org.freedesktop.ibus.engine.hangul.metainfo.xml.in
+++ b/data/org.freedesktop.ibus.engine.hangul.metainfo.xml.in
@@ -4,11 +4,9 @@
<name>ibus-hangul</name>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-2</project_license>
- <_summary>Hangul engine for IBus</_summary>
+ <summary>Hangul engine for IBus</summary>
<description>
- <_p>
- IBus-Hangul is a Korean input method engine for IBus.
- </_p>
+ <p>IBus-Hangul is a Korean input method engine for IBus.</p>
</description>
<project_group>IBus</project_group>
<url type="homepage">https://github.com/libhangul/ibus-hangul</url>
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 675bb5f..5b9d60f 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -20,4 +20,12 @@
EXTRA_DIST = \
as-version.m4 \
+ gettext.m4 \
+ iconv.m4 \
+ lib-ld.m4 \
+ lib-link.m4 \
+ lib-prefix.m4 \
+ nls.m4 \
+ po.m4 \
+ progtest.m4 \
$(NULL)
diff --git a/po/Makevars b/po/Makevars
index 7d73dbd..fabb0ac 100644
--- a/po/Makevars
+++ b/po/Makevars
@@ -8,7 +8,7 @@ subdir = po
top_builddir = ..
# These options get passed to xgettext.
-XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
+XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 --add-comments
# 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
@@ -20,6 +20,13 @@ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
# their copyright.
COPYRIGHT_HOLDER = Huang Peng <shawn.p.huang@gmail.com>
+# 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 = no
+
# 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
@@ -39,3 +46,33 @@ MSGID_BUGS_ADDRESS = $(PACKAGE_BUGREPORT)
# 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 = yes
+
+# 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 1248184..b32396d 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,7 +1,7 @@
-[type: gettext/xml]data/org.freedesktop.ibus.engine.hangul.metainfo.xml.in
+data/org.freedesktop.ibus.engine.hangul.metainfo.xml.in
setup/keycapturedialog.py
setup/main.py
setup/ibus-setup-hangul.desktop.in
-[type: gettext/glade]setup/setup.ui
+setup/setup.ui
src/engine.c
src/main.c
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
new file mode 100644
index 0000000..77352ad
--- /dev/null
+++ b/po/POTFILES.skip
@@ -0,0 +1,2 @@
+data/org.freedesktop.ibus.engine.hangul.metainfo.xml
+setup/ibus-setup-hangul.desktop
diff --git a/setup/Makefile.am b/setup/Makefile.am
index 2425834..41ba0ac 100644
--- a/setup/Makefile.am
+++ b/setup/Makefile.am
@@ -31,9 +31,12 @@ setup_hanguldir = $(pkgdatadir)/setup
libexec_SCRIPTS = ibus-setup-hangul
desktop_in_files = ibus-setup-hangul.desktop.in
-desktop_DATA = ibus-setup-hangul.desktop
+desktop_files = $(desktop_in_files:.desktop.in=.desktop)
+desktop_DATA = $(desktop_files)
desktopdir = $(datadir)/applications
-@INTLTOOL_DESKTOP_RULE@
+
+$(desktop_files): $(desktop_in_files) Makefile
+ $(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
hicolor_icon_64_DATA = ibus-setup-hangul.png
hicolor_icon_64dir = $(datadir)/icons/hicolor/64x64/apps
diff --git a/setup/ibus-setup-hangul.desktop.in b/setup/ibus-setup-hangul.desktop.in
index e3326d4..b19934e 100644
--- a/setup/ibus-setup-hangul.desktop.in
+++ b/setup/ibus-setup-hangul.desktop.in
@@ -1,6 +1,6 @@
[Desktop Entry]
-_Name=IBus Hangul Preferences
-_Comment=Set IBus Hangul Preferences
+Name=IBus Hangul Preferences
+Comment=Set IBus Hangul Preferences
Exec=ibus-setup-hangul
Icon=ibus-setup-hangul
NoDisplay=true