[gnome-font-viewer] build: Don't use gnome-common or intltool



commit a26fe3e6b04e7b59a337c0b2271ede50579307d4
Author: Jeremy Bicha <jbicha ubuntu com>
Date:   Fri Jun 9 15:42:29 2017 -0400

    build: Don't use gnome-common or intltool
    
    https://wiki.gnome.org/Projects/GnomeCommon/Migration
    https://wiki.gnome.org/Initiatives/GnomeGoals/GettextMigration
    
    https://bugzilla.gnome.org/show_bug.cgi?id=783611

 autogen.sh                                         |   41 ++++++++----
 configure.ac                                       |    5 +-
 data/Makefile.am                                   |    3 +-
 data/org.gnome.font-viewer.appdata.xml.in          |   12 ++--
 po/Makevars                                        |   69 ++++++++++++++++++++
 po/POTFILES.in                                     |    4 +-
 src/Makefile.am                                    |    8 +--
 ...ktop.in.in => org.gnome.font-viewer.desktop.in} |    8 ++-
 8 files changed, 118 insertions(+), 32 deletions(-)
---
diff --git a/autogen.sh b/autogen.sh
index 79caedd..3db9703 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,21 +1,36 @@
 #!/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="GNOME Font Viewer"
+cd $srcdir
 
-(test -f $srcdir/configure.ac \
-  && test -f $srcdir/src/font-view.c) || {
-    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
-    echo " top-level font-viewer directory"
-    exit 1
+(test -f configure.ac) || {
+        echo "*** ERROR: Directory '$srcdir' does not look like the top-level project directory ***"
+        exit 1
 }
 
-which gnome-autogen.sh || {
-    echo "You need to install gnome-common package"
-    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
+
+autoreconf --verbose --force --install || exit 1
+
+cd "$olddir"
+if [ "$NOCONFIGURE" = "" ]; then
+        $srcdir/configure "$@" || exit 1
 
-USE_GNOME2_MACROS=1 USE_COMMON_DOC_BUILD=yes . 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 cf1048e..d35e413 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,9 @@ AM_SILENT_RULES([yes])
 GETTEXT_PACKAGE=AC_PACKAGE_NAME
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain])
-IT_PROG_INTLTOOL(0.40.0)
+AM_GNU_GETTEXT_VERSION([0.19.6])
+AM_GNU_GETTEXT([external])
+
 PKG_PROG_PKG_CONFIG([0.22])
 
 AC_PROG_CC
@@ -49,7 +51,6 @@ AC_CONFIG_FILES([
 Makefile
 data/Makefile
 src/Makefile
-src/org.gnome.font-viewer.desktop.in
 po/Makefile.in
 ])
 
diff --git a/data/Makefile.am b/data/Makefile.am
index 132dbff..8fc61f3 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,7 +1,8 @@
 appdatadir = $(datadir)/appdata
 appdata_in_files = org.gnome.font-viewer.appdata.xml.in
 appdata_DATA = $(appdata_in_files:.xml.in=.xml)
