[arch-commits] Commit in kupfer/trunk (2 files)

Balló György bgyorgy at archlinux.org
Tue Mar 10 15:07:41 UTC 2020


    Date: Tuesday, March 10, 2020 @ 15:07:40
  Author: bgyorgy
Revision: 593647

upgpkg: kupfer 319-4: Remove deprecated gnome-doc-utils dependency

Added:
  kupfer/trunk/0001-Use-itstool-instead-of-xml2po.patch
Modified:
  kupfer/trunk/PKGBUILD

------------------------------------------+
 0001-Use-itstool-instead-of-xml2po.patch |  189 +++++++++++++++++++++++++++++
 PKGBUILD                                 |   14 +-
 2 files changed, 199 insertions(+), 4 deletions(-)

Added: 0001-Use-itstool-instead-of-xml2po.patch
===================================================================
--- 0001-Use-itstool-instead-of-xml2po.patch	                        (rev 0)
+++ 0001-Use-itstool-instead-of-xml2po.patch	2020-03-10 15:07:40 UTC (rev 593647)
@@ -0,0 +1,189 @@
+From 5d4228ca5dde7b6eef3ea161bb679d7dbb69617f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ball=C3=B3=20Gy=C3=B6rgy?= <ballogyor at gmail.com>
+Date: Tue, 10 Mar 2020 15:58:39 +0100
+Subject: [PATCH] Use itstool instead of xml2po
+
+xml2po is deprecated.
+---
+ README.rst       |  2 +-
+ help/Makefile    |  7 ++++---
+ help/Makefile.am | 12 +++++-------
+ help/wscript     | 41 ++++++++++++++++++++++++-----------------
+ 4 files changed, 34 insertions(+), 28 deletions(-)
+
+diff --git a/README.rst b/README.rst
+index ff8be7f7..bb597a18 100644
+--- a/README.rst
++++ b/README.rst
+@@ -65,7 +65,7 @@ Build Requirements
+ * Python 3
+ * intltool
+ * optionally: rst2man (python-docutils)  to install the manpage
+-* optionally: xml2po (gnome-doc-utils)  to install mallard help pages
++* optionally: itstool  to install mallard help pages
+ 
+ Runtime Requirements
+ --------------------
+diff --git a/help/Makefile b/help/Makefile
+index 7121d1ba..ce1c2546 100644
+--- a/help/Makefile
++++ b/help/Makefile
+@@ -11,12 +11,13 @@ C:
+ 	make -C C
+ 
+ 
+-$(DOC_LINGUAS): C/*.page
+-	xml2po -mmallard -u "$@/$@.po" C/*.page
++$(HELP_LINGUAS): C/*.page
++	msgfmt "$@/$@.po" -o "$@/$@.mo"
++	itstool -m "$@/$@.mo" -o $@/ C/*.page
+ 
+ 
+ html:
+-	for lang in C $(DOC_LINGUAS) ; do \
++	for lang in C $(HELP_LINGUAS) ; do \
+ 		rm -r $$lang ; \
+ 		mkdir $$lang ; \
+ 		yelp-build html -o $$lang /usr/share/help/$$lang/kupfer ; \
+diff --git a/help/Makefile.am b/help/Makefile.am
+index 8976e24f..4016a71e 100644
+--- a/help/Makefile.am
++++ b/help/Makefile.am
+@@ -5,17 +5,15 @@
+ # This file is needed for GNOME's translation infrastructure,
+ # but it is never used as a real Makefile.
+ #
+-# Define all languages for translation in the variable DOC_LINGUAS
++# Define all languages for translation in the variable HELP_LINGUAS
+ #
+ 
+ 
+-# include $(top_srcdir)/gnome-doc-utils.make
++# @YELP_HELP_RULES@
+ 
+-DOC_ID = kupfer
+-DOC_INCLUDES =
+-DOC_FIGURES =
++HELP_ID = kupfer
+ 
+-DOC_PAGES = \
++HELP_FILES = \
+ 	generalusage.page \
+ 	index.page \
+ 	introduction.page \
+@@ -34,7 +32,7 @@ DOC_PAGES = \
+ 	plugin-websearch.page
+ 
+ 
+-DOC_LINGUAS = cs de el es fr it pl ro sl
++HELP_LINGUAS = cs de el es fr it pl ro sl
+ 
+ 
+ # dist-hook: doc-dist-hook
+diff --git a/help/wscript b/help/wscript
+index eebcf6d2..20ac7b6f 100644
+--- a/help/wscript
++++ b/help/wscript
+@@ -10,29 +10,29 @@ from waflib import Task, TaskGen, Utils
+ # FIXME: Support for figures
+ 
+ def _read_makefile_am(filename):
+-    "read a Makefile.am file for DOC_* variable definitions, return a dict"
++    "read a Makefile.am file for HELP_* variable definitions, return a dict"
+     varstring = open(filename).read()
+     varstring = varstring.replace("\\\n", " ")
+-    varlines = [L for L in varstring.splitlines() if L.startswith("DOC")]
++    varlines = [L for L in varstring.splitlines() if L.startswith("HELP")]
+     return dict(tuple(map(str.strip, var.split("=", 1))) for var in varlines)
+ 
+ def init_mallard(self):
+     mf_am = self.path.find_resource(self.variable_definitions)
+-    DOC_VAR = _read_makefile_am(mf_am.abspath())
++    HELP_VAR = _read_makefile_am(mf_am.abspath())
+ 
+-    require_vars = "DOC_ID DOC_LINGUAS DOC_PAGES".split()
+-    have_vars = set(var for var in DOC_VAR if DOC_VAR[var])
++    require_vars = "HELP_ID HELP_LINGUAS HELP_FILES".split()
++    have_vars = set(var for var in HELP_VAR if HELP_VAR[var])
+     missing_vars = set(require_vars).difference(have_vars)
+     if missing_vars:
+-        print("Missing DOC variable declarations in %s:" % (mf_am.abspath()))
++        print("Missing HELP variable declarations in %s:" % (mf_am.abspath()))
+         print("\n".join(missing_vars))
+ 
+-    self.bld.env.update(DOC_VAR)
++    self.bld.env.update(HELP_VAR)
+     self.help_install_prefix='${PREFIX}/share/help/'
+ 
+ def apply_mallard(self):
+     bld = self.bld
+-    lst = self.to_list(bld.env["DOC_LINGUAS"])
++    lst = self.to_list(bld.env["HELP_LINGUAS"])
+     cnode = self.path.find_dir("C")
+ 
+     pages = cnode.ant_glob("*.page")
+@@ -40,30 +40,36 @@ def apply_mallard(self):
+     self.install_path = Utils.subst_vars(self.help_install_prefix, self.env)
+ 
+     # Check if the declared page list is consistent
+-    declared_pages = self.to_list(bld.env["DOC_PAGES"])
++    declared_pages = self.to_list(bld.env["HELP_FILES"])
+     missing_pages = set([str(p) for p in pages]).difference(declared_pages)
+     if missing_pages:
+         print("Warning: Some pages not declared:")
+         print("\n".join([str(p) for p in missing_pages]))
+ 
+     for lang in lst:
+-        lang_install_path = os.path.join(self.install_path, lang, bld.env["DOC_ID"])
++        lang_install_path = os.path.join(self.install_path, lang, bld.env["HELP_ID"])
+         node = self.path.find_resource("%s/%s.po" % (lang, lang))
++        mo = self.path.find_or_declare("%s/%s.mo" % (lang, lang))
++        bld(name='msgfmt', color='BLUE',
++            rule='${MSGFMT} ${SRC} -o ${TGT}',
++	    source=node,
++	    target=mo,
++	    )
+         for page in pages:
+-            tsk = self.create_task('xml2po')
++            tsk = self.create_task('itstool')
+             out = self.path.find_or_declare('%s/%s' % (lang, page))
+             src = self.path.find_resource('C/%s' % page)
+-            tsk.set_inputs([node,src])
++            tsk.set_inputs([mo,src])
+             tsk.set_outputs(out)
+             bld.install_files(lang_install_path, tsk.outputs)
+         bld.install_files(lang_install_path, legal_xml)
+ 
+-    c_install_path = os.path.join(self.install_path, "C", bld.env["DOC_ID"])
++    c_install_path = os.path.join(self.install_path, "C", bld.env["HELP_ID"])
+     for page in pages:
+         bld.install_files(c_install_path, page)
+     bld.install_files(c_install_path, legal_xml)
+ 
+-Task.task_factory('xml2po', '${XML2PO} ${XML2POFLAGS} ${SRC} > ${TGT}',
++Task.task_factory('itstool', '${ITSTOOL} ${ITSTOOLFLAGS} ${SRC} -o ${TGT}',
+         color='BLUE')
+ 
+ TaskGen.feature("mallard")(init_mallard)
+@@ -79,14 +85,15 @@ def options(opt):
+     pass
+ 
+ def configure(ctx):
++    ctx.find_program('msgfmt', var='MSGFMT')
+     try:
+-        ctx.find_program('xml2po', var='XML2PO')
+-        ctx.env['XML2POFLAGS'] = '-mmallard -p'
++        ctx.find_program('itstool', var='ITSTOOL')
++        ctx.env['ITSTOOLFLAGS'] = '-m'
+     except ctx.errors.ConfigurationError:
+         pass
+ 
+ def build(bld):
+-    if bld.env["XML2PO"]:
++    if bld.env["ITSTOOL"]:
+         task = bld(features="mallard",
+             variable_definitions="Makefile.am",
+         )
+-- 
+2.25.1
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-03-10 15:07:29 UTC (rev 593646)
+++ PKGBUILD	2020-03-10 15:07:40 UTC (rev 593647)
@@ -5,22 +5,28 @@
 
 pkgname=kupfer
 pkgver=319
-pkgrel=3
+pkgrel=4
 pkgdesc="Launcher application written in python. Similar to Gnome-Do / Launchy"
 arch=('any')
 url="https://kupferlauncher.github.io/"
 license=('GPL3')
 depends=('libkeybinder3' 'libwnck3' 'python-cairo' 'python-dbus' 'python-gobject' 'python-xdg')
-makedepends=('gnome-doc-utils' 'intltool' 'python-docutils')
+makedepends=('intltool' 'itstool' 'python-docutils')
 optdepends=('gvfs: Trash plugin'
             'xautomation: Send Keys plugin')
-source=(https://github.com/kupferlauncher/$pkgname/releases/download/v$pkgver/$pkgname-v$pkgver.tar.xz{,.sig})
+source=(https://github.com/kupferlauncher/$pkgname/releases/download/v$pkgver/$pkgname-v$pkgver.tar.xz{,.sig}
+        0001-Use-itstool-instead-of-xml2po.patch)
 validpgpkeys=('2578ABA1F9023159DFF211B7368712C4D7A44445') # Ulrik Sverdrup
 sha256sums=('22357233984a6588a9f9743002363af38ea63b5c2684af487693a13c42973d31'
-            'SKIP')
+            'SKIP'
+            'aae540ed3bd9330ac0a1675395be3a0ee2252315da9f2f2934d27a18a58404b3')
 
 prepare() {
   cd $pkgname-v$pkgver
+  # Don't use deprecated xml2po
+  # https://github.com/kupferlauncher/kupfer/issues/128
+  patch -Np1 -i ../0001-Use-itstool-instead-of-xml2po.patch
+
   sed -e 's|raise StopIteration|return|g' -i waflib/Node.py # Fix build with Python 3.7
 }
 



More information about the arch-commits mailing list