new blfs: dev-util/itstool-2.0.7

This commit is contained in:
2026-01-17 19:21:28 -05:00
parent 56a25f0fdb
commit 14f40dd1e0
2 changed files with 63 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
pkgname=itstool
pkgver=2.0.7
pkgdesc="Translation tool for XML documents that uses gettext files and ITS rules"
homepage="https://itstool.org/"
license=("GPL-3+")
depends=("dev-python/lxml")
_patches=("itstool-2.0.7-raw-string-testrunner.patch")
_patch_sums=("9864daaf40dcbb3a5074ea73d98275a1c5590044b4c1e74f980a78978a706153d5c70c347da5424757e877b0cc49307804a228404daf8f276568e214436c5610")
sources=("${pkgname}-${pkgver}.tar.gz"
"${pkgname}-2.0.7-switch-to-lxml.patch.xz"
"${_patches[@]}"
)
_commit="19f9580f27aa261ea383b395fdef7e153f3f9e6d"
urls=("https://github.com/itstool/itstool/archive/${_commit}.tar.gz"
"https://dev.gentoo.org/~sam/distfiles/dev-util/itstool/${sources[1]}"
"${_patches[@]}"
)
sha512sums=("52ec7c97891bb55628a34141e39029003fa09bb3f79baeeaaf782710bc14e6e4eda4c5ca360728db68928cd27f331ff0e0f6ee8a954ad723e4619f0d2193e50c"
"40e69baa1d644aa8bdf305fee396ee4bd15203f2d55aa3d7ece088a176a35624711eaa31ef05d6f3e6a0bfdd1ed39ab41911fc968099fe34802afdc4142b200a"
"${_patch_sums[@]}"
)
src_prepare() {
tar -xf ${distdir}/${sources[0]} --strip-components=1
for _patch in ${_patches[@]}; do
patch -p1 -i ${filedir}/${_patch}
done
cp -v ${distdir}/${sources[1]} ./
xz -d ${sources[1]}
patch -p1 -i ${sources[1]%.xz}
autoreconf -fiv
}
src_build() {
./configure --prefix=/usr
make
}
src_check() {
make check
}
src_install() {
make DESTDIR="$pkgdir" install
}
# vim:ft=sh syn=sh et sw=2:

View File

@@ -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)