[Development] Apply some downstream patches to get Xvnc build via build-xorg working.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4138 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/unix/build-xorg b/unix/build-xorg
index 0ac312b..1ddff9c 100755
--- a/unix/build-xorg
+++ b/unix/build-xorg
@@ -74,6 +74,9 @@
 	patch -p1 < $SRCDIR/unix/xserver15.patch
     else
 	patch -p1 < $SRCDIR/unix/xserver17.patch
+	for all in `find $SRCDIR/unix/xorg-7.5-patches/ -type f`; do
+	    patch -p1 < $all
+	done
     fi
 
     popd
diff --git a/unix/xorg-7.5-patches/0001-Add-xkbcompdir-parameter-to-modify-xkbcomp-path-from.patch b/unix/xorg-7.5-patches/0001-Add-xkbcompdir-parameter-to-modify-xkbcomp-path-from.patch
new file mode 100644
index 0000000..f7f358b
--- /dev/null
+++ b/unix/xorg-7.5-patches/0001-Add-xkbcompdir-parameter-to-modify-xkbcomp-path-from.patch
@@ -0,0 +1,46 @@
+From 5e6e99eaef3ca346c78a3e520ed58ec8b8100b41 Mon Sep 17 00:00:00 2001
+From: Adam Tkac <atkac@redhat.com>
+Date: Thu, 2 Sep 2010 17:24:38 +0200
+Subject: [PATCH] Add -xkbcompdir parameter to modify "xkbcomp" path from commandline.
+
+Signed-off-by: Adam Tkac <atkac@redhat.com>
+---
+ xkb/xkbInit.c |   21 +++++++++++++++++++++
+ 1 files changed, 21 insertions(+), 0 deletions(-)
+
+diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
+index fbf8f14..29fb33e 100644
+--- a/xkb/xkbInit.c
++++ b/xkb/xkbInit.c
+@@ -742,7 +742,28 @@ XkbProcessArguments(int argc,char *argv[],int i)
+ 	    }
+ 	}
+ 	return j;
++    } else if (strncmp(argv[i], "-xkbcompdir", 11)==0) {
++	if (++i < argc) {
++#if !defined(WIN32) && !defined(__CYGWIN__)
++            if (getuid() != geteuid()) {
++                LogMessage(X_WARNING, "-xkbdir is not available for setuid X servers\n");
++                return -1;
++            } else
++#endif
++	    {
++		if (strlen(argv[i]) < PATH_MAX) {
++		    XkbBinDirectory = argv[i];
++		    return 2;
++		} else {
++		    LogMessage(X_ERROR, "-xkbcompdir pathname too long\n");
++		    return -1;
++		}
++	    }
++	} else {
++	    return -1;
++	}
+     }
++
+     if ((strcmp(argv[i], "-ardelay") == 0) ||
+         (strcmp (argv[i], "-ar1") == 0)) {	/* -ardelay int */
+ 	if (++i >= argc) UseMsg ();
+-- 
+1.7.2.3
+
diff --git a/unix/xorg-7.5-patches/0001-Remove-CopyISOLatin1Lowered.patch b/unix/xorg-7.5-patches/0001-Remove-CopyISOLatin1Lowered.patch
new file mode 100644
index 0000000..8c745bf
--- /dev/null
+++ b/unix/xorg-7.5-patches/0001-Remove-CopyISOLatin1Lowered.patch
@@ -0,0 +1,58 @@
+From 7c31dd5db8b43c7796bf97a07e08213af5afd2ae Mon Sep 17 00:00:00 2001
+From: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+Date: Thu, 15 Oct 2009 04:24:25 -0500
+Subject: [PATCH] Remove CopyISOLatin1Lowered
+
+This function was moved verbatim into libXfont-1.4, and it is not used
+by the server or any drivers.  Exporting it in both places leads to
+multiple definition linking errors on Cygwin, where we need to use a
+static libXfont due to poor weak-symbol handling.
+
+Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+Signed-off-by: Keith Packard <keithp@keithp.com>
+Signed-off-by: Adam Tkac <atkac@redhat.com>
+---
+ dix/dixutils.c |   10 ----------
+ include/dix.h  |    5 -----
+ 2 files changed, 0 insertions(+), 15 deletions(-)
+
+diff --git a/dix/dixutils.c b/dix/dixutils.c
+index 5cede5f..8278d44 100644
+--- a/dix/dixutils.c
++++ b/dix/dixutils.c
+@@ -165,16 +165,6 @@ ISOLatin1ToLower (unsigned char source)
+ }
+ 
+ 
+-void
+-CopyISOLatin1Lowered(unsigned char *dest, unsigned char *source, int length)
+-{
+-    int i;
+-
+-    for (i = 0; i < length; i++, source++, dest++)
+-	*dest = ISOLatin1ToLower (*source);
+-    *dest = '\0';
+-}
+-
+ int
+ CompareISOLatin1Lowered(unsigned char *s1, int s1len, 
+ 			unsigned char *s2, int s2len)
+diff --git a/include/dix.h b/include/dix.h
+index 9fd2ed8..ed3acb6 100644
+--- a/include/dix.h
++++ b/include/dix.h
+@@ -173,11 +173,6 @@ extern _X_EXPORT void MarkClientException(
+ extern _X_HIDDEN Bool CreateConnectionBlock(void);
+ /* dixutils.c */
+ 
+-extern _X_EXPORT void CopyISOLatin1Lowered(
+-    unsigned char * /*dest*/,
+-    unsigned char * /*source*/,
+-    int /*length*/);
+-
+ extern _X_EXPORT int CompareISOLatin1Lowered(
+     unsigned char * /*a*/,
+     int alen,
+-- 
+1.7.2.3
+