commit:     681fc965ddaffd0a33ddb751e16bdcf31b07c346
Author:     Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com>
AuthorDate: Sun Oct 12 12:54:44 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Oct 12 16:46:58 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=681fc965

dev-util/itstool: add 2.0.7_p20250326 snapshot

- add git snapshot due to lack of releases
- add patch to move from libxml2 to lxml
- drop a patch that fixed a UAF in libxml2
- drop python-3.10, add python 3.14
- enable tests, successfully run with python-3.13/14

Closes: https://bugs.gentoo.org/964167
Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com>
Part-of: https://github.com/gentoo/gentoo/pull/44143
Closes: https://github.com/gentoo/gentoo/pull/44143
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/itstool/Manifest                          |  2 +
 .../itstool-2.0.7-raw-string-testrunner.patch      | 15 +++++++
 dev-util/itstool/itstool-2.0.7_p20250326.ebuild    | 47 ++++++++++++++++++++++
 3 files changed, 64 insertions(+)

diff --git a/dev-util/itstool/Manifest b/dev-util/itstool/Manifest
index d880ac0e6423..2b9de0ef64c0 100644
--- a/dev-util/itstool/Manifest
+++ b/dev-util/itstool/Manifest
@@ -1 +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-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/itstool-2.0.7_p20250326.ebuild 
b/dev-util/itstool/itstool-2.0.7_p20250326.ebuild
new file mode 100644
index 000000000000..51f05793dffa
--- /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_{11..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 ~amd64-linux ~x86-linux ~ppc-macos ~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"
+}

Reply via email to