[90554] trunk/dports/x11/xorg-libxcb/files

jeremyhu at macports.org jeremyhu at macports.org
Thu Mar 8 14:42:33 PST 2012


Revision: 90554
          http://trac.macports.org/changeset/90554
Author:   jeremyhu at macports.org
Date:     2012-03-08 14:42:32 -0800 (Thu, 08 Mar 2012)
Log Message:
-----------
xorg-libxcb: Actually add the patches...

Added Paths:
-----------
    trunk/dports/x11/xorg-libxcb/files/0001-Bump-xcb-proto-requirement.patch
    trunk/dports/x11/xorg-libxcb/files/0002-Revert-Fix-include-order-with-Xdmcp-on-WIN32.patch
    trunk/dports/x11/xorg-libxcb/files/0003-Fix-build-of-xcb_auth.c-with-XDMCP-on-WIN32.patch
    trunk/dports/x11/xorg-libxcb/files/0004-Update-use-of-error_connection-under-WIN32-to-_xcb_c.patch
    trunk/dports/x11/xorg-libxcb/files/0005-Add-xkb_internals-and-xkb_issues-to-EXTRA_DIST.patch
    trunk/dports/x11/xorg-libxcb/files/0006-Fallback-to-TCP-if-no-protocol-is-specified-and-the-.patch
    trunk/dports/x11/xorg-libxcb/files/0007-darwin-Use-read-2-rather-than-recv-2.patch
    trunk/dports/x11/xorg-libxcb/files/0008-Fix-a-busy-loop-on-BSD-and-Mac-OS.patch

Added: trunk/dports/x11/xorg-libxcb/files/0001-Bump-xcb-proto-requirement.patch
===================================================================
--- trunk/dports/x11/xorg-libxcb/files/0001-Bump-xcb-proto-requirement.patch	                        (rev 0)
+++ trunk/dports/x11/xorg-libxcb/files/0001-Bump-xcb-proto-requirement.patch	2012-03-08 22:42:32 UTC (rev 90554)
@@ -0,0 +1,28 @@
+From da1d15082baab844a3b9b2d5cc48620af0b806ec Mon Sep 17 00:00:00 2001
+From: Julien Danjou <julien at danjou.info>
+Date: Thu, 12 Jan 2012 10:25:07 +0100
+Subject: [PATCH 1/8] Bump xcb-proto requirement
+
+We are now unable to build xcb-proto before 1.7.
+
+Signed-off-by: Julien Danjou <julien at danjou.info>
+---
+ configure.ac |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git libxcb-1.8/configure.ac libxcb-1.8/configure.ac
+index 04529bd..9abaffc 100644
+--- libxcb-1.8/configure.ac
++++ libxcb-1.8/configure.ac
+@@ -34,7 +34,7 @@ fi
+ AC_SUBST(HTML_CHECK_RESULT)
+ 
+ # Checks for pkg-config packages
+-PKG_CHECK_MODULES(XCBPROTO, xcb-proto >= 1.6)
++PKG_CHECK_MODULES(XCBPROTO, xcb-proto >= 1.7)
+ NEEDED="pthread-stubs xau >= 0.99.2"
+ PKG_CHECK_MODULES(NEEDED, $NEEDED)
+ 
+-- 
+1.7.9.2
+

