add itstool

upg libx11 tbb
This commit is contained in:
joborun linux 2023-01-08 03:24:58 +02:00
parent 49329d2a1b
commit a5450b715f
11 changed files with 275 additions and 25 deletions

View File

@ -73,4 +73,3 @@ license=('GPL')
sha256sums=(2a3ee47f7276b759f74bac7614c05a1296a5b028d3f6a79a88e4c213db78e7dc) # doxygen-1.9.6.tar.gz

View File

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

57
itstool/PKGBUILD Normal file
View File

@ -0,0 +1,57 @@
#!/usr/bin/bash
# JOBoRun : Jwm OpenBox Obarun RUNit
# Maintainer : Joe Bo Run <joborun@disroot.org>
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=itstool
pkgver=2.0.7
pkgrel=01
epoch=1
pkgdesc="XML to PO and back again"
arch=(any)
url="http://itstool.org/"
depends=(python libxml2 docbook-xml)
makedepends=(git)
_commit=f1c6544dcd83a73a5ccea9e0c48cf9a47e006190 # tags/2.0.7^0
source=("git+https://github.com/itstool/itstool#commit=$_commit"
0001-Fix-the-crash-from-912099.patch)
pkgver() {
cd $pkgname
git describe --tags | sed 's/-/+/g'
}
prepare() {
cd $pkgname
# https://src.fedoraproject.org/rpms/itstool/blob/rawhide/f/itstool-2.0.5-fix-crash-wrong-encoding.patch
git apply -3 ../0001-Fix-the-crash-from-912099.patch
autoreconf -fvi
}
build() {
cd $pkgname
./configure --prefix=/usr
make
}
check() {
cd $pkgname
make check
}
package() {
cd $pkgname
make DESTDIR="$pkgdir" install
}
#---- license gpg-key sha256sums ----
license=(GPL3)
sha256sums=(SKIP
b43cea38118aaefa6724136d142dcc7099cd6de04cf2e226f53d4310dfe207cc) # 0001-Fix-the-crash-from-912099.patch

48
itstool/PKGBUILD-arch Normal file
View File

@ -0,0 +1,48 @@
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Michael Pusterhofer <pusterhofer(at)student(dot)tugraz(dot)at>
pkgname=itstool
pkgver=2.0.7
pkgrel=1
epoch=1
pkgdesc="XML to PO and back again"
arch=(any)
url="http://itstool.org/"
license=(GPL3)
depends=(python libxml2 docbook-xml)
makedepends=(git)
_commit=f1c6544dcd83a73a5ccea9e0c48cf9a47e006190 # tags/2.0.7^0
source=("git+https://github.com/itstool/itstool#commit=$_commit"
0001-Fix-the-crash-from-912099.patch)
sha256sums=('SKIP'
'b43cea38118aaefa6724136d142dcc7099cd6de04cf2e226f53d4310dfe207cc')
pkgver() {
cd $pkgname
git describe --tags | sed 's/-/+/g'
}
prepare() {
cd $pkgname
# https://src.fedoraproject.org/rpms/itstool/blob/rawhide/f/itstool-2.0.5-fix-crash-wrong-encoding.patch
git apply -3 ../0001-Fix-the-crash-from-912099.patch
autoreconf -fvi
}
build() {
cd $pkgname
./configure --prefix=/usr
make
}
check() {
cd $pkgname
make check
}
package() {
cd $pkgname
make DESTDIR="$pkgdir" install
}

1
itstool/clean Normal file
View File

@ -0,0 +1 @@
rm -rf {src,pkg,itstool}

7
itstool/deps Normal file
View File

@ -0,0 +1,7 @@
python
libxml2
docbook-xml
git
autoconf
automake

View File

