Add various packages and patches for build system improvements
- Introduced valgrind with a patch to respect flags and updated its configuration. - Added Vulkan ICD loader with CMake build configuration. - Implemented Waf build system with a custom build script and configuration. - Included Wayland protocols with Meson build system. - Added xcb-util-keysyms with autotools configuration. - Introduced Yasm with multiple patches for compatibility and improvements. - Added Yelp tools and XSL with Meson build configurations and necessary patches for POSIX compliance.
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Tanguy Ortolo <tanguy+debian@ortolo.eu>
|
||||
Date: Fri, 7 Dec 2018 00:00:00 +0000
|
||||
Subject: [PATCH] Fix the crash from #912099
|
||||
|
||||
ITS Tool 2.0.4 crashes when building some documentation, as reported in #912099.
|
||||
This comes from translations with invalid XML markup, which ITS Tool fails to
|
||||
merge (which is not abnormal), and to report these issues, needlessly encodes
|
||||
the original msgstr from unicode to bytes, causing it to be recoded using the
|
||||
default ascii codec, which fails when the msgstr contains anything out of ascii.
|
||||
|
||||
This patch removes the useless decoding, avoiding the failing subsequent
|
||||
recoding. It also explicitly encodes the output strings to be able to print them
|
||||
in all cases, even when the output encoding cannot be detected.
|
||||
|
||||
Bug: https://github.com/itstool/itstool/issues/25
|
||||
Bug-Debian: https://bugs.debian.org/912099
|
||||
Forwarded: https://github.com/itstool/itstool/issues/25
|
||||
---
|
||||
itstool.in | 21 +++++++++++++++++----
|
||||
1 file changed, 17 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/itstool.in b/itstool.in
|
||||
index c21ad4bfeb86..f34673581c88 100755
|
||||
--- a/itstool.in
|
||||
+++ b/itstool.in
|
||||
@@ -44,9 +44,22 @@ if PY3:
|
||||
else:
|
||||
return str(s)
|
||||
ustr_type = str
|
||||
+ def pr_str(s):
|
||||
+ """Return a string that can be safely print()ed"""
|
||||
+ # Since print works on both bytes and unicode, just return the argument
|
||||
+ return s
|
||||
else:
|
||||
string_types = basestring,
|
||||
ustr = ustr_type = unicode
|
||||
+ def pr_str(s):
|
||||
+ """Return a string that can be safely print()ed"""
|
||||
+ if isinstance(s, str):
|
||||
+ # Since print works on str, just return the argument
|
||||
+ return s
|
||||
+ else:
|
||||
+ # print may not work on unicode if the output encoding cannot be
|
||||
+ # detected, so just encode with UTF-8
|
||||
+ return unicode.encode(s, 'utf-8')
|
||||
|
||||
NS_ITS = 'http://www.w3.org/2005/11/its'
|
||||
NS_ITST = 'http://itstool.org/extensions/'
|
||||
@@ -1077,36 +1090,36 @@ class Document (object):
|
||||
if strict:
|
||||
raise
|
||||
else:
|
||||
- sys.stderr.write('Warning: Could not merge %stranslation for msgid:\n%s\n' % (
|
||||
+ sys.stderr.write(pr_str('Warning: Could not merge %stranslation for msgid:\n%s\n' % (
|
||||
(lang + ' ') if lang is not None else '',
|
||||
- msgstr.encode('utf-8')))
|
||||
+ msgstr)))
|
||||
self._xml_err = ''
|
||||
return node
|
||||
def scan_node(node):
|
||||
children = [child for child in xml_child_iter(node)]
|
||||
for child in children:
|
||||
if child.type != 'element':
|
||||
continue
|
||||
if child.ns() is not None and child.ns().content == NS_BLANK:
|
||||
ph_node = msg.get_placeholder(child.name).node
|
||||
if self.has_child_elements(ph_node):
|
||||
self.merge_translations(translations, None, ph_node, strict=strict)
|
||||
newnode = ph_node.copyNode(1)
|
||||
newnode.setTreeDoc(self._doc)
|
||||
child.replaceNode(newnode)
|
||||
else:
|
||||
repl = self.get_translated(ph_node, translations, strict=strict, lang=lang)
|
||||
child.replaceNode(repl)
|
||||
scan_node(child)
|
||||
try:
|
||||
scan_node(trnode)
|
||||
except:
|
||||
if strict:
|
||||
raise
|
||||
else:
|
||||
- sys.stderr.write('Warning: Could not merge %stranslation for msgid:\n%s\n' % (
|
||||
+ sys.stderr.write(pr_str('Warning: Could not merge %stranslation for msgid:\n%s\n' % (
|
||||
(lang + ' ') if lang is not None else '',
|
||||
- msgstr.encode('utf-8')))
|
||||
+ msgstr)))
|
||||
self._xml_err = ''
|
||||
ctxt.doc().freeDoc()
|
||||
return node
|
||||
@@ -0,0 +1,73 @@
|
||||
From 0000000000000000000000000000000000000000 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 f34673581c88..8e8c657aa352 100755
|
||||
--- a/itstool.in
|
||||
+++ b/itstool.in
|
||||
@@ -233,7 +233,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):
|
||||
@@ -331,7 +331,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):
|
||||
@@ -469,9 +469,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 ''
|
||||
|
||||
|
||||
@@ -902,7 +902,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:
|
||||
@@ -937,7 +937,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)
|
||||
@@ -1481,7 +1481,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)
|
||||
@@ -0,0 +1,31 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
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.
|
||||
---
|
||||
itstool.in | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/itstool.in b/itstool.in
|
||||
index 8e8c657aa352..0e273b4c5bfa 100755
|
||||
--- a/itstool.in
|
||||
+++ b/itstool.in
|
||||
@@ -1109,6 +1109,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:
|
||||
@@ -0,0 +1,33 @@
|
||||
[build]
|
||||
type = "autotools"
|
||||
|
||||
[dependencies]
|
||||
runtime = [
|
||||
"docbook-xml",
|
||||
"libxml215",
|
||||
"python",
|
||||
]
|
||||
|
||||
[[manual_sources]]
|
||||
files = [
|
||||
"0001-Fix-the-crash-from-912099.patch",
|
||||
"0002-Fix-insufficiently-quoted-regular-expressions.patch",
|
||||
"0003-Fix-handling-of-untranslated-nodes.patch",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "Translate XML with PO files using W3C Internationalization Tag Set rules"
|
||||
homepage = "https://itstool.org/"
|
||||
license = "GPL-3.0-only"
|
||||
name = "itstool"
|
||||
version = "2.0.7"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
patches = [
|
||||
"0001-Fix-the-crash-from-912099.patch",
|
||||
"0002-Fix-insufficiently-quoted-regular-expressions.patch",
|
||||
"0003-Fix-handling-of-untranslated-nodes.patch",
|
||||
]
|
||||
post_extract = ["autoreconf -fiv"]
|
||||
url = "https://github.com/itstool/itstool.git#$version"
|
||||
Reference in New Issue
Block a user