Added: trunk/dports/x11/xorg-libxcb/files/0002-Revert-Fix-include-order-with-Xdmcp-on-WIN32.patch
===================================================================
--- trunk/dports/x11/xorg-libxcb/files/0002-Revert-Fix-include-order-with-Xdmcp-on-WIN32.patch	                        (rev 0)
+++ trunk/dports/x11/xorg-libxcb/files/0002-Revert-Fix-include-order-with-Xdmcp-on-WIN32.patch	2012-03-08 22:42:32 UTC (rev 90554)
@@ -0,0 +1,47 @@
+From 6db1a2686f0f073438d36f5fa0f97b787842b0f2 Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston <jeremyhu at freedesktop.org>
+Date: Tue, 17 Jan 2012 23:55:23 -0800
+Subject: [PATCH 2/8] Revert "Fix include order with Xdmcp on WIN32"
+
+This reverts commit 0e9246def562be97cc816f824f702233a826ec56.
+
+This change caused build failures because <X11/Xdmcp.h> was never
+included under any circumstance.  This is because the check for
+HASXDMAUTH was moved before the inclusion of config.h (via xcbint.h)
+which defined it.
+
+Found-by: Tinderbox
+Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
+Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
+---
+ src/xcb_auth.c |    7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git libxcb-1.8/src/xcb_auth.c libxcb-1.8/src/xcb_auth.c
+index ea4ad8f..21c26b8 100644
+--- libxcb-1.8/src/xcb_auth.c
++++ libxcb-1.8/src/xcb_auth.c
+@@ -36,10 +36,6 @@
+ #include <rpc/types.h>
+ #endif
+ 
+-#ifdef HASXDMAUTH
+-#include <X11/Xdmcp.h>
+-#endif
+-
+ #ifdef _WIN32
+ #include "xcb_windefs.h"
+ #else
+@@ -52,6 +48,9 @@
+ #include "xcb.h"
+ #include "xcbint.h"
+ 
++#ifdef HASXDMAUTH
++#include <X11/Xdmcp.h>
++#endif
+ 
+ enum auth_protos {
+ #ifdef HASXDMAUTH
+-- 
+1.7.9.2
+

Added: trunk/dports/x11/xorg-libxcb/files/0003-Fix-build-of-xcb_auth.c-with-XDMCP-on-WIN32.patch
===================================================================
--- trunk/dports/x11/xorg-libxcb/files/0003-Fix-build-of-xcb_auth.c-with-XDMCP-on-WIN32.patch	                        (rev 0)
+++ trunk/dports/x11/xorg-libxcb/files/0003-Fix-build-of-xcb_auth.c-with-XDMCP-on-WIN32.patch	2012-03-08 22:42:32 UTC (rev 90554)
@@ -0,0 +1,59 @@
+From 87b7bf875e0105924ae306e90ca79512d6c0cf47 Mon Sep 17 00:00:00 2001
+From: Jon TURNEY <jon.turney at dronecode.org.uk>
+Date: Wed, 18 Jan 2012 14:11:07 +0000
+Subject: [PATCH 3/8] Fix build of xcb_auth.c with XDMCP on WIN32
+
+Fix a redefinition problem which shows up when building for _WIN32 and
+libXdmcp is installed, so HASXDMAUTH is enabled
+
+It seems this is a special place in xcb as it uses other X11 library headers here
+
+If HASXDMAUTH is defined, include the wrapped windows.h before any header which
+includes it unwrapped, to avoid conflicts with types defined in X headers
+
+We need to include config.h and check HASXDMAUTH to avoid an unconditional dependency
+on x11proto headers
+
+In file included from install/include/X11/Xdmcp.h:19:0,
+                 from git/xcb/libxcb/src/xcb_auth.c:52:
+install/include/X11/Xmd.h:120:14: error: conflicting types for 'INT32'
+/usr/i686-pc-mingw32/sys-root/mingw/include/basetsd.h:54:13: note: previous declaration of 'INT32' was here
+install/include/X11/Xmd.h:143:15: error: conflicting types for 'BOOL'
+/usr/i686-pc-mingw32/sys-root/mingw/include/windef.h:234:17: note: previous declaration of 'BOOL' was here
+
+Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
+Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
+---
+ src/xcb_auth.c |    9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git libxcb-1.8/src/xcb_auth.c libxcb-1.8/src/xcb_auth.c
+index 21c26b8..a5b730c 100644
+--- libxcb-1.8/src/xcb_auth.c
++++ libxcb-1.8/src/xcb_auth.c
+@@ -25,6 +25,10 @@
+ 
+ /* Authorization systems for the X protocol. */
+ 
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
+ #include <assert.h>
+ #include <X11/Xauth.h>
+ #include <sys/param.h>
+@@ -37,6 +41,11 @@
+ #endif
+ 
+ #ifdef _WIN32
++#ifdef HASXDMAUTH
++/* We must include the wrapped windows.h before any system header which includes
++   it unwrapped, to avoid conflicts with types defined in X headers */
++#include <X11/Xwindows.h>
++#endif
+ #include "xcb_windefs.h"
+ #else
+ #include <arpa/inet.h>
+-- 
+1.7.9.2
+

Added: trunk/dports/x11/xorg-libxcb/files/0004-Update-use-of-error_connection-under-WIN32-to-_xcb_c.patch
===================================================================
--- trunk/dports/x11/xorg-libxcb/files/0004-Update-use-of-error_connection-under-WIN32-to-_xcb_c.patch	                        (rev 0)
+++ trunk/dports/x11/xorg-libxcb/files/0004-Update-use-of-error_connection-under-WIN32-to-_xcb_c.patch	2012-03-08 22:42:32 UTC (rev 90554)
@@ -0,0 +1,35 @@
+From 68d30adde982f1be33a934707fa105c0db6f7f8f Mon Sep 17 00:00:00 2001
+From: Jon TURNEY <jon.turney at dronecode.org.uk>
+Date: Tue, 17 Jan 2012 20:59:56 +0000
+Subject: [PATCH 4/8] Update use of error_connection under WIN32 to
+ _xcb_conn_ret_error()
+
+Unfortunately, commit 31b57676 adding WSACleanup/WSAShutdown on Win32 adds a new use
+of error_connection, which was removed in commit 769acff0, applied 5 minutes earlier.
+
+src/xcb_util.c: In function 'xcb_connect_to_display_with_auth_info':
+src/xcb_util.c:433:39: error: 'error_connection' undeclared (first use in this function)
+
+Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
+Reviewed-by: Arvind Umrao <arvind.umrao at oracle.com>
+Signed-off-by: Uli Schlachter <psychon at znc.in>
+---
+ src/xcb_util.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git libxcb-1.8/src/xcb_util.c libxcb-1.8/src/xcb_util.c
+index 9329b81..7173db3 100644
+--- libxcb-1.8/src/xcb_util.c
++++ libxcb-1.8/src/xcb_util.c
+@@ -430,7 +430,7 @@ xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *displayname,
+ #ifdef _WIN32
+         WSADATA wsaData;
+         if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
+-            c = (xcb_connection_t *) &error_connection;
++            c = _xcb_conn_ret_error(XCB_CONN_ERROR);
+             goto out;
+         }
+ #endif
+-- 
+1.7.9.2
+