@ -0,0 +1,57 @@
From 88399e01be679bfcc9a5e8922ffe2c47f0e56dee Mon Sep 17 00:00:00 2001
From: Yuxuan Shui <yshuiv7@gmail.com>
Date: Tue, 3 Jan 2023 15:09:28 +0000
Subject: [PATCH] Revert "Update XPutBackEvent() to support clients that put
back unpadded events"
This reverts commit d6d6cba90215d323567fef13d6565756c9956f60.
The reverted commit intended to fix the problem where an unpadded X
event struct is passed into XPutBackEvent, by creating a padded struct
with _XEventToWire and _XWireToEvent. However, _XWireToEvent updates the
last sequence number in Display, which may cause xlib to complain about
lost sequence numbers.
IMO, the problem that commit tried to solve is a bug in the client
library, and workaround it inside Xlib is bad practice, especially given
the problem it caused. Plus, the offender cited in the original commit
message, freeglut, has already fixed this problem.
Fixes: #176 #174
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
---
src/PutBEvent.c | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/src/PutBEvent.c b/src/PutBEvent.c
index f7b74b31..0f9df342 100644
--- a/src/PutBEvent.c
+++ b/src/PutBEvent.c
@@ -79,22 +79,9 @@ XPutBackEvent (
register XEvent *event)
{
int ret;
- xEvent wire = {0};
- XEvent lib = {0};
- Status (*fp)(Display *, XEvent *, xEvent *);
- int type = event->type & 0177;
LockDisplay(dpy);
- fp = dpy->wire_vec[type];
- if (fp == NULL)
- fp = _XEventToWire;
- ret = (*fp)(dpy, event, &wire);
- if (ret)
- {
- ret = (*dpy->event_vec[type])(dpy, &lib, &wire);
- if (ret)
- ret = _XPutBackEvent(dpy, &lib);
- }
+ ret = _XPutBackEvent(dpy, event);
UnlockDisplay(dpy);
return ret;
}
--
GitLab

View File

@ -7,7 +7,7 @@
pkgname=libx11
pkgver=1.8.3
pkgrel=03
pkgrel=04
pkgdesc="X11 client-side library w/o ipv6"
arch=(x86_64)
url="https://xorg.freedesktop.org/"
@ -17,17 +17,13 @@ depends=('libxcb' 'xorgproto')
makedepends=('xorg-util-macros' 'xtrans')
# options=('debug') ## uncomment this line to have the debug pkg produced
source=(${url}/releases/individual/lib/libX11-${pkgver}.tar.xz{,.sig}
176.diff
177.diff)
0001-Revert_Update_XPutBackEvent.diff)
prepare() {
cd libX11-${pkgver}
# https://gitlab.freedesktop.org/xorg/lib/libx11/-/merge_requests/176
# should fix FS#76669
patch -Np1 -i ../176.diff
# https://gitlab.freedesktop.org/xorg/lib/libx11/-/merge_requests/177
# should fix FS#76860
patch -Np1 -i ../177.diff
# https://gitlab.freedesktop.org/xorg/lib/libx11/-/merge_requests/180 // fixes also MR #176/#187
# should fix FS#76669; FS#69295; FS#76860
patch -Np1 -i ../0001-Revert_Update_XPutBackEvent.diff
}
build() {
@ -67,7 +63,6 @@ validpgpkeys=('4A193C06D35E7C670FA4EF0BA2FB9E081F2D130E') # Alan Coopersmith <al
sha256sums=(e31565c84006b6b8e01dc9399c806085739710bc2db2e0930f1511ed9d6585bd # libX11-1.8.3.tar.xz
1bbabdabac57d92e4aa6b36027f10cbbf1aac5083e0276ff07b16c4179e167fc # libX11-1.8.3.tar.xz.sig
c78b76692cf0d4190847a56b33468c27f9c72c6c786a8bc54b5a6a0be1bc272a # 176.diff
02d6937aa7a30d1908a56f5fdbea769953e936b59bda4982afa4cf3db2ab2c69) # 177.diff
25cc0dbc16ab15c14c202c492d36593822098ae8abc422ff2e83f1aebc1579ca) # 0001-Revert_Update_XPutBackEvent.diff

