Mon Oct 8 12:29:08 2012 UTC ()
Add patch from cairo's GIT repository to fix crashes with older versions
of X.org. XChat now works again under Mac OS X Lion.


(tron)
diff -r1.109 -r1.110 pkgsrc/graphics/cairo/Makefile
diff -r1.62 -r1.63 pkgsrc/graphics/cairo/distinfo
diff -r0 -r1.1 pkgsrc/graphics/cairo/patches/patch-src_cairo-xlib-surface-shm.c

cvs diff -r1.109 -r1.110 pkgsrc/graphics/cairo/Makefile (expand / switch to unified diff)

--- pkgsrc/graphics/cairo/Makefile 2012/10/07 22:17:54 1.109
+++ pkgsrc/graphics/cairo/Makefile 2012/10/08 12:29:08 1.110
@@ -1,16 +1,17 @@ @@ -1,16 +1,17 @@
1# $NetBSD: Makefile,v 1.109 2012/10/07 22:17:54 wiz Exp $ 1# $NetBSD: Makefile,v 1.110 2012/10/08 12:29:08 tron Exp $
2 2
3DISTNAME= cairo-1.12.4 3DISTNAME= cairo-1.12.4
 4PKGREVISION= 1
4CATEGORIES= graphics 5CATEGORIES= graphics
5MASTER_SITES= http://cairographics.org/releases/ 6MASTER_SITES= http://cairographics.org/releases/
6EXTRACT_SUFX= .tar.xz 7EXTRACT_SUFX= .tar.xz
7 8
8MAINTAINER= pkgsrc-users@NetBSD.org 9MAINTAINER= pkgsrc-users@NetBSD.org
9HOMEPAGE= http://cairographics.org/ 10HOMEPAGE= http://cairographics.org/
10COMMENT= Vector graphics library with cross-device output support 11COMMENT= Vector graphics library with cross-device output support
11LICENSE= gnu-lgpl-v2.1 AND mpl-1.1 12LICENSE= gnu-lgpl-v2.1 AND mpl-1.1
12 13
13USE_LANGUAGES= c99 14USE_LANGUAGES= c99
14USE_LIBTOOL= yes 15USE_LIBTOOL= yes
15USE_PKGLOCALEDIR= yes 16USE_PKGLOCALEDIR= yes
16USE_TOOLS+= pkg-config 17USE_TOOLS+= pkg-config

cvs diff -r1.62 -r1.63 pkgsrc/graphics/cairo/distinfo (expand / switch to unified diff)

--- pkgsrc/graphics/cairo/distinfo 2012/10/07 22:17:54 1.62
+++ pkgsrc/graphics/cairo/distinfo 2012/10/08 12:29:08 1.63
@@ -1,9 +1,10 @@ @@ -1,9 +1,10 @@
1$NetBSD: distinfo,v 1.62 2012/10/07 22:17:54 wiz Exp $ 1$NetBSD: distinfo,v 1.63 2012/10/08 12:29:08 tron Exp $
2 2
3SHA1 (cairo-1.12.4.tar.xz) = f4158981ed01e73c94fb8072074b17feee61a68b 3SHA1 (cairo-1.12.4.tar.xz) = f4158981ed01e73c94fb8072074b17feee61a68b
4RMD160 (cairo-1.12.4.tar.xz) = 0e2ab9442f47228b7df2354caf157f2a4eeafb31 4RMD160 (cairo-1.12.4.tar.xz) = 0e2ab9442f47228b7df2354caf157f2a4eeafb31
5Size (cairo-1.12.4.tar.xz) = 42099760 bytes 5Size (cairo-1.12.4.tar.xz) = 42099760 bytes
6SHA1 (patch-aa) = 474f44c1c8d4017137fe59b160afca8f16ad7287 6SHA1 (patch-aa) = 474f44c1c8d4017137fe59b160afca8f16ad7287
7SHA1 (patch-ab) = 62ff361d52742bba0f49c6a32149269b958fa24a 7SHA1 (patch-ab) = 62ff361d52742bba0f49c6a32149269b958fa24a
8SHA1 (patch-ac) = 151c682245004902cf42ba141e3743592691dfb9 8SHA1 (patch-ac) = 151c682245004902cf42ba141e3743592691dfb9
9SHA1 (patch-ad) = a1068a37113b162ccfe14d7f1bd0baa9df7e5530 9SHA1 (patch-ad) = a1068a37113b162ccfe14d7f1bd0baa9df7e5530
 10SHA1 (patch-src_cairo-xlib-surface-shm.c) = bf7a24143f1788c21f8362a4a703ef4b5239eb65

File Added: pkgsrc/graphics/cairo/patches/Attic/patch-src_cairo-xlib-surface-shm.c
$NetBSD: patch-src_cairo-xlib-surface-shm.c,v 1.1 2012/10/08 12:29:08 tron Exp $

Prevent application crashes under old version of X.org e.g. under
Mac OS X Lion. Patch taken from here:

http://cgit.freedesktop.org/cairo/commit/?id=b1532f465e05d566f6d160c5ca916a5a12614067

--- src/cairo-xlib-surface-shm.c.orig	2012-10-05 14:06:00.000000000 +0100
+++ src/cairo-xlib-surface-shm.c	2012-10-08 13:10:35.000000000 +0100
@@ -1121,6 +1121,24 @@
     return shm->idle > 0;
 }
 
+#define XORG_VERSION_ENCODE(major,minor,patch,snap) \
+    (((major) * 10000000) + ((minor) * 100000) + ((patch) * 1000) + snap)
+
+static cairo_bool_t
+xorg_has_buggy_send_event(Display *dpy)
+{
+    /* Avoid incurring the wrath fixed by:
+     *
+     * commit 2d2dce558d24eeea0eb011ec9ebaa6c5c2273c39
+     * Author: Sam Spilsbury <sam.spilsbury@canonical.com>
+     * Date:   Wed Sep 14 09:58:34 2011 +0800
+     *
+     * Remove the SendEvent bit (0x80) before doing range checks on event type.
+     */
+    return (strstr (ServerVendor (dpy), "X.Org") != NULL &&
+	    VendorRelease (dpy) < XORG_VERSION_ENCODE(1,11,0,1));
+}
+
 void
 _cairo_xlib_display_init_shm (cairo_xlib_display_t *display)
 {
@@ -1153,6 +1171,9 @@
 				 DefaultVisual (display->display, scr),
 				 CWOverrideRedirect, &attr);
 
+    if (xorg_has_buggy_send_event(display->display))
+	has_pixmap = 0;
+
     shm->has_pixmaps = has_pixmap ? MIN_PIXMAP_SIZE : 0;
     cairo_list_init (&shm->pool);