summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsource.local/extra/source/tigervnc/tigervnc.SlackBuild134
-rw-r--r--source.local/extra/source/tigervnc/tigervnc11-java7.patch12
-rw-r--r--source.local/extra/source/tigervnc/tigervnc11-xorg110.patch96
-rw-r--r--source.local/extra/source/tigervnc/tigervnc11-xorg111.patch236
-rw-r--r--source.local/extra/source/tigervnc/tigervnc11-xorg112.patch429
-rw-r--r--source.local/extra/source/tigervnc/tigervnc11-xorg113.patch171
-rw-r--r--source.local/extra/source/tigervnc/tigervnc11-xorg114.patch141
-rw-r--r--source.local/extra/source/tigervnc/tigervnc11-xorg_headers.patch16
-rw-r--r--source.local/extra/source/tigervnc/tigervnc12-xorg_headers.patch25
-rw-r--r--source.local/extra/source/tigervnc/tigervnc12.SlackBuild401
10 files changed, 1612 insertions, 49 deletions
diff --git a/source.local/extra/source/tigervnc/tigervnc.SlackBuild b/source.local/extra/source/tigervnc/tigervnc.SlackBuild
index f195c3b..883d3ed 100755
--- a/source.local/extra/source/tigervnc/tigervnc.SlackBuild
+++ b/source.local/extra/source/tigervnc/tigervnc.SlackBuild
@@ -1,6 +1,6 @@
-#!/bin/bash
-# $Id: tigervnc.SlackBuild,v 1.6 2012/03/19 11:36:02 root Exp root $
-# Copyright 2010, 2011, 2012 Eric Hameleers, Eindhoven. NL
+#!/bin/sh
+# $Id: tigervnc.SlackBuild,v 1.9 2013/04/27 21:28:15 eha Exp eha $
+# Copyright 2010, 2011, 2012, 2013 Eric Hameleers, Eindhoven. NL
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software for
@@ -25,7 +25,7 @@
PKGNAM=tigervnc
VERSION=${VERSION:-1.1.0}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
NUMJOBS=${NUMJOBS:" -j4 "}
TAG=${TAG:-alien}
@@ -35,9 +35,10 @@ DO_APPLET=${DO_APPLET:-"YES"}
# TigerVNC needs to use source of the X.Org server whose version matches
# that of your installed X.Org package:
XORG=${XORG:-$(X -version 2>&1 | grep "^X.Org X Server " | cut -f4 -d' ')}
+MAXPATCHVER="$(echo $XORG | cut -f1,2 -d. | tr -d '.')"
# OS Stamp into the binaries:
-OSNAME="Slackware 13.37"
+OSNAME="$(head -1 /etc/slackware-version)"
OSVENDOR="Slackware Linux Project"
BUILDER="Built by Alien BOB on $(date -u)"
@@ -45,41 +46,41 @@ BUILDER="Built by Alien BOB on $(date -u)"
DOCS="LICENCE.TXT doc/TODO doc/*.txt doc/*.odt"
DOCS_XORG="COPYING ChangeLog"
-# Automatically determine the architecture we're building on:
-MARCH=$( uname -m )
-if [ -z "$ARCH" ]; then
- case "$MARCH" in
- i?86) export ARCH=i486 ;;
- armv7hl) export ARCH=$MARCH ;;
- arm*) export ARCH=arm ;;
- # Unless $ARCH is already set, use uname -m for all other archs:
- *) export ARCH=$MARCH ;;
- esac
-fi
-
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
- SLKLDFLAGS=""
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "s390" ]; then
- SLKCFLAGS="-O2"
- SLKLDFLAGS=""
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC"
- SLKLDFLAGS="-L/usr/lib64"
- LIBDIRSUFFIX="64"
-elif [ "$ARCH" = "armv7hl" ]; then
- SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16"
- SLKLDFLAGS=""
- LIBDIRSUFFIX=""
+if [ -e $CWD/machine.conf ]; then
+ . $CWD/machine.conf ]
+elif [ -e /etc/slackbuild/machine.conf ]; then
+ . /etc/slackbuild/machine.conf ]
else
- SLKCFLAGS="-O2"
- SLKLDFLAGS=""
- LIBDIRSUFFIX=""
+ # Automatically determine the architecture we're building on:
+ MARCH=$( uname -m )
+ if [ -z "$ARCH" ]; then
+ case "$MARCH" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$MARCH ;;
+ esac
+ fi
+ # Set CFLAGS/CXXFLAGS and LIBDIRSUFFIX:
+ if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+ elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+ elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+ elif [ "$ARCH" = "arm" ]; then
+ SLKCFLAGS="-O2 -march=armv5te"
+ LIBDIRSUFFIX=""
+ else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+ fi
fi
-case "ARCH" in
+case "$ARCH" in
arm*) TARGET=$ARCH-slackware-linux-gnueabi ;;
*) TARGET=$ARCH-slackware-linux ;;
esac
@@ -101,12 +102,42 @@ mv unix/xserver/hw/vnc ../xorg-server-${XORG}/hw/
rm -rf unix/xserver/hw
mv ../xorg-server-${XORG}/* unix/xserver/
-# Patch the xorg-server source to include building vnc driver:
+# We have patches for X.Org later than 1.10 which tigervnc does not have:
+for PATCHVER in 111 112 113 ; do
+ if [ -e $CWD/tigervnc$(echo $VERSION | cut -f1,2 -d. --output-delimiter=)-xorg${PATCHVER}.patch ]; then
+ cp $CWD/tigervnc$(echo $VERSION | cut -f1,2 -d. --output-delimiter=)-xorg${PATCHVER}.patch unix/xserver${PATCHVER}.patch
+ fi
+done
+
+if [ $MAXPATCHVER -gt 110 ]; then
+ if [ $MAXPATCHVER -lt 113 ]; then
+ # The sed magic in the hw/vnc Makefile needs some love:
+ # ... taken care of in the xserver113 patch if we ever move to X.Org 1.13.
+ cat $CWD/tigervnc$(echo $VERSION | cut -f1,2 -d. --output-delimiter=)-xorg_headers.patch | patch -p1 --verbose || exit 1
+ else
+ # We need to rewrite the xserver110.patch for X.Org 1.13 and newer:
+ cp $CWD/tigervnc$(echo $VERSION | cut -f1,2 -d. --output-delimiter=)-xorg110.patch unix/xserver110.patch
+ fi
+fi
+
+# Patch the xorg-server source to include building the vnc driver
cd unix/xserver
- cat ../xserver19.patch | patch -p1 --verbose \
- 2>&1 | tee $TMP/patch-$PKGNAM.log
+ if [ $MAXPATCHVER -le 110 ]; then
+ # apply one of the tigervnc-provided patches:
+ cat ../xserver${MAXPATCHVER}.patch | patch -p1 --verbose || exit 1
+ else
+ # these external patches are incremental and must be applied in order:
+ for PATCHVER in 110 111 112 113 ; do
+ if [ $PATCHVER -le $MAXPATCHVER -a -e ../xserver${PATCHVER}.patch ]; then
+ cat ../xserver${PATCHVER}.patch | patch -p1 --verbose || exit 1
+ fi
+ done
+ fi
cd -
+# We use Java7:
+cat $CWD/tigervnc11-java7.patch | patch -p1 --verbose || exit 1
+
# Explicitly put the java applet into a directory named 'tigervnc':
sed -i -e 's#/vnc/class#/tigervnc/class#'g $(grep -rl vnc/class .)
@@ -118,7 +149,7 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-export LDFLAGS="$SLKLDFLAGS"
+export LDFLAGS="$SLKLDFLAGS -lpthread"
export CXXFLAGS="$SLKCFLAGS"
export CFLAGS="$SLKCFLAGS"
@@ -137,10 +168,11 @@ autoreconf -vif
--build=$TARGET
make $NUMJOBS || make || exit 1
-make DESTDIR=$PKG install
+make DESTDIR=$PKG install || exit 1
cd unix/xserver
echo -e "\n*** Building xserver ***\n"
+ export CXXFLAGS="$SLKCFLAGS -fpermissive"
autoreconf -vif
# Default font paths to be used by the X server
@@ -152,13 +184,15 @@ cd unix/xserver
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
+ --disable-dri \
--disable-static \
--disable-xorg --disable-xnest --disable-xvfb --disable-dmx \
--disable-xwin --disable-xephyr --disable-kdrive \
- --disable-xinerama --disable-composite \
+ --disable-xinerama \
+ --enable-composite \
--enable-install-libxf86config \
--enable-xcsecurity \
- --enable-glx-tls \
+ --enable-glx-tls --enable-dri2 \
--with-pic \
--with-int10=x86emu \
--with-default-font-path="${DEF_FONTPATH}" \
@@ -169,6 +203,9 @@ cd unix/xserver
--disable-config-dbus \
--disable-config-hal \
--disable-config-udev \
+ --disable-devel-docs \
+ --disable-unit-tests \
+ --without-dtrace \
--with-os-name="$OSNAME" \
--with-os-vendor="$OSVENDOR" \
--with-builderstring="$BUILDER" \
@@ -179,7 +216,7 @@ cd unix/xserver
cd -
if [ "$DO_APPLET" = "YES" ]; then
- # Compile the java applet (needs the jdk... jre is not enough):
+ # Compile the java applet (needs the sdk... jre is not enough):
cd java/src/com/tigervnc/vncviewer
make || exit 1
cd -
@@ -189,7 +226,7 @@ fi
make -C media
if [ "$DO_APPLET" = "YES" ]; then
- # Install the java applet:
+ # Install the java applet:
cd java/src/com/tigervnc/vncviewer
mkdir -p $PKG/usr/share/tigervnc/classes
install -m0755 VncViewer.jar $PKG/usr/share/tigervnc/classes/
@@ -199,9 +236,8 @@ if [ "$DO_APPLET" = "YES" ]; then
fi
# Install menu entry:
-mkdir -p $PKG/usr/share/applications
+mkdir -p $PKG/usr/share/{applications,icons/hicolor/{16x16,24x24,32x32,48x48}/apps}
for PSIZE in 16 24 32 48; do
- mkdir -p $PKG/usr/share/icons/hicolor/${PSIZE}x${PSIZE}/apps
install -m644 media/icons/tigervnc_${PSIZE}.png \
$PKG/usr/share/icons/hicolor/${PSIZE}x${PSIZE}/apps/tigervnc.png
done
@@ -247,7 +283,7 @@ EOT
# Add documentation:
mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
-cp -a $DOCS $PKG/usr/doc/$PKGNAM-$VERSION
+cp -a $DOCS $PKG/usr/doc/$PKGNAM-$VERSION || true
for FIL in $(echo $DOCS_XORG); do cp -a unix/xserver/$FIL $PKG/usr/doc/$PKGNAM-$VERSION/${FIL}.xorg ; done
chown -R root:root $PKG/usr/doc/$PKGNAM-$VERSION
find $PKG/usr/doc -type f -exec chmod 644 {} \;
diff --git a/source.local/extra/source/tigervnc/tigervnc11-java7.patch b/source.local/extra/source/tigervnc/tigervnc11-java7.patch
new file mode 100644
index 0000000..6f30060
--- /dev/null
+++ b/source.local/extra/source/tigervnc/tigervnc11-java7.patch
@@ -0,0 +1,12 @@
+diff -up tigervnc-1.1.0/java/src/com/tigervnc/vncviewer/Makefile.java7 tigervnc-1.1.0/java/src/com/tigervnc/vncviewer/Makefile
+--- tigervnc-1.1.0/java/src/com/tigervnc/vncviewer/Makefile.java7 2012-03-27 14:20:20.107009796 +0200
++++ tigervnc-1.1.0/java/src/com/tigervnc/vncviewer/Makefile 2012-03-27 14:20:25.959966078 +0200
+@@ -4,7 +4,7 @@
+
+ CP = cp
+ JC = javac
+-JCFLAGS = -target 1.5 -classpath ../../../
++JCFLAGS = -target 1.7 -classpath ../../../
+ JAR = jar
+ ARCHIVE = VncViewer.jar
+ MANIFEST = MANIFEST.MF
diff --git a/source.local/extra/source/tigervnc/tigervnc11-xorg110.patch b/source.local/extra/source/tigervnc/tigervnc11-xorg110.patch
new file mode 100644
index 0000000..0f817d3
--- /dev/null
+++ b/source.local/extra/source/tigervnc/tigervnc11-xorg110.patch
@@ -0,0 +1,96 @@
+diff -up xserver/configure.ac.vnc xserver/configure.ac
+--- xserver/configure.ac.vnc 2012-07-19 20:22:21.774770804 -0400
++++ xserver/configure.ac 2012-07-19 20:24:42.293014083 -0400
+@@ -30,7 +30,6 @@ AC_INIT([xorg-server], 1.12.99.902, [htt
+ RELEASE_DATE="2012-07-17"
+ AC_CONFIG_SRCDIR([Makefile.am])
+ AM_INIT_AUTOMAKE([foreign dist-bzip2])
+-AM_MAINTAINER_MODE
+
+ # Require xorg-macros minimum of 1.14 for XORG_COMPILER_BRAND in XORG_DEFAULT_OPTIONS
+ m4_ifndef([XORG_MACROS_VERSION],
+@@ -72,6 +71,7 @@ dnl forcing an entire recompile.x
+ AC_CONFIG_HEADERS(include/version-config.h)
+
+ AM_PROG_AS
++AC_PROG_CXX
+ AC_PROG_LN_S
+ AC_LIBTOOL_WIN32_DLL
+ AC_DISABLE_STATIC
+@@ -1560,6 +1560,14 @@ if test "x$XVFB" = xyes; then
+ AC_SUBST([XVFB_SYS_LIBS])
+ fi
+
++dnl Xvnc DDX
++AC_SUBST([XVNC_CPPFLAGS], ["-DHAVE_DIX_CONFIG_H $XEXT_INC $FB_INC $MI_INC $RENDER_INC $RANDR_INC $MIEXT_DAMAGE_INC"])
++AC_SUBST([XVNC_LIBS], ["$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB"])
++AC_SUBST([XVNC_SYS_LIBS], ["$GLX_SYS_LIBS"])
++
++dnl This is necessary to allow Xvnc to statically link with GnuTLS
++AC_ARG_VAR(GNUTLS_LDFLAGS, [Custom linker flags for using GnuTLS, e.g. -L{GnuTLS directory}/lib -lgnutls])
++AC_SUBST(GNUTLS_LDFLAGS)
+
+ dnl Xnest DDX
+
+@@ -1595,6 +1603,8 @@ if test "x$XORG" = xauto; then
+ fi
+ AC_MSG_RESULT([$XORG])
+
++AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
++
+ if test "x$XORG" = xyes; then
+ XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common'
+ XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
+@@ -1813,7 +1823,6 @@ if test "x$XORG" = xyes; then
+ AC_DEFINE(XORG_SERVER, 1, [Building Xorg server])
+ AC_DEFINE(XORGSERVER, 1, [Building Xorg server])
+ AC_DEFINE(XFree86Server, 1, [Building XFree86 server])
+- AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
+ AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs])
+ AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions])
+ AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server])
+@@ -2279,6 +2288,7 @@ hw/dmx/Makefile
+ hw/dmx/man/Makefile
+ hw/vfb/Makefile
+ hw/vfb/man/Makefile
++hw/vnc/Makefile
+ hw/xnest/Makefile
+ hw/xnest/man/Makefile
+ hw/xwin/Makefile
+diff -up xserver/hw/Makefile.am.vnc xserver/hw/Makefile.am
+--- xserver/hw/Makefile.am.vnc 2012-07-19 20:22:28.575685781 -0400
++++ xserver/hw/Makefile.am 2012-07-19 20:22:31.483649426 -0400
+@@ -33,7 +33,8 @@ SUBDIRS = \
+ $(XNEST_SUBDIRS) \
+ $(DMX_SUBDIRS) \
+ $(KDRIVE_SUBDIRS) \
+- $(XQUARTZ_SUBDIRS)
++ $(XQUARTZ_SUBDIRS) \
++ vnc
+
+ DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive
+
+diff -up xserver/include/extinit.h.vnc xserver/include/extinit.h
+--- xserver/include/extinit.h.vnc 2012-07-19 20:25:50.465161815 -0400
++++ xserver/include/extinit.h 2012-07-19 20:25:52.490136499 -0400
+@@ -81,6 +81,8 @@ extern void DPMSExtensionInit(void);
+ extern Bool noGEExtension;
+ extern void GEExtensionInit(void);
+
++extern void vncExtensionInit(void);
++
+ #ifdef GLXEXT
+ extern _X_EXPORT Bool noGlxExtension;
+ extern void GlxExtensionInit(void);
+diff -up xserver/mi/miinitext.c.vnc xserver/mi/miinitext.c
+--- xserver/mi/miinitext.c.vnc 2012-07-19 20:22:30.000000000 -0400
++++ xserver/mi/miinitext.c 2012-07-19 20:26:48.560435524 -0400
+@@ -293,6 +293,7 @@ static ExtensionModule staticExtensions[
+ #ifdef XSELINUX
+ {SELinuxExtensionInit, SELINUX_EXTENSION_NAME, &noSELinuxExtension},
+ #endif
++ {vncExtensionInit, "VNC", NULL},
+ };
+
+ static ExtensionModule *ExtensionModuleList = NULL;
+
diff --git a/source.local/extra/source/tigervnc/tigervnc11-xorg111.patch b/source.local/extra/source/tigervnc/tigervnc11-xorg111.patch
new file mode 100644
index 0000000..690ca6b
--- /dev/null
+++ b/source.local/extra/source/tigervnc/tigervnc11-xorg111.patch
@@ -0,0 +1,236 @@
+diff -up xserver/hw/vnc/Input.cc.xorg111 xserver/hw/vnc/Input.cc
+--- xserver/hw/vnc/Input.cc.xorg111 2011-08-09 23:16:36.000000000 +0200
++++ xserver/hw/vnc/Input.cc 2011-11-11 11:59:14.226819903 +0100
+@@ -82,10 +82,11 @@ static KeyCode KeysymToKeycode(KeySymsPt
+ /* Event queue is shared between all devices. */
+ #if XORG == 15
+ static xEvent *eventq = NULL;
+-#else
++#elif XORG < 111
+ static EventList *eventq = NULL;
+ #endif
+
++#if XORG < 111
+ static void initEventq(void)
+ {
+ /* eventq is never free()-ed because it exists during server life. */
+@@ -100,7 +101,9 @@ static void initEventq(void)
+ #endif
+ }
+ }
++#endif /* XORG < 111 */
+
++#if XORG < 111
+ static void enqueueEvents(DeviceIntPtr dev, int n)
+ {
+ int i;
+@@ -122,6 +125,7 @@ static void enqueueEvents(DeviceIntPtr d
+ );
+ }
+ }
++#endif /* XORG < 111 */
+
+ InputDevice::InputDevice(rfb::VNCServerST *_server)
+ : server(_server), oldButtonMask(0)
+@@ -141,12 +145,17 @@ InputDevice::InputDevice(rfb::VNCServerS
+ keyboardProc, TRUE);
+ RegisterKeyboardDevice(keyboardDev);
+ #endif
++#if XORG < 111
+ initEventq();
++#endif
+ }
+
+ void InputDevice::PointerButtonAction(int buttonMask)
+ {
+- int i, n;
++ int i;
++#if XORG < 111
++ int n;
++#endif
+ #if XORG >= 110
+ ValuatorMask mask;
+ #endif
+@@ -160,13 +169,17 @@ void InputDevice::PointerButtonAction(in
+ #if XORG < 110
+ n = GetPointerEvents(eventq, pointerDev, action, i + 1,
+ POINTER_RELATIVE, 0, 0, NULL);
+-#else
++ enqueueEvents(pointerDev, n);
++#elif XORG < 111
+ valuator_mask_set_range(&mask, 0, 0, NULL);
+ n = GetPointerEvents(eventq, pointerDev, action, i + 1,
+ POINTER_RELATIVE, &mask);
+-#endif
+ enqueueEvents(pointerDev, n);
+-
++#else
++ valuator_mask_set_range(&mask, 0, 0, NULL);
++ QueuePointerEvents(pointerDev, action, i + 1,
++ POINTER_RELATIVE, &mask);
++#endif
+ }
+ }
+
+@@ -175,7 +188,10 @@ void InputDevice::PointerButtonAction(in
+
+ void InputDevice::PointerMove(const rfb::Point &pos)
+ {
+- int n, valuators[2];
++ int valuators[2];
++#if XORG < 111
++ int n;
++#endif
+ #if XORG >= 110
+ ValuatorMask mask;
+ #endif
+@@ -190,12 +206,16 @@ void InputDevice::PointerMove(const rfb:
+ #if XORG < 110
+ n = GetPointerEvents(eventq, pointerDev, MotionNotify, 0, POINTER_ABSOLUTE, 0,
+ 2, valuators);
+-#else
++ enqueueEvents(pointerDev, n);
++#elif XORG < 111
+ valuator_mask_set_range(&mask, 0, 2, valuators);
+ n = GetPointerEvents(eventq, pointerDev, MotionNotify, 0, POINTER_ABSOLUTE,
+ &mask);
+-#endif
+ enqueueEvents(pointerDev, n);
++#else
++ valuator_mask_set_range(&mask, 0, 2, valuators);
++ QueuePointerEvents(pointerDev, MotionNotify, 0, POINTER_ABSOLUTE, &mask);
++#endif
+
+ cursorPos = pos;
+ }
+@@ -299,14 +319,20 @@ void InputDevice::initInputDevice(void)
+ static inline void pressKey(DeviceIntPtr dev, int kc, bool down, const char *msg)
+ {
+ int action;
++#if XORG < 111
+ unsigned int n;
++#endif
+
+ if (msg != NULL)
+ vlog.debug("%s %d %s", msg, kc, down ? "down" : "up");
+
+ action = down ? KeyPress : KeyRelease;
+- n = GetKeyboardEvents(eventq, dev, action, kc);
++#if XORG < 111
++ n = GetKeyboardEvents(eventq, dev, action, kc, NULL);
+ enqueueEvents(dev, n);
++#else
++ QueueKeyboardEvents(dev, action, kc, NULL);
++#endif
+ }
+
+ #define IS_PRESSED(keyc, keycode) \
+@@ -341,8 +367,11 @@ public:
+ int state, maxKeysPerMod, keycode;
+ #if XORG >= 17
+ KeyCode *modmap = NULL;
+-
++#if XORG >= 111
++ state = XkbStateFieldFromRec(&dev->master->key->xkbInfo->state);
++#else /* XORG >= 111 */
+ state = XkbStateFieldFromRec(&dev->u.master->key->xkbInfo->state);
++#endif /* XORG >= 111 */
+ #else
+ KeyClassPtr keyc = dev->key;
+ state = keyc->state;
+@@ -380,7 +409,11 @@ public:
+ #if XORG >= 17
+ KeyCode *modmap = NULL;
+
++#if XORG >= 111
++ keyc = dev->master->key;
++#else /* XORG >= 111 */
+ keyc = dev->u.master->key;
++#endif /* XORG >= 111 */
+ state = XkbStateFieldFromRec(&keyc->xkbInfo->state);
+ #else
+ keyc = dev->key;
+@@ -596,7 +629,11 @@ void InputDevice::keyEvent(rdr::U32 keys
+ }
+
+ #if XORG >= 17
++#if XORG >= 111
++ keyc = keyboardDev->master->key;
++#else /* XORG >= 111 */
+ keyc = keyboardDev->u.master->key;
++#endif /* XORG >= 111 */
+
+ keymap = XkbGetCoreMap(keyboardDev);
+ if (!keymap) {
+@@ -753,7 +790,11 @@ ModeSwitchFound:
+ XkbApplyMappingChange(keyboardDev, keymap, minKeyCode,
+ maxKeyCode - minKeyCode + 1,
+ NULL, serverClient);
++#if XORG >= 111
++ XkbCopyDeviceKeymap(keyboardDev->master, keyboardDev);
++#else
+ XkbCopyDeviceKeymap(keyboardDev->u.master, keyboardDev);
++#endif
+ #endif /* XORG < 17 */
+ break;
+ }
+diff -up xserver/hw/vnc/xorg-version.h.xorg111 xserver/hw/vnc/xorg-version.h
+--- xserver/hw/vnc/xorg-version.h.xorg111 2011-08-09 23:16:36.000000000 +0200
++++ xserver/hw/vnc/xorg-version.h 2011-11-11 11:55:32.255835319 +0100
+@@ -36,6 +36,8 @@
+ #define XORG 19
+ #elif XORG_VERSION_CURRENT < ((1 * 10000000) + (10 * 100000) + (99 * 1000))
+ #define XORG 110
++#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (11 * 100000) + (99 * 1000))
++#define XORG 111
+ #else
+ #error "X.Org newer than 1.10 is not supported"
+ #endif
+diff -up xserver/hw/vnc/xvnc.cc.xorg111 xserver/hw/vnc/xvnc.cc
+--- xserver/hw/vnc/xvnc.cc.xorg111 2011-08-09 23:16:36.000000000 +0200
++++ xserver/hw/vnc/xvnc.cc 2011-11-11 11:55:32.256835319 +0100
+@@ -211,7 +211,11 @@ static void vfbFreeFramebufferMemory(vfb
+
+ extern "C" {
+
++#if XORG < 111
+ void ddxGiveUp()
++#else
++void ddxGiveUp(enum ExitCode error)
++#endif
+ {
+ int i;
+
+@@ -221,9 +225,17 @@ void ddxGiveUp()
+ }
+
+ void
++#if XORG < 111
+ AbortDDX()
++#else
++AbortDDX(enum ExitCode error)
++#endif
+ {
++#if XORG < 111
+ ddxGiveUp();
++#else
++ ddxGiveUp(error);
++#endif
+ }
+
+ #ifdef __DARWIN__
+@@ -668,8 +680,13 @@ vfbUninstallColormap(ColormapPtr pmap)
+ {
+ if (pmap->mid != pmap->pScreen->defColormap)
+ {
++#if XORG < 111
+ curpmap = (ColormapPtr) LookupIDByType(pmap->pScreen->defColormap,
+ RT_COLORMAP);
++#else
++ dixLookupResourceByType((pointer *) &curpmap, pmap->pScreen->defColormap,
++ RT_COLORMAP, serverClient, DixUnknownAccess);
++#endif
+ (*pmap->pScreen->InstallColormap)(curpmap);
+ }
+ }
+
diff --git a/source.local/extra/source/tigervnc/tigervnc11-xorg112.patch b/source.local/extra/source/tigervnc/tigervnc11-xorg112.patch
new file mode 100644
index 0000000..2931cd7
--- /dev/null
+++ b/source.local/extra/source/tigervnc/tigervnc11-xorg112.patch
@@ -0,0 +1,429 @@
+diff -up xserver/hw/vnc/vncExtInit.cc.xorg112 xserver/hw/vnc/vncExtInit.cc
+--- xserver/hw/vnc/vncExtInit.cc.xorg112 2011-08-09 23:16:36.000000000 +0200
++++ xserver/hw/vnc/vncExtInit.cc 2012-03-27 12:54:56.937271323 +0200
+@@ -56,6 +56,7 @@ extern "C" {
+ #include "XserverDesktop.h"
+ #include "vncHooks.h"
+ #include "vncExtInit.h"
++#include "xorg-version.h"
+
+ extern "C" {
+
+@@ -360,10 +361,16 @@ void vncClientCutText(const char* str, i
+ ev.window = cur->window;
+ ev.time = GetTimeInMillis();
+ if (cur->client->swapped) {
++#if XORG < 112
+ int n;
+ swaps(&ev.sequenceNumber, n);
+ swapl(&ev.window, n);
+ swapl(&ev.time, n);
++#else
++ swaps(&ev.sequenceNumber);
++ swapl(&ev.window);
++ swapl(&ev.time);
++#endif
+ }
+ WriteToClient(cur->client, sizeof(xVncExtClientCutTextNotifyEvent),
+ (char *)&ev);
+@@ -406,9 +413,14 @@ void vncQueryConnect(XserverDesktop* des
+ ev.sequenceNumber = cur->client->sequence;
+ ev.window = cur->window;
+ if (cur->client->swapped) {
++#if XORG < 112
+ int n;
+ swaps(&ev.sequenceNumber, n);
+ swapl(&ev.window, n);
++#else
++ swaps(&ev.sequenceNumber);
++ swapl(&ev.window);
++#endif
+ }
+ WriteToClient(cur->client, sizeof(xVncExtQueryConnectNotifyEvent),
+ (char *)&ev);
+@@ -449,10 +461,16 @@ static void SendSelectionChangeEvent(Ato
+ ev.window = cur->window;
+ ev.selection = selection;
+ if (cur->client->swapped) {
++#if XORG < 112
+ int n;
+ swaps(&ev.sequenceNumber, n);
+ swapl(&ev.window, n);
+ swapl(&ev.selection, n);
++#else
++ swaps(&ev.sequenceNumber);
++ swapl(&ev.window);
++ swapl(&ev.selection);
++#endif
+ }
+ WriteToClient(cur->client, sizeof(xVncExtSelectionChangeNotifyEvent),
+ (char *)&ev);
+@@ -473,7 +491,6 @@ static int ProcVncExtSetParam(ClientPtr
+ param.buf[stuff->paramLen] = 0;
+
+ xVncExtSetParamReply rep;
+- int n;
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.success = 0;
+@@ -514,8 +531,14 @@ static int ProcVncExtSetParam(ClientPtr
+
+ deny:
+ if (client->swapped) {
++#if XORG < 112
++ int n;
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
++#else
++ swaps(&rep.sequenceNumber);
++ swapl(&rep.length);
++#endif
+ }
+ WriteToClient(client, sizeof(xVncExtSetParamReply), (char *)&rep);
+ return (client->noClientException);
+@@ -523,9 +546,13 @@ deny:
+
+ static int SProcVncExtSetParam(ClientPtr client)
+ {
+- register char n;
+ REQUEST(xVncExtSetParamReq);
++#if XORG < 112
++ register char n;
+ swaps(&stuff->length, n);
++#else
++ swaps(&stuff->length);
++#endif
+ REQUEST_AT_LEAST_SIZE(xVncExtSetParamReq);
+ return ProcVncExtSetParam(client);
+ }
+@@ -539,7 +566,6 @@ static int ProcVncExtGetParam(ClientPtr
+ param.buf[stuff->paramLen] = 0;
+
+ xVncExtGetParamReply rep;
+- int n;
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.success = 0;
+@@ -557,9 +583,16 @@ static int ProcVncExtGetParam(ClientPtr
+ rep.length = (len + 3) >> 2;
+ rep.valueLen = len;
+ if (client->swapped) {
++#if XORG < 112
++ int n;
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swaps(&rep.valueLen, n);
++#else
++ swaps(&rep.sequenceNumber);
++ swapl(&rep.length);
++ swaps(&rep.valueLen);
++#endif
+ }
+ WriteToClient(client, sizeof(xVncExtGetParamReply), (char *)&rep);
+ if (value)
+@@ -570,9 +603,13 @@ static int ProcVncExtGetParam(ClientPtr
+
+ static int SProcVncExtGetParam(ClientPtr client)
+ {
+- register char n;
+ REQUEST(xVncExtGetParamReq);
++#if XORG < 112
++ register char n;
+ swaps(&stuff->length, n);
++#else
++ swaps(&stuff->length);
++#endif
+ REQUEST_AT_LEAST_SIZE(xVncExtGetParamReq);
+ return ProcVncExtGetParam(client);
+ }
+@@ -586,7 +623,6 @@ static int ProcVncExtGetParamDesc(Client
+ param.buf[stuff->paramLen] = 0;
+
+ xVncExtGetParamDescReply rep;
+- int n;
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.success = 0;
+@@ -601,9 +637,16 @@ static int ProcVncExtGetParamDesc(Client
+ rep.length = (len + 3) >> 2;
+ rep.descLen = len;
+ if (client->swapped) {
++#if XORG < 112
++ int n;
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swaps(&rep.descLen, n);
++#else
++ swaps(&rep.sequenceNumber);
++ swapl(&rep.length);
++ swaps(&rep.descLen);
++#endif
+ }
+ WriteToClient(client, sizeof(xVncExtGetParamDescReply), (char *)&rep);
+ if (desc)
+@@ -613,9 +656,13 @@ static int ProcVncExtGetParamDesc(Client
+
+ static int SProcVncExtGetParamDesc(ClientPtr client)
+ {
+- register char n;
+ REQUEST(xVncExtGetParamDescReq);
++#if XORG < 112
++ register char n;
+ swaps(&stuff->length, n);
++#else
++ swaps(&stuff->length);
++#endif
+ REQUEST_AT_LEAST_SIZE(xVncExtGetParamDescReq);
+ return ProcVncExtGetParamDesc(client);
+ }
+@@ -626,7 +673,6 @@ static int ProcVncExtListParams(ClientPt
+ REQUEST_SIZE_MATCH(xVncExtListParamsReq);
+
+ xVncExtListParamsReply rep;
+- int n;
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+
+@@ -642,9 +688,16 @@ static int ProcVncExtListParams(ClientPt
+ rep.length = (len + 3) >> 2;
+ rep.nParams = nParams;
+ if (client->swapped) {
++#if XORG < 112
++ int n;
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swaps(&rep.nParams, n);
++#else
++ swaps(&rep.sequenceNumber);
++ swapl(&rep.length);
++ swaps(&rep.nParams);
++#endif
+ }
+ WriteToClient(client, sizeof(xVncExtListParamsReply), (char *)&rep);
+ rdr::U8* data = new rdr::U8[len];
+@@ -664,9 +717,13 @@ static int ProcVncExtListParams(ClientPt
+
+ static int SProcVncExtListParams(ClientPtr client)
+ {
+- register char n;
+ REQUEST(xVncExtListParamsReq);
++#if XORG < 112
++ register char n;
+ swaps(&stuff->length, n);
++#else
++ swaps(&stuff->length);
++#endif
+ REQUEST_SIZE_MATCH(xVncExtListParamsReq);
+ return ProcVncExtListParams(client);
+ }
+@@ -689,11 +746,19 @@ static int ProcVncExtSetServerCutText(Cl
+
+ static int SProcVncExtSetServerCutText(ClientPtr client)
+ {
+- register char n;
+ REQUEST(xVncExtSetServerCutTextReq);
++#if XORG < 112
++ register char n;
+ swaps(&stuff->length, n);
++#else
++ swaps(&stuff->length);
++#endif
+ REQUEST_AT_LEAST_SIZE(xVncExtSetServerCutTextReq);
++#if XORG < 112
+ swapl(&stuff->textLen, n);
++#else
++ swapl(&stuff->textLen);
++#endif
+ return ProcVncExtSetServerCutText(client);
+ }
+
+@@ -703,15 +768,21 @@ static int ProcVncExtGetClientCutText(Cl
+ REQUEST_SIZE_MATCH(xVncExtGetClientCutTextReq);
+
+ xVncExtGetClientCutTextReply rep;
+- int n;
+ rep.type = X_Reply;
+ rep.length = (clientCutTextLen + 3) >> 2;
+ rep.sequenceNumber = client->sequence;
+ rep.textLen = clientCutTextLen;
+ if (client->swapped) {
++#if XORG < 112
++ int n;
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.textLen, n);
++#else
++ swaps(&rep.sequenceNumber);
++ swapl(&rep.length);
++ swapl(&rep.textLen);
++#endif
+ }
+ WriteToClient(client, sizeof(xVncExtGetClientCutTextReply), (char *)&rep);
+ if (clientCutText)
+@@ -721,9 +792,13 @@ static int ProcVncExtGetClientCutText(Cl
+
+ static int SProcVncExtGetClientCutText(ClientPtr client)
+ {
+- register char n;
+ REQUEST(xVncExtGetClientCutTextReq);
++#if XORG < 112
++ register char n;
+ swaps(&stuff->length, n);
++#else
++ swaps(&stuff->length);
++#endif
+ REQUEST_SIZE_MATCH(xVncExtGetClientCutTextReq);
+ return ProcVncExtGetClientCutText(client);
+ }
+@@ -753,12 +828,21 @@ static int ProcVncExtSelectInput(ClientP
+
+ static int SProcVncExtSelectInput(ClientPtr client)
+ {
+- register char n;
+ REQUEST(xVncExtSelectInputReq);
++#if XORG < 112
++ register char n;
+ swaps(&stuff->length, n);
++#else
++ swaps(&stuff->length);
++#endif
+ REQUEST_SIZE_MATCH(xVncExtSelectInputReq);
++#if XORG < 112
+ swapl(&stuff->window, n);
+ swapl(&stuff->mask, n);
++#else
++ swapl(&stuff->window);
++ swapl(&stuff->mask);
++#endif
+ return ProcVncExtSelectInput(client);
+ }
+
+@@ -804,9 +888,14 @@ static int ProcVncExtConnect(ClientPtr c
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ if (client->swapped) {
++#if XORG < 112
+ int n;
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
++#else
++ swaps(&rep.sequenceNumber);
++ swapl(&rep.length);
++#endif
+ }
+ WriteToClient(client, sizeof(xVncExtConnectReply), (char *)&rep);
+ return (client->noClientException);
+@@ -814,9 +903,13 @@ static int ProcVncExtConnect(ClientPtr c
+
+ static int SProcVncExtConnect(ClientPtr client)
+ {
+- register char n;
+ REQUEST(xVncExtConnectReq);
++#if XORG < 112
++ register char n;
+ swaps(&stuff->length, n);
++#else
++ swaps(&stuff->length);
++#endif
+ REQUEST_AT_LEAST_SIZE(xVncExtConnectReq);
+ return ProcVncExtConnect(client);
+ }
+@@ -836,7 +929,6 @@ static int ProcVncExtGetQueryConnect(Cli
+ qcTimeout = 0;
+
+ xVncExtGetQueryConnectReply rep;
+- int n;
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.timeout = qcTimeout;
+@@ -845,11 +937,20 @@ static int ProcVncExtGetQueryConnect(Cli
+ rep.opaqueId = (CARD32)(long)queryConnectId;
+ rep.length = (rep.userLen + rep.addrLen + 3) >> 2;
+ if (client->swapped) {
++#if XORG < 112
++ int n;
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.userLen, n);
+ swapl(&rep.addrLen, n);
+ swapl(&rep.timeout, n);
+ swapl(&rep.opaqueId, n);
++#else
++ swaps(&rep.sequenceNumber);
++ swapl(&rep.userLen);
++ swapl(&rep.addrLen);
++ swapl(&rep.timeout);
++ swapl(&rep.opaqueId);
++#endif
+ }
+ WriteToClient(client, sizeof(xVncExtGetQueryConnectReply), (char *)&rep);
+ if (qcTimeout)
+@@ -861,9 +962,13 @@ static int ProcVncExtGetQueryConnect(Cli
+
+ static int SProcVncExtGetQueryConnect(ClientPtr client)
+ {
+- register char n;
+ REQUEST(xVncExtGetQueryConnectReq);
++#if XORG < 112
++ register char n;
+ swaps(&stuff->length, n);
++#else
++ swaps(&stuff->length);
++#endif
+ REQUEST_SIZE_MATCH(xVncExtGetQueryConnectReq);
+ return ProcVncExtGetQueryConnect(client);
+ }
+@@ -888,10 +993,15 @@ static int ProcVncExtApproveConnect(Clie
+
+ static int SProcVncExtApproveConnect(ClientPtr client)
+ {
+- register char n;
+ REQUEST(xVncExtApproveConnectReq);
++#if XORG < 112
++ register char n;
+ swaps(&stuff->length, n);
+ swapl(&stuff->opaqueId, n);
++#else
++ swaps(&stuff->length);
++ swapl(&stuff->opaqueId);
++#endif
+ REQUEST_SIZE_MATCH(xVncExtApproveConnectReq);
+ return ProcVncExtApproveConnect(client);
+ }
+diff -up xserver/hw/vnc/xf86vncModule.cc.xorg112 xserver/hw/vnc/xf86vncModule.cc
+--- xserver/hw/vnc/xf86vncModule.cc.xorg112 2011-08-09 23:16:36.000000000 +0200
++++ xserver/hw/vnc/xf86vncModule.cc 2012-03-27 12:54:56.938271322 +0200
+@@ -26,6 +26,8 @@
+ #include <rfb/Logger_stdio.h>
+ #include <rfb/LogWriter.h>
+
++#include "xorg-version.h"
++
+ extern "C" {
+ #define class c_class
+ #define private c_private
+@@ -89,7 +91,12 @@ static void vncExtensionInitWithParams(I
+ ScrnInfoPtr pScrn = xf86Screens[scr];
+
+ for (ParameterIterator i(Configuration::global()); i.param; i.next()) {
+- char* val = xf86FindOptionValue(pScrn->options, i.param->getName());
++ const char *val;
++#if XORG < 112
++ val = xf86FindOptionValue(pScrn->options, i.param->getName());
++#else
++ val = xf86FindOptionValue((XF86OptionPtr)pScrn->options, i.param->getName());
++#endif
+ if (val)
+ i.param->setParam(val);
+ }
+diff -up xserver/hw/vnc/xorg-version.h.xorg112 xserver/hw/vnc/xorg-version.h
+--- xserver/hw/vnc/xorg-version.h.xorg112 2012-03-27 12:55:27.576240843 +0200
++++ xserver/hw/vnc/xorg-version.h 2012-03-27 12:56:07.541204026 +0200
+@@ -38,6 +38,8 @@
+ #define XORG 110
+ #elif XORG_VERSION_CURRENT < ((1 * 10000000) + (11 * 100000) + (99 * 1000))
+ #define XORG 111
++#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (12 * 100000) + (99 * 1000))
++#define XORG 112
+ #else
+ #error "X.Org newer than 1.10 is not supported"
+ #endif
diff --git a/source.local/extra/source/tigervnc/tigervnc11-xorg113.patch b/source.local/extra/source/tigervnc/tigervnc11-xorg113.patch
new file mode 100644
index 0000000..12ce549
--- /dev/null
+++ b/source.local/extra/source/tigervnc/tigervnc11-xorg113.patch
@@ -0,0 +1,171 @@
+diff -up xserver/hw/vnc/Makefile.am.xorg113 xserver/hw/vnc/Makefile.am
+--- xserver/hw/vnc/Makefile.am.xorg113 2012-07-19 21:42:46.297455970 -0400
++++ xserver/hw/vnc/Makefile.am 2012-07-19 21:19:22.526005528 -0400
+@@ -62,7 +62,7 @@ EXTRA_DIST = Xvnc.man
+ BUILT_SOURCES = $(nodist_Xvnc_SOURCES)
+
+ fb.h: $(top_srcdir)/fb/fb.h
+- cat $(top_srcdir)/fb/fb.h | sed -e 's,and,c_and,' -e 's,xor,c_xor,' > $(srcdir)/fb.h
++ cat $(top_srcdir)/fb/fb.h | sed -e 's,and,c_and,g' -e 's,xor,c_xor,g' > $(srcdir)/fb.h
+
+ pixman.h: $(includedir)/pixman-1/pixman.h
+ cat $(includedir)/pixman-1/pixman.h | sed 's/xor/c_xor/' > $(srcdir)/pixman.h
+diff -up xserver/hw/vnc/vncHooks.cc.xorg113 xserver/hw/vnc/vncHooks.cc
+--- xserver/hw/vnc/vncHooks.cc.xorg113 2012-07-19 21:31:37.191820942 -0400
++++ xserver/hw/vnc/vncHooks.cc 2012-07-19 21:36:00.327531293 -0400
+@@ -116,7 +116,7 @@ static DevPrivateKeyRec vncHooksGCKeyRec
+
+ // screen functions
+
+-static Bool vncHooksCloseScreen(int i, ScreenPtr pScreen);
++static Bool vncHooksCloseScreen(ScreenPtr pScreen);
+ static Bool vncHooksCreateGC(GCPtr pGC);
+ static void vncHooksCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
+ RegionPtr pOldRegion);
+@@ -133,7 +133,7 @@ static Bool vncHooksDisplayCursor(
+ DeviceIntPtr pDev,
+ #endif
+ ScreenPtr pScreen, CursorPtr cursor);
+-static void vncHooksBlockHandler(int i, pointer blockData, pointer pTimeout,
++static void vncHooksBlockHandler(ScreenPtr pScreen_, pointer pTimeout,
+ pointer pReadmask);
+ #ifdef RENDER
+ static void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
+@@ -335,7 +335,7 @@ Bool vncHooksInit(ScreenPtr pScreen, Xse
+ // CloseScreen - unwrap the screen functions and call the original CloseScreen
+ // function
+
+-static Bool vncHooksCloseScreen(int i, ScreenPtr pScreen_)
++static Bool vncHooksCloseScreen(ScreenPtr pScreen_)
+ {
+ SCREEN_UNWRAP(pScreen_, CloseScreen);
+
+@@ -366,7 +366,7 @@ static Bool vncHooksCloseScreen(int i, S
+
+ DBGPRINT((stderr,"vncHooksCloseScreen: unwrapped screen functions\n"));
+
+- return (*pScreen->CloseScreen)(i, pScreen);
++ return (*pScreen->CloseScreen)(pScreen);
+ }
+
+ // CreateGC - wrap the "GC funcs"
+@@ -531,14 +531,14 @@ static Bool vncHooksDisplayCursor(
+ // BlockHandler - ignore any changes during the block handler - it's likely
+ // these are just drawing the cursor.
+
+-static void vncHooksBlockHandler(int i, pointer blockData, pointer pTimeout,
++static void vncHooksBlockHandler(ScreenPtr pScreen_, pointer pTimeout,
+ pointer pReadmask)
+ {
+- SCREEN_UNWRAP(screenInfo.screens[i], BlockHandler);
++ SCREEN_UNWRAP(pScreen_, BlockHandler);
+
+ vncHooksScreen->desktop->ignoreHooks(true);
+
+- (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
++ (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask);
+
+ vncHooksScreen->desktop->ignoreHooks(false);
+
+diff -up xserver/hw/vnc/xf86vncModule.cc.xorg113 xserver/hw/vnc/xf86vncModule.cc
+--- xserver/hw/vnc/xf86vncModule.cc.xorg113 2012-07-19 21:19:27.558942606 -0400
++++ xserver/hw/vnc/xf86vncModule.cc 2012-07-19 21:19:27.574942408 -0400
+@@ -53,8 +53,6 @@ ExtensionModule vncExt =
+ {
+ vncExtensionInitWithParams,
+ "VNC",
+- NULL,
+- NULL,
+ NULL
+ };
+
+diff -up xserver/hw/vnc/xorg-version.h.xorg113 xserver/hw/vnc/xorg-version.h
+--- xserver/hw/vnc/xorg-version.h.xorg113 2012-07-19 21:19:27.560942582 -0400
++++ xserver/hw/vnc/xorg-version.h 2012-07-19 21:19:27.576942382 -0400
+@@ -40,6 +40,8 @@
+ #define XORG 111
+ #elif XORG_VERSION_CURRENT < ((1 * 10000000) + (12 * 100000) + (99 * 1000))
+ #define XORG 112
++#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (13 * 100000) + (99 * 1000))
++#define XORG 113
+ #else
+ #error "X.Org newer than 1.10 is not supported"
+ #endif
+diff -up xserver/hw/vnc/xvnc.cc.xorg113 xserver/hw/vnc/xvnc.cc
+--- xserver/hw/vnc/xvnc.cc.xorg113 2012-07-19 21:36:33.078121854 -0400
++++ xserver/hw/vnc/xvnc.cc 2012-07-19 21:39:49.685663920 -0400
+@@ -267,7 +267,7 @@ OsVendorInit()
+ }
+
+ void
+-OsVendorFatalError()
++OsVendorFatalError(const char *f, va_list args)
+ {
+ }
+
+@@ -1135,9 +1135,9 @@ static Bool vncRandRSetConfig (ScreenPtr
+ #endif
+
+ static Bool
+-vfbCloseScreen(int index, ScreenPtr pScreen)
++vfbCloseScreen(ScreenPtr pScreen)
+ {
+- vfbScreenInfoPtr pvfb = &vfbScreens[index];
++ vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum];
+ int i;
+
+ pScreen->CloseScreen = pvfb->closeScreen;
+@@ -1149,13 +1149,13 @@ vfbCloseScreen(int index, ScreenPtr pScr
+ for (i = 0; i < MAXSCREENS; i++)
+ InstalledMaps[i] = NULL;
+
+- return pScreen->CloseScreen(index, pScreen);
++ return pScreen->CloseScreen(pScreen);
+ }
+
+ static Bool
+-vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
++vfbScreenInit(ScreenPtr pScreen, int argc, char **argv)
+ {
+- vfbScreenInfoPtr pvfb = &vfbScreens[index];
++ vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum];
+ int dpi;
+ int ret;
+ void *pbits;
+@@ -1167,8 +1167,8 @@ vfbScreenInit(int index, ScreenPtr pScre
+
+ pbits = vfbAllocateFramebufferMemory(&pvfb->fb);
+ if (!pbits) return FALSE;
+- vncFbptr[index] = pbits;
+- vncFbstride[index] = pvfb->fb.paddedWidth;
++ vncFbptr[pScreen->myNum] = pbits;
++ vncFbstride[pScreen->myNum] = pvfb->fb.paddedWidth;
+
+ miSetPixmapDepths();
+
+diff -up xserver/include/screenint.h.xorg113 xserver/include/screenint.h
+--- xserver/include/screenint.h.xorg113 2012-07-19 21:30:38.258557709 -0400
++++ xserver/include/screenint.h 2012-07-19 21:30:45.415468235 -0400
+@@ -72,18 +72,18 @@ extern _X_EXPORT int AddGPUScreen(Bool (
+ extern _X_EXPORT void RemoveGPUScreen(ScreenPtr pScreen);
+
+ extern _X_EXPORT void
+-AttachUnboundGPU(ScreenPtr pScreen, ScreenPtr newScreen);
++AttachUnboundGPU(ScreenPtr pScreen, ScreenPtr);
+ extern _X_EXPORT void
+ DetachUnboundGPU(ScreenPtr unbound);
+
+ extern _X_EXPORT void
+-AttachOutputGPU(ScreenPtr pScreen, ScreenPtr newScreen);
++AttachOutputGPU(ScreenPtr pScreen, ScreenPtr);
+
+ extern _X_EXPORT void
+ DetachOutputGPU(ScreenPtr output);
+
+ extern _X_EXPORT void
+-AttachOffloadGPU(ScreenPtr pScreen, ScreenPtr newScreen);
++AttachOffloadGPU(ScreenPtr pScreen, ScreenPtr);
+
+ extern _X_EXPORT void
+ DetachOffloadGPU(ScreenPtr slave);
+
diff --git a/source.local/extra/source/tigervnc/tigervnc11-xorg114.patch b/source.local/extra/source/tigervnc/tigervnc11-xorg114.patch
new file mode 100644
index 0000000..16027e7
--- /dev/null
+++ b/source.local/extra/source/tigervnc/tigervnc11-xorg114.patch
@@ -0,0 +1,141 @@
+--- xserver/hw/vnc/xorg-version.h Mon Feb 18 08:28:49 2013
++++ xserver/hw/vnc/xorg-version.h Mon Feb 18 08:28:43 2013
+@@ -40,6 +40,10 @@
+ #define XORG 111
+ #elif XORG_VERSION_CURRENT < ((1 * 10000000) + (12 * 100000) + (99 * 1000))
+ #define XORG 112
++#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (13 * 100000) + (99 * 1000))
++#define XORG 113
++#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (14 * 100000) + (99 * 1000))
++#define XORG 114
+ #else
+ #error "X.Org newer than 1.10 is not supported"
+ #endif
+--- xserver/hw/vnc/vncHooks.cc Mon Feb 18 08:29:37 2013
++++ xserver/hw/vnc/vncHooks.cc Mon Feb 18 08:31:40 2013
+@@ -116,7 +116,7 @@
+
+ // screen functions
+
+-static Bool vncHooksCloseScreen(int i, ScreenPtr pScreen);
++static Bool vncHooksCloseScreen(ScreenPtr pScreen);
+ static Bool vncHooksCreateGC(GCPtr pGC);
+ static void vncHooksCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
+ RegionPtr pOldRegion);
+@@ -133,7 +133,7 @@
+ DeviceIntPtr pDev,
+ #endif
+ ScreenPtr pScreen, CursorPtr cursor);
+-static void vncHooksBlockHandler(int i, pointer blockData, pointer pTimeout,
++static void vncHooksBlockHandler(ScreenPtr pScreen_, pointer pTimeout,
+ pointer pReadmask);
+ #ifdef RENDER
+ static void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
+@@ -335,7 +335,7 @@
+ // CloseScreen - unwrap the screen functions and call the original CloseScreen
+ // function
+
+-static Bool vncHooksCloseScreen(int i, ScreenPtr pScreen_)
++static Bool vncHooksCloseScreen(ScreenPtr pScreen_)
+ {
+ SCREEN_UNWRAP(pScreen_, CloseScreen);
+
+@@ -366,7 +366,7 @@
+
+ DBGPRINT((stderr,"vncHooksCloseScreen: unwrapped screen functions\n"));
+
+- return (*pScreen->CloseScreen)(i, pScreen);
++ return (*pScreen->CloseScreen)(pScreen);
+ }
+
+ // CreateGC - wrap the "GC funcs"
+@@ -531,14 +531,14 @@
+ // BlockHandler - ignore any changes during the block handler - it's likely
+ // these are just drawing the cursor.
+
+-static void vncHooksBlockHandler(int i, pointer blockData, pointer pTimeout,
++static void vncHooksBlockHandler(ScreenPtr pScreen_, pointer pTimeout,
+ pointer pReadmask)
+ {
+- SCREEN_UNWRAP(screenInfo.screens[i], BlockHandler);
++ SCREEN_UNWRAP(pScreen_, BlockHandler);
+
+ vncHooksScreen->desktop->ignoreHooks(true);
+
+- (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
++ (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask);
+
+ vncHooksScreen->desktop->ignoreHooks(false);
+
+--- xserver/hw/vnc/xf86vncModule.cc Mon Feb 18 08:32:09 2013
++++ xserver/hw/vnc/xf86vncModule.cc Mon Feb 18 08:32:27 2013
+@@ -53,8 +53,6 @@
+ {
+ vncExtensionInitWithParams,
+ "VNC",
+- NULL,
+- NULL,
+ NULL
+ };
+
+--- xserver/hw/vnc/xvnc.cc Mon Feb 18 08:32:43 2013
++++ xserver/hw/vnc/xvnc.cc Mon Feb 18 08:33:57 2013
+@@ -266,7 +266,7 @@
+ }
+
+ void
+-OsVendorFatalError()
++OsVendorFatalError(const char *f, va_list args)
+ {
+ }
+
+@@ -1134,9 +1134,9 @@
+ #endif
+
+ static Bool
+-vfbCloseScreen(int index, ScreenPtr pScreen)
++vfbCloseScreen(ScreenPtr pScreen)
+ {
+- vfbScreenInfoPtr pvfb = &vfbScreens[index];
++ vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum];
+ int i;
+
+ pScreen->CloseScreen = pvfb->closeScreen;
+@@ -1148,13 +1148,13 @@
+ for (i = 0; i < MAXSCREENS; i++)
+ InstalledMaps[i] = NULL;
+
+- return pScreen->CloseScreen(index, pScreen);
++ return pScreen->CloseScreen(pScreen);
+ }
+
+ static Bool
+-vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
++vfbScreenInit(ScreenPtr pScreen, int argc, char **argv)
+ {
+- vfbScreenInfoPtr pvfb = &vfbScreens[index];
++ vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum];
+ int dpi;
+ int ret;
+ void *pbits;
+@@ -1166,8 +1166,8 @@
+
+ pbits = vfbAllocateFramebufferMemory(&pvfb->fb);
+ if (!pbits) return FALSE;
+- vncFbptr[index] = pbits;
+- vncFbstride[index] = pvfb->fb.paddedWidth;
++ vncFbptr[pScreen->myNum] = pbits;
++ vncFbstride[pScreen->myNum] = pvfb->fb.paddedWidth;
+
+ miSetPixmapDepths();
+
+--- xserver/hw/vnc/xvnc.cc Tue Feb 19 08:50:20 2013
++++ xserver/hw/vnc/xvnc.cc Tue Feb 19 08:50:27 2013
+@@ -54,7 +54,6 @@
+ #include "servermd.h"
+ #include "fb.h"
+ #include "mi.h"
+-#include "mibstore.h"
+ #include "colormapst.h"
+ #include "gcstruct.h"
+ #include "input.h"
diff --git a/source.local/extra/source/tigervnc/tigervnc11-xorg_headers.patch b/source.local/extra/source/tigervnc/tigervnc11-xorg_headers.patch
new file mode 100644
index 0000000..2ef5bec
--- /dev/null
+++ b/source.local/extra/source/tigervnc/tigervnc11-xorg_headers.patch
@@ -0,0 +1,16 @@
+--- tigervnc-1.1.0/unix/xserver/hw/vnc/Makefile.am.orig 2011-08-09 23:16:36.000000000 +0200
++++ tigervnc-1.1.0/unix/xserver/hw/vnc/Makefile.am 2012-07-29 14:14:55.078998592 +0200
+@@ -61,10 +61,10 @@
+ BUILT_SOURCES = $(nodist_Xvnc_SOURCES)
+
+ fb.h: $(top_srcdir)/fb/fb.h
+- cat $(top_srcdir)/fb/fb.h | sed -e 's,and,c_and,' -e 's,xor,c_xor,' > $(srcdir)/fb.h
++ cat $(top_srcdir)/fb/fb.h | sed -e 's,and,c_and,g' -e 's,xor,c_xor,g' > $(srcdir)/fb.h
+
+ pixman.h: $(includedir)/pixman-1/pixman.h
+- cat $(includedir)/pixman-1/pixman.h | sed 's/xor/c_xor/' > $(srcdir)/pixman.h
++ cat $(includedir)/pixman-1/pixman.h | sed 's/xor/c_xor/g' > $(srcdir)/pixman.h
+
+ fbrop.h: $(top_srcdir)/fb/fbrop.h
+- cat $(top_srcdir)/fb/fbrop.h | sed -e 's,and,c_and,' -e 's,xor,c_xor,' > $(srcdir)/fbrop.h
++ cat $(top_srcdir)/fb/fbrop.h | sed -e 's,and,c_and,' -e 's,xor,c_xor,g' > $(srcdir)/fbrop.h
diff --git a/source.local/extra/source/tigervnc/tigervnc12-xorg_headers.patch b/source.local/extra/source/tigervnc/tigervnc12-xorg_headers.patch
new file mode 100644
index 0000000..5497052
--- /dev/null
+++ b/source.local/extra/source/tigervnc/tigervnc12-xorg_headers.patch
@@ -0,0 +1,25 @@
+--- tigervnc-1.2.0/unix/xserver/hw/vnc/Makefile.am~ 2011-10-31 09:14:40.000000000 +0100
++++ tigervnc-1.2.0/unix/xserver/hw/vnc/Makefile.am 2012-04-19 08:15:51.849379891 +0200
+@@ -63,7 +63,7 @@
+ BUILT_SOURCES = $(nodist_Xvnc_SOURCES)
+
+ fb.h: $(top_srcdir)/fb/fb.h
+- cat $(top_srcdir)/fb/fb.h | sed -e 's,and,c_and,' -e 's,xor,c_xor,' > $(srcdir)/fb.h
++ cat $(top_srcdir)/fb/fb.h | sed -e 's,and,c_and,g' -e 's,xor,c_xor,g' > $(srcdir)/fb.h
+
+ pixman.h:
+ for i in ${XSERVERLIBS_CFLAGS}; do \
+@@ -72,10 +72,10 @@
+ fi; \
+ done; \
+ if [ ! "$$PIXMANINCDIR" = "" ]; then \
+- cat $$PIXMANINCDIR/pixman.h | sed 's/xor/c_xor/' > $(srcdir)/pixman.h; \
++ cat $$PIXMANINCDIR/pixman.h | sed 's/xor/c_xor/g' > $(srcdir)/pixman.h; \
+ else \
+ echo Pixman include directory not set in XSERVERLIBS_CFLAGS \(perhaps Pixman was not found by configure?\); \
+ fi
+
+ fbrop.h: $(top_srcdir)/fb/fbrop.h
+- cat $(top_srcdir)/fb/fbrop.h | sed -e 's,and,c_and,' -e 's,xor,c_xor,' > $(srcdir)/fbrop.h
++ cat $(top_srcdir)/fb/fbrop.h | sed -e 's,and,c_and,g' -e 's,xor,c_xor,g' > $(srcdir)/fbrop.h
+
diff --git a/source.local/extra/source/tigervnc/tigervnc12.SlackBuild b/source.local/extra/source/tigervnc/tigervnc12.SlackBuild
new file mode 100644
index 0000000..f17a51d
--- /dev/null
+++ b/source.local/extra/source/tigervnc/tigervnc12.SlackBuild
@@ -0,0 +1,401 @@
+#!/bin/bash
+# $Id: tigervnc.SlackBuild,v 1.8 2012/06/23 19:37:20 root Exp $
+# Copyright 2010, 2011, 2012 Eric Hameleers, Eindhoven. NL
+# All rights reserved.
+#
+# Permission to use, copy, modify, and distribute this software for
+# any purpose with or without fee is hereby granted, provided that
+# the above copyright notice and this permission notice appear in all
+# copies.
+#
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# -----------------------------------------------------------------------------
+#
+# Slackware SlackBuild script
+# ===========================
+# By: Eric Hameleers <alien@slackware.com>
+# For: tigervnc
+# Descr: VNC server and client
+# URL: http://tigervnc.org/
+# Needs: jdk (only during building the java applet)
+# libjpeg-turbo (only during compilation of the vncviewer)
+# Changelog:
+# r4126-1: 31/Aug/2010 by Eric Hameleers <alien@slackware.com>
+# * Initial build.
+# r4126-2: 02/sep/2010 by Eric Hameleers <alien@slackware.com>
+# * Fix a syntax error in thye doinst.sh script
+# 1.0.90-1: 14/may/2011 by Eric Hameleers <alien@slackware.com>
+# * Update to 1.1.beta1
+# 1.1.0-1: 14/nov/2011 by Eric Hameleers <alien@slackware.com>
+# * Update to 1.1.0
+# 1.2.0-1: 23/jun/2012 by Eric Hameleers <alien@slackware.com>
+# * Update.
+#
+# Run 'sh tigervnc.SlackBuild' to build a Slackware package.
+# The package (.txz) and .txt file as well as build logs are created in /tmp .
+# Install it using 'installpkg'.
+#
+# -----------------------------------------------------------------------------
+
+PRGNAM=tigervnc
+VERSION=${VERSION:-1.2.0}
+BUILD=${BUILD:-1}
+NUMJOBS=${NUMJOBS:" -j4 "}
+TAG=${TAG:-alien}
+
+# Do we build the java applet (needs jdk)?
+DO_APPLET=${DO_APPLET:-"YES"}
+
+# TigerVNC needs to use source of the X.Org server whose version matches
+# that of your installed X.Org package:
+XORG=${XORG:-$(X -version 2>&1 | grep "^X.Org X Server " | cut -f4 -d' ')}
+PATCHVER="$(echo $XORG | cut -f1,2 -d. | tr -d '.')"
+
+# OS Stamp into the binaries:
+OSNAME="Slackware 13.37"
+OSVENDOR="Slackware Linux Project"
+BUILDER="Built by Alien BOB on $(date -u)"
+
+# This covers most filenames you'd want as documentation. Change if needed.
+DOCS="BUILDING.txt LICENCE.TXT README.txt doc/TODO doc/*.txt doc/*.odt"
+DOCS_XORG="COPYING ChangeLog"
+
+# Where do we look for sources?
+SRCDIR=$(cd $(dirname $0); pwd)
+
+# Place to build (TMP) package (PKG) and output (OUTPUT) the program:
+TMP=${TMP:-/tmp/build}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+# If you want automatic download to work, supply a URL for 'SRCURL' below:
+SOURCE[0]="$SRCDIR/${PRGNAM}-${VERSION}.tar.gz"
+SRCURL[0]="http://downloads.sourceforge.net/$PRGNAM/${PRGNAM}-${VERSION}.tar.gz"
+
+SOURCE[1]="$SRCDIR/xorg-server-${XORG}.tar.gz"
+SRCURL[1]="http://xorg.freedesktop.org/releases/individual/xserver/xorg-server-${XORG}.tar.gz"
+
+# Use the src_checkout() function if no downloadable tarball exists.
+# This function checks out sources from SVN/CVS and creates a tarball of them.
+src_checkout() {
+ # Param #1 : index in the SOURCE[] array.
+ # Param #2 : full path to where SOURCE[$1] tarball should be created.
+ # Determine the tarball extension:
+ PEXT=$(echo "${2}" | sed -r -e 's/.*[^.].(tar.xz|tar.gz|tar.bz2|tgz).*/\1/')
+ case "$PEXT" in
+ "tar.xz") TARCOMP="J" ;;
+ "tar.gz") TARCOMP="z" ;;
+ "tgz") TARCOMP="z" ;;
+ "tar.bz2") TARCOMP="j" ;;
+ *) echo "Archive can only have extension 'tar.xz', '.tar.gz' '.tar.bz2' or '.tgz'" ; exit 1 ;;
+ esac
+ case ${1} in
+ 0) # This example assumes a SVN checkout:
+ if [ "$(echo ${VERSION}|cut -c1)" == 'r' ]; then # revision instead of date
+ REV=$(echo ${VERSION} | cut -c2-)
+ else
+ REV="{${VERSION}}"
+ fi
+ mkdir $PRGNAM-${VERSION} \
+ && cd $PRGNAM-${VERSION} \
+ && svn checkout --revision $REV https://tigervnc.svn.sourceforge.net/svnroot/tigervnc/trunk/ . \
+ && find . -type d -name '.svn' -depth | xargs rm -rf \
+ && chown -R root:root . \
+ && cd .. \
+ && tar -${TARCOMP}cf ${2} $PRGNAM-${VERSION}
+ rm -rf $PRGNAM-${VERSION}
+ ;;
+ *) # Do nothing
+ ;;
+ esac
+}
+
+##
+## --- with a little luck, you won't have to edit below this point --- ##
+##
+
+# Automatically determine the architecture we're building on:
+MARCH=$( uname -m )
+if [ -z "$ARCH" ]; then
+ case "$MARCH" in
+ i?86) export ARCH=i486 ;;
+ armv7hl) export ARCH=$MARCH ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$MARCH ;;
+ esac
+fi
+
+case "$ARCH" in
+ i486) SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ SLKLDFLAGS=""; LIBDIRSUFFIX=""
+ ;;
+ x86_64) SLKCFLAGS="-O2 -fPIC"
+ SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64"
+ ;;
+ armv7hl) SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16"
+ SLKLDFLAGS=""; LIBDIRSUFFIX=""
+ ;;
+ *) SLKCFLAGS="-O2"
+ SLKLDFLAGS=""; LIBDIRSUFFIX=""
+ ;;
+esac
+
+case "ARCH" in
+ arm*) TARGET=$ARCH-slackware-linux-gnueabi ;;
+ *) TARGET=$ARCH-slackware-linux ;;
+esac
+
+# Exit the script on errors:
+set -e
+trap 'echo "$0 FAILED at line ${LINENO}" | tee $OUTPUT/error-${PRGNAM}.log' ERR
+# Catch unitialized variables:
+set -u
+P1=${1:-1}
+
+# Save old umask and set to 0022:
+_UMASK_=$(umask)
+umask 0022
+
+# Create working directories:
+mkdir -p $OUTPUT # place for the package to be saved
+mkdir -p $TMP/tmp-$PRGNAM # location to build the source
+mkdir -p $PKG # place for the package to be built
+rm -rf $PKG/* # always erase old package's contents
+rm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous build
+rm -rf $OUTPUT/{configure,make,install,error,makepkg}-$PRGNAM.log
+ # remove old log files
+
+# Source file availability:
+for (( i = 0; i < ${#SOURCE[*]}; i++ )) ; do
+ if ! [ -f ${SOURCE[$i]} ]; then
+ echo "Source '$(basename ${SOURCE[$i]})' not available yet..."
+ # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT
+ [ -w "$SRCDIR" ] || SOURCE[$i]="$OUTPUT/$(basename ${SOURCE[$i]})"
+ if [ -f ${SOURCE[$i]} ]; then echo "Ah, found it!"; continue; fi
+ if ! [ "x${SRCURL[$i]}" == "x" ]; then
+ echo "Will download file to $(dirname $SOURCE[$i])"
+ wget -nv -T 20 -O "${SOURCE[$i]}" "${SRCURL[$i]}" || true
+ if [ $? -ne 0 -o ! -s "${SOURCE[$i]}" ]; then
+ echo "Fail to download '$(basename ${SOURCE[$i]})'. Aborting the build."
+ mv -f "${SOURCE[$i]}" "${SOURCE[$i]}".FAIL
+ exit 1
+ fi
+ else
+ # Try if we have a SVN/CVS download routine for ${SOURCE[$i]}
+ echo "Will checkout sources to $(dirname $SOURCE[$i])"
+ src_checkout $i "${SOURCE[$i]}" \
+ 2>&1 > $OUTPUT/checkout-$(basename ${SOURCE[$i]}).log
+ fi
+ if [ ! -f "${SOURCE[$i]}" -o ! -s "${SOURCE[$i]}" ]; then
+ echo "File '$(basename ${SOURCE[$i]})' not available. Aborting the build."
+ exit 1
+ fi
+ fi
+done
+
+if [ "$P1" == "--download" ]; then
+ echo "Download complete."
+ exit 0
+fi
+
+# --- PACKAGE BUILDING ---
+
+echo "++"
+echo "|| $PRGNAM-$VERSION"
+echo "++"
+
+cd $TMP/tmp-$PRGNAM
+echo "Extracting the source archive(s) for $PRGNAM..."
+for (( i = 0; i < ${#SOURCE[*]}; i++ )) ; do
+ tar -xvf ${SOURCE[$i]}
+done
+cd ${PRGNAM}-${VERSION}
+chmod -R u+w,go+r-w,a+X-s .
+chown -R root:root .
+
+echo Building ...
+export LDFLAGS="$SLKLDFLAGS"
+export CXXFLAGS="$SLKCFLAGS"
+export CFLAGS="$SLKCFLAGS"
+
+[ "$DO_APPLET" = "YES" ] && CMAKE_JAVA="ON" || CMAKE_JAVA="OFF"
+# Explicitly put the java applet into a directory named 'tigervnc':
+sed -i -e 's#/vnc/class#/tigervnc/class#'g $(grep -rl vnc/class .)
+sed -i -e 's#DESTINATION vnc/class#DESTINATION share/tigervnc/class#'g $(grep -rl vnc/class .)
+
+echo -e "\n*** Building tigervnc ***\n"
+mkdir -p build
+cd build
+ cmake \
+ -G "Unix Makefiles" \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DMAN_INSTALL_DIR=/usr/man \
+ -DSYSCONF_INSTALL_DIR=/etc \
+ -DLIB_SUFFIX=${LIBDIRSUFFIX} \
+ -DENABLE_PAM:BOOL=OFF \
+ -DBUILD_JAVA:BOOL=${CMAKE_JAVA} \
+ -DJPEG_INCLUDE_DIR=/usr/include/libjpeg-turbo \
+ -DJPEG_LIBRARY=/usr/lib${LIBDIRSUFFIX}/libjpeg-turbo/libjpeg.a \
+ ..
+ make $NUMJOBS 2>&1 | tee $OUTPUT/make-${PRGNAM}.log
+ make DESTDIR=$PKG install 2>&1 | tee $OUTPUT/install-${PRGNAM}.log
+cd -
+
+# Do we have a patch for X.Org which tigervnc does not have?
+if [ ! -f unix/xserver${PATCHVER}.patch -a -f $SRCDIR/xserver${PATCHVER}.patch ]
+then
+ cp $SRCDIR/xserver${PATCHVER}.patch unix/
+fi
+
+# Prepare the Xvnc sources (we are building out-of-tree, in ./build directory):
+mkdir -p build/unix
+cp -R unix/xserver unix/xserver${PATCHVER}.patch build/unix/
+cp -R ../xorg-server-${XORG}/* build/unix/xserver/
+
+cd build/unix/xserver/
+ # Patch the xorg-server source to include building vnc driver:
+ cat ../xserver${PATCHVER}.patch | patch -p1 --verbose \
+ 2>&1 | tee $OUTPUT/patch-$PRGNAM.log
+ echo -e "\n*** Building xserver ***\n"
+ autoreconf -vif 2>&1 | tee $OUTPUT/configure-${PRGNAM}.log
+
+ # Default font paths to be used by the X server
+ DEF_FONTPATH="/usr/share/fonts/local,/usr/share/fonts/TTF,/usr/share/fonts/OTF,/usr/share/fonts/Type1,/usr/share/fonts/misc,/usr/share/fonts/CID,/usr/share/fonts/75dpi/:unscaled,/usr/share/fonts/100dpi/:unscaled,/usr/share/fonts/75dpi,/usr/share/fonts/100dpi,/usr/share/fonts/cyrillic"
+
+ ./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --disable-static \
+ --disable-config-dbus --disable-config-hal --disable-config-udev \
+ --disable-xorg --disable-xnest --disable-xvfb --disable-dmx \
+ --disable-xwin --disable-xephyr --disable-kdrive --disable-xinerama \
+ --disable-composite --disable-dri --disable-dri2 \
+ --enable-install-libxf86config \
+ --enable-xcsecurity \
+ --enable-glx-tls \
+ --with-pic \
+ --with-int10=x86emu \
+ --with-default-font-path="${DEF_FONTPATH}" \
+ --with-module-dir=/usr/lib${LIBDIRSUFFIX}/xorg/modules \
+ --with-xkb-path=/etc/X11/xkb \
+ --with-xkb-output=/var/lib/xkb \
+ --with-os-name="$OSNAME" \
+ --with-os-vendor="$OSVENDOR" \
+ --with-builderstring="$BUILDER" \
+ --build=$TARGET \
+ 2>&1 | tee $OUTPUT/configure-${PRGNAM}.log
+
+ make TIGERVNC_SRCDIR="$TMP/tmp-$PRGNAM/${PRGNAM}-${VERSION}" $NUMJOBS \
+ 2>&1 | tee -a $OUTPUT/make-${PRGNAM}.log
+ make TIGERVNC_SRCDIR="$TMP/tmp-$PRGNAM/${PRGNAM}-${VERSION}" -C hw/vnc \
+ DESTDIR=$PKG install 2>&1 | tee -a $OUTPUT/install-${PRGNAM}.log
+cd -
+
+# Create .png icons from the .svg file:
+make -C media 2>&1 | tee -a $OUTPUT/make-${PRGNAM}.log
+
+# Install menu entry:
+mkdir -p $PKG/usr/share/{applications,icons/hicolor/{16x16,24x24,32x32,48x48}/apps}
+for PSIZE in 16 24 32 48; do
+ install -m644 media/icons/tigervnc_${PSIZE}.png \
+ $PKG/usr/share/icons/hicolor/${PSIZE}x${PSIZE}/apps/tigervnc.png
+done
+cat <<EOT > $PKG/usr/share/applications/tigervnc.desktop
+[Desktop Entry]
+Encoding=UTF-8
+Name=TigerVNC
+GenericName=VNCViewer (RFB Client)
+Comment=Connect to remote desktop
+SwallowExec=
+Exec=vncviewer
+MimeType=
+Icon=tigervnc
+Path=
+TerminalOptions=
+Terminal=false
+Type=Application
+Categories=Network;
+StartupWMClass=VNC Viewer: Connection Details
+EOT
+
+# Add this to the doinst.sh:
+! [ -d $PKG/install ] && mkdir -p $PKG/install
+cat <<EOT >> $PKG/install/doinst.sh
+# Update the desktop database:
+if [ -x usr/bin/update-desktop-database ]; then
+ chroot . /usr/bin/update-desktop-database usr/share/applications 1>/dev/null 2>&1
+fi
+
+# Update the mime database:
+if [ -x usr/bin/update-mime-database ]; then
+ chroot . /usr/bin/update-mime-database usr/share/mime 1>/dev/null 2>&1
+fi
+
+# Update hicolor theme cache:
+if [ -d usr/share/icons/hicolor ]; then
+ if [ -x usr/bin/gtk-update-icon-cache ]; then
+ chroot . /usr/bin/gtk-update-icon-cache -f -t usr/share/icons/hicolor 1> /dev/null 2> /dev/null
+ fi
+fi
+
+EOT
+
+# Add documentation:
+# First, remove files which were misplaced:
+rm -f $PKG/usr/doc/*
+cd $TMP/tmp-$PRGNAM/${PRGNAM}-${VERSION}
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true
+for FIL in $(echo $DOCS_XORG); do cp -a build/unix/xserver/$FIL $PKG/usr/doc/$PRGNAM-$VERSION/${FIL}.xorg ; done || true
+cat $SRCDIR/$(basename $0) > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+chown -R root:root $PKG/usr/doc/$PRGNAM-$VERSION
+find $PKG/usr/doc -type f -exec chmod 644 {} \;
+
+# Compress the man page(s):
+if [ -d $PKG/usr/man ]; then
+ find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
+ for i in $(find $PKG/usr/man -type l -name "*.?") ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+fi
+
+# Strip binaries (if any):
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+# Add a package description:
+mkdir -p $PKG/install
+cat $SRCDIR/slack-desc > $PKG/install/slack-desc
+if [ -f $SRCDIR/doinst.sh ]; then
+ cat $SRCDIR/doinst.sh >> $PKG/install/doinst.sh
+fi
+
+# Build the package:
+cd $PKG
+makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-txz} 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log
+cd $OUTPUT
+md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-txz} > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-txz}.md5
+cd -
+cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txt
+if [ -f $PKG/install/slack-required ]; then
+ cat $PKG/install/slack-required > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.dep
+fi
+
+# Restore the original umask:
+umask ${_UMASK_}
+