Added: trunk/dports/x11/xorg-libxcb/files/0005-Add-xkb_internals-and-xkb_issues-to-EXTRA_DIST.patch
===================================================================
--- trunk/dports/x11/xorg-libxcb/files/0005-Add-xkb_internals-and-xkb_issues-to-EXTRA_DIST.patch	                        (rev 0)
+++ trunk/dports/x11/xorg-libxcb/files/0005-Add-xkb_internals-and-xkb_issues-to-EXTRA_DIST.patch	2012-03-08 22:42:32 UTC (rev 90554)
@@ -0,0 +1,27 @@
+From f7bd139616d228b20eeb2c96b85e4093606c93fc Mon Sep 17 00:00:00 2001
+From: Arnaud Fontaine <arnau at debian.org>
+Date: Wed, 25 Jan 2012 17:18:20 +0900
+Subject: [PATCH 5/8] Add xkb_internals and xkb_issues to EXTRA_DIST.
+
+---
+ doc/Makefile.am |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git libxcb-1.8/doc/Makefile.am libxcb-1.8/doc/Makefile.am
+index 1925519..dbe2e0b 100644
+--- libxcb-1.8/doc/Makefile.am
++++ libxcb-1.8/doc/Makefile.am
+@@ -2,7 +2,9 @@
+ EXTRA_DIST = \
+ tutorial/index.html \
+ tutorial/xcb.css \
+-xcb.doxygen.in
++xcb.doxygen.in \
++xkb_internals \
++xkb_issues
+ 
+ docdirs = $(srcdir)/tutorial
+ 
+-- 
+1.7.9.2
+

