aboutsummaryrefslogtreecommitdiffstats
path: root/x11-servers
diff options
context:
space:
mode:
authordumbbell <dumbbell@FreeBSD.org>2014-12-20 07:03:54 +0800
committerdumbbell <dumbbell@FreeBSD.org>2014-12-20 07:03:54 +0800
commita3afe6e889e504242b3654ec235424592614a684 (patch)
treee484d37e2856dd43389bc284d3dd6136848e4c6c /x11-servers
parentc60e2d34250c4755873d3fa27565fe6e3b194082 (diff)
downloadfreebsd-ports-gnome-a3afe6e889e504242b3654ec235424592614a684.tar.gz
freebsd-ports-gnome-a3afe6e889e504242b3654ec235424592614a684.tar.zst
freebsd-ports-gnome-a3afe6e889e504242b3654ec235424592614a684.zip
x11-servers/xorg-server: Update to 1.14
The X.Org server has been updated to 1.14. The changes it brings are described in a post on the Graphics team blog: http://blogs.freebsdish.org/graphics/2014/11/19/xserver-1-14-update-ready/ The most noticable change is the DEVD input device autodetection backend which is enabled by default, replacing the HAL backend. The keyboard layout configuration must be migrated from HAL's .fdi files to X.Org files. The procedure is explained in the post mentionned above. Several ports were removed with this update, mainly because they are not compatible with the X.Org server anymore: o nvidia-driver-71 o nvidia-driver-96 o xf86-input-egalax o xf86-video-newport o xf86-video-tga PR: 155696, 181660, 183478 (partially fixed), 188640, 191331 Differential Revision: https://reviews.freebsd.org/D1337 Submitted by: ak (most of the work on the DEVD backend), dumbbell, kwm, zeising Tested by: Many people on freebsd-x11@ and IRC Reviewed by: kwm, portmgr (antoine) Approved by: kwm, portmgr (antoine)
Diffstat (limited to 'x11-servers')
-rw-r--r--x11-servers/xorg-dmx/pkg-plist3
-rw-r--r--x11-servers/xorg-server/Makefile108
-rw-r--r--x11-servers/xorg-server/distinfo6
-rw-r--r--x11-servers/xorg-server/files/extra-Xext-xace.c229
-rw-r--r--x11-servers/xorg-server/files/extra-Xserver-hw-xfree86-common-xf86Config.c11
-rw-r--r--x11-servers/xorg-server/files/extra-Xserver-os-xprintf.c12
-rw-r--r--x11-servers/xorg-server/files/extra-arch-i386 (renamed from x11-servers/xorg-server/files/extra-new-arch-i386)0
-rw-r--r--x11-servers/xorg-server/files/extra-arch-powerpc (renamed from x11-servers/xorg-server/files/extra-new-arch-powerpc)0
-rw-r--r--x11-servers/xorg-server/files/extra-arch-sparc64 (renamed from x11-servers/xorg-server/files/extra-new-arch-sparc64)0
-rw-r--r--x11-servers/xorg-server/files/extra-clang98
-rw-r--r--x11-servers/xorg-server/files/extra-config_devd.c481
-rw-r--r--x11-servers/xorg-server/files/extra-configure11
-rw-r--r--x11-servers/xorg-server/files/extra-dix_events.c89
-rw-r--r--x11-servers/xorg-server/files/extra-include_eventstr.h14
-rw-r--r--x11-servers/xorg-server/files/extra-new-bad-impl38
-rw-r--r--x11-servers/xorg-server/files/extra-new-dix_dixfonts.c41
-rw-r--r--x11-servers/xorg-server/files/extra-old-arch-i38611
-rw-r--r--x11-servers/xorg-server/files/extra-old-arch-powerpc14
-rw-r--r--x11-servers/xorg-server/files/extra-old-arch-sparc6413
-rw-r--r--x11-servers/xorg-server/files/extra-old-dix_dixfonts.c42
-rw-r--r--x11-servers/xorg-server/files/extra-os-utils.c20
-rw-r--r--x11-servers/xorg-server/files/patch-CVE-2014-8092-3-42
-rw-r--r--x11-servers/xorg-server/files/patch-CVE-2014-809532
-rw-r--r--x11-servers/xorg-server/files/patch-CVE-2014-8098-7-846
-rw-r--r--x11-servers/xorg-server/files/patch-CVE-2014-8100-1-218
-rw-r--r--x11-servers/xorg-server/files/patch-Xserver-hw-xfree86-os-support-bsd-i386_video.c7
-rw-r--r--x11-servers/xorg-server/files/patch-config_config-backends.h11
-rw-r--r--x11-servers/xorg-server/files/patch-config_config.c21
-rw-r--r--x11-servers/xorg-server/files/patch-config_devd.c533
-rw-r--r--x11-servers/xorg-server/files/patch-hw_xfree86_common_xf86Config.c20
-rw-r--r--x11-servers/xorg-server/files/patch-hw_xfree86_common_xf86Globals.c12
-rw-r--r--x11-servers/xorg-server/files/patch-hw_xfree86_loader_loadmod.c11
-rw-r--r--x11-servers/xorg-server/files/patch-hw_xfree86_modes_xf86Crtc.c12
-rw-r--r--x11-servers/xorg-server/files/patch-xkb_Makefile.in6
-rw-r--r--x11-servers/xorg-server/files/patch-xorgconf.cpp14
-rw-r--r--x11-servers/xorg-server/pkg-plist76
36 files changed, 709 insertions, 1353 deletions
diff --git a/x11-servers/xorg-dmx/pkg-plist b/x11-servers/xorg-dmx/pkg-plist
index 2fb0ebea5db0..0ec9bfaee182 100644
--- a/x11-servers/xorg-dmx/pkg-plist
+++ b/x11-servers/xorg-dmx/pkg-plist
@@ -1,8 +1,7 @@
bin/Xdmx
-%%OLD%%bin/xdmx
bin/dmxaddinput
bin/dmxaddscreen
-%%NEW%%bin/dmxinfo
+bin/dmxinfo
bin/dmxreconfig
bin/dmxresize
bin/dmxrminput
diff --git a/x11-servers/xorg-server/Makefile b/x11-servers/xorg-server/Makefile
index 183136dbc8bb..f54cd438881c 100644
--- a/x11-servers/xorg-server/Makefile
+++ b/x11-servers/xorg-server/Makefile
@@ -2,8 +2,8 @@
# $FreeBSD$
PORTNAME?= xorg-server
-PORTVERSION= ${XORG_VERSION}
-PORTREVISION?= ${XORG_REVISION}
+PORTVERSION= 1.14.7
+PORTREVISION?= 0
PORTEPOCH?= 1
CATEGORIES= x11-servers
MASTER_SITES= XORG
@@ -13,6 +13,8 @@ DISTNAME= xorg-server-${PORTVERSION}
MAINTAINER= x11@FreeBSD.org
COMMENT?= X.Org X server and related programs
+LICENSE= MIT
+
LIB_DEPENDS= libdrm.so:${PORTSDIR}/graphics/libdrm
RUN_DEPENDS= xkeyboard-config>=2.5:${PORTSDIR}/x11/xkeyboard-config \
xkbcomp:${PORTSDIR}/x11/xkbcomp
@@ -20,42 +22,20 @@ RUN_DEPENDS= xkeyboard-config>=2.5:${PORTSDIR}/x11/xkeyboard-config \
XORG_CAT= xserver
SLAVE_PORT?= no
-OPTIONS_DEFINE= AIGLX SUID
+OPTIONS_SUB= yes
+OPTIONS_DEFINE= SUID
OPTIONS_RADIO= CONF
OPTIONS_RADIO_CONF= HAL DEVD
-AIGLX_DESC= Compile with Accelerated Indirect GLX support
SUID_DESC= Install the Xorg server with setuid bit set
HAL_DESC= Compile with HAL config support
-DEVD_DESC= Use devd for autoconfiguration of input devices (experimental)
-OPTIONS_DEFAULT=AIGLX SUID HAL
+DEVD_DESC= Use devd for autoconfiguration of input devices
+OPTIONS_DEFAULT=SUID DEVD
OPTIONS_EXCLUDE_sparc64= HAL
.include <bsd.port.options.mk>
-.if defined(WITH_NEW_XORG)
-XORG_VERSION= 1.12.4
-XORG_REVISION= 10
-PLIST_SUB+= OLD="@comment " NEW=""
-EXTRA_PATCHES+= ${FILESDIR}/extra-clang \
- ${FILESDIR}/extra-configure \
- ${FILESDIR}/extra-new-bad-impl \
- ${FILESDIR}/extra-new-dix_dixfonts.c
-.else
-FORBIDDEN= unfixed security issues
-XORG_VERSION= 1.7.7
-XORG_REVISION= 14
-PLIST_SUB+= OLD="" NEW="@comment "
-EXTRA_PATCHES+= ${FILESDIR}/extra-Xext-xace.c \
- ${FILESDIR}/extra-Xserver-os-xprintf.c \
- ${FILESDIR}/extra-include_eventstr.h \
- ${FILESDIR}/extra-os-utils.c \
- ${FILESDIR}/extra-dix_events.c \
- ${FILESDIR}/extra-Xserver-hw-xfree86-common-xf86Config.c \
- ${FILESDIR}/extra-old-dix_dixfonts.c
-.endif
-
-USES= gmake libtool:keepla perl5 tar:bzip2
+USES= gmake libtool perl5 tar:bzip2
USE_PERL5= build
USE_GL= gl
USE_XORG?= xf86driproto glproto xdmcp x11 xkbfile xxf86misc xxf86vm xaw7 \
@@ -97,74 +77,31 @@ CONFIGURE_ARGS+= --enable-config-hal=yes
CONFIGURE_ARGS+= --enable-config-hal=no
.endif
-.if ${PORT_OPTIONS:MDEVD}
-EXTRA_PATCHES+= ${FILESDIR}/extra-config_devd.c
-.endif
-
-.if ${PORT_OPTIONS:MAIGLX}
-CONFIGURE_ARGS+= --enable-aiglx=yes
-.else
-CONFIGURE_ARGS+= --enable-aiglx=no
-.endif
-
-# We handle Xorg setuid in the plist. This allows to build xorg-server as a user
-CONFIGURE_ARGS+=--enable-install-setuid=no
-.if ${PORT_OPTIONS:MSUID}
-PLIST_SUB+= SUID=""
-.else
-PLIST_SUB+= SUID="@comment "
-.endif
+# We handle Xorg setuid in the plist. This allows to build xorg-server as a user.
+CONFIGURE_ARGS+=--disable-install-setuid
.if ${ARCH} == armv6
-.if defined(WITH_NEW_XORG)
EXTRA_PATCHES+= ${FILESDIR}/extra-arm-patch-hw__xfree86__os-support__bsd__Makefile.in
EXTRA_PATCHES+= ${FILESDIR}/extra-arm-patch-include__servermd.h
.endif
-.endif
.if ${ARCH} == i386
-.if defined(WITH_NEW_XORG)
-EXTRA_PATCHES+= ${FILESDIR}/extra-new-arch-i386
-.else
-EXTRA_PATCHES+= ${FILESDIR}/extra-old-arch-i386
-.endif
+EXTRA_PATCHES+= ${FILESDIR}/extra-arch-i386
.endif
.if ${ARCH} == ia64
-PLIST_SUB+= IA64_NA="@comment "
-EXTRA_PATCHES+= ${.CURDIR}/files/extra-arch-ia64
-.else
-PLIST_SUB+= IA64_NA=""
+EXTRA_PATCHES+= ${FILESDIR}/extra-arch-ia64
.endif
.if ${ARCH} == powerpc || ${ARCH} == powerpc64
-PLIST_SUB+= PPC_NA="@comment "
-.if defined(WITH_NEW_XORG)
-EXTRA_PATCHES+= ${.CURDIR}/files/extra-new-arch-powerpc
-.else
-EXTRA_PATCHES+= ${.CURDIR}/files/extra-old-arch-powerpc
-.endif
-.else
-PLIST_SUB+= PPC_NA=""
+EXTRA_PATCHES+= ${FILESDIR}/extra-arch-powerpc
.endif
.if ${ARCH} == sparc64
PLIST_SUB+= SPARC64=""
-PLIST_SUB+= SPARC64_NA="@comment "
-.if defined(WITH_NEW_XORG)
-EXTRA_PATCHES+= ${FILESDIR}/extra-new-arch-sparc64
-.else
-EXTRA_PATCHES+= ${FILESDIR}/extra-old-arch-sparc64
-.endif
+EXTRA_PATCHES+= ${FILESDIR}/extra-arch-sparc64
.else
PLIST_SUB+= SPARC64="@comment "
-PLIST_SUB+= SPARC64_NA=""
-.endif
-
-.if ${ARCH} == amd64 || ${ARCH} == i386 || ${ARCH} == sparc64
-PLIST_SUB+= AMD64_I386_SPARC64=""
-.else
-PLIST_SUB+= AMD64_I386_SPARC64="@comment "
.endif
.if ${PORT_OPTIONS:MSUID}
@@ -184,29 +121,24 @@ post-patch:
@${REINPLACE_CMD} -e 's|@GLX_TRUE@GLXMODS =|@GLX_BOGUS@GLXMODS =|g' \
-e 's|^LTLIBRARIES = |LTLIBRARIES = libglx.la |g' \
${WRKSRC}/hw/xfree86/dixmods/Makefile.in
-.if ${PORT_OPTIONS:MDEVD}
- @${ECHO_CMD} -e "\nint config_devd_init(void);\nvoid config_devd_fini(void);" \
- >> ${WRKSRC}/config/config-backends.h
-.endif
-
+
post-configure:
.if ${PORT_OPTIONS:MDEVD}
@${REINPLACE_CMD} -e 's|config\.c|config.c devd.c|g' \
-e 's|config\.lo|config.lo devd.lo|g' \
${WRKSRC}/config/Makefile
+ @${REINPLACE_CMD} -e 's|^/\* #undef CONFIG_UDEV \*/|#define CONFIG_DEVD 1|' \
+ ${WRKSRC}/include/dix-config.h
.endif
.if ${SLAVE_PORT} == "no"
post-install:
-# The .xorg dir because else the xorg-server might not load the correct
+# The .xorg dir because else the xorg-server might not load the correct
# libglx module.
- ${MKDIR} ${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/.xorg
+ @${MKDIR} ${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/.xorg
${INSTALL_LIB} ${WRKSRC}/hw/xfree86/dixmods/.libs/libglx.so \
${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/.xorg/
-
-.if defined(WITH_NEW_XORG)
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/X11/xorg.conf.d
-.endif
.endif # ! SLAVE_PORT
.include <bsd.port.post.mk>
diff --git a/x11-servers/xorg-server/distinfo b/x11-servers/xorg-server/distinfo
index 7f1ac5194b83..7574aaa6dcc4 100644
--- a/x11-servers/xorg-server/distinfo
+++ b/x11-servers/xorg-server/distinfo
@@ -1,4 +1,2 @@
-SHA256 (xorg/xserver/xorg-server-1.7.7.tar.bz2) = 54c4d32bfeb8852adbea3ddae6981f3bc2eadb330124d9b35226c617c01926ff
-SIZE (xorg/xserver/xorg-server-1.7.7.tar.bz2) = 4939257
-SHA256 (xorg/xserver/xorg-server-1.12.4.tar.bz2) = 8ac07c35306ba3fb3c0972722dd4e919303039eca1d40ac7862560e0b2c94cf7
-SIZE (xorg/xserver/xorg-server-1.12.4.tar.bz2) = 5444761
+SHA256 (xorg/xserver/xorg-server-1.14.7.tar.bz2) = fcf66fa6ad86227613d2d3e8ae13ded297e2a1e947e9060a083eaf80d323451f
+SIZE (xorg/xserver/xorg-server-1.14.7.tar.bz2) = 5520884
diff --git a/x11-servers/xorg-server/files/extra-Xext-xace.c b/x11-servers/xorg-server/files/extra-Xext-xace.c
deleted file mode 100644
index 25bd4252d516..000000000000
--- a/x11-servers/xorg-server/files/extra-Xext-xace.c
+++ /dev/null
@@ -1,229 +0,0 @@
-From 6dae7f3792611aace1df0cca63bf50c50d93de43 Mon Sep 17 00:00:00 2001
-From: Chris Wilson <chris@chris-wilson.co.uk>
-Date: Tue, 10 Aug 2010 18:30:20 +0000
-Subject: xace: Invalid reference to out-of-scope data.
-
-The callback data passed by reference to the hook was allocated on stack
-within the scope of the case statement. The compiler is free to reuse
-any of that stack space whilst making the function call so we may end up
-passing garbage into the callback.
-
-References:
-
- Bug 18451 - Xorg server 1.5.2 SEGV during XFixesGetCursorImage()
- https://bugs.freedesktop.org/show_bug.cgi?id=18451
-
-v2: Drop the unrelated hunk that snuck in when ammending the commit
-message.
-
-Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-Signed-off-by: Keith Packard <keithp@keithp.com>
----
-diff --git a/Xext/xace.c b/Xext/xace.c
-index e10d837..c757cad 100644
---- Xext/xace.c
-+++ Xext/xace.c
-@@ -87,7 +87,18 @@ void XaceHookAuditEnd(ClientPtr ptr, int result)
- */
- int XaceHook(int hook, ...)
- {
-- pointer calldata; /* data passed to callback */
-+ union {
-+ XaceResourceAccessRec res;
-+ XaceDeviceAccessRec dev;
-+ XaceSendAccessRec send;
-+ XaceReceiveAccessRec recv;
-+ XaceClientAccessRec client;
-+ XaceExtAccessRec ext;
-+ XaceServerAccessRec server;
-+ XaceScreenAccessRec screen;
-+ XaceAuthAvailRec auth;
-+ XaceKeyAvailRec key;
-+ } u;
- int *prv = NULL; /* points to return value from callback */
- va_list ap; /* argument list */
- va_start(ap, hook);
-@@ -99,117 +110,86 @@ int XaceHook(int hook, ...)
- */
- switch (hook)
- {
-- case XACE_RESOURCE_ACCESS: {
-- XaceResourceAccessRec rec;
-- rec.client = va_arg(ap, ClientPtr);
-- rec.id = va_arg(ap, XID);
-- rec.rtype = va_arg(ap, RESTYPE);
-- rec.res = va_arg(ap, pointer);
-- rec.ptype = va_arg(ap, RESTYPE);
-- rec.parent = va_arg(ap, pointer);
-- rec.access_mode = va_arg(ap, Mask);
-- rec.status = Success; /* default allow */
-- calldata = &rec;
-- prv = &rec.status;
-+ case XACE_RESOURCE_ACCESS:
-+ u.res.client = va_arg(ap, ClientPtr);
-+ u.res.id = va_arg(ap, XID);
-+ u.res.rtype = va_arg(ap, RESTYPE);
-+ u.res.res = va_arg(ap, pointer);
-+ u.res.ptype = va_arg(ap, RESTYPE);
-+ u.res.parent = va_arg(ap, pointer);
-+ u.res.access_mode = va_arg(ap, Mask);
-+ u.res.status = Success; /* default allow */
-+ prv = &u.res.status;
- break;
-- }
-- case XACE_DEVICE_ACCESS: {
-- XaceDeviceAccessRec rec;
-- rec.client = va_arg(ap, ClientPtr);
-- rec.dev = va_arg(ap, DeviceIntPtr);
-- rec.access_mode = va_arg(ap, Mask);
-- rec.status = Success; /* default allow */
-- calldata = &rec;
-- prv = &rec.status;
-+ case XACE_DEVICE_ACCESS:
-+ u.dev.client = va_arg(ap, ClientPtr);
-+ u.dev.dev = va_arg(ap, DeviceIntPtr);
-+ u.dev.access_mode = va_arg(ap, Mask);
-+ u.dev.status = Success; /* default allow */
-+ prv = &u.dev.status;
- break;
-- }
-- case XACE_SEND_ACCESS: {
-- XaceSendAccessRec rec;
-- rec.client = va_arg(ap, ClientPtr);
-- rec.dev = va_arg(ap, DeviceIntPtr);
-- rec.pWin = va_arg(ap, WindowPtr);
-- rec.events = va_arg(ap, xEventPtr);
-- rec.count = va_arg(ap, int);
-- rec.status = Success; /* default allow */
-- calldata = &rec;
-- prv = &rec.status;
-+ case XACE_SEND_ACCESS:
-+ u.send.client = va_arg(ap, ClientPtr);
-+ u.send.dev = va_arg(ap, DeviceIntPtr);
-+ u.send.pWin = va_arg(ap, WindowPtr);
-+ u.send.events = va_arg(ap, xEventPtr);
-+ u.send.count = va_arg(ap, int);
-+ u.send.status = Success; /* default allow */
-+ prv = &u.send.status;
- break;
-- }
-- case XACE_RECEIVE_ACCESS: {
-- XaceReceiveAccessRec rec;
-- rec.client = va_arg(ap, ClientPtr);
-- rec.pWin = va_arg(ap, WindowPtr);
-- rec.events = va_arg(ap, xEventPtr);
-- rec.count = va_arg(ap, int);
-- rec.status = Success; /* default allow */
-- calldata = &rec;
-- prv = &rec.status;
-+ case XACE_RECEIVE_ACCESS:
-+ u.recv.client = va_arg(ap, ClientPtr);
-+ u.recv.pWin = va_arg(ap, WindowPtr);
-+ u.recv.events = va_arg(ap, xEventPtr);
-+ u.recv.count = va_arg(ap, int);
-+ u.recv.status = Success; /* default allow */
-+ prv = &u.recv.status;
- break;
-- }
-- case XACE_CLIENT_ACCESS: {
-- XaceClientAccessRec rec;
-- rec.client = va_arg(ap, ClientPtr);
-- rec.target = va_arg(ap, ClientPtr);
-- rec.access_mode = va_arg(ap, Mask);
-- rec.status = Success; /* default allow */
-- calldata = &rec;
-- prv = &rec.status;
-+ case XACE_CLIENT_ACCESS:
-+ u.client.client = va_arg(ap, ClientPtr);
-+ u.client.target = va_arg(ap, ClientPtr);
-+ u.client.access_mode = va_arg(ap, Mask);
-+ u.client.status = Success; /* default allow */
-+ prv = &u.client.status;
- break;
-- }
-- case XACE_EXT_ACCESS: {
-- XaceExtAccessRec rec;
-- rec.client = va_arg(ap, ClientPtr);
-- rec.ext = va_arg(ap, ExtensionEntry*);
-- rec.access_mode = DixGetAttrAccess;
-- rec.status = Success; /* default allow */
-- calldata = &rec;
-- prv = &rec.status;
-+ case XACE_EXT_ACCESS:
-+ u.ext.client = va_arg(ap, ClientPtr);
-+ u.ext.ext = va_arg(ap, ExtensionEntry*);
-+ u.ext.access_mode = DixGetAttrAccess;
-+ u.ext.status = Success; /* default allow */
-+ prv = &u.ext.status;
- break;
-- }
-- case XACE_SERVER_ACCESS: {
-- XaceServerAccessRec rec;
-- rec.client = va_arg(ap, ClientPtr);
-- rec.access_mode = va_arg(ap, Mask);
-- rec.status = Success; /* default allow */
-- calldata = &rec;
-- prv = &rec.status;
-+ case XACE_SERVER_ACCESS:
-+ u.server.client = va_arg(ap, ClientPtr);
-+ u.server.access_mode = va_arg(ap, Mask);
-+ u.server.status = Success; /* default allow */
-+ prv = &u.server.status;
- break;
-- }
- case XACE_SCREEN_ACCESS:
-- case XACE_SCREENSAVER_ACCESS: {
-- XaceScreenAccessRec rec;
-- rec.client = va_arg(ap, ClientPtr);
-- rec.screen = va_arg(ap, ScreenPtr);
-- rec.access_mode = va_arg(ap, Mask);
-- rec.status = Success; /* default allow */
-- calldata = &rec;
-- prv = &rec.status;
-+ case XACE_SCREENSAVER_ACCESS:
-+ u.screen.client = va_arg(ap, ClientPtr);
-+ u.screen.screen = va_arg(ap, ScreenPtr);
-+ u.screen.access_mode = va_arg(ap, Mask);
-+ u.screen.status = Success; /* default allow */
-+ prv = &u.screen.status;
- break;
-- }
-- case XACE_AUTH_AVAIL: {
-- XaceAuthAvailRec rec;
-- rec.client = va_arg(ap, ClientPtr);
-- rec.authId = va_arg(ap, XID);
-- calldata = &rec;
-+ case XACE_AUTH_AVAIL:
-+ u.auth.client = va_arg(ap, ClientPtr);
-+ u.auth.authId = va_arg(ap, XID);
- break;
-- }
-- case XACE_KEY_AVAIL: {
-- XaceKeyAvailRec rec;
-- rec.event = va_arg(ap, xEventPtr);
-- rec.keybd = va_arg(ap, DeviceIntPtr);
-- rec.count = va_arg(ap, int);
-- calldata = &rec;
-+ case XACE_KEY_AVAIL:
-+ u.key.event = va_arg(ap, xEventPtr);
-+ u.key.keybd = va_arg(ap, DeviceIntPtr);
-+ u.key.count = va_arg(ap, int);
- break;
-- }
-- default: {
-+ default:
- va_end(ap);
- return 0; /* unimplemented hook number */
-- }
- }
- va_end(ap);
-
- /* call callbacks and return result, if any. */
-- CallCallbacks(&XaceHooks[hook], calldata);
-+ CallCallbacks(&XaceHooks[hook], &u);
- return prv ? *prv : Success;
- }
-
---
-cgit v0.9.0.2-2-gbebe
diff --git a/x11-servers/xorg-server/files/extra-Xserver-hw-xfree86-common-xf86Config.c b/x11-servers/xorg-server/files/extra-Xserver-hw-xfree86-common-xf86Config.c
deleted file mode 100644
index 59aad379ae11..000000000000
--- a/x11-servers/xorg-server/files/extra-Xserver-hw-xfree86-common-xf86Config.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- hw/xfree86/common/xf86Config.c.orig Fri Jun 23 12:32:32 2006
-+++ hw/xfree86/common/xf86Config.c Fri Jun 23 12:32:46 2006
-@@ -1042,7 +1042,7 @@
- else
- xf86Info.estimateSizesAggressively = 0;
-
-- xf86Info.aiglx = TRUE;
-+ xf86Info.aiglx = FALSE;
- xf86Info.aiglxFrom = X_DEFAULT;
- if (xf86GetOptValBool(FlagOptions, FLAG_AIGLX, &value)) {
- xf86Info.aiglx = value;
diff --git a/x11-servers/xorg-server/files/extra-Xserver-os-xprintf.c b/x11-servers/xorg-server/files/extra-Xserver-os-xprintf.c
deleted file mode 100644
index e9fb876333cc..000000000000
--- a/x11-servers/xorg-server/files/extra-Xserver-os-xprintf.c
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -u -p programs/Xserver/os/xprintf.c.orig programs/Xserver/os/xprintf.c
---- os/xprintf.c.orig Sun Jul 3 17:53:52 2005
-+++ os/xprintf.c Thu Jan 26 12:47:37 2006
-@@ -39,7 +39,7 @@
- # ifdef __va_copy
- # define va_copy __va_copy
- # else
--# error "no working va_copy was found"
-+# define va_copy(dest, src) ((dest) = (src))
- # endif
- #endif
-
diff --git a/x11-servers/xorg-server/files/extra-new-arch-i386 b/x11-servers/xorg-server/files/extra-arch-i386
index 1a0bdeef2bd0..1a0bdeef2bd0 100644
--- a/x11-servers/xorg-server/files/extra-new-arch-i386
+++ b/x11-servers/xorg-server/files/extra-arch-i386
diff --git a/x11-servers/xorg-server/files/extra-new-arch-powerpc b/x11-servers/xorg-server/files/extra-arch-powerpc
index 389fc8766b5d..389fc8766b5d 100644
--- a/x11-servers/xorg-server/files/extra-new-arch-powerpc
+++ b/x11-servers/xorg-server/files/extra-arch-powerpc
diff --git a/x11-servers/xorg-server/files/extra-new-arch-sparc64 b/x11-servers/xorg-server/files/extra-arch-sparc64
index 45d40053ece6..45d40053ece6 100644
--- a/x11-servers/xorg-server/files/extra-new-arch-sparc64
+++ b/x11-servers/xorg-server/files/extra-arch-sparc64
diff --git a/x11-servers/xorg-server/files/extra-clang b/x11-servers/xorg-server/files/extra-clang
deleted file mode 100644
index 7f22a529561c..000000000000
--- a/x11-servers/xorg-server/files/extra-clang
+++ /dev/null
@@ -1,98 +0,0 @@
---- dix/events.c.orig 2012-07-09 02:32:59.000000000 +0200
-+++ dix/events.c 2012-07-22 14:34:46.000000000 +0200
-@@ -5189,7 +5189,8 @@
- InitEvents(void)
- {
- int i;
-- QdEventPtr qe, tmp;
-+ QdEventPtr qe = NULL;
-+ QdEventPtr tmp;
-
- inputInfo.numDevices = 0;
- inputInfo.devices = (DeviceIntPtr) NULL;
---- hw/xfree86/common/xf86Xinput.c.orig 2012-06-26 08:24:18.000000000 +0200
-+++ hw/xfree86/common/xf86Xinput.c 2012-07-22 14:34:46.000000000 +0200
-@@ -524,7 +524,7 @@
- MatchAttrToken(const char *attr, struct xorg_list *patterns,
- int (*compare) (const char *attr, const char *pattern))
- {
-- const xf86MatchGroup *group;
-+ const xf86MatchGroup *group = NULL;
-
- /* If there are no patterns, accept the match */
- if (xorg_list_is_empty(patterns))
---- hw/xfree86/dri2/dri2.c.orig 2012-07-09 02:32:59.000000000 +0200
-+++ hw/xfree86/dri2/dri2.c 2012-07-22 14:38:42.000000000 +0200
-@@ -239,7 +239,7 @@
- static DRI2DrawableRefPtr
- DRI2LookupDrawableRef(DRI2DrawablePtr pPriv, XID id)
- {
-- DRI2DrawableRefPtr ref;
-+ DRI2DrawableRefPtr ref = NULL;
-
- xorg_list_for_each_entry(ref, &pPriv->reference_list, link) {
- if (ref->id == id)
-@@ -306,7 +306,8 @@
- {
- DRI2DrawablePtr pPriv = p;
- DRI2ScreenPtr ds = pPriv->dri2_screen;
-- DRI2DrawableRefPtr ref, next;
-+ DRI2DrawableRefPtr ref = NULL;
-+ DRI2DrawableRefPtr next;
- WindowPtr pWin;
- PixmapPtr pPixmap;
- DrawablePtr pDraw;
-@@ -587,7 +588,7 @@
- DRI2InvalidateDrawable(DrawablePtr pDraw)
- {
- DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw);
-- DRI2DrawableRefPtr ref;
-+ DRI2DrawableRefPtr ref = NULL;
-
- if (!pPriv || !pPriv->needInvalidate)
- return;
---- test/list.c.orig 2012-06-26 06:12:51.000000000 +0200
-+++ test/list.c 2012-07-22 14:34:46.000000000 +0200
-@@ -187,7 +187,7 @@
- {
- struct parent parent = { 0 };
- struct child child[3];
-- struct child *c;
-+ struct child *c = NULL;
- int i = 0;
-
- xorg_list_init(&parent.children);
---- xfixes/cursor.c.orig 2012-07-06 07:17:19.000000000 +0200
-+++ xfixes/cursor.c 2012-07-22 14:34:46.000000000 +0200
-@@ -1143,7 +1143,7 @@
- barrier_find_nearest(CursorScreenPtr cs, int dir,
- int x1, int y1, int x2, int y2)
- {
-- struct PointerBarrierClient *c;
-+ struct PointerBarrierClient *c = NULL;
- struct PointerBarrier *nearest = NULL;
- double min_distance = INT_MAX; /* can't get higher than that in X anyway */
-
---- hw/xfree86/parser/InputClass.c.orig 2013-07-04 11:45:42.139818164 +0200
-+++ hw/xfree86/parser/InputClass.c 2013-07-04 11:46:29.034806839 +0200
-@@ -362,7 +362,8 @@
- XF86ConfInputClassPtr prev;
-
- while (ptr) {
-- xf86MatchGroup *group, *next;
-+ xf86MatchGroup *group = NULL;
-+ xf86MatchGroup *next;
- char **list;
-
- TestFree(ptr->identifier);
---- hw/xfree86/loader/loadmod.c.orig 2013-07-04 11:48:11.160800614 +0200
-+++ hw/xfree86/loader/loadmod.c 2013-07-04 11:48:32.000800157 +0200
-@@ -472,7 +472,7 @@
- char **elem;
- const char **subdirs;
- const char **s;
-- PatternPtr patterns;
-+ PatternPtr patterns = NULL;
- PatternPtr p;
- DIR *d;
- struct dirent *dp;
diff --git a/x11-servers/xorg-server/files/extra-config_devd.c b/x11-servers/xorg-server/files/extra-config_devd.c
deleted file mode 100644
index f6d66a37c862..000000000000
--- a/x11-servers/xorg-server/files/extra-config_devd.c
+++ /dev/null
@@ -1,481 +0,0 @@
---- /dev/null 2013-08-03 00:44:23.000000000 +0200
-+++ config/devd.c 2013-08-03 00:45:15.162836806 +0200
-@@ -0,0 +1,478 @@
-+/*
-+ * Copyright © 2012 Baptiste Daroussin
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining a
-+ * copy of this software and associated documentation files (the "Software"),
-+ * to deal in the Software without restriction, including without limitation
-+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-+ * and/or sell copies of the Software, and to permit persons to whom the
-+ * Software is furnished to do so, subject to the following conditions:
-+ *
-+ * The above copyright notice and this permission notice (including the next
-+ * paragraph) shall be included in all copies or substantial portions of the
-+ * Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-+ * DEALINGS IN THE SOFTWARE.
-+ *
-+ * Author: Baptiste Daroussin <bapt@FreeBSD.org>
-+ */
-+
-+#ifdef HAVE_DIX_CONFIG_H
-+#include <dix-config.h>
-+#endif
-+
-+#include <sys/types.h>
-+#include <sys/socket.h>
-+#include <sys/sysctl.h>
-+#include <sys/un.h>
-+
-+#include <ctype.h>
-+#include <stdlib.h>
-+#include <stdio.h>
-+#include <stdarg.h>
-+#include <stdbool.h>
-+#include <unistd.h>
-+
-+#include "input.h"
-+#include "inputstr.h"
-+#include "hotplug.h"
-+#include "config-backends.h"
-+#include "os.h"
-+
-+#define DEVD_SOCK_PATH "/var/run/devd.pipe"
-+
-+#define DEVD_EVENT_ADD '+'
-+#define DEVD_EVENT_REMOVE '-'
-+
-+static int sock_devd = -1;
-+
-+#if XORG_VERSION_CURRENT < 10800000
-+enum {
-+ ATTR_KEYBOARD,
-+ ATTR_POINTER,
-+ ATTR_JOYSTICK,
-+ ATTR_TOUCHPAD,
-+ ATTR_TOUCHSCREEN,
-+};
-+#endif
-+
-+struct hw_type {
-+ const char *driver;
-+ int flag;
-+ const char *xdriver;
-+};
-+
-+static struct hw_type hw_types[] = {
-+ { "ukbd", ATTR_KEYBOARD, "kdb" },
-+ { "atkbd", ATTR_KEYBOARD, "kdb" },
-+ { "ums", ATTR_POINTER, "mouse" },
-+ { "psm", ATTR_POINTER, "mouse" },
-+ { "uhid", ATTR_POINTER, "mouse" },
-+ { "joy", ATTR_JOYSTICK, NULL },
-+ { "atp", ATTR_TOUCHPAD, NULL },
-+ { "uep", ATTR_TOUCHSCREEN, NULL },
-+ { NULL, -1, NULL },
-+};
-+
-+#if XORG_VERSION_CURRENT < 10800000
-+static void
-+add_option(InputOption **options, const char *key, const char *value)
-+{
-+ if (!value || *value == '\0')
-+ return;
-+
-+ for (; *options; options = &(*options)->next)
-+ ;
-+ *options = calloc(sizeof(**options), 1);
-+ if (!*options) /* Yeesh. */
-+ return;
-+ (*options)->key = xstrdup(key);
-+ (*options)->value = xstrdup(value);
-+ (*options)->next = NULL;
-+}
-+
-+static void
-+remove_device(DeviceIntPtr dev)
-+{
-+ /* this only gets called for devices that have already been added */
-+ LogMessage(X_INFO, "config/devd: removing device %s\n", dev->name);
-+
-+ /* Call PIE here so we don't try to dereference a device that's
-+ * already been removed. */
-+ OsBlockSignals();
-+ ProcessInputEvents();
-+ DeleteInputDeviceRequest(dev);
-+ OsReleaseSignals();
-+}
-+
-+static bool
-+device_is_duplicate(char *config_info)
-+{
-+ DeviceIntPtr dev;
-+
-+ for (dev = inputInfo.devices; dev; dev = dev->next)
-+ if (dev->config_info && (strcmp(dev->config_info, config_info) == 0))
-+ return true;
-+
-+ for (dev = inputInfo.off_devices; dev; dev = dev->next)
-+ if (dev->config_info && (strcmp(dev->config_info, config_info) == 0))
-+ return true;
-+
-+ return false;
-+}
-+
-+#endif
-+
-+static bool
-+sysctl_exists(const char *format, ...)
-+{
-+ va_list args;
-+ char *name = NULL;
-+ size_t len;
-+ int ret;
-+
-+ if (format == NULL)
-+ return false;
-+
-+ va_start(args, format);
-+ vasprintf(&name, format, args);
-+ va_end(args);
-+
-+ ret = sysctlbyname(name, NULL, &len, NULL, 0);
-+
-+ if (ret == -1)
-+ len = 0;
-+
-+ free(name);
-+ return (len > 0);
-+}
-+
-+static char *
-+sysctl_get_str(const char *format, ...)
-+{
-+ va_list args;
-+ char *name = NULL;
-+ char *dest = NULL;
-+ size_t len;
-+
-+ if (format == NULL)
-+ return NULL;
-+
-+ va_start(args, format);
-+ vasprintf(&name, format, args);
-+ va_end(args);
-+
-+ if (sysctlbyname(name, NULL, &len, NULL, 0) == 0) {
-+ dest = malloc(len + 1);
-+ if (sysctlbyname(name, dest, &len, NULL, 0) == 0)
-+ dest[len] = '\0';
-+ else {
-+ free(dest);
-+ dest = NULL;
-+ }
-+ }
-+
-+ free(name);
-+ return dest;
-+}
-+
-+static void
-+device_added(char *line)
-+{
-+ char *walk;
-+ char *path;
-+ char *vendor;
-+ char *product = NULL;
-+ char *config_info = NULL;
-+ InputOption *options = NULL;
-+#if XORG_VERSION_CURRENT > 10800000
-+ InputAttributes attrs = {};
-+#else
-+ InputOption *tmpo;
-+#endif
-+ DeviceIntPtr dev = NULL;
-+ int i, rc;
-+
-+ walk = strchr(line, ' ');
-+ if (walk != NULL)
-+ walk[0] = '\0';
-+
-+ for (i = 0; hw_types[i].driver != NULL; i++) {
-+ if (strncmp(line, hw_types[i].driver,
-+ strlen(hw_types[i].driver)) == 0 &&
-+ isnumber(*(line + strlen(hw_types[i].driver)))) {
-+#if XORG_VERSION_CURRENT > 10800000
-+ attrs.flags |= hw_types[i].flag;
-+#endif
-+ break;
-+ }
-+ }
-+ if (hw_types[i].driver == NULL) {
-+ LogMessageVerb(X_INFO, 10, "config/devd: ignoring device %s\n", line);
-+ return;
-+ }
-+
-+#if XORG_VERSION_CURRENT < 10800000
-+ if (hw_types[i].xdriver == NULL) {
-+ LogMessageVerb(X_INFO, 10, "config/devd: ignoring device %s\n", line);
-+ return;
-+ }
-+#endif
-+ if (asprintf(&path, "/dev/%s", line) == -1)
-+ return;
-+
-+#if XORG_VERSION_CURRENT < 10800000
-+ options = calloc(sizeof(*options), 1);
-+ if (!options)
-+ return;
-+
-+ add_option(&options, "_source", "server/devd");
-+#else
-+ options = input_option_new(NULL, "_source", "server/devd");
-+ if (!options)
-+ return;
-+#endif
-+
-+ vendor = sysctl_get_str("dev.%s.%s.%%desc", hw_types[i].driver, line + strlen(hw_types[i].driver));
-+ if (vendor == NULL) {
-+#if XORG_VERSION_CURRENT > 10800000
-+ attrs.vendor = strdup("(unnamed)");
-+#endif
-+ } else {
-+ if ((product = strchr(vendor, ' ')) != NULL) {
-+ product[0] = '\0';
-+ product++;
-+ }
-+#if XORG_VERSION_CURRENT > 10800000
-+ attrs.vendor = strdup(vendor);
-+#endif
-+ if (product != NULL && (walk = strchr(product, ',')) != NULL)
-+ walk[0] = '\0';
-+#if XORG_VERSION_CURRENT > 10800000
-+ attrs.product = strdup(product != NULL ? product : "(unnamed)");
-+ options = input_option_new(options, "name", product != NULL ? product : "(unnamed)");
-+#else
-+ add_option(&options, "name", product != NULL ? product : "(unnamed)");
-+#endif
-+ }
-+#if XORG_VERSION_CURRENT > 10800000
-+ attrs.usb_id = NULL;
-+ options = input_option_new(options, "path", path);
-+ options = input_option_new(options, "device", path);
-+#else
-+ add_option(&options, "path", path);
-+ add_option(&options, "device", path);
-+#endif
-+
-+#if XORG_VERSION_CURRENT < 10800000
-+ add_option(&options, "driver", hw_types[i].xdriver);
-+#endif
-+
-+ if (asprintf(&config_info, "devd:%s", line) == -1) {
-+ config_info = NULL;
-+ goto unwind;
-+ }
-+
-+ if (device_is_duplicate(config_info)) {
-+ LogMessage(X_WARNING, "config/devd: device %s already added. "
-+ "Ignoring.\n", product != NULL ? product : "(unnamed)");
-+ goto unwind;
-+ }
-+
-+#if XORG_VERSION_CURRENT < 10800000
-+ add_option(&options, "config_info", config_info);
-+#else
-+ options = input_option_new(options, "config_info", config_info);
-+#endif
-+ LogMessage(X_INFO, "config/devd: Adding input device %s (%s)\n",
-+ product != NULL ? product : "(unnamed)", path);
-+
-+#if XORG_VERSION_CURRENT > 10800000
-+ rc = NewInputDeviceRequest(options, &attrs, &dev);
-+#else
-+ rc = NewInputDeviceRequest(options, &dev);
-+#endif
-+
-+ if (rc != Success)
-+ goto unwind;
-+
-+ unwind:
-+ free(config_info);
-+#if XORG_VERSION_CURRENT < 10800000
-+ while ((tmpo = options)) {
-+ options = tmpo->next;
-+ free(tmpo->key); /* NULL if dev != NULL */
-+ free(tmpo->value); /* NULL if dev != NULL */
-+ free(tmpo);
-+ }
-+#else
-+ input_option_free_list(&options);
-+#endif
-+
-+#if XORG_VERSION_CURRENT > 10800000
-+ free(attrs.usb_id);
-+ free(attrs.product);
-+ free(attrs.device);
-+ free(attrs.vendor);
-+#endif
-+
-+ return;
-+}
-+
-+static void
-+device_removed(char *line)
-+{
-+ char *walk;
-+ char *value;
-+#if XORG_VERSION_CURRENT < 10800000
-+ DeviceIntPtr dev, next;
-+#endif
-+
-+ walk = strchr(line, ' ');
-+ if (walk != NULL)
-+ walk[0] = '\0';
-+
-+ if (asprintf(&value, "devd:%s", line) == -1)
-+ return;
-+
-+#if XORG_VERSION_CURRENT > 10800000
-+ remove_devices("dev", value);
-+#else
-+ for (dev = inputInfo.devices; dev; dev = next) {
-+ next = dev->next;
-+ if (dev->config_info && strcmp(dev->config_info, value) == 0)
-+ remove_device(dev);
-+ }
-+ for (dev = inputInfo.off_devices; dev; dev = next) {
-+ next = dev->next;
-+ if (dev->config_info && strcmp(dev->config_info, value) == 0)
-+ remove_device(dev);
-+ }
-+#endif
-+
-+ free(value);
-+}
-+
-+static ssize_t
-+socket_getline(int fd, char **out)
-+{
-+ char *buf;
-+ ssize_t ret, cap, sz = 0;
-+ char c;
-+
-+ cap = 1024;
-+ buf = malloc(cap * sizeof(char));
-+ if (!buf)
-+ return -1;
-+
-+ for (;;) {
-+ ret = read(sock_devd, &c, 1);
-+ if (ret < 1) {
-+ free(buf);
-+ return -1;
-+ }
-+
-+ if (c == '\n')
-+ break;
-+
-+ if (sz + 1 >= cap) {
-+ cap *= 2;
-+ buf = realloc(buf, cap *sizeof(char));
-+ }
-+ buf[sz] = c;
-+ sz++;
-+ }
-+
-+ buf[sz] = '\0';
-+ if (sz > 0)
-+ *out = buf;
-+ else
-+ free(buf);
-+
-+ return sz; /* number of bytes in the line, not counting the line break*/
-+}
-+
-+static void
-+wakeup_handler(pointer data, int err, pointer read_mask)
-+{
-+ char *line = NULL;
-+
-+ if (err < 0)
-+ return;
-+
-+ if (FD_ISSET(sock_devd, (fd_set *)read_mask)) {
-+ if (socket_getline(sock_devd, &line) < 0)
-+ return;
-+
-+ switch(*line) {
-+ case DEVD_EVENT_ADD:
-+ device_added(line++);
-+ break;
-+ case DEVD_EVENT_REMOVE:
-+ device_removed(line++);
-+ break;
-+ default:
-+ break;
-+ }
-+ free(line);
-+ }
-+}
-+
-+static void
-+block_handler(pointer data, struct timeval **tv, pointer read_mask)
-+{
-+}
-+
-+int
-+config_devd_init(void)
-+{
-+ struct sockaddr_un devd;
-+ char devicename[1024];
-+ int i, j;
-+
-+ /* first scan the sysctl to determine the hardware if needed */
-+
-+ for (i = 0; hw_types[i].driver != NULL; i++) {
-+ for (j = 0; sysctl_exists("dev.%s.%i.%%desc", hw_types[i].driver, j); j++) {
-+ snprintf(devicename, 1024, "%s%i", hw_types[i].driver, j);
-+ device_added(devicename);
-+ }
-+
-+ }
-+ sock_devd = socket(AF_UNIX, SOCK_STREAM, 0);
-+ if (sock_devd < 0) {
-+ ErrorF("config/devd: Fail opening stream socket");
-+ return 0;
-+ }
-+
-+ devd.sun_family = AF_UNIX;
-+ strlcpy(devd.sun_path, DEVD_SOCK_PATH, sizeof(devd.sun_path));
-+
-+ if (connect(sock_devd, (struct sockaddr *) &devd, sizeof(struct sockaddr_un)) < 0) {
-+ close(sock_devd);
-+ ErrorF("config/devd: Fail to connect to devd");
-+ return 0;
-+ }
-+
-+ RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL);
-+ AddGeneralSocket(sock_devd);
-+
-+ return 1;
-+}
-+
-+void
-+config_devd_fini(void)
-+{
-+ if (sock_devd < 0)
-+ return;
-+
-+ RemoveGeneralSocket(sock_devd);
-+ RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL);
-+ close(sock_devd);
-+}
diff --git a/x11-servers/xorg-server/files/extra-configure b/x11-servers/xorg-server/files/extra-configure
deleted file mode 100644
index cede35be92f3..000000000000
--- a/x11-servers/xorg-server/files/extra-configure
+++ /dev/null
@@ -1,11 +0,0 @@
---- configure.orig 2013-09-07 22:11:27.210621324 +0200
-+++ configure 2013-09-07 22:11:52.912624338 +0200
-@@ -22839,7 +22839,7 @@
- }
- _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
-- ac_cv_tls=$kw
-+ ac_cv_tls=$kw; break ;
- fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
diff --git a/x11-servers/xorg-server/files/extra-dix_events.c b/x11-servers/xorg-server/files/extra-dix_events.c
deleted file mode 100644
index caa7a99ec255..000000000000
--- a/x11-servers/xorg-server/files/extra-dix_events.c
+++ /dev/null
@@ -1,89 +0,0 @@
---- dix/events.c.orig 2010-05-04 02:47:57.000000000 +0200
-+++ dix/events.c 2012-04-24 12:59:22.000000000 +0200
-@@ -3440,7 +3440,6 @@ CheckPassiveGrabsOnWindow(
- {
- DeviceIntPtr gdev;
- XkbSrvInfoPtr xkbi = NULL;
-- Mask mask = 0;
-
- gdev= grab->modifierDevice;
- if (grab->grabtype == GRABTYPE_CORE)
-@@ -3555,9 +3554,6 @@ CheckPassiveGrabsOnWindow(
- }
- xE = &core;
- count = 1;
-- mask = grab->eventMask;
-- if (grab->ownerEvents)
-- mask |= pWin->eventMask;
- } else if (match & XI2_MATCH)
- {
- rc = EventToXI2((InternalEvent*)event, &xE);
-@@ -3569,34 +3565,6 @@ CheckPassiveGrabsOnWindow(
- continue;
- }
- count = 1;
--
-- /* FIXME: EventToXI2 returns NULL for enter events, so
-- * dereferencing the event is bad. Internal event types are
-- * aligned with core events, so the else clause is valid.
-- * long-term we should use internal events for enter/focus
-- * as well */
-- if (xE)
-- mask = grab->xi2mask[device->id][((xGenericEvent*)xE)->evtype/8];
-- else if (event->type == XI_Enter || event->type == XI_FocusIn)
-- mask = grab->xi2mask[device->id][event->type/8];
--
-- if (grab->ownerEvents && wOtherInputMasks(grab->window))
-- {
-- InputClientsPtr icp =
-- wOtherInputMasks(grab->window)->inputClients;
--
-- while(icp)
-- {
-- if (rClient(icp) == rClient(grab))
-- {
-- int evtype = (xE) ? ((xGenericEvent*)xE)->evtype : event->type;
-- mask |= icp->xi2mask[device->id][evtype/8];
-- break;
-- }
--
-- icp = icp->next;
-- }
-- }
- } else
- {
- rc = EventToXI((InternalEvent*)event, &xE, &count);
-@@ -3607,23 +3575,6 @@ CheckPassiveGrabsOnWindow(
- "(%d, %d).\n", device->name, event->type, rc);
- continue;
- }
-- mask = grab->eventMask;
-- if (grab->ownerEvents && wOtherInputMasks(grab->window))
-- {
-- InputClientsPtr icp =
-- wOtherInputMasks(grab->window)->inputClients;
--
-- while(icp)
-- {
-- if (rClient(icp) == rClient(grab))
-- {
-- mask |= icp->mask[device->id];
-- break;
-- }
--
-- icp = icp->next;
-- }
-- }
- }
-
- (*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE);
-@@ -3632,7 +3583,8 @@ CheckPassiveGrabsOnWindow(
- {
- FixUpEventFromWindow(device, xE, grab->window, None, TRUE);
-
-- TryClientEvents(rClient(grab), device, xE, count, mask,
-+ TryClientEvents(rClient(grab), device, xE, count,
-+ GetEventFilter(device, xE),
- GetEventFilter(device, xE), grab);
- }
-
diff --git a/x11-servers/xorg-server/files/extra-include_eventstr.h b/x11-servers/xorg-server/files/extra-include_eventstr.h
deleted file mode 100644
index e39aadd16be6..000000000000
--- a/x11-servers/xorg-server/files/extra-include_eventstr.h
+++ /dev/null
@@ -1,14 +0,0 @@
---- include/eventstr.h.orig 2012-02-05 19:23:06.000000000 +0100
-+++ include/eventstr.h 2012-02-05 19:23:35.000000000 +0100
-@@ -91,9 +91,9 @@
- uint32_t button; /**< Button number */
- uint32_t key; /**< Key code */
- } detail;
-- uint16_t root_x; /**< Pos relative to root window in integral data */
-+ int16_t root_x; /**< Pos relative to root window in integral data */
- float root_x_frac; /**< Pos relative to root window in frac part */
-- uint16_t root_y; /**< Pos relative to root window in integral part */
-+ int16_t root_y; /**< Pos relative to root window in integral part */
- float root_y_frac; /**< Pos relative to root window in frac part */
- uint8_t buttons[(MAX_BUTTONS + 7)/8]; /**< Button mask */
- struct {
diff --git a/x11-servers/xorg-server/files/extra-new-bad-impl b/x11-servers/xorg-server/files/extra-new-bad-impl
deleted file mode 100644
index d15ee84fa700..000000000000
--- a/x11-servers/xorg-server/files/extra-new-bad-impl
+++ /dev/null
@@ -1,38 +0,0 @@
-Fix BadImplemented triggered in GDK 3
-
-Lead:
-https://bbs.archlinux.org/viewtopic.php?id=162012
-Debian bug:
-http://lists.debian.org/debian-x/2012/12/msg00133.html
-
---- Xi/xiselectev.c.orig 2012-05-17 19:09:01.000000000 +0200
-+++ Xi/xiselectev.c 2012-12-18 10:29:38.804469850 +0100
-@@ -175,17 +175,24 @@
- if (inputMasks)
- iclient = inputMasks->inputClients;
- for (; iclient; iclient = iclient->next) {
-- DeviceIntPtr dummy;
-+ DeviceIntPtr devTest;
-+ DeviceIntRec dummyTest;
-
- if (CLIENT_ID(iclient->resource) == client->index)
- continue;
-
-- dixLookupDevice(&dummy, evmask->deviceid, serverClient,
-+ if (evmask->deviceid == XIAllDevices ||
-+ evmask->deviceid == XIAllMasterDevices) {
-+ dummyTest.id = evmask->deviceid;
-+ devTest = &dummyTest;
-+ }
-+ else
-+ dixLookupDevice(&devTest, evmask->deviceid, serverClient,
- DixReadAccess);
-- if (!dummy)
-+ if (!devTest)
- return BadImplementation; /* this shouldn't happen */
-
-- if (xi2mask_isset(iclient->xi2mask, dummy, XI_TouchBegin))
-+ if (xi2mask_isset(iclient->xi2mask, devTest, XI_TouchBegin))
- return BadAccess;
- }
- }
diff --git a/x11-servers/xorg-server/files/extra-new-dix_dixfonts.c b/x11-servers/xorg-server/files/extra-new-dix_dixfonts.c
deleted file mode 100644
index d1f56741f902..000000000000
--- a/x11-servers/xorg-server/files/extra-new-dix_dixfonts.c
+++ /dev/null
@@ -1,41 +0,0 @@
---- dix/dixfonts.c.orig 2012-05-17 19:09:01.000000000 +0200
-+++ dix/dixfonts.c 2013-10-09 10:49:38.158284440 +0200
-@@ -1414,6 +1414,7 @@
- GC *pGC;
- unsigned char *data;
- ITclosurePtr new_closure;
-+ ITclosurePtr old_closure;
-
- /* We're putting the client to sleep. We need to
- save some state. Similar problem to that handled
-@@ -1425,12 +1426,14 @@
- err = BadAlloc;
- goto bail;
- }
-+ old_closure = c;
- *new_closure = *c;
- c = new_closure;
-
- data = malloc(c->nChars * itemSize);
- if (!data) {
- free(c);
-+ c = old_closure;
- err = BadAlloc;
- goto bail;
- }
-@@ -1441,6 +1444,7 @@
- if (!pGC) {
- free(c->data);
- free(c);
-+ c = old_closure;
- err = BadAlloc;
- goto bail;
- }
-@@ -1453,6 +1457,7 @@
- FreeScratchGC(pGC);
- free(c->data);
- free(c);
-+ c = old_closure;
- err = BadAlloc;
- goto bail;
- }
diff --git a/x11-servers/xorg-server/files/extra-old-arch-i386 b/x11-servers/xorg-server/files/extra-old-arch-i386
deleted file mode 100644
index c5e558c2cdd0..000000000000
--- a/x11-servers/xorg-server/files/extra-old-arch-i386
+++ /dev/null
@@ -1,11 +0,0 @@
---- hw/xfree86/common/compiler.h.orig 2010-05-04 02:47:58.000000000 +0200
-+++ hw/xfree86/common/compiler.h 2013-01-18 13:07:35.785442739 +0100
-@@ -1021,7 +1021,7 @@
-
- # if !defined(__SUNPRO_C)
- # if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__m32r__)
--# ifdef GCCUSESGAS
-+# if defined(GCCUSESGAS) || defined(__clang__)
-
- /*
- * If gcc uses gas rather than the native assembler, the syntax of these
diff --git a/x11-servers/xorg-server/files/extra-old-arch-powerpc b/x11-servers/xorg-server/files/extra-old-arch-powerpc
deleted file mode 100644
index 6fa917849749..000000000000
--- a/x11-servers/xorg-server/files/extra-old-arch-powerpc
+++ /dev/null
@@ -1,14 +0,0 @@
---- hw/xfree86/os-support/bsd/ppc_video.c.orig 2008-01-02 12:29:21.000000000 +0000
-+++ hw/xfree86/os-support/bsd/ppc_video.c 2008-01-02 12:29:00.000000000 +0000
-@@ -164,7 +164,11 @@
-
- if (ioBase != MAP_FAILED)
- {
-+#if defined(__FreeBSD__)
-+ munmap(__DEVOLATILE(unsigned char *, ioBase), 0x10000);
-+#else
- munmap(__UNVOLATILE(ioBase), 0x10000);
-+#endif
- ioBase = MAP_FAILED;
- }
- }
diff --git a/x11-servers/xorg-server/files/extra-old-arch-sparc64 b/x11-servers/xorg-server/files/extra-old-arch-sparc64
deleted file mode 100644
index 651be80114fe..000000000000
--- a/x11-servers/xorg-server/files/extra-old-arch-sparc64
+++ /dev/null
@@ -1,13 +0,0 @@
---- hw/xfree86/os-support/bsd/sparc64_video.c.orig 2008-10-02 21:01:25.000000000 +0000
-+++ hw/xfree86/os-support/bsd/sparc64_video.c 2009-03-29 19:55:40.000000000 +0000
-@@ -52,6 +52,10 @@
- pVidMem->mapMem = sparc64MapVidMem;
- pVidMem->unmapMem = sparc64UnmapVidMem;
- pVidMem->initialised = TRUE;
-+
-+#if defined(__FreeBSD__)
-+ pci_system_init_dev_mem(xf86Info.screenFd);
-+#endif
- }
-
- static pointer
diff --git a/x11-servers/xorg-server/files/extra-old-dix_dixfonts.c b/x11-servers/xorg-server/files/extra-old-dix_dixfonts.c
deleted file mode 100644
index 163a4efe396c..000000000000
--- a/x11-servers/xorg-server/files/extra-old-dix_dixfonts.c
+++ /dev/null
@@ -1,42 +0,0 @@
---- dix/dixfonts.c.orig 2010-05-04 02:47:57.000000000 +0200
-+++ dix/dixfonts.c 2013-10-09 10:54:40.488267646 +0200
-@@ -1508,6 +1508,7 @@
- GC *pGC;
- unsigned char *data;
- ITclosurePtr new_closure;
-+ ITclosurePtr old_closure;
-
- /* We're putting the client to sleep. We need to
- save some state. Similar problem to that handled
-@@ -1520,6 +1521,7 @@
- err = BadAlloc;
- goto bail;
- }
-+ old_closure = c;
- *new_closure = *c;
- c = new_closure;
-
-@@ -1527,6 +1529,7 @@
- if (!data)
- {
- xfree(c);
-+ c = old_closure;
- err = BadAlloc;
- goto bail;
- }
-@@ -1538,6 +1541,7 @@
- {
- xfree(c->data);
- xfree(c);
-+ c = old_closure;
- err = BadAlloc;
- goto bail;
- }
-@@ -1551,6 +1555,7 @@
- FreeScratchGC(pGC);
- xfree(c->data);
- xfree(c);
-+ c = old_closure;
- err = BadAlloc;
- goto bail;
- }
diff --git a/x11-servers/xorg-server/files/extra-os-utils.c b/x11-servers/xorg-server/files/extra-os-utils.c
deleted file mode 100644
index 2980ded6fd7d..000000000000
--- a/x11-servers/xorg-server/files/extra-os-utils.c
+++ /dev/null
@@ -1,20 +0,0 @@
---- os/utils.c.orig 2010-05-04 02:48:00.000000000 +0200
-+++ os/utils.c 2011-10-18 20:08:10.000000000 +0200
-@@ -315,7 +315,7 @@
- FatalError("Could not create lock file in %s\n", tmp);
- (void) sprintf(pid_str, "%10ld\n", (long)getpid());
- (void) write(lfd, pid_str, 11);
-- (void) chmod(tmp, 0444);
-+ (void) fchmod(tmp, 0444);
- (void) close(lfd);
-
- /*
-@@ -336,7 +336,7 @@
- /*
- * Read the pid from the existing file
- */
-- lfd = open(LockFile, O_RDONLY);
-+ lfd = open(LockFile, O_RDONLY|O_NOFOLLOW);
- if (lfd < 0) {
- unlink(tmp);
- FatalError("Can't read lock file %s\n", LockFile);
diff --git a/x11-servers/xorg-server/files/patch-CVE-2014-8092-3-4 b/x11-servers/xorg-server/files/patch-CVE-2014-8092-3-4
index e05101bac9e3..1d40d0459699 100644
--- a/x11-servers/xorg-server/files/patch-CVE-2014-8092-3-4
+++ b/x11-servers/xorg-server/files/patch-CVE-2014-8092-3-4
@@ -119,7 +119,7 @@ index 515e93f..079375d 100644
- if (((_size) > 1) && ((_pReg)->data =
- (RegDataPtr) malloc(RegionSizeof(_size)))) {
+ if (((_size) > 1) && ((rgnSize = RegionSizeof(_size)) > 0) &&
-+ (((_pReg)->data = malloc(rgnSize)) != NULL)) {
++ (((_pReg)->data = (RegDataPtr) malloc(rgnSize)) != NULL)) {
(_pReg)->data->size = (_size);
(_pReg)->data->numRects = 0;
}
diff --git a/x11-servers/xorg-server/files/patch-CVE-2014-8095 b/x11-servers/xorg-server/files/patch-CVE-2014-8095
index 8c8a3f0bd6d5..8fddc451c391 100644
--- a/x11-servers/xorg-server/files/patch-CVE-2014-8095
+++ b/x11-servers/xorg-server/files/patch-CVE-2014-8095
@@ -281,38 +281,28 @@ index 63d95bc..e2a2ae3 100644
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
if (ret != Success)
---- Xi/xipassivegrab.c.orig 2012-05-17 19:09:01.000000000 +0200
-+++ Xi/xipassivegrab.c 2014-12-10 10:32:35.379412598 +0100
-@@ -50,9 +50,10 @@
- SProcXIPassiveGrabDevice(ClientPtr client)
- {
- int i;
-- xXIModifierInfo *mods;
-+ uint32_t *mods;
+--- Xi/xipassivegrab.c.orig 2014-04-15 03:01:56.000000000 +0200
++++ Xi/xipassivegrab.c 2014-12-11 09:00:53.965074134 +0100
+@@ -53,6 +53,7 @@
+ uint32_t *mods;
REQUEST(xXIPassiveGrabDeviceReq);
+ REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq);
swaps(&stuff->length);
swaps(&stuff->deviceid);
-@@ -63,12 +64,12 @@
+@@ -63,7 +64,9 @@
swaps(&stuff->mask_len);
swaps(&stuff->num_modifiers);
-- mods = (xXIModifierInfo *) &stuff[1];
+- mods = (uint32_t *) &stuff[1];
+ REQUEST_FIXED_SIZE(xXIPassiveGrabDeviceReq,
+ ((uint32_t) stuff->mask_len + stuff->num_modifiers) *4);
+ mods = (uint32_t *) &stuff[1] + stuff->mask_len;
for (i = 0; i < stuff->num_modifiers; i++, mods++) {
-- swapl(&mods->base_mods);
-- swapl(&mods->latched_mods);
-- swapl(&mods->locked_mods);
-+ swapl(mods);
- }
-
- return ProcXIPassiveGrabDevice(client);
-@@ -88,7 +89,8 @@
+ swapl(mods);
+@@ -92,7 +95,8 @@
int mask_len;
REQUEST(xXIPassiveGrabDeviceReq);
@@ -322,7 +312,7 @@ index 63d95bc..e2a2ae3 100644
if (stuff->deviceid == XIAllDevices)
dev = inputInfo.all_devices;
-@@ -250,6 +252,7 @@
+@@ -248,6 +252,7 @@
uint32_t *modifiers;
REQUEST(xXIPassiveUngrabDeviceReq);
@@ -330,7 +320,7 @@ index 63d95bc..e2a2ae3 100644
swaps(&stuff->length);
swapl(&stuff->grab_window);
-@@ -257,6 +260,8 @@
+@@ -255,6 +260,8 @@
swapl(&stuff->detail);
swaps(&stuff->num_modifiers);
@@ -339,7 +329,7 @@ index 63d95bc..e2a2ae3 100644
modifiers = (uint32_t *) &stuff[1];
for (i = 0; i < stuff->num_modifiers; i++, modifiers++)
-@@ -275,7 +280,8 @@
+@@ -273,7 +280,8 @@
int i, rc;
REQUEST(xXIPassiveUngrabDeviceReq);
diff --git a/x11-servers/xorg-server/files/patch-CVE-2014-8098-7-8 b/x11-servers/xorg-server/files/patch-CVE-2014-8098-7-8
index 518b71d1f885..76fa0e0232f9 100644
--- a/x11-servers/xorg-server/files/patch-CVE-2014-8098-7-8
+++ b/x11-servers/xorg-server/files/patch-CVE-2014-8098-7-8
@@ -47,8 +47,8 @@ index cda7656..1ebf7f3 100644
pc += __GLX_SINGLE_HDR_SIZE;
if (cx != NULL) {
const GLenum target = (GLenum) bswap_32(*(int *) (pc + 0));
---- glx/single2.c.orig 2012-05-17 19:09:02.000000000 +0200
-+++ glx/single2.c 2014-12-10 14:44:06.961670320 +0100
+--- glx/single2.c.orig 2014-04-15 03:01:57.000000000 +0200
++++ glx/single2.c 2014-12-11 09:08:22.788060618 +0100
@@ -49,11 +49,14 @@
int
__glXDisp_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc)
@@ -101,10 +101,10 @@ index cda7656..1ebf7f3 100644
*/
noChangeAllowed:;
- client = cl->client;
- reply.length = nitems;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
-@@ -209,9 +216,12 @@
+ reply = (xGLXRenderModeReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+@@ -211,9 +218,12 @@
int
__glXDisp_Flush(__GLXclientState * cl, GLbyte * pc)
{
@@ -117,7 +117,7 @@ index cda7656..1ebf7f3 100644
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
-@@ -225,10 +235,12 @@
+@@ -227,10 +237,12 @@
int
__glXDisp_Finish(__GLXclientState * cl, GLbyte * pc)
{
@@ -131,7 +131,7 @@ index cda7656..1ebf7f3 100644
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
-@@ -319,7 +331,7 @@
+@@ -321,7 +332,7 @@
int
DoGetString(__GLXclientState * cl, GLbyte * pc, GLboolean need_swap)
{
@@ -140,7 +140,7 @@ index cda7656..1ebf7f3 100644
__GLXcontext *cx;
GLenum name;
const char *string;
-@@ -329,6 +341,8 @@
+@@ -331,6 +342,8 @@
char *buf = NULL, *buf1 = NULL;
GLint length = 0;
@@ -149,7 +149,7 @@ index cda7656..1ebf7f3 100644
/* If the client has the opposite byte order, swap the contextTag and
* the name.
*/
-@@ -345,7 +359,6 @@
+@@ -347,7 +360,6 @@
pc += __GLX_SINGLE_HDR_SIZE;
name = *(GLenum *) (pc + 0);
string = (const char *) CALL_GetString(GET_DISPATCH(), (name));
@@ -157,8 +157,8 @@ index cda7656..1ebf7f3 100644
if (string == NULL)
string = "";
---- glx/single2swap.c.orig 2012-05-17 19:09:02.000000000 +0200
-+++ glx/single2swap.c 2014-12-10 14:46:06.475406737 +0100
+--- glx/single2swap.c.orig 2014-04-15 03:01:57.000000000 +0200
++++ glx/single2swap.c 2014-12-11 09:05:12.670056539 +0100
@@ -45,6 +45,7 @@
int
__glXDispSwap_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc)
@@ -215,10 +215,10 @@ index cda7656..1ebf7f3 100644
*/
noChangeAllowed:;
- client = cl->client;
- reply.length = nitems;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
-@@ -226,11 +233,14 @@
+ reply = (xGLXRenderModeReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+@@ -228,11 +235,14 @@
int
__glXDispSwap_Flush(__GLXclientState * cl, GLbyte * pc)
{
@@ -233,7 +233,7 @@ index cda7656..1ebf7f3 100644
__GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
-@@ -245,12 +255,14 @@
+@@ -247,12 +257,14 @@
int
__glXDispSwap_Finish(__GLXclientState * cl, GLbyte * pc)
{
@@ -249,7 +249,7 @@ index cda7656..1ebf7f3 100644
__GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag);
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
-@@ -262,7 +274,6 @@
+@@ -264,7 +276,6 @@
cx->hasUnflushedCommands = GL_FALSE;
/* Send empty reply packet to indicate finish is finished */
@@ -257,8 +257,8 @@ index cda7656..1ebf7f3 100644
__GLX_BEGIN_REPLY(0);
__GLX_PUT_RETVAL(0);
__GLX_SWAP_REPLY_HEADER();
---- glx/singlepix.c.orig 2014-12-10 15:49:35.025115139 +0100
-+++ glx/singlepix.c 2014-12-10 15:53:21.967098978 +0100
+--- glx/singlepix.c.orig 2014-12-11 09:04:51.072058678 +0100
++++ glx/singlepix.c 2014-12-11 09:10:51.484033826 +0100
@@ -55,6 +55,8 @@
int error;
char *answer, answerBuffer[200];
@@ -404,8 +404,8 @@ index cda7656..1ebf7f3 100644
+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16);
return GetColorTable(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag);
}
---- glx/singlepixswap.c.orig 2014-12-10 15:49:35.025115139 +0100
-+++ glx/singlepixswap.c 2014-12-10 15:55:47.558406617 +0100
+--- glx/singlepixswap.c.orig 2014-12-11 09:04:51.073058638 +0100
++++ glx/singlepixswap.c 2014-12-11 09:12:14.151301716 +0100
@@ -57,6 +57,8 @@
int error;
char *answer, answerBuffer[200];
@@ -438,7 +438,7 @@ index cda7656..1ebf7f3 100644
compsize2 = __glGetTexImage_size(target, 1, format, type, height, 1, 1);
- if (compsize < 0)
-+ if ((compsize = safe_pad(compsize)) < 0)
++ if ((compsize =safe_pad(compsize)) < 0)
return BadLength;
- if (compsize2 < 0)
+ if ((compsize2 = safe_pad(compsize2)) < 0)
diff --git a/x11-servers/xorg-server/files/patch-CVE-2014-8100-1-2 b/x11-servers/xorg-server/files/patch-CVE-2014-8100-1-2
index a2ae0541e95e..cfb0c4cc3f3f 100644
--- a/x11-servers/xorg-server/files/patch-CVE-2014-8100-1-2
+++ b/x11-servers/xorg-server/files/patch-CVE-2014-8100-1-2
@@ -13,9 +13,11 @@ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
render/render.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---- render/render.c.orig 2014-12-10 16:06:01.737046585 +0100
-+++ render/render.c 2014-12-10 16:07:49.285040265 +0100
-@@ -271,10 +271,11 @@
+diff --git a/render/render.c b/render/render.c
+index e3031da..200e0c8 100644
+--- render/render.c
++++ render/render.c
+@@ -276,11 +276,11 @@ ProcRenderQueryVersion(ClientPtr client)
REQUEST(xRenderQueryVersionReq);
@@ -25,6 +27,10 @@ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
pRenderClient->minor_version = stuff->minorVersion;
- REQUEST_SIZE_MATCH(xRenderQueryVersionReq);
- memset(&rep, 0, sizeof(xRenderQueryVersionReply));
- rep.type = X_Reply;
- rep.length = 0;
+-
+ if ((stuff->majorVersion * 1000 + stuff->minorVersion) <
+ (SERVER_RENDER_MAJOR_VERSION * 1000 + SERVER_RENDER_MINOR_VERSION)) {
+ rep.majorVersion = stuff->majorVersion;
+--
+2.1.2
+
diff --git a/x11-servers/xorg-server/files/patch-Xserver-hw-xfree86-os-support-bsd-i386_video.c b/x11-servers/xorg-server/files/patch-Xserver-hw-xfree86-os-support-bsd-i386_video.c
index 933742b00170..d0bbe3df3f80 100644
--- a/x11-servers/xorg-server/files/patch-Xserver-hw-xfree86-os-support-bsd-i386_video.c
+++ b/x11-servers/xorg-server/files/patch-Xserver-hw-xfree86-os-support-bsd-i386_video.c
@@ -1,8 +1,5 @@
-Index: programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c
-diff -u -p programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c.orig programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c
---- hw/xfree86/os-support/bsd/i386_video.c.orig Tue Oct 4 01:46:14 2005
-+++ hw/xfree86/os-support/bsd/i386_video.c Thu Jan 26 14:57:56 2006
-@@ -35,6 +35,7 @@
+Index: hw/xfree86/os-support/bsd/i386_video.c
+@@ -32,6 +32,7 @@
#include "xf86Priv.h"
#include <errno.h>
diff --git a/x11-servers/xorg-server/files/patch-config_config-backends.h b/x11-servers/xorg-server/files/patch-config_config-backends.h
new file mode 100644
index 000000000000..89d3c656814c
--- /dev/null
+++ b/x11-servers/xorg-server/files/patch-config_config-backends.h
@@ -0,0 +1,11 @@
+--- config/config-backends.h.orig 2014-04-12 15:29:14 UTC
++++ config/config-backends.h
+@@ -75,3 +75,8 @@ void config_hal_fini(void);
+ int config_wscons_init(void);
+ void config_wscons_fini(void);
+ #endif
++
++#ifdef CONFIG_DEVD
++int config_devd_init(void);
++void config_devd_fini(void);
++#endif
diff --git a/x11-servers/xorg-server/files/patch-config_config.c b/x11-servers/xorg-server/files/patch-config_config.c
new file mode 100644
index 000000000000..570d0de16ee4
--- /dev/null
+++ b/x11-servers/xorg-server/files/patch-config_config.c
@@ -0,0 +1,21 @@
+--- config/config.c.orig 2014-04-12 15:29:14 UTC
++++ config/config.c
+@@ -64,6 +64,9 @@ config_init(void)
+ #elif defined(CONFIG_WSCONS)
+ if (!config_wscons_init())
+ ErrorF("[config] failed to initialise wscons\n");
++#elif defined(CONFIG_DEVD)
++ if (!config_devd_init())
++ ErrorF("[config] failed to initialise devd\n");
+ #endif
+ }
+
+@@ -82,6 +85,8 @@ config_fini(void)
+ config_dbus_core_fini();
+ #elif defined(CONFIG_WSCONS)
+ config_wscons_fini();
++#elif defined(CONFIG_DEVD)
++ config_devd_fini();
+ #endif
+ }
+
diff --git a/x11-servers/xorg-server/files/patch-config_devd.c b/x11-servers/xorg-server/files/patch-config_devd.c
new file mode 100644
index 000000000000..039205d5b9bf
--- /dev/null
+++ b/x11-servers/xorg-server/files/patch-config_devd.c
@@ -0,0 +1,533 @@
+--- config/devd.c.orig 2014-12-16 23:03:10 UTC
++++ config/devd.c
+@@ -0,0 +1,530 @@
++/*
++ * Copyright (c) 2012 Baptiste Daroussin
++ * Copyright (c) 2013, 2014 Alex Kozlov
++ * Copyright (c) 2014 Robert Millan
++ * Copyright (c) 2014 Jean-Sebastien Pedron
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice (including the next
++ * paragraph) shall be included in all copies or substantial portions of the
++ * Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ * DEALINGS IN THE SOFTWARE.
++ *
++ * Author: Baptiste Daroussin <bapt@FreeBSD.org>
++ */
++
++#ifdef HAVE_DIX_CONFIG_H
++#include <dix-config.h>
++#endif
++
++#include <sys/types.h>
++#include <sys/kbio.h>
++#include <sys/socket.h>
++#include <sys/stat.h>
++#include <sys/sysctl.h>
++#include <sys/un.h>
++
++#include <ctype.h>
++#include <errno.h>
++#include <fcntl.h>
++#include <stdlib.h>
++#include <stdio.h>
++#include <stdbool.h>
++#include <unistd.h>
++
++#include "input.h"
++#include "inputstr.h"
++#include "hotplug.h"
++#include "config-backends.h"
++#include "os.h"
++
++#define DEVD_SOCK_PATH "/var/run/devd.pipe"
++
++#define DEVD_EVENT_ADD '+'
++#define DEVD_EVENT_REMOVE '-'
++
++#define RECONNECT_DELAY 5 * 1000
++
++static int sock_devd;
++static bool is_console_kbd = false;
++static bool is_kbdmux = false;
++OsTimerPtr rtimer;
++
++struct hw_type {
++ const char *driver;
++ int flag;
++ const char *xdriver;
++};
++
++static struct hw_type hw_types[] = {
++ { "ukbd", ATTR_KEYBOARD, "kbd" },
++ { "atkbd", ATTR_KEYBOARD, "kbd" },
++ { "kbdmux", ATTR_KEYBOARD, "kbd" },
++ { "sysmouse", ATTR_POINTER, "mouse" },
++ { "ums", ATTR_POINTER, "mouse" },
++ { "psm", ATTR_POINTER, "mouse" },
++ { "joy", ATTR_JOYSTICK, NULL },
++ { "atp", ATTR_TOUCHPAD, NULL },
++ { "uep", ATTR_TOUCHSCREEN, NULL },
++ { NULL, -1, NULL },
++};
++
++static bool
++sysctl_exists(const struct hw_type *device, int unit,
++ char *devname, size_t devname_len)
++{
++ char sysctlname[PATH_MAX];
++ size_t len;
++ int ret;
++
++ if (device == NULL || device->driver == NULL)
++ return false;
++
++ /* Check if a sysctl exists. */
++ snprintf(sysctlname, sizeof(sysctlname), "dev.%s.%i.%%desc",
++ device->driver, unit);
++ ret = sysctlbyname(sysctlname, NULL, &len, NULL, 0);
++
++ if (ret == 0 && len > 0) {
++ snprintf(devname, devname_len, "%s%i", device->driver, unit);
++ return true;
++ }
++
++ return false;
++}
++
++static bool
++devpath_exists(const struct hw_type *device,
++ char *devname, size_t devname_len)
++{
++ char *devpath;
++ struct stat st;
++ int ret;
++
++ if (device == NULL || device->driver == NULL)
++ return false;
++
++ /* Check if /dev/$driver exists. */
++ asprintf(&devpath, "/dev/%s", device->driver);
++ if (devpath == NULL)
++ return false;
++
++ ret = stat(devpath, &st);
++ free(devpath);
++
++ if (ret == 0) {
++ strncpy(devname, device->driver, devname_len);
++ return true;
++ }
++
++ return false;
++}
++
++static char *
++sysctl_get_str(const char *sysctlname)
++{
++ char *dest = NULL;
++ size_t len;
++
++ if (sysctlname == NULL)
++ return NULL;
++
++ if (sysctlbyname(sysctlname, NULL, &len, NULL, 0) == 0) {
++ dest = malloc(len + 1);
++ if (dest) {
++ if (sysctlbyname(sysctlname, dest, &len, NULL, 0) == 0)
++ dest[len] = '\0';
++ else {
++ free(dest);
++ dest = NULL;
++ }
++ }
++ }
++
++ return dest;
++}
++
++static void
++device_added(const char *devname)
++{
++ char path[PATH_MAX];
++ char sysctlname[PATH_MAX];
++ char *vendor;
++ char *product = NULL;
++ char *config_info = NULL;
++ char *walk;
++ InputOption *options = NULL;
++ InputAttributes attrs = { };
++ DeviceIntPtr dev = NULL;
++ int i;
++ int fd;
++
++ for (i = 0; hw_types[i].driver != NULL; i++) {
++ size_t len;
++
++ len = strlen(hw_types[i].driver);
++ if (strcmp(devname, hw_types[i].driver) == 0 ||
++ (strncmp(devname, hw_types[i].driver, len) == 0 &&
++ isnumber(*(devname + len)))) {
++ attrs.flags |= hw_types[i].flag;
++ break;
++ }
++ }
++
++ if (hw_types[i].driver == NULL || hw_types[i].xdriver == NULL) {
++ LogMessage(X_INFO, "config/devd: ignoring device %s\n",
++ devname);
++ return;
++ }
++
++ /* Skip keyboard devices if kbdmux is enabled */
++ if (is_kbdmux && is_console_kbd && hw_types[i].flag & ATTR_KEYBOARD) {
++ LogMessage(X_INFO, "config/devd: kbdmux is enabled, ignoring device %s\n",
++ devname);
++ return;
++ }
++
++ snprintf(path, sizeof(path), "/dev/%s", devname);
++
++ options = input_option_new(NULL, "_source", "server/devd");
++ if (!options)
++ return;
++
++ snprintf(sysctlname, sizeof(sysctlname), "dev.%s.%s.%%desc",
++ hw_types[i].driver, devname + strlen(hw_types[i].driver));
++ vendor = sysctl_get_str(sysctlname);
++ if (vendor == NULL) {
++ options = input_option_new(options, "name", devname);
++ }
++ else {
++ if ((walk = strchr(vendor, ' ')) != NULL) {
++ walk[0] = '\0';
++ walk++;
++ product = walk;
++ if ((walk = strchr(product, ',')) != NULL)
++ walk[0] = '\0';
++ }
++
++ attrs.vendor = strdup(vendor);
++ if (product) {
++ attrs.product = strdup(product);
++ options = input_option_new(options, "name", product);
++ }
++ else
++ options = input_option_new(options, "name", "(unnamed)");
++
++ free(vendor);
++ }
++
++ /* XXX implement usb_id */
++ attrs.usb_id = NULL;
++ attrs.device = strdup(path);
++ options = input_option_new(options, "driver", hw_types[i].xdriver);
++
++ fd = open(path, O_RDONLY);
++ if (fd > 0) {
++ close(fd);
++ options = input_option_new(options, "device", path);
++ }
++ else {
++ if (attrs.flags & ~ATTR_KEYBOARD) {
++ LogMessage(X_INFO, "config/devd: device %s already opened\n",
++ path);
++
++ /*
++ * Fail if cannot open device, it breaks AllowMouseOpenFail,
++ * but it should not matter when config/devd enabled
++ */
++ goto unwind;
++ }
++
++ if (is_console_kbd) {
++ /*
++ * There can be only one keyboard attached to console and
++ * it is already added.
++ */
++ LogMessage(X_WARNING, "config/devd: console keyboard is "
++ "already added, ignoring %s (%s)\n",
++ attrs.product, path);
++ goto unwind;
++ }
++ else
++ /*
++ * Don't pass "device" option if the keyboard is already
++ * attached to the console (ie. open() fails).
++ * This would activate a special logic in xf86-input-keyboard.
++ * Prevent any other attached to console keyboards being
++ * processed. There can be only one such device.
++ */
++ is_console_kbd = true;
++ }
++
++ if (asprintf(&config_info, "devd:%s", devname) == -1) {
++ config_info = NULL;
++ goto unwind;
++ }
++
++ if (device_is_duplicate(config_info)) {
++ LogMessage(X_WARNING, "config/devd: device %s (%s) already added. "
++ "ignoring\n", attrs.product, path);
++ goto unwind;
++ }
++
++ options = input_option_new(options, "config_info", config_info);
++ LogMessage(X_INFO, "config/devd: adding input device %s (%s)\n",
++ attrs.product, path);
++
++ NewInputDeviceRequest(options, &attrs, &dev);
++
++unwind:
++ free(config_info);
++ input_option_free_list(&options);
++ free(attrs.usb_id);
++ free(attrs.product);
++ free(attrs.device);
++ free(attrs.vendor);
++}
++
++static void
++device_removed(char *devname)
++{
++ char *config_info;
++
++ if (asprintf(&config_info, "devd:%s", devname) == -1)
++ return;
++
++ remove_devices("devd", config_info);
++
++ free(config_info);
++}
++
++static bool is_kbdmux_enabled(void)
++{
++ /* Xorg uses /dev/ttyv0 as a console device */
++ /* const char device[]="/dev/console"; */
++ const char device[]="/dev/ttyv0";
++ keyboard_info_t info;
++ int fd;
++
++ fd = open(device, O_RDONLY);
++
++ if (fd < 0)
++ return false;
++
++ if (ioctl(fd, KDGKBINFO, &info) == -1) {
++ close(fd);
++ return false;
++ }
++
++ close(fd);
++
++ if (!strncmp(info.kb_name, "kbdmux", 6))
++ return true;
++
++ return false;
++}
++
++static void
++disconnect_devd(int sock)
++{
++ if (sock >= 0) {
++ RemoveGeneralSocket(sock);
++ close(sock);
++ }
++}
++
++static int
++connect_devd(void)
++{
++ struct sockaddr_un devd;
++ int sock;
++
++ sock = socket(AF_UNIX, SOCK_STREAM, 0);
++ if (sock < 0) {
++ LogMessage(X_ERROR, "config/devd: fail opening stream socket\n");
++ return -1;
++ }
++
++ devd.sun_family = AF_UNIX;
++ strlcpy(devd.sun_path, DEVD_SOCK_PATH, sizeof(devd.sun_path));
++
++ if (connect(sock, (struct sockaddr *) &devd, sizeof(devd)) < 0) {
++ close(sock);
++ LogMessage(X_ERROR, "config/devd: fail to connect to devd\n");
++ return -1;
++ }
++
++ AddGeneralSocket(sock);
++
++ return sock;
++}
++
++static CARD32
++reconnect_handler(OsTimerPtr timer, CARD32 time, pointer arg)
++{
++ int newsock;
++
++ if ((newsock = connect_devd()) > 0) {
++ sock_devd = newsock;
++ TimerFree(rtimer);
++ rtimer = NULL;
++ LogMessage(X_INFO, "config/devd: reopening devd socket\n");
++ return 0;
++ }
++
++ /* Try again after RECONNECT_DELAY */
++ return RECONNECT_DELAY;
++}
++
++static ssize_t
++socket_getline(int fd, char **out)
++{
++ char *buf, *newbuf;
++ ssize_t ret, cap, sz = 0;
++ char c;
++
++ cap = 1024;
++ buf = malloc(cap * sizeof(char));
++ if (!buf)
++ return -1;
++
++ for (;;) {
++ ret = read(sock_devd, &c, 1);
++ if (ret < 0) {
++ if (errno == EINTR)
++ continue;
++ free(buf);
++ return -1;
++ /* EOF - devd socket is lost */
++ } else if (ret == 0) {
++ disconnect_devd(sock_devd);
++ rtimer = TimerSet(NULL, 0, 1, reconnect_handler, NULL);
++ LogMessage(X_WARNING, "config/devd: devd socket is lost\n");
++ return -1;
++ }
++ if (c == '\n')
++ break;
++
++ if (sz + 1 >= cap) {
++ cap *= 2;
++ newbuf = realloc(buf, cap * sizeof(char));
++ if (!newbuf) {
++ free(buf);
++ return -1;
++ }
++ buf = newbuf;
++ }
++ buf[sz] = c;
++ sz++;
++ }
++
++ buf[sz] = '\0';
++ if (sz >= 0)
++ *out = buf;
++ else
++ free(buf);
++
++ /* Number of bytes in the line, not counting the line break */
++ return sz;
++}
++
++static void
++wakeup_handler(void *data, int err, void *read_mask)
++{
++ char *line = NULL;
++ char *walk;
++
++ if (err < 0)
++ return;
++
++ if (FD_ISSET(sock_devd, (fd_set *) read_mask)) {
++ if (socket_getline(sock_devd, &line) < 0)
++ return;
++
++ walk = strchr(line + 1, ' ');
++ if (walk != NULL)
++ walk[0] = '\0';
++
++ switch (*line) {
++ case DEVD_EVENT_ADD:
++ device_added(line + 1);
++ break;
++ case DEVD_EVENT_REMOVE:
++ device_removed(line + 1);
++ break;
++ default:
++ break;
++ }
++ free(line);
++ }
++}
++
++static void
++block_handler(void *data, struct timeval **tv, void *read_mask)
++{
++}
++
++int
++config_devd_init(void)
++{
++ char devicename[1024];
++ int i, j;
++
++ LogMessage(X_INFO, "config/devd: probing input devices...\n");
++
++ /*
++ * Add fake keyboard and give up on keyboards management
++ * if kbdmux is enabled
++ */
++ if ((is_kbdmux = is_kbdmux_enabled()) == true)
++ device_added("kbdmux");
++
++ for (i = 0; hw_types[i].driver != NULL; i++) {
++ /* First scan the sysctl to determine the hardware */
++ for (j = 0; j < 16; j++) {
++ if (sysctl_exists(&hw_types[i], j,
++ devicename, sizeof(devicename)) != 0)
++ device_added(devicename);
++ }
++
++ if (devpath_exists(&hw_types[i], devicename, sizeof(devicename)) != 0)
++ device_added(devicename);
++ }
++
++ if ((sock_devd = connect_devd()) < 0)
++ return 0;
++
++ RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL);
++
++ return 1;
++}
++
++void
++config_devd_fini(void)
++{
++ LogMessage(X_INFO, "config/devd: terminating backend...\n");
++
++ if (rtimer) {
++ TimerFree(rtimer);
++ rtimer = NULL;
++ }
++
++ disconnect_devd(sock_devd);
++
++ RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL);
++
++ is_console_kbd = false;
++}
diff --git a/x11-servers/xorg-server/files/patch-hw_xfree86_common_xf86Config.c b/x11-servers/xorg-server/files/patch-hw_xfree86_common_xf86Config.c
new file mode 100644
index 000000000000..7d9edf6a0e21
--- /dev/null
+++ b/x11-servers/xorg-server/files/patch-hw_xfree86_common_xf86Config.c
@@ -0,0 +1,20 @@
+--- hw/xfree86/common/xf86Config.c.orig 2014-04-15 01:01:57 UTC
++++ hw/xfree86/common/xf86Config.c
+@@ -1376,13 +1376,16 @@ checkCoreInputDevices(serverLayoutPtr se
+ }
+
+ if (!xf86Info.forceInputDevices && !(foundPointer && foundKeyboard)) {
+-#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS)
++#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS) || \
++ defined(CONFIG_DEVD)
+ const char *config_backend;
+
+ #if defined(CONFIG_HAL)
+ config_backend = "HAL";
+ #elif defined(CONFIG_UDEV)
+ config_backend = "udev";
++#elif defined(CONFIG_DEVD)
++ config_backend = "devd";
+ #else
+ config_backend = "wscons";
+ #endif
diff --git a/x11-servers/xorg-server/files/patch-hw_xfree86_common_xf86Globals.c b/x11-servers/xorg-server/files/patch-hw_xfree86_common_xf86Globals.c
new file mode 100644
index 000000000000..bae0675d962a
--- /dev/null
+++ b/x11-servers/xorg-server/files/patch-hw_xfree86_common_xf86Globals.c
@@ -0,0 +1,12 @@
+--- hw/xfree86/common/xf86Globals.c.orig 2014-04-12 15:29:14 UTC
++++ hw/xfree86/common/xf86Globals.c
+@@ -123,7 +123,8 @@ xf86InfoRec xf86Info = {
+ .log = LogNone,
+ .disableRandR = FALSE,
+ .randRFrom = X_DEFAULT,
+-#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS)
++#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS) || \
++ defined(CONFIG_DEVD)
+ .forceInputDevices = FALSE,
+ .autoAddDevices = TRUE,
+ .autoEnableDevices = TRUE,
diff --git a/x11-servers/xorg-server/files/patch-hw_xfree86_loader_loadmod.c b/x11-servers/xorg-server/files/patch-hw_xfree86_loader_loadmod.c
new file mode 100644
index 000000000000..3af4e169e3dd
--- /dev/null
+++ b/x11-servers/xorg-server/files/patch-hw_xfree86_loader_loadmod.c
@@ -0,0 +1,11 @@
+--- hw/xfree86/loader/loadmod.c.orig 2014-04-12 15:29:14 UTC
++++ hw/xfree86/loader/loadmod.c
+@@ -490,7 +490,7 @@ LoaderListDirs(const char **subdirlist,
+ char **elem;
+ const char **subdirs;
+ const char **s;
+- PatternPtr patterns;
++ PatternPtr patterns = NULL;
+ PatternPtr p;
+ DIR *d;
+ struct dirent *dp;
diff --git a/x11-servers/xorg-server/files/patch-hw_xfree86_modes_xf86Crtc.c b/x11-servers/xorg-server/files/patch-hw_xfree86_modes_xf86Crtc.c
new file mode 100644
index 000000000000..8e89fbc1a5da
--- /dev/null
+++ b/x11-servers/xorg-server/files/patch-hw_xfree86_modes_xf86Crtc.c
@@ -0,0 +1,12 @@
+--- hw/xfree86/modes/xf86Crtc.c.orig 2014-04-15 01:01:57 UTC
++++ hw/xfree86/modes/xf86Crtc.c
+@@ -1774,6 +1774,9 @@ SetCompatOutput(xf86CrtcConfigPtr config
+ DisplayModePtr maxmode = NULL, testmode, mode;
+ int o, compat = -1, count, mincount = 0;
+
++ if (config->num_output == 0)
++ return NULL;
++
+ /* Look for one that's definitely connected */
+ for (o = 0; o < config->num_output; o++) {
+ test = config->output[o];
diff --git a/x11-servers/xorg-server/files/patch-xkb_Makefile.in b/x11-servers/xorg-server/files/patch-xkb_Makefile.in
index 934bef0af445..48f821c1b3b2 100644
--- a/x11-servers/xorg-server/files/patch-xkb_Makefile.in
+++ b/x11-servers/xorg-server/files/patch-xkb_Makefile.in
@@ -1,6 +1,6 @@
---- xkb/Makefile.in.orig 2013-06-16 11:16:48.000000000 +0000
-+++ xkb/Makefile.in 2013-06-16 11:17:08.000000000 +0000
-@@ -816,7 +816,7 @@
+--- xkb/Makefile.in.orig 2014-12-12 22:12:45 UTC
++++ xkb/Makefile.in
+@@ -790,7 +790,7 @@ info: info-am
info-am:
diff --git a/x11-servers/xorg-server/files/patch-xorgconf.cpp b/x11-servers/xorg-server/files/patch-xorgconf.cpp
deleted file mode 100644
index 04e217b8d9fe..000000000000
--- a/x11-servers/xorg-server/files/patch-xorgconf.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
---- hw/xfree86/xorgconf.cpp.orig Fri Dec 31 14:40:27 2004
-+++ hw/xfree86/xorgconf.cpp Fri Dec 31 14:40:28 2004
-@@ -624,3 +624,11 @@
- InputDevice "Keyboard1" "CoreKeyboard"
- EndSection
-
-+
-+XCOMM Two experimental extensions are available -- Composite and XEVIE. Uncomment
-+XCOMM the section below to enable Composite. Many extensions can also be disabled
-+XCOMM in this manner.
-+
-+XCOMM Section "Extensions"
-+XCOMM Option "Composite" "Enable"
-+XCOMM EndSection
diff --git a/x11-servers/xorg-server/pkg-plist b/x11-servers/xorg-server/pkg-plist
index b893360bebc6..62612ed3eb09 100644
--- a/x11-servers/xorg-server/pkg-plist
+++ b/x11-servers/xorg-server/pkg-plist
@@ -12,13 +12,10 @@ include/xorg/BT.h
include/xorg/IBM.h
include/xorg/TI.h
include/xorg/XIstubs.h
-%%NEW%%include/xorg/Xprintf.h
+include/xorg/Xprintf.h
include/xorg/bt829.h
-%%OLD%%include/xorg/bstore.h
-%%OLD%%include/xorg/bstorestr.h
-%%NEW%%include/xorg/callback.h
-%%OLD%%include/xorg/cfb8_16.h
-%%NEW%%include/xorg/client.h
+include/xorg/callback.h
+include/xorg/client.h
include/xorg/closestr.h
include/xorg/closure.h
include/xorg/colormap.h
@@ -61,14 +58,13 @@ include/xorg/geext.h
include/xorg/geint.h
include/xorg/globals.h
include/xorg/glyphstr.h
+include/xorg/glx_extinit.h
include/xorg/hotplug.h
include/xorg/i2c_def.h
include/xorg/input.h
include/xorg/inputstr.h
-%%NEW%%include/xorg/list.h
+include/xorg/list.h
include/xorg/mi.h
-%%OLD%%include/xorg/mibank.h
-include/xorg/mibstore.h
include/xorg/micmap.h
include/xorg/micoord.h
include/xorg/mifillarc.h
@@ -82,15 +78,15 @@ include/xorg/misc.h
include/xorg/miscstruct.h
include/xorg/mispans.h
include/xorg/mistruct.h
-%%NEW%%include/xorg/misync.h
-%%NEW%%include/xorg/misyncstr.h
+include/xorg/misync.h
+include/xorg/misyncstr.h
include/xorg/miwideline.h
include/xorg/mizerarc.h
include/xorg/mioverlay.h
include/xorg/msp3430.h
include/xorg/opaque.h
include/xorg/os.h
-%%NEW%%include/xorg/optionstr.h
+include/xorg/optionstr.h
include/xorg/panoramiXsrv.h
include/xorg/panoramiX.h
include/xorg/picture.h
@@ -102,7 +98,6 @@ include/xorg/property.h
include/xorg/propertyst.h
include/xorg/ptrveloc.h
include/xorg/randrstr.h
-%%OLD%%include/xorg/renderedge.h
include/xorg/region.h
include/xorg/regionstr.h
include/xorg/registry.h
@@ -120,7 +115,7 @@ include/xorg/shmint.h
include/xorg/site.h
include/xorg/swaprep.h
include/xorg/swapreq.h
-%%NEW%%include/xorg/syncsdk.h
+include/xorg/syncsdk.h
include/xorg/tda8425.h
include/xorg/tda9850.h
include/xorg/tda9885.h
@@ -133,9 +128,6 @@ include/xorg/vidmodeproc.h
include/xorg/wfbrename.h
include/xorg/window.h
include/xorg/windowstr.h
-include/xorg/xaa.h
-%%OLD%%include/xorg/xaaWrapper.h
-include/xorg/xaalocal.h
include/xorg/xaarop.h
include/xorg/xace.h
include/xorg/xacestr.h
@@ -146,7 +138,7 @@ include/xorg/xf86DDC.h
include/xorg/xf86Modes.h
include/xorg/xf86Module.h
include/xorg/xf86Opt.h
-%%NEW%%include/xorg/xf86Optionstr.h
+include/xorg/xf86Optionstr.h
include/xorg/xf86Optrec.h
include/xorg/xf86Parser.h
include/xorg/xf86Pci.h
@@ -165,6 +157,7 @@ include/xorg/xf86cmap.h
include/xorg/xf86fbman.h
include/xorg/xf86i2c.h
include/xorg/xf86int10.h
+include/xorg/xf86platformBus.h
include/xorg/xf86sbusBus.h
include/xorg/xf86str.h
include/xorg/xf86xv.h
@@ -181,54 +174,22 @@ include/xorg/xorgVersion.h
include/xorg/xserver-properties.h
include/xorg/xvdix.h
include/xorg/xvmcext.h
-lib/xorg/modules/extensions/libdbe.la
-lib/xorg/modules/extensions/libdbe.so
-lib/xorg/modules/extensions/libdri.la
-lib/xorg/modules/extensions/libdri.so
-lib/xorg/modules/extensions/libdri2.la
-lib/xorg/modules/extensions/libdri2.so
-lib/xorg/modules/extensions/libextmod.la
-lib/xorg/modules/extensions/libextmod.so
-lib/xorg/modules/extensions/librecord.la
-lib/xorg/modules/extensions/librecord.so
lib/xorg/modules/extensions/.xorg/libglx.so
-lib/xorg/modules/libexa.la
lib/xorg/modules/libexa.so
-lib/xorg/modules/libfb.la
lib/xorg/modules/libfb.so
-%%NEW%%lib/xorg/modules/libfbdevhw.so
-%%NEW%%lib/xorg/modules/libfbdevhw.la
-lib/xorg/modules/libint10.la
+lib/xorg/modules/libfbdevhw.so
lib/xorg/modules/libint10.so
-lib/xorg/modules/libshadow.la
lib/xorg/modules/libshadow.so
-lib/xorg/modules/libshadowfb.la
lib/xorg/modules/libshadowfb.so
-lib/xorg/modules/libvbe.la
lib/xorg/modules/libvbe.so
-lib/xorg/modules/libvgahw.la
lib/xorg/modules/libvgahw.so
-lib/xorg/modules/libwfb.la
lib/xorg/modules/libwfb.so
-lib/xorg/modules/libxaa.la
-lib/xorg/modules/libxaa.so
-%%OLD%%lib/xorg/modules/libxf8_16bpp.la
-%%OLD%%lib/xorg/modules/libxf8_16bpp.so
-%%OLD%%lib/xorg/modules/linux/libfbdevhw.la
-%%OLD%%lib/xorg/modules/linux/libfbdevhw.so
-lib/xorg/modules/multimedia/bt829_drv.la
lib/xorg/modules/multimedia/bt829_drv.so
-lib/xorg/modules/multimedia/fi1236_drv.la
lib/xorg/modules/multimedia/fi1236_drv.so
-lib/xorg/modules/multimedia/msp3430_drv.la
lib/xorg/modules/multimedia/msp3430_drv.so
-lib/xorg/modules/multimedia/tda8425_drv.la
lib/xorg/modules/multimedia/tda8425_drv.so
-lib/xorg/modules/multimedia/tda9850_drv.la
lib/xorg/modules/multimedia/tda9850_drv.so
-lib/xorg/modules/multimedia/tda9885_drv.la
lib/xorg/modules/multimedia/tda9885_drv.so
-lib/xorg/modules/multimedia/uda1380_drv.la
lib/xorg/modules/multimedia/uda1380_drv.so
lib/xorg/protocol.txt
libdata/pkgconfig/xorg-server.pc
@@ -239,15 +200,6 @@ man/man1/gtf.1.gz
man/man4/exa.4.gz
man/man4/fbdevhw.4.gz
man/man5/xorg.conf.5.gz
-%%NEW%%man/man5/xorg.conf.d.5.gz
+man/man5/xorg.conf.d.5.gz
share/aclocal/xorg-server.m4
-@comment %%NEW%%@dirrm share/doc/xorg-server
-@dirrm include/xorg
-@dirrm lib/xorg/modules/extensions/.xorg
-@dirrm lib/xorg/modules/extensions
-@dirrm lib/xorg/modules/multimedia
-%%OLD%%@dirrm lib/xorg/modules/linux
-@dirrm lib/xorg/modules
-@dirrm lib/xorg
-%%NEW%%@dirrmtry etc/X11/xorg.conf.d
-%%NEW%%@dirrmtry etc/X11
+@dir etc/X11/xorg.conf.d