[pybliographer/wip/gtk3: 39/42] Drop intltool



commit 012c84e9ecfee014f775a8f5cca01f7f493609f1
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Fri Oct 6 20:46:40 2017 -0300

    Drop intltool
    
    Require a newer gettext. Make distcheck work again.

 Makefile.am                                        |   63 +++++++------------
 autogen.sh                                         |    1 -
 configure.ac                                       |   14 +----
 po/Makevars                                        |   54 +++++++++++++++++
 po/POTFILES.in                                     |    1 +
 ...hic.appdata.xml => pybliographic.appdata.xml.in |    0
 pybliographic.desktop.in                           |    6 +-
 scripts/Makefile.am                                |    4 +-
 8 files changed, 85 insertions(+), 58 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 264c183..c5fd54e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,14 +17,11 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 # 
-# 
-
-DISTCHECK_CONFIGURE_FLAGS = --disable-update-desktop-database
+#
 
 pybdir  = $(datadir)/$(PACKAGE)
-appdir  = $(datadir)/applications
 
-SUBDIRS =      Pyblio          \
+SUBDIRS =      . Pyblio                \
                scripts         \
                tests           \
                Styles          \
@@ -32,13 +29,6 @@ SUBDIRS =    Pyblio          \
                help            \
                data
 
-
-app_DATA = pybliographic.desktop
-
-appdatadir = $(datadir)/appdata
-appdata_DATA = pybliographic.appdata.xml
-
-
 bin_SCRIPTS = pybliographer
 
 pyb_DATA = pybrc.py
@@ -46,28 +36,30 @@ pyb_DATA = pybrc.py
 desktopdir = $(datadir)/applications
 desktop_in_files = pybliographic.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 $@
 
-@INTLTOOL_DESKTOP_RULE@
-
-INTLTOOL =                     \
-       intltool-extract.in     \
-       intltool-merge.in       \
-       intltool-update.in
+appdatadir = $(datadir)/appdata
+appdata_in_files = pybliographic.appdata.xml.in
+appdata_DATA = $(appdata_in_files:.xml.in=.xml)
+%.xml: %.xml.in Makefile
+       $(AM_V_GEN) $(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
 
 EXTRA_DIST = \
-               pybliographer.in                \
-               pybliographic.appdata.xml       \
-               $(desktop_in_files) $(INTLTOOL) $(pyb_DATA)
+       pybliographer.in                \
+       $(appdata_in_files) \
+       $(desktop_in_files) \
+       $(pyb_DATA)
 
-CLEANFILES = pybliographer $(desktop_DATA)
+CLEANFILES = \
+       pybliographer \
+       $(desktop_DATA) \
+       $(appdata_DATA)
 
-DISTCLEANFILES =               \
-       intltool-extract        \
-       intltool-merge          \
-       intltool-update
+DISTCLEANFILES =
 
-pybliographer: pybliographer.in
-       sed \
+pybliographer: pybliographer.in Makefile
+       $(AM_V_GEN)sed \
                -e s!\@bin_dir\@!$(bindir)!               \
                -e s!\@libpyb\@!$(libdir)/$(PACKAGE)!     \
                -e s!\@datapyb\@!$(datadir)/$(PACKAGE)!   \
@@ -75,17 +67,8 @@ pybliographer: pybliographer.in
                -e s!\@version\@!$(VERSION)!              \
                -e s!\@locale_dir\@!$(localedir)!         \
                -e s!\@p_datadir\@!$(datadir)/$(PACKAGE)! \
+               -e s!\@python_path\@!$(PYTHON)! \
                < $< > $@
-       chmod 755 $@
-
-pybliographer: Makefile
-
-update_desktop_database = update-desktop-database $(DESTDIR)$(appdir) \
-       || echo "**** Warning: cannot update mime cache (recommended for Gnome >= 2.8)"
+       chmod +x $@
 
-install-data-hook: update-desktop-database
-uninstall-hook: update-desktop-database
-update-desktop-database:
-if ENABLE_UPDATE_DESKTOP_DATABASE
-       $(update_desktop_database)
-endif
+ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
diff --git a/autogen.sh b/autogen.sh
index 657db8c..1dde36a 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -33,7 +33,6 @@ GNOMEDOC=`which yelp-build`
 
 run aclocal ${aclocal_extra}
 run autoconf
-run intltoolize
 run automake -a
 
 if [ -x ./config.status ] ; then
diff --git a/configure.ac b/configure.ac
index bd9eb35..640d4d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -64,23 +64,16 @@ else
        AC_MSG_RESULT([disabled by user])
 fi
 
-# i18n
-IT_PROG_INTLTOOL([0.40.0])
-
 GETTEXT_PACKAGE=AC_PACKAGE_TARNAME
 AC_SUBST([GETTEXT_PACKAGE])
 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE", [Gettext package])
 
+AM_GNU_GETTEXT_VERSION([0.19.7])
+AM_GNU_GETTEXT
+
 # Documentation
 YELP_HELP_INIT
 
-AC_ARG_ENABLE(update-desktop-database,
-AC_HELP_STRING([--disable-update-desktop-database],
-       [do not update desktop database after installation]),,
-       enable_update_desktop_database=yes)
-
-AM_CONDITIONAL(ENABLE_UPDATE_DESKTOP_DATABASE, test x$enable_update_desktop_database = xyes)
-
 AC_CONFIG_FILES(
        Makefile
        po/Makefile.in
@@ -101,7 +94,6 @@ AC_CONFIG_FILES(
        data/src/Makefile
 )
 
-
 AC_OUTPUT
 
 echo "pybliographer is now configured. Type make to build it"
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..99d5a20
--- /dev/null
+++ b/po/Makevars
@@ -0,0 +1,54 @@
+# 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
+
+# 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=pybliographer&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 1f9717a..1bb3e08 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -78,6 +78,7 @@ Pyblio/recode.py
 Pyblio/userexit.py
 Pyblio/version.py.in
 pybliographer.in
+pybliographic.appdata.xml.in
 pybliographic.desktop.in
 scripts/pybliocheck.py
 scripts/pybliocompact.py
diff --git a/pybliographic.appdata.xml b/pybliographic.appdata.xml.in
similarity index 100%
rename from pybliographic.appdata.xml
rename to pybliographic.appdata.xml.in
diff --git a/pybliographic.desktop.in b/pybliographic.desktop.in
index 51f0fdd..0e6ffbc 100644
--- a/pybliographic.desktop.in
+++ b/pybliographic.desktop.in
@@ -1,7 +1,7 @@
 [Desktop Entry]
-_Name=Pybliographer
-_GenericName=Bibliography Manager
-_Comment=Manage bibliographic databases
+Name=Pybliographer
+GenericName=Bibliography Manager
+Comment=Manage bibliographic databases
 Icon=pybliographic
 Exec=pybliographic
 Terminal=false
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 503b2a8..9553181 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -52,7 +52,7 @@ EXTRA_DIST =  pybscript.in                    \
 $(bin_SCRIPTS):
        $(LN_S) pybscript $@
 
-pybscript: pybscript.in
+pybscript: pybscript.in Makefile
        sed \
                -e s!\@bin_dir\@!$(bindir)!               \
                -e s!\@libpyb\@!$(libdir)/$(PACKAGE)!     \
@@ -64,8 +64,6 @@ pybscript: pybscript.in
                < $< > $@
        chmod 755 $@
 
-pybscript: Makefile
-
 DISTCLEANFILES = pybscript
 
 CLEANFILES = $(bin_SCRIPTS)


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