Added: trunk/dports/x11/xorg-libxcb/files/0006-Fallback-to-TCP-if-no-protocol-is-specified-and-the-.patch
===================================================================
--- trunk/dports/x11/xorg-libxcb/files/0006-Fallback-to-TCP-if-no-protocol-is-specified-and-the-.patch	                        (rev 0)
+++ trunk/dports/x11/xorg-libxcb/files/0006-Fallback-to-TCP-if-no-protocol-is-specified-and-the-.patch	2012-03-08 22:42:32 UTC (rev 90554)
@@ -0,0 +1,31 @@
+From 7d235c62f0d5bd0df1236cc52141c10c5d272a18 Mon Sep 17 00:00:00 2001
+From: Julien Cristau <jcristau at debian.org>
+Date: Sun, 19 Feb 2012 13:43:54 +0100
+Subject: [PATCH 6/8] Fallback to TCP if no protocol is specified and the UNIX
+ connection fails
+
+Signed-off-by: Julien Cristau <jcristau at debian.org>
+Signed-off-by: Jamey Sharp <jamey at minilop.net>
+---
+ src/xcb_util.c |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git libxcb-1.8/src/xcb_util.c libxcb-1.8/src/xcb_util.c
+index 7173db3..f17aa3c 100644
+--- libxcb-1.8/src/xcb_util.c
++++ libxcb-1.8/src/xcb_util.c
+@@ -235,6 +235,11 @@ static int _xcb_open(const char *host, char *protocol, const int display)
+     fd = _xcb_open_unix(protocol, file);
+     free(file);
+ 
++    if (fd < 0 && !protocol && *host == '\0') {
++	    unsigned short port = X_TCP_PORT + display;
++	    fd = _xcb_open_tcp(host, protocol, port);
++    }
++
+     return fd;
+ #endif /* !_WIN32 */
+     return -1; /* if control reaches here then something has gone wrong */
+-- 
+1.7.9.2
+

