summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2016-08-22 18:17:57 +0200
committer Eric Hameleers <alien@slackware.com>2016-08-22 18:17:57 +0200
commit72a2bb40ae21ed97e7ee9e75f00aadaa352578ad (patch)
tree99ba020f772cdce0ebca8f34a1efe9a9e90946af
parentdb67df3cf8a58828960ce535166c208dc73725f7 (diff)
downloadktown-72a2bb40ae21ed97e7ee9e75f00aadaa352578ad.tar.gz
ktown-72a2bb40ae21ed97e7ee9e75f00aadaa352578ad.tar.xz
Wayland: needs recompiled mesa, xorg-server and addition of elogind.
- Slackware's mesa package was recompiled against wayland. - Slackware's xorg-server package was recompiled against wayland; note that this package obsoletes the original xorg-server-xephyr, xorg-server-xnest and xorg-server-xvfb packages because the new xorg-server package is all-in-one. - New package elogind is the systemd project's 'logind', extracted to be a standalone daemon (quite similar to the 'eudev' package we already have in Slackware). An implementation of the logind dbus protociol is required by kwin_wayland. At the moment, there is no other option than elogind until the ConsoleKit2 developers implement the protocol.
-rw-r--r--deps/elogind/.url2
-rwxr-xr-xdeps/elogind/doinst.sh41
-rwxr-xr-xdeps/elogind/elogind.SlackBuild170
-rw-r--r--deps/elogind/patches/elogind-219.12-session.patch45
-rw-r--r--deps/elogind/patches/elogind-docs.patch19
-rw-r--r--deps/elogind/patches/elogind-lrt.patch10
-rw-r--r--deps/elogind/patches/elogind-polkit.patch121
-rw-r--r--deps/elogind/rc.elogind29
-rw-r--r--deps/elogind/slack-desc19
-rwxr-xr-xdeps/mesa/get-mesa.sh20
-rwxr-xr-xdeps/mesa/mesa.SlackBuild188
-rw-r--r--deps/mesa/mesa.no.mako.diff.gzbin0 -> 425 bytes
-rw-r--r--deps/mesa/mesa.url2
-rw-r--r--deps/mesa/slack-desc19
-rw-r--r--deps/xorg-server/patches/x11.startwithblackscreen.diff14
-rw-r--r--deps/xorg-server/patches/xorg-server.combo.mouse.keyboard.layout.patch49
-rw-r--r--deps/xorg-server/slack-desc19
-rw-r--r--deps/xorg-server/slack-descs/xorg-server19
-rw-r--r--deps/xorg-server/slack-descs/xorg-server-xephyr19
-rw-r--r--deps/xorg-server/slack-descs/xorg-server-xnest19
-rw-r--r--deps/xorg-server/slack-descs/xorg-server-xvfb19
-rw-r--r--deps/xorg-server/slack-descs/xorg-server-xwayland19
-rwxr-xr-xdeps/xorg-server/xorg-server.SlackBuild255
23 files changed, 1117 insertions, 0 deletions
diff --git a/deps/elogind/.url b/deps/elogind/.url
new file mode 100644
index 0000000..444f958
--- /dev/null
+++ b/deps/elogind/.url
@@ -0,0 +1,2 @@
+https://github.com/wingo/elogind/archive/v219.12.tar.gz
+https://github.com/wingo/elogind/archive/master.zip
diff --git a/deps/elogind/doinst.sh b/deps/elogind/doinst.sh
new file mode 100755
index 0000000..75adb23
--- /dev/null
+++ b/deps/elogind/doinst.sh
@@ -0,0 +1,41 @@
+# Handle the incoming configuration files:
+config() {
+ for infile in $1; do
+ NEW="$infile"
+ OLD="`dirname $NEW`/`basename $NEW .new`"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+ done
+}
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname ${NEW})/$(basename ${NEW} .new)"
+ if [ -e ${OLD} ]; then
+ cp -a ${OLD} ${NEW}.incoming
+ cat ${NEW} > ${NEW}.incoming
+ mv ${NEW}.incoming ${NEW}
+ fi
+ config ${NEW}
+}
+
+#
+# Preserve permissions while moving into place:
+preserve_perms etc/rc.d/rc.elogind.new
+
+#
+# Update rc.local so that elogind will be functional after boot:
+if ! grep "rc.elogind" etc/rc.d/rc.local 1>/dev/null 2>/dev/null ; then
+ cat <<_EOM_ >> etc/rc.d/rc.local
+
+if [ -x /etc/rc.d/rc.elogind ]; then
+ # Create runtime for elogind (standalone logind extracted from systemd):
+ /etc/rc.d/rc.elogind
+fi
+_EOM_
+fi
diff --git a/deps/elogind/elogind.SlackBuild b/deps/elogind/elogind.SlackBuild
new file mode 100755
index 0000000..042ba8f
--- /dev/null
+++ b/deps/elogind/elogind.SlackBuild
@@ -0,0 +1,170 @@
+#!/bin/sh
+# Copyright 2016 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2016 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.
+# -----------------------------------------------------------------------------
+
+
+PKGNAM=elogind
+VERSION=${VERSION:-219.14}
+BUILD=${BUILD:-1}
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-$PKGNAM
+
+# We do not use PAM by default:
+USE_PAM=${USE_PAM:-"NO"}
+[ "$USE_PAM" = "NO" -o "$USE_PAM" = "no" ] && DO_PAM="dis" || DO_PAM="en"
+
+if [ -e $CWD/machine.conf ]; then
+ . $CWD/machine.conf ]
+elif [ -e /etc/slackbuild/machine.conf ]; then
+ . /etc/slackbuild/machine.conf ]
+else
+ # Automatically determine the architecture we're building on:
+ MARCH=$( uname -m )
+ if [ -z "$ARCH" ]; then
+ case "$MARCH" in
+ i?86) export ARCH=i486 ;;
+ arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7hl ;;
+ # 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" = "armv7hl" ]; then
+ SLKCFLAGS="-O3 -march=armv7-a -mfpu=vfpv3-d16"
+ LIBDIRSUFFIX=""
+ elif [ "$ARCH" = "arm" ]; then
+ SLKCFLAGS="-O2 -march=armv5te"
+ LIBDIRSUFFIX=""
+ else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+ fi
+fi
+
+case "$ARCH" in
+ arm*) TARGET=$ARCH-slackware-linux-gnueabi ;;
+ *) TARGET=$ARCH-slackware-linux ;;
+esac
+
+rm -rf $PKG
+mkdir -p $TMP $PKG
+cd $TMP
+rm -rf $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.gz || exit 1
+cd $PKGNAM-$VERSION || exit 1
+
+# Launch elogind when called via DBus and make sure its rundir exists
+# (in Slackware, /run is mounted as a tmpfs):
+sed -i src/login/org.freedesktop.login1.service \
+ -e "s,/bin/false,/bin/bash -c \"[[ ! -d /run/systemd ]] \&\& mkdir /run/systemd;/usr/libexec/elogind/elogind\","
+
+# Apply Gentoo patches:
+#cat $CWD/patches/elogind-219.12-session.patch | patch -p1 --verbose || exit 1
+cat $CWD/patches/elogind-lrt.patch | patch -p1 --verbose || exit 1
+cat $CWD/patches/elogind-docs.patch | patch -p1 --verbose || exit 1
+# Merge a pull request for an upstream fix:
+cat $CWD/patches/elogind-polkit.patch | patch -p1 --verbose || exit 1
+
+# Make sure ownerships and permissions are sane:
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+# Configure:
+autoreconf -vif
+intltoolize
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --libexecdir=/usr/libexec \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --docdir=/usr/doc/$PKGNAM-$VERSION \
+ --disable-seccomp \
+ --disable-selinux \
+ --disable-apparmor \
+ --${DO_PAM}able-pam \
+ --disable-smack \
+ --disable-tests \
+ --enable-split-usr \
+ --build=$TARGET
+
+# Build and install:
+make || exit 1
+make install DESTDIR=$PKG || exit 1
+
+# Strip binaries:
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | \
+ grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+# Compress and link manpages, if any:
+if [ -d $PKG/usr/man ]; then
+ ( cd $PKG/usr/man
+ for manpagedir in $(find . -type d -name "man*") ; do
+ ( cd $manpagedir
+ for eachpage in $( find . -type l -maxdepth 1) ; do
+ ln -s $( readlink $eachpage ).gz $eachpage.gz
+ rm $eachpage
+ done
+ gzip -9 *.?
+ )
+ done
+ )
+fi
+
+# Add a rc script; Slackware does not support this out of the box:
+mkdir -p $PKG/etc/rc.d
+install -m 0755 $CWD/rc.elogind $PKG/etc/rc.d/rc.elogind.new
+
+# Add documentation:
+mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
+cp -a \
+ CODING_STYLE LICENSE* NEWS README TODO \
+ $PKG/usr/doc/$PKGNAM-$VERSION
+
+# Add a description and post-install script:
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+# Create the package:
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
+
diff --git a/deps/elogind/patches/elogind-219.12-session.patch b/deps/elogind/patches/elogind-219.12-session.patch
new file mode 100644
index 0000000..82cbebd
--- /dev/null
+++ b/deps/elogind/patches/elogind-219.12-session.patch
@@ -0,0 +1,45 @@
+From b5c5dd2ad43a3bf4fa0fb21139f8d16959b5d14e Mon Sep 17 00:00:00 2001
+From: Andy Wingo <wingo@pobox.com>
+Date: Sun, 6 Mar 2016 16:56:33 +0100
+Subject: [PATCH] Fixes to user and session saving
+
+* src/login/logind-dbus.c (method_create_session): No need to save
+ session here, as session_send_create_reply will do it.
+* src/login/logind-session-dbus.c (session_send_create_reply): On the
+ other hand we do need to save the user here, so the file marks them as
+ being active.
+---
+ src/login/logind-dbus.c | 2 --
+ src/login/logind-session-dbus.c | 5 +++--
+ 2 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
+index 5e6952d..6f7e569 100644
+--- a/src/login/logind-dbus.c
++++ b/src/login/logind-dbus.c
+@@ -801,8 +801,6 @@ static int method_create_session(sd_bus *bus, sd_bus_message *message, void *use
+ if (r < 0)
+ goto fail;
+
+- session_save(session);
+-
+ return 1;
+
+ fail:
+diff --git a/src/login/logind-session-dbus.c b/src/login/logind-session-dbus.c
+index f71798b..337bbbb 100644
+--- a/src/login/logind-session-dbus.c
++++ b/src/login/logind-session-dbus.c
+@@ -721,9 +721,10 @@ int session_send_create_reply(Session *s, sd_bus_error *error) {
+ if (fifo_fd < 0)
+ return fifo_fd;
+
+- /* Update the session state file before we notify the client
+- * about the result. */
++ /* Update the session and user state files before we notify
++ * the client about the result. */
+ session_save(s);
++ user_save(s->user);
+
+ p = session_bus_path(s);
+ if (!p)
diff --git a/deps/elogind/patches/elogind-docs.patch b/deps/elogind/patches/elogind-docs.patch
new file mode 100644
index 0000000..4763be2
--- /dev/null
+++ b/deps/elogind/patches/elogind-docs.patch
@@ -0,0 +1,19 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -253,16 +253,6 @@
+ dist_bashcompletion_DATA =
+ dist_zshcompletion_DATA =
+
+-dist_doc_DATA = \
+- README \
+- NEWS \
+- LICENSE.LGPL2.1 \
+- LICENSE.GPL2 \
+- LICENSE.MIT \
+- src/libelogind/sd-bus/PORTING-DBUS1 \
+- src/libelogind/sd-bus/DIFFERENCES \
+- src/libelogind/sd-bus/GVARIANT-SERIALIZATION
+-
+ @INTLTOOL_POLICY_RULE@
+
+ # ------------------------------------------------------------------------------
diff --git a/deps/elogind/patches/elogind-lrt.patch b/deps/elogind/patches/elogind-lrt.patch
new file mode 100644
index 0000000..19055fa
--- /dev/null
+++ b/deps/elogind/patches/elogind-lrt.patch
@@ -0,0 +1,10 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -778,6 +778,7 @@
+
+ libelogind_core_la_LIBADD = \
+ $(UDEV_LIBS) \
++ -lrt \
+ libelogind-internal.la
+
+ if HAVE_ACL
diff --git a/deps/elogind/patches/elogind-polkit.patch b/deps/elogind/patches/elogind-polkit.patch
new file mode 100644
index 0000000..4d91b98
--- /dev/null
+++ b/deps/elogind/patches/elogind-polkit.patch
@@ -0,0 +1,121 @@
+Update org.freedesktop.login1.conf
+This mirrors an upstream change opening up all of logind's bus calls to
+unprivileged users via polkit.
+
+See systemd/systemd#471.
+Closes #3.
+
+diff -uar a/src/login/org.freedesktop.login1.conf b/src/login/org.freedesktop.login1.conf
+--- a/src/login/org.freedesktop.login1.conf
++++ b/src/login/org.freedesktop.login1.conf
+@@ -90,6 +90,42 @@
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Manager"
++ send_member="LockSession"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Manager"
++ send_member="UnlockSession"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Manager"
++ send_member="LockSessions"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Manager"
++ send_member="UnlockSessions"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Manager"
++ send_member="KillSession"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Manager"
++ send_member="KillUser"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Manager"
++ send_member="TerminateSession"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Manager"
++ send_member="TerminateUser"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Manager"
++ send_member="TerminateSeat"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Manager"
+ send_member="PowerOff"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ @@ -130,6 +166,10 @@
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Manager"
++ send_member="SetWallMessage"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Manager"
+ send_member="AttachDevice"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ @@ -138,6 +178,10 @@
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Seat"
++ send_member="Terminate"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Seat"
+ send_member="ActivateSession"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ @@ -154,14 +198,30 @@
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Session"
++ send_member="Terminate"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Session"
+ send_member="Activate"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Session"
++ send_member="Lock"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Session"
++ send_member="Unlock"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Session"
+ send_member="SetIdleHint"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Session"
++ send_member="Kill"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Session"
+ send_member="TakeControl"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ @@ -180,6 +240,14 @@
+ send_interface="org.freedesktop.login1.Session"
+ send_member="PauseDeviceComplete"/>
+
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.User"
++ send_member="Terminate"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.User"
++ send_member="Kill"/>
++
+ <allow receive_sender="org.freedesktop.login1"/>
+ </policy>
+
diff --git a/deps/elogind/rc.elogind b/deps/elogind/rc.elogind
new file mode 100644
index 0000000..b1adcaa
--- /dev/null
+++ b/deps/elogind/rc.elogind
@@ -0,0 +1,29 @@
+#
+# /etc/rc.d/rc.elogind
+# Initializes the elogind service on Slackware.
+#
+# Author:
+# Eric Hameleers <alien@slackware.com> 2016
+#
+# Description:
+# We use elogind (standalone subset extracted from systemd) instead of
+# systemd itself; so we need to initialize a systemd-like state.
+#
+# Note:
+# Slackware has a tmpfs mounted on /run (see rc.S).
+#
+
+# The systemd/elogind state directory:
+mkdir -p /run/systemd
+chmod 0755 /run/systemd
+
+# Toplevel directory for runtime user session data:
+mkdir -p /run/user
+chmod 1777 /run/user
+
+# Elogind uses cgroups to organize processes like mapping PIDs to sessions.
+# Elogind's cgroup hierarchy isn't associated with any resource controller
+# ("subsystem") so we must create it manually:
+mkdir -p /sys/fs/cgroup/elogind
+mount -t cgroup -o none,name=elogind elogind /sys/fs/cgroup/elogind
+
diff --git a/deps/elogind/slack-desc b/deps/elogind/slack-desc
new file mode 100644
index 0000000..81db522
--- /dev/null
+++ b/deps/elogind/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+elogind: elogind (logind extracted from systemd)
+elogind:
+elogind: elogind is the systemd project's logind, extracted to a standalone
+elogind: package.
+elogind:
+elogind:
+elogind:
+elogind:
+elogind:
+elogind: Homepage: https://github.com/wingo/elogind
+elogind:
diff --git a/deps/mesa/get-mesa.sh b/deps/mesa/get-mesa.sh
new file mode 100755
index 0000000..b883299
--- /dev/null
+++ b/deps/mesa/get-mesa.sh
@@ -0,0 +1,20 @@
+# Pull a stable branch + patches
+BRANCH=7.10
+
+rm -rf mesa
+git clone git://anongit.freedesktop.org/git/mesa/mesa
+# package the source archive and clean up:
+( cd mesa
+ git checkout $BRANCH || exit 1
+)
+HEADISAT="$(cat mesa/.git/packed-refs | grep "refs/remotes/origin/${BRANCH}$" | cut -b1-7)"
+# Cleanup. We're not packing up the whole git repo.
+( cd mesa && find . -type d -name ".git*" -exec rm -rf {} \; 2> /dev/null )
+DATE=$(date +%Y%m%d)
+mv mesa mesa-${BRANCH}_${HEADISAT}
+tar cf mesa-${BRANCH}_${HEADISAT}.tar mesa-${BRANCH}_${HEADISAT}
+xz -9 mesa-${BRANCH}_${HEADISAT}.tar
+rm -rf mesa-${BRANCH}_${HEADISAT}
+echo
+echo "Mesa branch $BRANCH with HEAD at $HEADISAT packaged as mesa-${BRANCH}_${HEADISAT}.tar.xz"
+echo
diff --git a/deps/mesa/mesa.SlackBuild b/deps/mesa/mesa.SlackBuild
new file mode 100755
index 0000000..24f1b3d
--- /dev/null
+++ b/deps/mesa/mesa.SlackBuild
@@ -0,0 +1,188 @@
+#!/bin/sh
+
+# Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2013, 2014, 2015, 2016 Patrick J. Volkerding, Sebeka, MN, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 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 AUTHOR 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.
+
+PKGNAM=mesa
+VERSION=${VERSION:-12.0.1}
+DEMOVERS=${DEMOVERS:-8.3.0}
+BUILD=${BUILD:-1}
+
+NUMJOBS=${NUMJOBS:--j7}
+
+# Be sure this list is up-to-date:
+DRI_DRIVERS="i915,i965,nouveau,r200,radeon,swrast"
+GALLIUM_DRIVERS="nouveau,r300,r600,svga,radeonsi,swrast"
+EGL_PLATFORMS="drm,x11,wayland"
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i586 ;;
+ arm*) export ARCH=arm ;;
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-mesa
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+rm -rf $PKG
+mkdir -p $TMP $PKG
+cd $TMP
+rm -rf ${PKGNAM}-${VERSION}
+
+tar xvf $CWD/${PKGNAM}-${VERSION}.tar.xz || exit 1
+cd ${PKGNAM}-$VERSION
+
+# Let's kill the warning about operating on a dangling symlink:
+rm -f src/gallium/state_trackers/d3d1x/w32api
+
+# Make sure ownerships and permissions are sane:
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+# Apply patches from git (and maybe elsewhere):
+# Patches obtained by:
+# git checkout origin/11.2
+# git format-patch 5de088f7da75cc0209ff1602ed70aff14f733e4b # 11.2.2 release
+if /bin/ls $CWD/patches/*.patch 1> /dev/null 2> /dev/null ; then
+ for patch in $CWD/patches/*.patch ; do
+ patch -p1 < $patch || exit 1 ;
+ done
+fi
+
+# Don't worry if Mako is not present:
+#sed -i "s,AX_CHECK_PYTHON_MAKO_MODULE(\$PYTHON_MAKO_REQUIRED),,g" configure.ac
+zcat $CWD/mesa.no.mako.diff.gz | patch -p1 --verbose || exit 1
+
+# This doesn't fully do the trick. See below. ;-)
+#./autogen.sh
+
+# Fix detection of libLLVM when built with CMake
+sed -i 's/LLVM_SO_NAME=.*/LLVM_SO_NAME=LLVM/' configure.ac
+
+# Seems to need this to avoid tripping over a different libtool version:
+autoreconf -fi
+
+CFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --mandir=/usr/man \
+ --docdir=/usr/doc/${PKGNAM}-$VERSION \
+ --with-dri-driverdir=/usr/lib${LIBDIRSUFFIX}/xorg/modules/dri \
+ --with-dri-drivers="$DRI_DRIVERS" \
+ --with-gallium-drivers="$GALLIUM_DRIVERS" \
+ --with-egl-platforms="$EGL_PLATFORMS" \
+ --enable-gallium-llvm \
+ --enable-llvm-shared-libs \
+ --enable-egl \
+ --enable-texture-float \
+ --enable-shared-glapi \
+ --enable-xa \
+ --enable-nine \
+ --enable-osmesa \
+ --enable-dri \
+ --enable-dri3 \
+ --enable-gbm \
+ --enable-glx \
+ --enable-glx-tls \
+ --enable-gles1 \
+ --enable-gles2 \
+ --enable-vdpau \
+ --build=$ARCH-slackware-linux
+
+# This is autodetected anyway:
+# --enable-va \
+
+make $NUMJOBS || make || exit 1
+make install DESTDIR=$PKG || exit 1
+
+# Now install the demos
+( cd $TMP
+ rm -rf mesa-demos-$DEMOVERS
+ tar xvf $CWD/mesa-demos-$DEMOVERS.tar.?z* || exit 1
+ cd mesa-demos-$DEMOVERS
+ chown -R root:root .
+ find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+ CFLAGS="$SLKCFLAGS" \
+ ./configure \
+ --prefix=/usr \
+ --build=$ARCH-slackware-linux
+ # Build and install gears and glinfo, as well as a few other demos
+ make -C src/demos gears glinfo
+ make -C src/xdemos \
+ glthreads glxcontexts glxdemo glxgears glxgears_fbconfig \
+ glxheads glxinfo glxpbdemo glxpixmap
+ mkdir -p $PKG/usr/bin
+ cp -a src/demos/{gears,glinfo} $PKG/usr/bin
+ for i in glthreads glxcontexts glxdemo glxgears glxgears_fbconfig \
+ glxheads glxinfo glxpbdemo glxpixmap ; do
+ cp -a src/xdemos/$i $PKG/usr/bin ;
+ done
+)
+
+# Strip binaries:
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+
+# Compress info files, if any:
+if [ -d $PKG/usr/info ]; then
+ rm -f $PKG/usr/info/dir
+ gzip -9 $PKG/usr/info/*
+fi
+
+mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION/html
+cp -a \
+ docs/COPYING* docs/relnotes/relnotes-${VERSION}*.html docs/README* docs/GL* \
+ $PKG/usr/doc/$PKGNAM-$VERSION
+cp -a docs/*.html $PKG/usr/doc/$PKGNAM-$VERSION/html
+rm -f $PKG/usr/doc/$PKGNAM-$VERSION/html/relnotes*.html
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz
+
diff --git a/deps/mesa/mesa.no.mako.diff.gz b/deps/mesa/mesa.no.mako.diff.gz
new file mode 100644
index 0000000..ab6aa29
--- /dev/null
+++ b/deps/mesa/mesa.no.mako.diff.gz
Binary files differ
diff --git a/deps/mesa/mesa.url b/deps/mesa/mesa.url
new file mode 100644
index 0000000..3f30cc8
--- /dev/null
+++ b/deps/mesa/mesa.url
@@ -0,0 +1,2 @@
+ftp://ftp.freedesktop.org/pub/mesa/
+ftp://ftp.freedesktop.org/pub/mesa/demos/
diff --git a/deps/mesa/slack-desc b/deps/mesa/slack-desc
new file mode 100644
index 0000000..113964b
--- /dev/null
+++ b/deps/mesa/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+mesa: mesa (a 3-D graphics library)
+mesa:
+mesa: Mesa is a 3-D graphics library with an API very similar to that of
+mesa: another well-known 3-D graphics library. :-) The Mesa libraries are
+mesa: used by X to provide both software and hardware accelerated graphics.
+mesa:
+mesa: Mesa was written by Brian Paul.
+mesa:
+mesa:
+mesa:
+mesa:
diff --git a/deps/xorg-server/patches/x11.startwithblackscreen.diff b/deps/xorg-server/patches/x11.startwithblackscreen.diff
new file mode 100644
index 0000000..8c0e3b5
--- /dev/null
+++ b/deps/xorg-server/patches/x11.startwithblackscreen.diff
@@ -0,0 +1,14 @@
+diff -Nur xorg-server-1.12.1.orig/dix/window.c xorg-server-1.12.1/dix/window.c
+--- xorg-server-1.12.1.orig/dix/window.c 2012-03-29 21:57:25.000000000 -0500
++++ xorg-server-1.12.1/dix/window.c 2012-04-13 22:01:24.456073603 -0500
+@@ -145,8 +145,8 @@
+
+ Bool bgNoneRoot = FALSE;
+
+-static unsigned char _back_lsb[4] = { 0x88, 0x22, 0x44, 0x11 };
+-static unsigned char _back_msb[4] = { 0x11, 0x44, 0x22, 0x88 };
++static unsigned char _back_lsb[4] = { 0x00, 0x00, 0x00, 0x00 };
++static unsigned char _back_msb[4] = { 0x00, 0x00, 0x00, 0x00 };
+
+ static Bool WindowParentHasDeviceCursor(WindowPtr pWin,
+ DeviceIntPtr pDev, CursorPtr pCurs);
diff --git a/deps/xorg-server/patches/xorg-server.combo.mouse.keyboard.layout.patch b/deps/xorg-server/patches/xorg-server.combo.mouse.keyboard.layout.patch
new file mode 100644
index 0000000..83f6730
--- /dev/null
+++ b/deps/xorg-server/patches/xorg-server.combo.mouse.keyboard.layout.patch
@@ -0,0 +1,49 @@
+--- b/Xi/exevents.c 2013-12-27 19:38:52.000000000 +0200
++++ a/Xi/exevents.c 2014-03-04 19:44:15.228721619 +0200
+@@ -665,7 +665,8 @@
+ DeepCopyFeedbackClasses(from, to);
+
+ if ((dce->flags & DEVCHANGE_KEYBOARD_EVENT))
+- DeepCopyKeyboardClasses(from, to);
++ /* We need to copy to MASTER_KEYBOARD. Didn't worked with 'to'. */
++ DeepCopyKeyboardClasses(from, GetMaster(from, MASTER_KEYBOARD));
+ if ((dce->flags & DEVCHANGE_POINTER_EVENT))
+ DeepCopyPointerClasses(from, to);
+ }
+--- b/dix/getevents.c 2013-12-27 19:38:52.000000000 +0200
++++ a/dix/getevents.c 2014-03-04 19:46:50.126336327 +0200
+@@ -706,12 +706,19 @@
+ {
+ DeviceIntPtr master;
+
+- master =
+- GetMaster(dev,
+- (type & DEVCHANGE_POINTER_EVENT) ? MASTER_POINTER :
+- MASTER_KEYBOARD);
++ /* Don't guess the master upon the event type. Use MASTER_ATTACHED,
++ * otherwise we'll never get a DeviceChangedEvent(reason:SlaveSwith). */
++ master = GetMaster(dev, MASTER_ATTACHED);
++ /* Need to track the slave event type. Other we'le never get a
++ * DeviceChangedEvent(reason:SlaveSwith) for the 'keyboard' if the
++ * 'pointer' has been touched before. */
++ int slave_type = (type & DEVCHANGE_KEYBOARD_EVENT) |
++ (type & DEVCHANGE_POINTER_EVENT);
+
+- if (master && master->last.slave != dev) {
++ if (master &&
++ ((master->last.slave != dev) ||
++ (master->last.slave == dev && master->last.slave_type != slave_type))) {
++ master->last.slave_type = slave_type;
+ CreateClassesChangedEvent(events, master, dev,
+ type | DEVCHANGE_SLAVE_SWITCH);
+ if (IsPointerDevice(master)) {
+--- b/include/inputstr.h 2013-12-27 19:38:52.000000000 +0200
++++ a/include/inputstr.h 2014-03-04 19:47:28.074051116 +0200
+@@ -577,6 +577,7 @@
+ double valuators[MAX_VALUATORS];
+ int numValuators;
+ DeviceIntPtr slave;
++ int slave_type;
+ ValuatorMask *scroll;
+ int num_touches; /* size of the touches array */
+ DDXTouchPointInfoPtr touches;
diff --git a/deps/xorg-server/slack-desc b/deps/xorg-server/slack-desc
new file mode 100644
index 0000000..9d25b40
--- /dev/null
+++ b/deps/xorg-server/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+xorg-server: xorg-server (The Xorg server, the core of the X Window System)
+xorg-server:
+xorg-server: Xorg is a full featured X server that was originally designed for UNIX
+xorg-server: and UNIX-like operating systems running on Intel x86 hardware. It now
+xorg-server: runs on a wider range of hardware and OS platforms. This work was
+xorg-server: derived by the X.Org Foundation from the XFree86 Project's XFree86
+xorg-server: 4.4rc2 release. The XFree86 release was originally derived from X386
+xorg-server: 1.2 by Thomas Roell which was contributed to X11R5 by Snitily Graphics
+xorg-server: Consulting Service.
+xorg-server:
+xorg-server: The home page for the X project is: http://www.x.org
diff --git a/deps/xorg-server/slack-descs/xorg-server b/deps/xorg-server/slack-descs/xorg-server
new file mode 100644
index 0000000..9d25b40
--- /dev/null
+++ b/deps/xorg-server/slack-descs/xorg-server
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+xorg-server: xorg-server (The Xorg server, the core of the X Window System)
+xorg-server:
+xorg-server: Xorg is a full featured X server that was originally designed for UNIX
+xorg-server: and UNIX-like operating systems running on Intel x86 hardware. It now
+xorg-server: runs on a wider range of hardware and OS platforms. This work was
+xorg-server: derived by the X.Org Foundation from the XFree86 Project's XFree86
+xorg-server: 4.4rc2 release. The XFree86 release was originally derived from X386
+xorg-server: 1.2 by Thomas Roell which was contributed to X11R5 by Snitily Graphics
+xorg-server: Consulting Service.
+xorg-server:
+xorg-server: The home page for the X project is: http://www.x.org
diff --git a/deps/xorg-server/slack-descs/xorg-server-xephyr b/deps/xorg-server/slack-descs/xorg-server-xephyr
new file mode 100644
index 0000000..640f3d1
--- /dev/null
+++ b/deps/xorg-server/slack-descs/xorg-server-xephyr
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|' on
+# the right side marks the last column you can put a character in. You must make
+# exactly 11 lines for the formatting to be correct. It's also customary to
+# leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+xorg-server-xephyr: xorg-server-xephyr (Improved nested X server/client)
+xorg-server-xephyr:
+xorg-server-xephyr: Xephyr is a nested X-Client like Xnest, but with some additional
+xorg-server-xephyr: features like XRender support.
+xorg-server-xephyr:
+xorg-server-xephyr:
+xorg-server-xephyr:
+xorg-server-xephyr:
+xorg-server-xephyr:
+xorg-server-xephyr:
+xorg-server-xephyr:
diff --git a/deps/xorg-server/slack-descs/xorg-server-xnest b/deps/xorg-server/slack-descs/xorg-server-xnest
new file mode 100644
index 0000000..393f93b
--- /dev/null
+++ b/deps/xorg-server/slack-descs/xorg-server-xnest
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|' on
+# the right side marks the last column you can put a character in. You must make
+# exactly 11 lines for the formatting to be correct. It's also customary to
+# leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+xorg-server-xnest: xorg-server-xnest (a nested X server)
+xorg-server-xnest:
+xorg-server-xnest: Xnest is an experimental nested server for X that acts as both a
+xorg-server-xnest: client and a server. Xnest is a client of the real server which
+xorg-server-xnest: manages windows and graphics requests on its behalf. Xnest is a
+xorg-server-xnest: server to its own clients. Xnest manages windows and graphics
+xorg-server-xnest: requests on their behalf. To these clients Xnest appears to be a
+xorg-server-xnest: conventional server.
+xorg-server-xnest:
+xorg-server-xnest:
+xorg-server-xnest:
diff --git a/deps/xorg-server/slack-descs/xorg-server-xvfb b/deps/xorg-server/slack-descs/xorg-server-xvfb
new file mode 100644
index 0000000..aff9c64
--- /dev/null
+++ b/deps/xorg-server/slack-descs/xorg-server-xvfb
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|' on
+# the right side marks the last column you can put a character in. You must make
+# exactly 11 lines for the formatting to be correct. It's also customary to
+# leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+xorg-server-xvfb: xorg-server-xvfb (virtual framebuffer X server)
+xorg-server-xvfb:
+xorg-server-xvfb: Xvfb is an X server that can run on machines with no display hardware
+xorg-server-xvfb: and no physical input devices. It emulates a dumb framebuffer using
+xorg-server-xvfb: virtual memory. The primary use of this server is intended to be
+xorg-server-xvfb: server testing. The mfb or cfb code for any depth can be exercised
+xorg-server-xvfb: with this server without the need for real hardware that supports the
+xorg-server-xvfb: desired depths. A secondary use is testing clients against unusual
+xorg-server-xvfb: depths and screen configurations.
+xorg-server-xvfb:
+xorg-server-xvfb:
diff --git a/deps/xorg-server/slack-descs/xorg-server-xwayland b/deps/xorg-server/slack-descs/xorg-server-xwayland
new file mode 100644
index 0000000..391dc49
--- /dev/null
+++ b/deps/xorg-server/slack-descs/xorg-server-xwayland
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|' on
+# the right side marks the last column you can put a character in. You must make
+# exactly 11 lines for the formatting to be correct. It's also customary to
+# leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+xorg-server-xwayland: xorg-server-xwayland (Wayland X server)
+xorg-server-xwayland:
+xorg-server-xwayland: Xwayland is an X server client package that provides an X server
+xorg-server-xwayland: running on top of wayland, using wayland input devices for input and
+xorg-server-xwayland: forwarding either the root window or individual top-level windows as
+xorg-server-xwayland: wayland surfaces.
+xorg-server-xwayland:
+xorg-server-xwayland:
+xorg-server-xwayland:
+xorg-server-xwayland:
+xorg-server-xwayland:
diff --git a/deps/xorg-server/xorg-server.SlackBuild b/deps/xorg-server/xorg-server.SlackBuild
new file mode 100755
index 0000000..93390c3
--- /dev/null
+++ b/deps/xorg-server/xorg-server.SlackBuild
@@ -0,0 +1,255 @@
+#!/bin/sh
+# Copyright 2007-2016 Patrick J. Volkerding, Sebeka, MN, USA
+# 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.
+# -----------------------------------------------------------------------------
+
+# Condensed from the modular x11.SlackBuild
+# 2016 by Eric Hameleers <alien@slackware.com>
+# Note: this package contains _all_ X servers. Not just Xorg, but also:
+# Xnest, Xephyr, Xvfb, Xwayland.
+
+PKGNAM=xorg-server
+VERSION=${VERSION:-1.18.4}
+BUILD=${BUILD:-1}
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-$PKGNAM
+
+if [ -e $CWD/machine.conf ]; then
+ . $CWD/machine.conf ]
+elif [ -e /etc/slackbuild/machine.conf ]; then
+ . /etc/slackbuild/machine.conf ]
+else
+ # Automatically determine the architecture we're building on:
+ MARCH=$( uname -m )
+ if [ -z "$ARCH" ]; then
+ case "$MARCH" in
+ i?86) export ARCH=i486 ;;
+ arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7hl ;;
+ # 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" = "armv7hl" ]; then
+ SLKCFLAGS="-O3 -march=armv7-a -mfpu=vfpv3-d16"
+ LIBDIRSUFFIX=""
+ elif [ "$ARCH" = "arm" ]; then
+ SLKCFLAGS="-O2 -march=armv5te"
+ LIBDIRSUFFIX=""
+ else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+ fi
+fi
+
+case "$ARCH" in
+ arm*) TARGET=$ARCH-slackware-linux-gnueabi ;;
+ *) TARGET=$ARCH-slackware-linux ;;
+esac
+
+rm -rf $PKG
+mkdir -p $TMP $PKG
+cd $TMP
+rm -rf $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1
+cd $PKGNAM-$VERSION || exit 1
+
+# Apply patches:
+cat $CWD/patches/x11.startwithblackscreen.diff | patch -p1 --verbose || exit 1
+cat $CWD/patches/xorg-server.combo.mouse.keyboard.layout.patch | patch -p1 --verbose || exit 1
+
+# Make sure ownerships and permissions are sane:
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+# Servers to build:
+BUILD_SERVERS=" \
+ --enable-xorg \
+ --enable-dmx \
+ --enable-xvfb \
+ --enable-xnest \
+ --enable-glamor \
+ --enable-kdrive \
+ --enable-xephyr \
+ --enable-xfbdev \
+ --enable-xwayland \
+ --enable-config-udev \
+ --enable-kdrive-evdev \
+ --enable-kdrive-kbd \
+ --enable-kdrive-mouse \
+ --disable-config-hal \
+ --disable-systemd-logind"
+
+#MESA_VERSION=${MESA_VERSION:-7.5} # unused in 1.7+
+
+# 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"
+
+# Reconf (don't remove this plz):
+autoreconf -vif
+
+CFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --infodir=/usr/info \
+ --mandir=/usr/man \
+ --disable-static \
+ --with-pic \
+ --enable-suid-wrapper \
+ --with-int10=x86emu \
+ --with-default-font-path="${DEF_FONTPATH}" \
+ --with-module-dir=/usr/lib${LIBDIRSUFFIX}/xorg/modules \
+ --with-os-name="Slackware 14.2 current" \
+ --with-os-vendor="Slackware Linux Project" \
+ --with-xkb-path=/etc/X11/xkb \
+ --with-xkb-output=/var/lib/xkb \
+ $BUILD_SERVERS \
+ --build=$TARGET
+
+# --with-dri-driver-path=/usr/lib${LIBDIRSUFFIX}/xorg/modules/dri
+
+if [ "$ARCH" = "x86_64" ]; then
+ # To prevent the error "No rule to make target `-ldl'"
+ sed -i -e 's#-ldl##' hw/xfree86/Makefile
+ sed -i -e 's#-lm#-lm -ldl#' hw/xfree86/Makefile
+fi
+
+# Build and install:
+make || exit 1
+make install DESTDIR=$PKG || exit 1
+
+# Fix suid setting, Makefile gets the order of install and chmod wrong:
+chmod u+s $PKG/usr/libexec/Xorg.wrap
+
+# Create the configuration directories for xorg-server 1.9.x
+mkdir -p $PKG/etc/X11/xorg.conf.d $PKG/usr/share/X11/xorg.conf.d
+
+# Create a sample keyboard layout
+# Enable zapping by default
+cat << EOF > $PKG/usr/share/X11/xorg.conf.d/90-keyboard-layout.conf
+Section "InputClass"
+ Identifier "keyboard-all"
+ MatchIsKeyboard "on"
+ MatchDevicePath "/dev/input/event*"
+ Driver "evdev"
+ Option "XkbLayout" "us"
+ #Option "XkbVariant" ""
+ Option "XkbOptions" "terminate:ctrl_alt_bksp"
+EndSection
+
+# READ THIS FOR CUSTOM KEYBOARD INFORMATION
+#
+# If you want to add a custom model/layout/variant to X, you will need to COPY
+# this file to /etc/X11/xorg.conf.d/ and edit that copy. After editing it to
+# suit, you will need to restart X.
+#
+# Here's an example of the lines from above:
+#
+# Section "InputClass"
+# Identifier "keyboard-all"
+# MatchIsKeyboard "on"
+# MatchDevicePath "/dev/input/event*"
+# Driver "evdev"
+# Option "XkbLayout" "us"
+# Option "XkbVariant" "intl"
+# Option "XkbOptions" "compose:rwin,terminate:ctrl_alt_bksp"
+# EndSection
+#
+# Many desktop environments, including KDE and Xfce, have their own methods to
+# configure keyboard layouts and such if you'd like to use them.
+#
+# If you prefer to use the "old" way of configuring keyboards (without input
+# device hotplugging), then you'll need to add the following lines to the
+# ServerFlags section of /etc/X11/xorg.conf:
+# Option "AllowEmptyInput" "false"
+# Option "AutoAddDevices" "false"
+# Option "AutoEnableDevices" "false"
+# Alternatively, you can break this up into separate "stubs" in the xorg.conf.d/
+# directory, but that's your call. Assuming you elect to keep a monolithic
+# /etc/X11/xorg.conf file, you can now edit the Keyboard section as usual.
+
+EOF
+
+# Don't mess with my /var/log/ permissions:
+rmdir $PKG/var/log 2>/dev/null
+rmdir $PKG/var 2>/dev/null
+
+# While I hate to have X11 take over another generic-sounding
+# piece of prime filesystem real estate, this symlink will
+# direct (for now) proprietary X drivers into the corrent
+# location:
+
+( cd $PKG/usr/lib${LIBDIRSUFFIX}
+ rm -rf modules
+ ln -sf xorg/modules .
+)
+
+# Strip binaries:
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | \
+ grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+# Compress and link manpages, if any:
+if [ -d $PKG/usr/man ]; then
+ ( cd $PKG/usr/man
+ for manpagedir in $(find . -type d -name "man*") ; do
+ ( cd $manpagedir
+ for eachpage in $( find . -type l -maxdepth 1) ; do
+ ln -s $( readlink $eachpage ).gz $eachpage.gz
+ rm $eachpage
+ done
+ gzip -9 *.?
+ )
+ done
+ )
+fi
+
+# Add documentation:
+mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
+cp -a \
+ COPYING ChangeLog INSTALL README TODO \
+ $PKG/usr/doc/$PKGNAM-$VERSION
+
+# Add a description:
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+# Create the package:
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
+