[118622] trunk/dports/x11/xorg-libxcb

jeremyhu at macports.org jeremyhu at macports.org
Sun Apr 6 03:15:14 PDT 2014


Revision: 118622
          https://trac.macports.org/changeset/118622
Author:   jeremyhu at macports.org
Date:     2014-04-06 03:15:14 -0700 (Sun, 06 Apr 2014)
Log Message:
-----------
xorg-libxcb: Bump to 1.10

Modified Paths:
--------------
    trunk/dports/x11/xorg-libxcb/Portfile

Added Paths:
-----------
    trunk/dports/x11/xorg-libxcb/files/
    trunk/dports/x11/xorg-libxcb/files/0001-xcb_open-Minor-code-cleanup-for-better-readability.patch
    trunk/dports/x11/xorg-libxcb/files/0002-xcb_open-Improve-abstraction-for-launchd-secure-sock.patch

Modified: trunk/dports/x11/xorg-libxcb/Portfile
===================================================================
--- trunk/dports/x11/xorg-libxcb/Portfile	2014-04-06 10:15:11 UTC (rev 118621)
+++ trunk/dports/x11/xorg-libxcb/Portfile	2014-04-06 10:15:14 UTC (rev 118622)
@@ -3,7 +3,7 @@
 PortSystem 1.0
 
 name		xorg-libxcb
-version		1.9.1
+version		1.10
 categories	x11 devel
 license		X11
 maintainers	jeremyhu openmaintainer
@@ -14,9 +14,9 @@
 master_sites	 ${homepage}dist/
 
 distname	libxcb-${version}
-checksums           sha1    bf786bb7b9089102b73753135e061c87dc8e8685 \
-                    rmd160  ab86e167f8cfea581b881d5bf79f36fc0ebafe6f \
-                    sha256  d44a5ff4eb0b9569e6f7183b51fdaf6f58da90e7d6bfc36b612d7263f83e362f
+checksums           sha1    bb1a3113eca5146e2a1cf6379c2e52c212a757e0 \
+                    rmd160  39e06176a6b174503c8cede776d85d92ee1b3259 \
+                    sha256  98d9ab05b636dd088603b64229dd1ab2d2cc02ab807892e107d674f9c3f2d5b5
 use_bzip2	yes
 use_parallel_build yes
 
@@ -27,6 +27,10 @@
                 port:xorg-xcb-proto \
                 port:xorg-libpthread-stubs
 
