[arch-commits] Commit in (4 files)
Balló György
bgyorgy at archlinux.org
Tue Mar 10 14:13:56 UTC 2020
Date: Tuesday, March 10, 2020 @ 14:13:56
Author: bgyorgy
Revision: 593626
Add back hamster-time-tracker
Added:
hamster-time-tracker/
hamster-time-tracker/trunk/
hamster-time-tracker/trunk/0001-Use-itstool-instead-of-xml2po.patch
hamster-time-tracker/trunk/PKGBUILD
------------------------------------------+
0001-Use-itstool-instead-of-xml2po.patch | 156 +++++++++++++++++++++++++++++
PKGBUILD | 36 ++++++
2 files changed, 192 insertions(+)
Added: hamster-time-tracker/trunk/0001-Use-itstool-instead-of-xml2po.patch
===================================================================
--- hamster-time-tracker/trunk/0001-Use-itstool-instead-of-xml2po.patch (rev 0)
+++ hamster-time-tracker/trunk/0001-Use-itstool-instead-of-xml2po.patch 2020-03-10 14:13:56 UTC (rev 593626)
@@ -0,0 +1,156 @@
+From 930a7e378d581f8c0065a7414e8dc98b9d9f3bc2 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:07:56 +0100
+Subject: [PATCH] Use itstool instead of xml2po
+
+xml2po is deprecated.
+---
+ README.md | 4 ++--
+ help/Makefile.am | 14 +++++++-------
+ help/wscript | 41 ++++++++++++++++++++++++-----------------
+ 3 files changed, 33 insertions(+), 26 deletions(-)
+
+diff --git a/README.md b/README.md
+index a91ead2f..91365ea8 100644
+--- a/README.md
++++ b/README.md
+@@ -65,7 +65,7 @@ https://snapcraft.io/hamster-snap
+ ```bash
+ sudo apt install gettext intltool python3-gi-cairo python3-distutils python3-dbus python3-xdg libglib2.0-dev
+ # and for documentation
+-sudo apt install gnome-doc-utils yelp
++sudo apt install itstool yelp
+ ```
+
+ ##### openSUSE
+@@ -73,7 +73,7 @@ sudo apt install gnome-doc-utils yelp
+ Leap-15.0 and Leap-15.1:
+ ```bash
+ sudo zypper install intltool python3-pyxdg python3-cairo python3-gobject-Gdk
+-sudo zypper install gnome-doc-utils xml2po yelp
++sudo zypper install itstool yelp
+ ```
+
+ ##### RPM-based
+diff --git a/help/Makefile.am b/help/Makefile.am
+index 0c88afad..908a3737 100644
+--- a/help/Makefile.am
++++ b/help/Makefile.am
+@@ -1,11 +1,8 @@
+-include $(top_srcdir)/gnome-doc-utils.make
+-dist-hook: doc-dist-hook
++ at YELP_HELP_RULES@
+
+-DOC_ID = hamster
+-DOC_INCLUDES = legal.xml
+-DOC_LINGUAS = cs da de el es fa fr gl hu pl pt_BR ro ru sl te zh_CN zh_HK zh_TW
++HELP_ID = hamster
+
+-DOC_PAGES = \
++HELP_FILES = \
+ backup.page \
+ index.page \
+ input.page \
+@@ -13,4 +10,7 @@ DOC_PAGES = \
+ merge.page \
+ reports.page \
+ statistics.page \
+- tracking.page
++ tracking.page \
++ legal.xml
++
++HELP_LINGUAS = cs da de el es fa fr gl hu pl pt_BR ro ru sl te zh_CN zh_HK zh_TW
+diff --git a/help/wscript b/help/wscript
+index 6d385fc8..3d05c5d2 100644
+--- a/help/wscript
++++ b/help/wscript
+@@ -9,50 +9,56 @@ import os
+ from waflib import Logs, TaskGen
+
+ 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 {}:".format(mf_am.abspath()))
++ print("Missing HELP variable declarations in {}:".format(mf_am.abspath()))
+ print("\n".join(missing_vars))
+
+- self.bld.env.update(DOC_VAR)
++ self.bld.env.update(HELP_VAR)
+ self.default_install_path='${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 = [p.name for p in cnode.ant_glob("*.page")]
+
+ # 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(pages).difference(declared_pages)
+ if missing_pages:
+ print("Warning: Some pages not declared:")
+ print("\n".join(missing_pages))
+
+- install_path = lambda lang: os.path.join(bld.env.DATADIR, "help", lang, "${DOC_ID}")
++ install_path = lambda lang: os.path.join(bld.env.DATADIR, "help", lang, "${HELP_ID}")
+
+ for lang in lst:
+ 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:
+- out = self.path.find_or_declare('%s/%s' % (lang, page))
+ src = self.path.find_resource('C/%s' % page)
+- bld(name='xml2po', color='BLUE',
+- rule='${XML2PO} ${XML2POFLAGS} ${SRC} > ${TGT}',
+- source=[node, src],
++ out = self.path.find_or_declare('%s/%s' % (lang, page))
++ bld(name='itstool', color='BLUE',
++ rule='${ITSTOOL} ${ITSTOOLFLAGS} ${SRC} -o ${TGT}',
++ source=[mo, src],
+ target=out,
+ install_path=install_path(lang)
+ )
+@@ -74,11 +80,12 @@ TaskGen.after('init_mallard')(apply_mallard)
+
+
+ def configure(ctx):
+- lookfor = "xml2po"
++ ctx.find_program('msgfmt', var='MSGFMT')
++ lookfor = "itstool"
+ try:
+- ctx.find_program(lookfor, var='XML2PO')
++ ctx.find_program(lookfor, var='ITSTOOL')
+ ctx.env.docs = True
+- ctx.env.XML2POFLAGS = '-mmallard -p'
++ ctx.env.ITSTOOLFLAGS = '-m'
+ except ctx.errors.ConfigurationError:
+ Logs.warn("'{}' not found; documentation build disabled".format(lookfor))
+ ctx.env.docs = False
+--
+2.25.1
+
Added: hamster-time-tracker/trunk/PKGBUILD
===================================================================
--- hamster-time-tracker/trunk/PKGBUILD (rev 0)
+++ hamster-time-tracker/trunk/PKGBUILD 2020-03-10 14:13:56 UTC (rev 593626)
@@ -0,0 +1,36 @@
+# Maintainer: Balló György <ballogyor+arch at gmail dot com>
+# Contributor: Jan de Groot <jgc at archlinux.org>
+# Contributor: Georg Vogetseder <georg.vogetseder at gmail.com>
+
+pkgname=hamster-time-tracker
+pkgver=3.0.1
+pkgrel=1
+pkgdesc="Time tracking application that helps you to keep track on how much time you have spent during the day on activities you choose to track"
+arch=('any')
+url="https://github.com/projecthamster/hamster"
+license=('GPL')
+depends=('gtk3' 'python-dbus' 'python-cairo' 'python-gobject' 'python-xdg')
+makedepends=('intltool' 'itstool')
+source=("$pkgname-$pkgver.tar.gz::https://github.com/projecthamster/hamster/archive/v$pkgver.tar.gz"
+ 0001-Use-itstool-instead-of-xml2po.patch)
+sha256sums=('f3386ce57ffcc67ccdcf1791baaaf7ada8467bee573802f34f796a126e752ca2'
+ '3a4b81e2f79468180212b35cdf7b1aa130ed2aa89e03617832bbd808a469c23d')
+
+prepare() {
+ cd hamster-$pkgver
+ # Don't use deprecated xml2po
+ # https://github.com/projecthamster/hamster/issues/583
+ patch -Np1 -i ../0001-Use-itstool-instead-of-xml2po.patch
+}
+
+build() {
+ cd hamster-$pkgver
+ python ./waf configure --prefix=/usr --libexecdir=/usr/lib --skip-icon-cache-update
+ python ./waf build
+}
+
+package() {
+ cd hamster-$pkgver
+ python ./waf install --destdir="$pkgdir"
+ rm "$pkgdir/usr/share/glib-2.0/schemas/gschemas.compiled"
+}
More information about the arch-commits
mailing list