-@INTLTOOL_XML_RULE@
+%.xml: %.xml.in Makefile
+       $(AM_V_GEN) $(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
 
 EXTRA_DIST =                           \
        $(appdata_in_files)
diff --git a/data/org.gnome.font-viewer.appdata.xml.in b/data/org.gnome.font-viewer.appdata.xml.in
index 291b541..5cfd44c 100644
--- a/data/org.gnome.font-viewer.appdata.xml.in
+++ b/data/org.gnome.font-viewer.appdata.xml.in
@@ -3,20 +3,20 @@
   <id>org.gnome.font-viewer.desktop</id>
   <metadata_license>CC0-1.0</metadata_license>
   <project_license>GPL-2.0+</project_license>
-  <_name>GNOME Font Viewer</_name>
-  <_summary>View fonts on your system</_summary>
+  <name>GNOME Font Viewer</name>
+  <summary>View fonts on your system</summary>
   <description>
-    <_p>
+    <p>
       GNOME Font Viewer shows you the fonts installed on your computer for your use as
       thumbnails.
       Selecting any thumbnails shows the full view of how the font would look under
       various sizes.
-    </_p>
-    <_p>
+    </p>
+    <p>
       GNOME Font Viewer also supports installing new font files downloaded in the .ttf
       and other formats.
       Fonts may be installed only for your use or made available to all users on the computer.
-    </_p>
+    </p>
   </description>
   <url type="homepage">http://www.gnome.org/gnome-3/</url>
   <url type="bugtracker">https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-font-viewer</url>
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..0da6eed
--- /dev/null
+++ b/po/Makevars
@@ -0,0 +1,69 @@
+# 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 = --from-code=UTF-8 --keyword=_ --keyword=N_ \
+        --keyword=C_:1c,2 --keyword=NC_:1c,2 \
+        --keyword=g_dngettext:2,3 --add-comments \
+        --flag=g_dngettext:2:pass-c-format \
+        --flag=g_strdup_printf:1:c-format \
+        --flag=g_string_printf:2:c-format \
+        --flag=g_string_append_printf:2:c-format \
+        --flag=g_error_new:3:c-format \
+        --flag=g_set_error:4:c-format \
+        --flag=g_markup_printf_escaped:1:c-format \
+        --flag=g_log:3:c-format \
+        --flag=g_print:1:c-format \
+        --flag=g_printerr:1:c-format \
+        --flag=g_printf:1:c-format \
+        --flag=g_fprintf:2:c-format \
+        --flag=g_sprintf:2:c-format \
+        --flag=g_snprintf:3:c-format
+
+
+# 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 = Translation copyright holder
+# 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 = 
http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-font-viewer&keywords=I18N+L10N&component=general
+
+# 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 =
+
+# Ignore the timestamp of the .pot file, as git clones do not have
+# deterministic timestamps, and .po files are updated by translators
+# (only) in GNOME projects.
+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 e515c5c..99de0a4 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -2,6 +2,6 @@
 # Please keep this file sorted alphabetically.
 data/org.gnome.font-viewer.appdata.xml.in
 src/font-thumbnailer.c
-[type: gettext/glade]src/font-view-app-menu.ui
+src/font-view-app-menu.ui
 src/font-view.c
-src/org.gnome.font-viewer.desktop.in.in
+src/org.gnome.font-viewer.desktop.in
diff --git a/src/Makefile.am b/src/Makefile.am
index 1f68acf..ea7b0ed 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -50,6 +50,8 @@ gnome_font_viewer_SOURCES = \
 desktopdir = $(datadir)/applications
 desktop_in_files = org.gnome.font-viewer.desktop.in
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
+%.desktop: %.desktop.in Makefile
+       $(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
 
 dbusservicedir = $(datadir)/dbus-1/services
 dbusservice_DATA = org.gnome.font-viewer.service
@@ -69,19 +71,15 @@ install-desktop-database: install-desktopDATA
 uninstall-local:
        rm -f $(DESTDIR)$(desktopdir)/mimeinfo.cache
 
-@INTLTOOL_DESKTOP_RULE@
-@INTLTOOL_DIRECTORY_RULE@
-
 CLEANFILES = \
        $(dbusservice_DATA) \
-       $(desktop_in_files) \
        $(desktop_DATA) \
        $(directory_DATA)
 
 EXTRA_DIST = \
+       $(desktop_in_files) \
        $(resource_files) \
        gnome-font-viewer.thumbnailer \
-       org.gnome.font-viewer.desktop.in.in \
        gnome-font-viewer.gresource.xml
 
 -include $(top_srcdir)/git.mk
diff --git a/src/org.gnome.font-viewer.desktop.in.in b/src/org.gnome.font-viewer.desktop.in
similarity index 61%
rename from src/org.gnome.font-viewer.desktop.in.in
rename to src/org.gnome.font-viewer.desktop.in
index b0545a2..ad2c17a 100644
--- a/src/org.gnome.font-viewer.desktop.in.in
+++ b/src/org.gnome.font-viewer.desktop.in
@@ -1,7 +1,9 @@
 [Desktop Entry]
-_Name=Font Viewer
-_Comment=View fonts on your system
-_Keywords=fonts;fontface;
+Name=Font Viewer
+Comment=View fonts on your system
+# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list 
MUST also end with a semicolon!
+Keywords=fonts;fontface;
+# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
 Icon=preferences-desktop-font
 Exec=gnome-font-viewer %u
 Terminal=false


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