+patchfiles 0001-xcb_open-Minor-code-cleanup-for-better-readability.patch \
+           0002-xcb_open-Improve-abstraction-for-launchd-secure-sock.patch
+patch.pre_args -p1
+
 configure.args  --disable-build-docs
 
 variant docs description "Install extra documentation" {

Added: trunk/dports/x11/xorg-libxcb/files/0001-xcb_open-Minor-code-cleanup-for-better-readability.patch
===================================================================
--- trunk/dports/x11/xorg-libxcb/files/0001-xcb_open-Minor-code-cleanup-for-better-readability.patch	                        (rev 0)
+++ trunk/dports/x11/xorg-libxcb/files/0001-xcb_open-Minor-code-cleanup-for-better-readability.patch	2014-04-06 10:15:14 UTC (rev 118622)
@@ -0,0 +1,43 @@
+From 1c7fd31d6fd19233a586cce37cfd9156c24f1add Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
+Date: Sat, 5 Apr 2014 21:09:42 -0700
+Subject: [PATCH 1/2] xcb_open: Minor code cleanup for better readability
+
+Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
+---
+ src/xcb_util.c | 17 +++++++++--------
+ 1 file changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/src/xcb_util.c b/src/xcb_util.c
+index 466dc23..0c5b07f 100644
+--- a/src/xcb_util.c
++++ b/src/xcb_util.c
+@@ -438,16 +438,17 @@ xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *displayname,
+     if(!parsed) {
+         c = _xcb_conn_ret_error(XCB_CONN_CLOSED_PARSE_ERR);
+         goto out;
+-    } else {
++    }
++
+ #ifdef _WIN32
+-        WSADATA wsaData;
+-        if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
+-            c = _xcb_conn_ret_error(XCB_CONN_ERROR);
+-            goto out;
+-        }
+-#endif
+-        fd = _xcb_open(host, protocol, display);
++    WSADATA wsaData;
++    if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
++        c = _xcb_conn_ret_error(XCB_CONN_ERROR);
++        goto out;
+     }
++#endif
++
++    fd = _xcb_open(host, protocol, display);
+ 
+     if(fd == -1) {
+         c = _xcb_conn_ret_error(XCB_CONN_ERROR);
+-- 
+1.9.1
+

Added: trunk/dports/x11/xorg-libxcb/files/0002-xcb_open-Improve-abstraction-for-launchd-secure-sock.patch
===================================================================
--- trunk/dports/x11/xorg-libxcb/files/0002-xcb_open-Improve-abstraction-for-launchd-secure-sock.patch	                        (rev 0)
+++ trunk/dports/x11/xorg-libxcb/files/0002-xcb_open-Improve-abstraction-for-launchd-secure-sock.patch	2014-04-06 10:15:14 UTC (rev 118622)
@@ -0,0 +1,155 @@
+From 5aa915fa6a61233d72173e8e587dbc674c81071c Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
+Date: Sat, 5 Apr 2014 20:54:59 -0700
+Subject: [PATCH 2/2] xcb_open: Improve abstraction for launchd secure sockets
+
+This changes away from hard-coding the /tmp/launch-* path to now
+supporting a generic <path to unix socket>[.<screen>] format for
+$DISPLAY.
+
+Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
+---
+ src/xcb_util.c | 95 +++++++++++++++++++++++++++++++++++++++++++++-------------
+ 1 file changed, 75 insertions(+), 20 deletions(-)
+
+diff --git a/src/xcb_util.c b/src/xcb_util.c
+index 0c5b07f..7f446a4 100644
+--- a/src/xcb_util.c
++++ b/src/xcb_util.c
+@@ -60,6 +60,10 @@
+ # include <sys/stat.h>
+ #endif
+ 
++#ifdef HAVE_LAUNCHD
++#include <sys/stat.h>
++#endif
++
+ int xcb_popcount(uint32_t mask)
+ {
+     uint32_t y;
+@@ -78,6 +82,59 @@ int xcb_sumof(uint8_t *list, int len)
+   return s;
+ }
+ 
++#ifdef HAVE_LAUNCHD
++/* Return true and parse if name matches <path to socket>[.<screen>]
++ * Upon success:
++ *     host = <path to socket>
++ *     protocol = "unix"
++ *     display = 0
++ *     screen = <screen>
++ */
++static int _xcb_parse_display_path_to_socket(const char *name, char **host, char **protocol,
++                                             int *displayp, int *screenp)
++{
++    struct stat sbuf;
++    char path[PATH_MAX];
++    int _screen = 0;
++
++    strlcpy(path, name, sizeof(path));
++    if (0 != stat(path, &sbuf)) {
++        char *dot = strrchr(path, '.');
++        if (!dot)
++            return 0;
++        *dot = '\0';
++
++        if (0 != stat(path, &sbuf))
++            return 0;
++
++        _screen = atoi(dot + 1);
++    }
++
++    if (host) {
++        *host = strdup(path);
++        if (!*host)
++            return 0;
++    }
++
++    if (protocol) {
++        *protocol = strdup("unix");
++        if (!*protocol) {
++            if (host)
++                free(*host);
++            return 0;
++        }
++    }
++
++    if (displayp)
++        *displayp = 0;
++
++    if (screenp)
++        *screenp = _screen;
++
++    return 1;
++}
++#endif
++
+ static int _xcb_parse_display(const char *name, char **host, char **protocol,
+                       int *displayp, int *screenp)
+ {
+@@ -90,10 +147,11 @@ static int _xcb_parse_display(const char *name, char **host, char **protocol,
+         return 0;
+ 
+ #ifdef HAVE_LAUNCHD
+-    if(strncmp(name, "/tmp/launch", 11) == 0)
+-        slash = NULL;
+-    else
++    /* First check for <path to socket>[.<screen>] */
++    if (_xcb_parse_display_path_to_socket(name, host, protocol, displayp, screenp))
++        return 1;
+ #endif
++
+     slash = strrchr(name, '/');
+ 
+     if (slash) {
+@@ -178,14 +236,6 @@ static int _xcb_open(const char *host, char *protocol, const int display)
+     char *file = NULL;
+     int actual_filelen;
+ 
+-#ifdef HAVE_LAUNCHD
+-    if(strncmp(host, "/tmp/launch", 11) == 0) {
+-        base = host;
+-        host = "";
+-        protocol = "unix";
+-    }
+-#endif
+-
+     /* If protocol or host is "unix", fall through to Unix socket code below */
+     if ((!protocol || (strcmp("unix",protocol) != 0)) &&
+         (*host != '\0') && (strcmp("unix",host) != 0))
+@@ -211,18 +261,23 @@ static int _xcb_open(const char *host, char *protocol, const int display)
+     }
+ #endif
+ 
+-    filelen = strlen(base) + 1 + sizeof(display) * 3 + 1;
+-    file = malloc(filelen);
+-    if(file == NULL)
+-        return -1;
+-
+-    /* display specifies Unix socket */
+ #ifdef HAVE_LAUNCHD
+-    if(strncmp(base, "/tmp/launch", 11) == 0)
+-        actual_filelen = snprintf(file, filelen, "%s:%d", base, display);
+-    else
++    struct stat sbuf;
++    if (0 == stat(host, &sbuf)) {
++        file = strdup(host);
++        filelen = actual_filelen = strlen(file);
++    } else
+ #endif
++    {
++        filelen = strlen(base) + 1 + sizeof(display) * 3 + 1;
++        file = malloc(filelen);
++        if(file == NULL)
++            return -1;
++
++        /* display specifies Unix socket */
+         actual_filelen = snprintf(file, filelen, "%s%d", base, display);
++    }
++
+     if(actual_filelen < 0)
+     {
+         free(file);
+-- 
+1.9.1
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140406/018ce3c8/attachment.html>


More information about the macports-changes mailing list