diff options
| author | root <root@alpha.trunkmasters.com> | 2026-06-12 19:09:37 -0500 |
|---|---|---|
| committer | root <root@alpha.trunkmasters.com> | 2026-06-12 19:09:37 -0500 |
| commit | b590c8d7572b727d565cc0b8ff660d43569845de (patch) | |
| tree | 06f7a4102ea4e845df8b66660f252920d52952f9 /dev-util/itstool | |
| parent | 24f9cbfc4c34fdb6a6e03311674414e881ceab47 (diff) | |
| download | baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.gz baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.xz baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.zip | |
Adding metadata
Diffstat (limited to 'dev-util/itstool')
| -rw-r--r-- | dev-util/itstool/Manifest | 3 | ||||
| -rw-r--r-- | dev-util/itstool/files/itstool-2.0.7-missing-translation-fix.patch | 28 | ||||
| -rw-r--r-- | dev-util/itstool/files/itstool-2.0.7-raw-string-testrunner.patch | 15 | ||||
| -rw-r--r-- | dev-util/itstool/files/itstool-2.0.7-raw-string.patch | 74 | ||||
| -rw-r--r-- | dev-util/itstool/itstool-2.0.7-r2.ebuild | 38 | ||||
| -rw-r--r-- | dev-util/itstool/itstool-2.0.7_p20250326.ebuild | 47 | ||||
| -rw-r--r-- | dev-util/itstool/metadata.xml | 14 |
7 files changed, 219 insertions, 0 deletions
diff --git a/dev-util/itstool/Manifest b/dev-util/itstool/Manifest new file mode 100644 index 000000000000..2b9de0ef64c0 --- /dev/null +++ b/dev-util/itstool/Manifest @@ -0,0 +1,3 @@ +DIST itstool-2.0.7-switch-to-lxml.patch.xz 14280 BLAKE2B 261c16ca704ac40200150013d0025680c79fdd79eccc7da821b4a4b17106da29ef45bb286d02a5a52ae326a9c81b89da317ed5d8f0f4cff73e10ca4350887c52 SHA512 40e69baa1d644aa8bdf305fee396ee4bd15203f2d55aa3d7ece088a176a35624711eaa31ef05d6f3e6a0bfdd1ed39ab41911fc968099fe34802afdc4142b200a +DIST itstool-2.0.7.tar.bz2 104648 BLAKE2B e2d27d7b0a772596a0fa02b157bbef65b132b839c908c114596d21a54c245a0c941419a3555a8b9b7255800f9ef65d557a5b0f6847103b0a3934c908d43128ab SHA512 710c188e518a7eccbf9d31df59692fd6acc79430589a93ef4333f33f74440c311c340614ca74cc43191830567a98024d0981325ccd83a8fd9b75410d9dd91992 +DIST itstool-2.0.7_p20250326.tar.gz 79985 BLAKE2B f4a37c1927ebbcdeb82c1b3ef3557fb19d65a993d0c0ab50bb8f3f537d4de40e913d42fa3b473c9d35676c0824c91662e1f1504040d01939873db6a078458d27 SHA512 52ec7c97891bb55628a34141e39029003fa09bb3f79baeeaaf782710bc14e6e4eda4c5ca360728db68928cd27f331ff0e0f6ee8a954ad723e4619f0d2193e50c diff --git a/dev-util/itstool/files/itstool-2.0.7-missing-translation-fix.patch b/dev-util/itstool/files/itstool-2.0.7-missing-translation-fix.patch new file mode 100644 index 000000000000..bdd45e40eb80 --- /dev/null +++ b/dev-util/itstool/files/itstool-2.0.7-missing-translation-fix.patch @@ -0,0 +1,28 @@ +Bug: https://github.com/mate-desktop/mate-utils/issues/210 +Bug: https://github.com/itstool/itstool/issues/36# + +From: https://github.com/itstool/itstool/pull/47/commits/e9b053be5c50c2bd69442a8484a4c9c371bc3a45 +From: Harald van Dijk <harald@gigawatt.nl> +Date: Thu, 15 Jun 2023 23:18:11 +0100 +Subject: [PATCH] Fix handling of untranslated nodes + +If a translation is missing, get_translated returns the node it was +called with. But ph_node when passed to get_translated is part of +another document and cannot just be reparented, it needs to be cloned. +The reparenting leaves things in an inconsistent state where references +intended to refer to nodes in the original document no longer do so, and +they may then be accessed from those references after the new document +has already been freed. + +Fixes bug #36. +--- a/itstool.in ++++ b/itstool.in +@@ -1096,6 +1096,8 @@ class Document (object): + child.replaceNode(newnode) + else: + repl = self.get_translated(ph_node, translations, strict=strict, lang=lang) ++ if repl == ph_node: ++ repl = repl.copyNode(1) + child.replaceNode(repl) + scan_node(child) + try: diff --git a/dev-util/itstool/files/itstool-2.0.7-raw-string-testrunner.patch b/dev-util/itstool/files/itstool-2.0.7-raw-string-testrunner.patch new file mode 100644 index 000000000000..0f7d0b77b9a1 --- /dev/null +++ b/dev-util/itstool/files/itstool-2.0.7-raw-string-testrunner.patch @@ -0,0 +1,15 @@ +Followup fix to: +https://github.com/itstool/itstool/commit/32c7d07664dc37765100285d1202d488cd6a27e8 +but for the test runner, which we can now run. + +--- a/tests/run_tests.py ++++ b/tests/run_tests.py +@@ -379,7 +379,7 @@ class ITSTestRunner(unittest.TextTestRun + test_binary_path = os.path.join(ITSTOOL_DIR, "itstool_test") + shutil.copy(os.path.join(ITSTOOL_DIR, "itstool.in"), test_binary_path) + data_dir = os.path.join(ITSTOOL_DIR, "its") +- call("sed -i -e 's/@DATADIR@/%s/' %s" % (data_dir.replace('/', '\/'), test_binary_path), shell=True) ++ call("sed -i -e 's/@DATADIR@/%s/' %s" % (data_dir.replace('/', r'\/'), test_binary_path), shell=True) + + result = super(ITSTestRunner, self).run(test) + diff --git a/dev-util/itstool/files/itstool-2.0.7-raw-string.patch b/dev-util/itstool/files/itstool-2.0.7-raw-string.patch new file mode 100644 index 000000000000..d879734b7622 --- /dev/null +++ b/dev-util/itstool/files/itstool-2.0.7-raw-string.patch @@ -0,0 +1,74 @@ +From: https://github.com/itstool/itstool/pull/51/commits/32c7d07664dc37765100285d1202d488cd6a27e8 +From 32c7d07664dc37765100285d1202d488cd6a27e8 Mon Sep 17 00:00:00 2001 +From: Nils Philippsen <nils@tiptoe.de> +Date: Mon, 9 Oct 2023 14:26:43 +0200 +Subject: [PATCH] Fix insufficiently quoted regular expressions + +These went under the radar until Python 3.12 started warning about them. + +Signed-off-by: Nils Philippsen <nils@tiptoe.de> +--- + itstool.in | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/itstool.in b/itstool.in +index c21ad4b..4452616 100755 +--- a/itstool.in ++++ b/itstool.in +@@ -220,7 +220,7 @@ class Message (object): + if not isinstance(text, ustr_type): + text = ustr(text, 'utf-8') + self._message[-1] += text.replace('&', '&').replace('<', '<').replace('>', '>') +- if re.sub('\s+', ' ', text).strip() != '': ++ if re.sub(r'\s+', ' ', text).strip() != '': + self._empty = False + + def add_entity_ref (self, name): +@@ -318,7 +318,7 @@ class Message (object): + message += '<_:%s-%i/>' % (msg.name, placeholder) + placeholder += 1 + if not self._preserve: +- message = re.sub('\s+', ' ', message).strip() ++ message = re.sub(r'\s+', ' ', message).strip() + return message + + def get_preserve_space (self): +@@ -456,9 +456,9 @@ class LocNote (object): + if self._preserve_space: + return self.locnote + else: +- return re.sub('\s+', ' ', self.locnote).strip() ++ return re.sub(r'\s+', ' ', self.locnote).strip() + elif self.locnoteref is not None: +- return '(itstool) link: ' + re.sub('\s+', ' ', self.locnoteref).strip() ++ return '(itstool) link: ' + re.sub(r'\s+', ' ', self.locnoteref).strip() + return '' + + +@@ -889,7 +889,7 @@ class Document (object): + trans = translations.ugettext('_\x04translator-credits') + if trans is None or trans == 'translator-credits': + return +- regex = re.compile('(.*) \<(.*)\>, (.*)') ++ regex = re.compile(r'(.*) \<(.*)\>, (.*)') + for credit in trans.split('\n'): + match = regex.match(credit) + if not match: +@@ -924,7 +924,7 @@ class Document (object): + prevnode = None + if node.prev is not None and node.prev.type == 'text': + prevtext = node.prev.content +- if re.sub('\s+', '', prevtext) == '': ++ if re.sub(r'\s+', '', prevtext) == '': + prevnode = node.prev + for lang in sorted(list(translations.keys()), reverse=True): + locale = self.get_its_locale_filter(node) +@@ -1468,7 +1468,7 @@ def match_locale(extrange, locale): + localei += 1 + return True + +-_locale_pattern = re.compile('([a-zA-Z0-9-]+)(_[A-Za-z0-9]+)?(@[A-Za-z0-9]+)?(\.[A-Za-z0-9]+)?') ++_locale_pattern = re.compile(r'([a-zA-Z0-9-]+)(_[A-Za-z0-9]+)?(@[A-Za-z0-9]+)?(\.[A-Za-z0-9]+)?') + def convert_locale (locale): + # Automatically convert POSIX-style locales to BCP47 + match = _locale_pattern.match(locale) diff --git a/dev-util/itstool/itstool-2.0.7-r2.ebuild b/dev-util/itstool/itstool-2.0.7-r2.ebuild new file mode 100644 index 000000000000..db1343a09c28 --- /dev/null +++ b/dev-util/itstool/itstool-2.0.7-r2.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{13..14} ) +PYTHON_REQ_USE="xml(+)" + +inherit python-single-r1 + +DESCRIPTION="Translation tool for XML documents that uses gettext files and ITS rules" +HOMEPAGE="http://itstool.org/" +SRC_URI="http://files.itstool.org/itstool/${P}.tar.bz2" + +# files in /usr/share/itstool/its are under a special exception || GPL-3+ +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~x64-macos ~x64-solaris" + +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +RDEPEND="${PYTHON_DEPS} + $(python_gen_cond_dep ' + dev-libs/libxml2[python,${PYTHON_USEDEP}] + ')" +DEPEND="${RDEPEND}" + +DOCS=(ChangeLog NEWS) # AUTHORS, README are empty + +PATCHES=( + "${FILESDIR}"/${PN}-2.0.7-missing-translation-fix.patch + "${FILESDIR}"/${PN}-2.0.7-raw-string.patch +) + +src_test() { + : + #"${PYTHON}" tests/run_tests.py || die "test suite failed" # Test suite not shipped in tarball +} diff --git a/dev-util/itstool/itstool-2.0.7_p20250326.ebuild b/dev-util/itstool/itstool-2.0.7_p20250326.ebuild new file mode 100644 index 000000000000..706d4434539c --- /dev/null +++ b/dev-util/itstool/itstool-2.0.7_p20250326.ebuild @@ -0,0 +1,47 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{13..14} ) +PYTHON_REQ_USE="xml(+)" + +inherit autotools python-single-r1 + +DESCRIPTION="Translation tool for XML documents that uses gettext files and ITS rules" +HOMEPAGE="https://itstool.org/" + +# use snapshot due to a lack of releases +COMMIT="19f9580f27aa261ea383b395fdef7e153f3f9e6d" +SRC_URI="https://github.com/itstool/itstool/archive/${COMMIT}.tar.gz -> ${P}.tar.gz" +SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${PN}-2.0.7-switch-to-lxml.patch.xz" +S="${WORKDIR}/${PN}-${COMMIT}" + +# files in /usr/share/itstool/its are under a special exception || GPL-3+ +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~x64-macos ~x64-solaris" + +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +RDEPEND="${PYTHON_DEPS} + $(python_gen_cond_dep ' + dev-python/lxml[${PYTHON_USEDEP}] + ')" +DEPEND="${RDEPEND}" + +DOCS=( NEWS ) # Changelog is missing; AUTHORS, README are empty + +PATCHES=( + "${WORKDIR}"/${PN}-2.0.7-switch-to-lxml.patch + "${FILESDIR}"/${PN}-2.0.7-raw-string-testrunner.patch +) + +src_prepare() { + default + eautoreconf +} + +src_test() { + "${PYTHON}" tests/run_tests.py || die "test suite failed" +} diff --git a/dev-util/itstool/metadata.xml b/dev-util/itstool/metadata.xml new file mode 100644 index 000000000000..cb51bc06d3bd --- /dev/null +++ b/dev-util/itstool/metadata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>gnome@gentoo.org</email> + <name>Gentoo GNOME Desktop</name> + </maintainer> + <longdescription lang="en">ITS Tool allows you to translate your XML documents + with gettext PO files, using rules from the W3C Internationalization Tag Set + (ITS) to determine what to translate and how to separate it into PO file + messages. + </longdescription> + <origin>baldeagleos-repo</origin> +</pkgmetadata> |