Added: trunk/dports/x11/xorg-libxcb/files/0007-darwin-Use-read-2-rather-than-recv-2.patch
===================================================================
--- trunk/dports/x11/xorg-libxcb/files/0007-darwin-Use-read-2-rather-than-recv-2.patch	                        (rev 0)
+++ trunk/dports/x11/xorg-libxcb/files/0007-darwin-Use-read-2-rather-than-recv-2.patch	2012-03-08 22:42:32 UTC (rev 90554)
@@ -0,0 +1,45 @@
+From 9061ee45b8dbe5431c23e3f628089d703ccad0b1 Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston <jeremyhu at apple.com>
+Date: Thu, 8 Mar 2012 00:50:13 -0800
+Subject: [PATCH 7/8] darwin: Use read(2) rather than recv(2)
+
+2dcf8b025be88a25d4333abdc28d425b88238d96 was causing some regressions on
+darwin, so go back to using read(2) there until I have time to investigate
+further.
+
+Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
+---
+ src/xcb_in.c |    8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git libxcb-1.8/src/xcb_in.c libxcb-1.8/src/xcb_in.c
+index 969cfc0..fdcc813 100644
+--- libxcb-1.8/src/xcb_in.c
++++ libxcb-1.8/src/xcb_in.c
+@@ -269,7 +269,11 @@ static int read_block(const int fd, void *buf, const ssize_t len)
+     int done = 0;
+     while(done < len)
+     {
++#ifdef __APPLE__
++        int ret = read(fd, ((char *) buf) + done, len - done);
++#else
+         int ret = recv(fd, ((char *) buf) + done, len - done,MSG_WAITALL);
++#endif
+         if(ret > 0)
+             done += ret;
+ #ifndef _WIN32
+@@ -661,7 +665,11 @@ void _xcb_in_replies_done(xcb_connection_t *c)
+ 
+ int _xcb_in_read(xcb_connection_t *c)
+ {
++#ifdef __APPLE__
++    int n = read(c->fd, c->in.queue + c->in.queue_len, sizeof(c->in.queue) - c->in.queue_len);
++#else
+     int n = recv(c->fd, c->in.queue + c->in.queue_len, sizeof(c->in.queue) - c->in.queue_len,MSG_WAITALL);
++#endif
+     if(n > 0)
+         c->in.queue_len += n;
+     while(read_packet(c))
+-- 
+1.7.9.2
+

Added: trunk/dports/x11/xorg-libxcb/files/0008-Fix-a-busy-loop-on-BSD-and-Mac-OS.patch
===================================================================
--- trunk/dports/x11/xorg-libxcb/files/0008-Fix-a-busy-loop-on-BSD-and-Mac-OS.patch	                        (rev 0)
+++ trunk/dports/x11/xorg-libxcb/files/0008-Fix-a-busy-loop-on-BSD-and-Mac-OS.patch	2012-03-08 22:42:32 UTC (rev 90554)
@@ -0,0 +1,88 @@
+From 236f914ea7205f5f74e87fcc1b06d87bd0789a7a Mon Sep 17 00:00:00 2001
+From: Uli Schlachter <psychon at znc.in>
+Date: Thu, 1 Mar 2012 20:26:39 +0100
+Subject: [PATCH 8/8] Fix a busy loop on BSD and Mac OS
+
+On FreeBSD MSG_WAITALL on a non-blocking socket fails immediately if less bytes
+than were asked for are available. This is different than the behavior on linux
+where as many bytes as are available are returned in this case. Other OS
+apparently follow the FreeBSD behavior.
+
+_xcb_in_read() is used to fill xcb's read buffer, thus this function will call
+recv() with a big length argument (xcb's read buffer is by default 16 KiB
+large). That many bytes are highly unlikely to be available in the kernel
+buffer.
+
+This means that _xcb_in_read() always failed on FreeBSD. Since the socket was
+still signaled as readable by poll(), this bug even resulted in a busy loop.
+
+The same issue is present in read_block(), but here it is slightly different.
+read_block() is called when we read the first few bytes of an event or a reply,
+so that we already know its length. This means that we should be able to use
+MSG_WAITALL here, because we know how many bytes there have to be.
+
+However, that function could busy loop, too, when only the first few bytes of
+the packet were sent while the rest is stuck somewhere on the way to us. Thus,
+MSG_WAITALL should be removed here, too.
+
+Thanks to Christoph Egger from Debian for noticing the problem, doing all the
+necessary debugging and figuring out what the problem was! This patch is 99%
+from debian. Thanks for all the work.
+
+This bug was introduced in commit 2dcf8b025be88a25d4333abdc28d425b88238d96.
+
+This commit also reverts commit 9061ee45b8dbe5431c23e3f628089d703ccad0b1.
+
+Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45776
+
+Signed-off-by: Uli Schlachter <psychon at znc.in>
+Reviewed-by: Josh Triplett <josh at joshtriplett.org>
+---
+ src/xcb_in.c |   17 ++---------------
+ 1 file changed, 2 insertions(+), 15 deletions(-)
+
+diff --git libxcb-1.8/src/xcb_in.c libxcb-1.8/src/xcb_in.c
+index fdcc813..4998cdd 100644
+--- libxcb-1.8/src/xcb_in.c
++++ libxcb-1.8/src/xcb_in.c
+@@ -51,11 +51,6 @@
+ #define XCB_REPLY 1
+ #define XCB_XGE_EVENT 35
+ 
+-/* required for compiling for Win32 using MinGW */
+-#ifndef MSG_WAITALL
+-#define MSG_WAITALL 0
+-#endif
+-
+ struct event_list {
+     xcb_generic_event_t *event;
+     struct event_list *next;
+@@ -269,11 +264,7 @@ static int read_block(const int fd, void *buf, const ssize_t len)
+     int done = 0;
+     while(done < len)
+     {
+-#ifdef __APPLE__
+-        int ret = read(fd, ((char *) buf) + done, len - done);
+-#else
+-        int ret = recv(fd, ((char *) buf) + done, len - done,MSG_WAITALL);
+-#endif
++        int ret = recv(fd, ((char *) buf) + done, len - done, 0);
+         if(ret > 0)
+             done += ret;
+ #ifndef _WIN32
+@@ -665,11 +656,7 @@ void _xcb_in_replies_done(xcb_connection_t *c)
+ 
+ int _xcb_in_read(xcb_connection_t *c)
+ {
+-#ifdef __APPLE__
+-    int n = read(c->fd, c->in.queue + c->in.queue_len, sizeof(c->in.queue) - c->in.queue_len);
+-#else
+-    int n = recv(c->fd, c->in.queue + c->in.queue_len, sizeof(c->in.queue) - c->in.queue_len,MSG_WAITALL);
+-#endif
++    int n = recv(c->fd, c->in.queue + c->in.queue_len, sizeof(c->in.queue) - c->in.queue_len, 0);
+     if(n > 0)
+         c->in.queue_len += n;
+     while(read_packet(c))
+-- 
+1.7.9.2
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120308/377e8c69/attachment.html>


More information about the macports-changes mailing list