View File

@ -2,7 +2,7 @@
pkgname=libx11
pkgver=1.8.3
pkgrel=3
pkgrel=4
pkgdesc="X11 client-side library"
arch=(x86_64)
url="https://xorg.freedesktop.org/"
@ -13,12 +13,10 @@ makedepends=('xorg-util-macros' 'xtrans')
license=('custom')
options=('debug')
source=(${url}/releases/individual/lib/libX11-${pkgver}.tar.xz{,.sig}
176.diff
177.diff)
0001-Revert_Update_XPutBackEvent.diff)
sha512sums=('bc862338fed855986659e9ffa641db6b36c3ac9abced590d1b164e3cc24446671936e3688cdca18393129c4ea41777977eeb37e87d8edc14d6cc5d194a9c0325'
'SKIP'
'6f5a06e7191b355e5adf48c3391ba66dc2482673b1a485f4c53253c1b800847b9c20c006140b1775644dbd6c77668e588b7df9d6f23aee3e3c9d36b7135c3f8b'
'6c6c1c98f36bffb4f492e83f3e76fa6fe07757dff52d72a891c389e94c53350ab7bd1e07fcaaa6e1eea69b6c1138e2bdc5e7466a58a3de5799bca705db478ab0')
'1db742e84c6373d6ce2273c82e5e9b72d7943eea4ffedc9b99570037072ae2cfdf7cd318bf4d5fc6da908304286068e8ba181f6a12cb21b15d47699e77b51341')
validpgpkeys=('4A193C06D35E7C670FA4EF0BA2FB9E081F2D130E') # Alan Coopersmith <alanc@freedesktop.org>
#validpgpkeys=('C41C985FDCF1E5364576638B687393EE37D128F8') # Matthieu Herrb <matthieu.herrb@laas.fr>
#validpgpkeys=('3BB639E56F861FA2E86505690FDD682D974CA72A') # Matt Turner <mattst88@gmail.com>
@ -27,12 +25,9 @@ validpgpkeys=('4A193C06D35E7C670FA4EF0BA2FB9E081F2D130E') # Alan Coopersmith <al
prepare() {
cd libX11-${pkgver}
# https://gitlab.freedesktop.org/xorg/lib/libx11/-/merge_requests/176
# should fix FS#76669
patch -Np1 -i ../176.diff
# https://gitlab.freedesktop.org/xorg/lib/libx11/-/merge_requests/177
# should fix FS#76860
patch -Np1 -i ../177.diff
# https://gitlab.freedesktop.org/xorg/lib/libx11/-/merge_requests/180 // fixes also MR #176/#187
# should fix FS#76669; FS#69295; FS#76860
patch -Np1 -i ../0001-Revert_Update_XPutBackEvent.diff
}
build() {

View File

@ -1 +1 @@
rm -rf {src,pkg,pac*.tar.gz*}
rm -rf {src,pkg,pacman-contrib}

View File

@ -16,7 +16,7 @@ makedepends=('cmake' 'inetutils' 'ninja' 'python' 'swig')
conflicts=('intel-tbb')
provides=("intel-tbb=$pkgver")
replaces=('intel-tbb')
source=(https://github.com/oneapi-src/oneTBB/archive/v$pkgver/$pkgname-$pkgver.tar.gz)
source=(https://github.com/oneapi-src/oneTBB/archive/v$pkgver/$pkgname-$pkgver.tar.gz
retry-pthread_create.patch::https://github.com/oneapi-src/oneTBB/pull/824.patch)
## with or without the patch building fails (tried last 17 Noc 2022)
@ -58,3 +58,4 @@ license=('Apache')
sha256sums=(e5b57537c741400cf6134b428fc1689a649d7d38d9bb9c1b6d64f092ea28178a # tbb-2021.5.0.tar.gz
70b077d1cac26e35336a8217f9c56c1ce2c8885c6df6dfb9805aa8374dad9617) # retry-pthread_create.patch