summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCebtenzzre2018-12-04 17:53:44 -0500
committerCebtenzzre2018-12-04 17:53:44 -0500
commit1be6246beb3f2c72ea7b82f1b675037b64d4204a (patch)
tree00eed2f0dbd537ae36709de146c5871f42553d50
downloadaur-1be6246beb3f2c72ea7b82f1b675037b64d4204a.tar.gz
Initial commit
-rw-r--r--.SRCINFO28
-rw-r--r--.gitignore1
-rw-r--r--PKGBUILD47
-rw-r--r--threadsafe.patch180
4 files changed, 256 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..eaa4763391ad
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,28 @@
+pkgbase = libx11-threadsafe
+ pkgdesc = X11 client-side library
+ pkgver = 1.6.7
+ pkgrel = 1
+ url = https://xorg.freedesktop.org/
+ arch = x86_64
+ license = custom
+ makedepends = xorg-util-macros
+ makedepends = xextproto
+ makedepends = xtrans
+ makedepends = inputproto
+ depends = libxcb
+ depends = xproto
+ depends = kbproto
+ provides = libx11=1.6.7
+ conflicts = libx11=1.6.7
+ source = https://xorg.freedesktop.org//releases/individual/lib/libX11-1.6.7.tar.bz2
+ source = https://xorg.freedesktop.org//releases/individual/lib/libX11-1.6.7.tar.bz2.sig
+ source = threadsafe.patch
+ validpgpkeys = 4A193C06D35E7C670FA4EF0BA2FB9E081F2D130E
+ validpgpkeys = C41C985FDCF1E5364576638B687393EE37D128F8
+ validpgpkeys = 3BB639E56F861FA2E86505690FDD682D974CA72A
+ sha256sums = 910e9e30efba4ad3672ca277741c2728aebffa7bc526f04dcfa74df2e52a1348
+ sha256sums = SKIP
+ sha256sums = 1bbe923604ee12fd2b7d0a575b3a7212463c4ae558e5df1ac5f9646de3c5e5f5
+
+pkgname = libx11-threadsafe
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..72e8ffc0db8a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..5c8602aff8ca
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,47 @@
+# Contributor: Andreas Radke <andyrtr@archlinux.org>
+# Contributor: Jan de Groot <jgc@archlinux.org>
+# Maintainer: Cebtenzzre <cebtenzzre (at) gmail (dot) com>
+
+pkgname=libx11-threadsafe
+pkgver=1.6.7
+pkgrel=1
+pkgdesc="X11 client-side library"
+arch=(x86_64)
+url="https://xorg.freedesktop.org/"
+depends=('libxcb' 'xproto' 'kbproto')
+makedepends=('xorg-util-macros' 'xextproto' 'xtrans' 'inputproto')
+provides=("libx11=${pkgver}")
+conflicts=("libx11=${pkgver}")
+license=('custom')
+source=(${url}/releases/individual/lib/libX11-${pkgver}.tar.bz2{,.sig}
+ threadsafe.patch)
+sha256sums=('910e9e30efba4ad3672ca277741c2728aebffa7bc526f04dcfa74df2e52a1348'
+ 'SKIP'
+ '1bbe923604ee12fd2b7d0a575b3a7212463c4ae558e5df1ac5f9646de3c5e5f5')
+validpgpkeys=('4A193C06D35E7C670FA4EF0BA2FB9E081F2D130E')
+validpgpkeys+=('C41C985FDCF1E5364576638B687393EE37D128F8') # Matthieu Herrb <matthieu.herrb@laas.fr>
+validpgpkeys+=('3BB639E56F861FA2E86505690FDD682D974CA72A') # Matt Turner <mattst88@gmail.com>
+
+prepare() {
+ cd 'libX11-1.6.7'
+ patch -Np1 <../threadsafe.patch
+}
+
+build() {
+ cd "${srcdir}/libX11-${pkgver}"
+ ./configure --prefix=/usr --disable-static --disable-xf86bigfont
+ make
+}
+
+check() {
+ cd "${srcdir}/libX11-${pkgver}"
+ make check
+}
+
+package() {
+ cd "${srcdir}/libX11-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+
+ install -d -m755 "${pkgdir}/usr/share/licenses/${pkgname}"
+ install -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/"
+}
diff --git a/threadsafe.patch b/threadsafe.patch
new file mode 100644
index 000000000000..0bb2e7354610
--- /dev/null
+++ b/threadsafe.patch
@@ -0,0 +1,180 @@
+From the Xorg mailing list: https://lists.x.org/archives/xorg-devel/2017-August/054347.html
+
+Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=55678
+Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=68538
+Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=69088
+Signed-off-by: Jacek Caban <jacek at codeweavers.com>
+---
+diff --git a/src/xlibi18n/lcWrap.c b/src/xlibi18n/lcWrap.c
+index 38242608..43b4d622 100644
+--- a/src/xlibi18n/lcWrap.c
++++ b/src/xlibi18n/lcWrap.c
+@@ -324,6 +324,8 @@ _XCloseLC(
+ {
+ XLCdList cur, *prev;
+
++ _XLockMutex(_Xi18n_lock);
++
+ for (prev = &lcd_list; (cur = *prev); prev = &cur->next) {
+ if (cur->lcd == lcd) {
+ if (--cur->ref_count < 1) {
+@@ -339,6 +341,8 @@ _XCloseLC(
+ _XlcDeInitLoader();
+ loader_list = NULL;
+ }
++
++ _XUnlockMutex(_Xi18n_lock);
+ }
+
+ /*
+--
+2.13.0
+diff --git a/src/xlibi18n/lcWrap.c b/src/xlibi18n/lcWrap.c
+index 43b4d622..5339dcf3 100644
+--- a/src/xlibi18n/lcWrap.c
++++ b/src/xlibi18n/lcWrap.c
+@@ -352,17 +352,7 @@ _XCloseLC(
+ XLCd
+ _XlcCurrentLC(void)
+ {
+- XLCd lcd;
+- static XLCd last_lcd = NULL;
+-
+- lcd = _XOpenLC((char *) NULL);
+-
+- if (last_lcd)
+- _XCloseLC(last_lcd);
+-
+- last_lcd = lcd;
+-
+- return lcd;
++ return _XOpenLC(NULL);
+ }
+
+ XrmMethods
+diff --git a/src/locking.c b/src/locking.c
+index 9f4fe067..3981c0f5 100644
+--- a/src/locking.c
++++ b/src/locking.c
+@@ -66,6 +66,8 @@ in this Software without prior written authorization from The Open Group.
+
+ /* in lcWrap.c */
+ extern LockInfoPtr _Xi18n_lock;
++/* in lcConv.c */
++extern LockInfoPtr _conv_lock;
+
+ #ifdef WIN32
+ static DWORD _X_TlsIndex = (DWORD)-1;
+@@ -98,6 +100,7 @@ static xthread_t _Xthread_self(void)
+
+ static LockInfoRec global_lock;
+ static LockInfoRec i18n_lock;
++static LockInfoRec conv_lock;
+
+ static void _XLockMutex(
+ LockInfoPtr lip
+@@ -594,12 +597,22 @@ Status XInitThreads(void)
+ global_lock.lock = NULL;
+ return 0;
+ }
++ if (!(conv_lock.lock = xmutex_malloc())) {
++ xmutex_free(global_lock.lock);
++ global_lock.lock = NULL;
++ xmutex_free(i18n_lock.lock);
++ i18n_lock.lock = NULL;
++ return 0;
++ }
+ _Xglobal_lock = &global_lock;
+ xmutex_init(_Xglobal_lock->lock);
+ xmutex_set_name(_Xglobal_lock->lock, "Xlib global");
+ _Xi18n_lock = &i18n_lock;
+ xmutex_init(_Xi18n_lock->lock);
+ xmutex_set_name(_Xi18n_lock->lock, "Xlib i18n");
++ _conv_lock = &conv_lock;
++ xmutex_init(_conv_lock->lock);
++ xmutex_set_name(_conv_lock->lock, "Xlib conv");
+ _XLockMutex_fn = _XLockMutex;
+ _XUnlockMutex_fn = _XUnlockMutex;
+ _XCreateMutex_fn = _XCreateMutex;
+diff --git a/src/xlibi18n/lcConv.c b/src/xlibi18n/lcConv.c
+index 7d9a4738..32699746 100644
+--- a/src/xlibi18n/lcConv.c
++++ b/src/xlibi18n/lcConv.c
+@@ -29,6 +29,11 @@
+ #include "Xlibint.h"
+ #include "XlcPubI.h"
+ #include <stdio.h>
++#include "locking.h"
++
++#ifdef XTHREADS
++LockInfoPtr _conv_lock;
++#endif
+
+ typedef struct _XlcConverterListRec {
+ XLCd from_lcd;
+@@ -58,6 +63,9 @@ get_converter(
+ XrmQuark to_type)
+ {
+ XlcConverterList list, prev = NULL;
++ XlcConv conv = NULL;
++
++ _XLockMutex(_conv_lock);
+
+ for (list = conv_list; list; list = list->next) {
+ if (list->from_lcd == from_lcd && list->to_lcd == to_lcd
+@@ -69,13 +77,16 @@ get_converter(
+ conv_list = list;
+ }
+
+- return (*list->converter)(from_lcd, list->from, to_lcd, list->to);
++ conv = (*list->converter)(from_lcd, list->from, to_lcd, list->to);
++ break;
+ }
+
+ prev = list;
+ }
+
+- return (XlcConv) NULL;
++ _XUnlockMutex(_conv_lock);
++
++ return conv;
+ }
+
+ Bool
+@@ -92,18 +103,20 @@ _XlcSetConverter(
+ from_type = XrmStringToQuark(from);
+ to_type = XrmStringToQuark(to);
+
++ _XLockMutex(_conv_lock);
++
+ for (list = conv_list; list; list = list->next) {
+ if (list->from_lcd == from_lcd && list->to_lcd == to_lcd
+ && list->from_type == from_type && list->to_type == to_type) {
+
+ list->converter = converter;
+- return True;
++ goto ret;
+ }
+ }
+
+ list = Xmalloc(sizeof(XlcConverterListRec));
+ if (list == NULL)
+- return False;
++ goto ret;
+
+ list->from_lcd = from_lcd;
+ list->from = from;
+@@ -115,7 +128,9 @@ _XlcSetConverter(
+ list->next = conv_list;
+ conv_list = list;
+
+- return True;
++ret:
++ _XUnlockMutex(_conv_lock);
++ return list != NULL;
+ }
+
+ typedef struct _ConvRec {
+--
+2.13.0
+