summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
Diffstat (limited to 'extra')
-rw-r--r--extra/dovecot/PKGBUILD6
-rw-r--r--extra/freetype2/PKGBUILD13
-rw-r--r--extra/glibmm/PKGBUILD20
-rw-r--r--extra/lua/PKGBUILD26
-rw-r--r--extra/mesa/PKGBUILD32
-rw-r--r--extra/oxygen-gtk/PKGBUILD6
-rw-r--r--extra/rasqal/PKGBUILD11
-rw-r--r--extra/telepathy-farstream/PKGBUILD10
-rw-r--r--extra/varnish/PKGBUILD9
-rw-r--r--extra/xf86-input-joystick/PKGBUILD11
-rw-r--r--extra/xf86-input-joystick/git-fixes.patch399
-rw-r--r--extra/xorg-server/PKGBUILD20
-rw-r--r--extra/xorg-server/Xi-allow-passive-keygrabs-on-the-XIAll-Master-Device.patch31
-rw-r--r--extra/xorg-server/git-fixes.patch44
-rw-r--r--extra/xorg-server/xserver-1.11.2-record-crasher.patch241
15 files changed, 815 insertions, 64 deletions
diff --git a/extra/dovecot/PKGBUILD b/extra/dovecot/PKGBUILD
index de9dfa97b..5589facb8 100644
--- a/extra/dovecot/PKGBUILD
+++ b/extra/dovecot/PKGBUILD
@@ -1,11 +1,11 @@
-# $Id: PKGBUILD 138194 2011-09-18 13:49:40Z andyrtr $
+# $Id: PKGBUILD 142912 2011-11-18 08:18:50Z andyrtr $
# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Contributor: Paul Mattal <paul@mattal.com>
# Contributor: Federico Quagliata (quaqo) <quaqo@despammed.com>
# Contributor: GARETTE Emmanuel <gnunux at laposte dot net>
pkgname=dovecot
-pkgver=2.0.15
+pkgver=2.0.16
pkgrel=1
pkgdesc="An IMAP and POP3 server written with security primarily in mind"
arch=('i686' 'x86_64')
@@ -25,7 +25,7 @@ backup=(etc/dovecot/dovecot.conf
etc/ssl/dovecot-openssl.cnf)
install=$pkgname.install
source=(http://dovecot.org/releases/2.0/${pkgname}-${pkgver}.tar.gz dovecot.sh)
-md5sums=('16a08dfd24422d482440a8b03d6f7f6c'
+md5sums=('e01a29a355afefcb9fb5f8b7a54e1a14'
'587159e84e2da6f83d70b3c706ba87cc')
build() {
diff --git a/extra/freetype2/PKGBUILD b/extra/freetype2/PKGBUILD
index c7094a53a..66b741634 100644
--- a/extra/freetype2/PKGBUILD
+++ b/extra/freetype2/PKGBUILD
@@ -1,19 +1,19 @@
-# $Id: PKGBUILD 141107 2011-10-24 08:04:06Z jgc $
+# $Id: PKGBUILD 142921 2011-11-18 09:26:09Z andyrtr $
# Maintainer: Jan de Groot <jgc@archlinux.org>
pkgname=freetype2
-pkgver=2.4.7
+pkgver=2.4.8
pkgrel=1
pkgdesc="TrueType font rendering library"
arch=(i686 x86_64)
license=('GPL')
url="http://freetype.sourceforge.net"
-depends=('zlib')
+depends=('zlib' 'bzip2' 'sh')
options=('!libtool')
source=(http://downloads.sourceforge.net/sourceforge/freetype/freetype-${pkgver}.tar.bz2
freetype-2.3.0-enable-spr.patch
freetype-2.2.1-enable-valid.patch)
-md5sums=('dbadce8f0c5e70a0b7c51eadf2dd9394'
+md5sums=('dbf2caca1d3afd410a29217a9809d397'
'816dc8619a6904a7385769433c0a8653'
'214119610444c9b02766ccee5e220680')
@@ -26,6 +26,11 @@ build() {
make
}
+check() {
+ cd "${srcdir}/freetype-${pkgver}"
+ make -k check
+}
+
package() {
cd "${srcdir}/freetype-${pkgver}"
make DESTDIR="${pkgdir}" install
diff --git a/extra/glibmm/PKGBUILD b/extra/glibmm/PKGBUILD
index a6a64bcc5..dd8fce6d2 100644
--- a/extra/glibmm/PKGBUILD
+++ b/extra/glibmm/PKGBUILD
@@ -1,21 +1,21 @@
-# $Id: PKGBUILD 139277 2011-10-01 18:57:17Z ibiru $
+# $Id: PKGBUILD 142936 2011-11-18 15:46:22Z ibiru $
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
pkgbase=glibmm
pkgname=('glibmm' 'glibmm-docs')
-pkgver=2.30.0
+pkgver=2.30.1
pkgrel=1
arch=('i686' 'x86_64')
license=('LGPL')
makedepends=('glib2' 'libsigc++2.0' 'pkgconfig')
-source=(http://ftp.gnome.org/pub/GNOME/sources/${pkgname}/${pkgver%.*}/${pkgname}-${pkgver}.tar.xz)
+source=(http://ftp.gnome.org/pub/GNOME/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz)
options=('!libtool')
-url="http://gtkmm.sourceforge.net/"
-sha256sums=('a7ad3fc34c2ba108511738a6ecbf9396edeb26776b2f9b5f4490551509ee0db4')
+url="http://www.gtkmm.org/"
+sha256sums=('69582b584666cab1dc4253faffee548054730bc058e28466871e6a954d7ff897')
build() {
- cd "${srcdir}/${pkgname}-${pkgver}"
+ cd "$srcdir/$pkgname-$pkgver"
./configure --prefix=/usr
make
}
@@ -23,13 +23,13 @@ build() {
package_glibmm() {
pkgdesc="Glib-- (glibmm) is a C++ interface for glib"
depends=('glib2' 'libsigc++2.0')
- cd "${srcdir}/${pkgbase}-${pkgver}"
+ cd "$srcdir/$pkgbase-$pkgver"
sed -i -e 's/^doc_subdirs/#doc_subdirs/' Makefile
- make DESTDIR="${pkgdir}" install
+ make DESTDIR="$pkgdir" install
}
package_glibmm-docs() {
pkgdesc="Developer documentation for glibmm"
- cd "${srcdir}/${pkgbase}-${pkgver}/docs"
- make DESTDIR="${pkgdir}" install
+ cd "$srcdir/$pkgbase-$pkgver/docs"
+ make DESTDIR="$pkgdir" install
}
diff --git a/extra/lua/PKGBUILD b/extra/lua/PKGBUILD
index 871d8f655..2020b0270 100644
--- a/extra/lua/PKGBUILD
+++ b/extra/lua/PKGBUILD
@@ -1,30 +1,30 @@
-# $Id: PKGBUILD 138070 2011-09-16 01:15:44Z eric $
+# $Id: PKGBUILD 142952 2011-11-19 04:33:22Z eric $
# Maintainer: Juergen Hoetzel <juergen@archlinux.org>
# Contributor: Damir Perisa <damir.perisa@bluewin.ch>
pkgname=lua
pkgver=5.1.4
-pkgrel=8
-pkgdesc="A powerful light-weight programming language designed for extending applications."
+pkgrel=9
+_patchver=5.1.4-4
+pkgdesc="A powerful light-weight programming language designed for extending applications"
arch=('i686' 'x86_64')
url="http://www.lua.org/"
depends=('readline')
license=('MIT')
options=('!makeflags' '!emptydirs')
-source=("http://www.lua.org/ftp/${pkgname}-${pkgver}.tar.gz"
- 'http://www.lua.org/ftp/patch-lua-5.1.4-3'
- 'lua-arch.patch'
- 'lua-5.1-cflags.diff')
+source=(http://www.lua.org/ftp/${pkgname}-${pkgver}.tar.gz
+ http://www.lua.org/ftp/patch-lua-${_patchver}
+ lua-arch.patch lua-5.1-cflags.diff)
md5sums=('d0870f2de55d59c1c8419f36e8fac150'
- '998ef7886183f61d3a5ca891a9ce6a79'
+ '329d8695e3e6f1267190e220559f7b6c'
'6c5953f63904bf20a0183cdab05b80de'
'249582bf1fd861ccf492d2c35a9fe732')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
+ patch -p0 -i "${srcdir}/patch-lua-${_patchver}" -d src
patch -p1 -i "${srcdir}/lua-arch.patch"
- patch -i "${srcdir}/patch-lua-5.1.4-3" -d src
- [ "$CARCH" == "x86_64" ] && patch -Np1 -i ../lua-5.1-cflags.diff
+ [ "$CARCH" == "x86_64" ] && patch -p1 -i "${srcdir}/lua-5.1-cflags.diff"
[ "$CARCH" == "x86_64" ] && export CFLAGS="$CFLAGS -fPIC"
make INSTALL_DATA="cp -d" TO_LIB="liblua.a liblua.so liblua.so.5.1" LUA_SO=liblua.so \
INSTALL_TOP="${pkgdir}/usr" INSTALL_MAN="${pkgdir}/usr/share/man/man1" \
@@ -36,10 +36,10 @@ package() {
make INSTALL_DATA="cp -d" TO_LIB="liblua.a liblua.so liblua.so.5.1" LUA_SO=liblua.so \
INSTALL_TOP="${pkgdir}/usr" INSTALL_MAN="${pkgdir}/usr/share/man/man1" \
install
- install -D -m 644 etc/lua.pc "${pkgdir}/usr/lib/pkgconfig/lua.pc"
+ install -D -m644 etc/lua.pc "${pkgdir}/usr/lib/pkgconfig/lua.pc"
install -D -m644 COPYRIGHT "${pkgdir}/usr/share/licenses/${pkgname}/COPYRIGHT"
# Install the documentation
- mkdir -p "${pkgdir}/usr/share/doc/lua"
- cp -R doc/* "${pkgdir}/usr/share/doc/lua"
+ install -d "${pkgdir}/usr/share/doc/lua"
+ install -m644 doc/*.{gif,png,css,html} "${pkgdir}/usr/share/doc/lua"
}
diff --git a/extra/mesa/PKGBUILD b/extra/mesa/PKGBUILD
index a13c53003..bb7e6c83f 100644
--- a/extra/mesa/PKGBUILD
+++ b/extra/mesa/PKGBUILD
@@ -1,9 +1,9 @@
-# $Id: PKGBUILD 141617 2011-10-31 20:42:28Z andyrtr $
+# $Id: PKGBUILD 142908 2011-11-18 07:55:25Z andyrtr $
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Maintainer: Andreas Radke <andyrtr@archlinux.org>
pkgbase=mesa
-pkgname=('mesa' 'libgl' 'libglapi' 'libgles' 'libegl' 'ati-dri' 'intel-dri' 'unichrome-dri' 'mach64-dri' 'mga-dri' 'r128-dri' 'savage-dri' 'sis-dri' 'tdfx-dri' 'nouveau-dri') # 'llvm-dri')
+pkgname=('mesa' 'libgl' 'libglapi' 'libgles' 'libegl' 'khrplatform-devel' 'ati-dri' 'intel-dri' 'unichrome-dri' 'mach64-dri' 'mga-dri' 'r128-dri' 'savage-dri' 'sis-dri' 'tdfx-dri' 'nouveau-dri') # 'llvm-dri')
# prepare 7.12/8.0
#pkgname=('mesa' 'libgl' 'libglapi' 'libgles' 'libegl' 'ati-dri' 'intel-dri' 'nouveau-dri') # 'llvm-dri')
@@ -15,9 +15,9 @@ if [ "${_git}" = "true" ]; then
#pkgver=7.10.99.git20110709
pkgver=7.11
else
- pkgver=7.11
+ pkgver=7.11.1
fi
-pkgrel=4
+pkgrel=1
arch=('i686' 'x86_64')
makedepends=('glproto>=1.4.14' 'libdrm>=2.4.26' 'libxxf86vm>=1.1.1' 'libxdamage>=1.1.3' 'expat>=2.0.1' 'libx11>=1.4.3' 'libxt>=1.1.1'
'gcc-libs>=4.6.1' 'dri2proto>=2.6' 'python2' 'libxml2' 'imake' 'llvm' 'udev')
@@ -29,12 +29,12 @@ if [ "${_git}" = "true" ]; then
#source=(${source[@]} 'ftp://ftp.archlinux.org/other/mesa/mesa-1ae00c5960af83bea9545a18a1754bad83d5cbd0.tar.bz2')
source=(${source[@]} "MesaLib-git${_gitdate}.zip"::"http://cgit.freedesktop.org/mesa/mesa/snapshot/mesa-ef9f16f6322a89fb699fbe3da868b10f9acaef98.tar.bz2")
else
- #source=(${source[@]} "ftp://ftp.freedesktop.org/pub/mesa/${pkgver}/MesaLib-${pkgver}.tar.bz2"
- source=(${source[@]} "MesaLib-git${_gitdate}.zip"::"http://cgit.freedesktop.org/mesa/mesa/snapshot/mesa-4464ee1a9aa3745109cee23531e3fb2323234d07.tar.bz2"
+ source=(${source[@]} "ftp://ftp.freedesktop.org/pub/mesa/${pkgver}/MesaLib-${pkgver}.tar.bz2"
+ #source=(${source[@]} "MesaLib-git${_gitdate}.zip"::"http://cgit.freedesktop.org/mesa/mesa/snapshot/mesa-4464ee1a9aa3745109cee23531e3fb2323234d07.tar.bz2"
)
fi
md5sums=('5c65a0fe315dd347e09b1f2826a1df5a'
- '774eb6f30b31fa08c04e16e00ca070e1')
+ 'a77307102cee844ff6544ffa8fafeac1')
build() {
cd ${srcdir}/?esa-*
@@ -114,7 +114,7 @@ package_libglapi() {
}
package_libgles() {
- depends=('libglapi')
+ depends=('libglapi' 'khrplatform-devel')
pkgdesc="Mesa GLES libraries and headers"
cd ${srcdir}/?esa-*
@@ -135,7 +135,7 @@ package_libgles() {
}
package_libegl() {
- depends=('libglapi' 'libdrm' 'libxext' 'libxfixes' 'udev')
+ depends=('libglapi' 'libdrm' 'libxext' 'libxfixes' 'udev' 'khrplatform-devel')
pkgdesc="Mesa EGL libraries and headers"
cd ${srcdir}/?esa-*
@@ -145,7 +145,6 @@ package_libegl() {
install -m755 -d "${pkgdir}/usr/include"
install -m755 -d "${pkgdir}/usr/include/"
install -m755 -d "${pkgdir}/usr/include/EGL"
- install -m755 -d "${pkgdir}/usr/include/KHR"
install -m755 -d "${pkgdir}/usr/share"
install -m755 -d "${pkgdir}/usr/share/doc"
install -m755 -d "${pkgdir}/usr/share/doc/libegl"
@@ -154,13 +153,24 @@ package_libegl() {
bin/minstall lib/egl/* "${pkgdir}/usr/lib/egl/"
bin/minstall src/egl/main/egl.pc "${pkgdir}/usr/lib/pkgconfig/"
bin/minstall include/EGL/* "${pkgdir}/usr/include/EGL/"
- bin/minstall include/KHR/khrplatform.h "${pkgdir}/usr/include/KHR/"
bin/minstall docs/egl.html "${pkgdir}/usr/share/doc/libegl/"
install -m755 -d "${pkgdir}/usr/share/licenses/libegl"
install -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/libegl/"
}
+package_khrplatform-devel() {
+ depends=('')
+ pkgdesc="Khronos platform development package"
+
+ cd ${srcdir}/?esa-*
+ install -m755 -d "${pkgdir}/usr/include/KHR"
+ bin/minstall include/KHR/khrplatform.h "${pkgdir}/usr/include/KHR/"
+
+ install -m755 -d "${pkgdir}/usr/share/licenses/khrplatform-devel"
+ install -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/khrplatform-devel/"
+}
+
package_mesa() {
depends=('libgl' 'libx11>=1.4.3' 'libxt>=1.1.1' 'gcc-libs>=4.6' 'dri2proto>=2.6' 'glproto>=1.4.14') #dri2proto + glproto needed for gl.pc
optdepends=('opengl-man-pages: for the OpenGL API man pages')
diff --git a/extra/oxygen-gtk/PKGBUILD b/extra/oxygen-gtk/PKGBUILD
index 03f661181..b577b8db9 100644
--- a/extra/oxygen-gtk/PKGBUILD
+++ b/extra/oxygen-gtk/PKGBUILD
@@ -1,9 +1,9 @@
-# $Id: PKGBUILD 140513 2011-10-16 08:02:52Z eric $
+# $Id: PKGBUILD 142925 2011-11-18 11:11:32Z andrea $
# Maintainer: Andrea Scarpino <andrea@archlinux.org>
# Contributor: birdflesh <antkoul at gmail dot com>
pkgname=oxygen-gtk
-pkgver=1.1.4
+pkgver=1.1.5
pkgrel=1
pkgdesc="Port of the default KDE widget theme (Oxygen) to GTK"
arch=('i686' 'x86_64')
@@ -12,7 +12,7 @@ license=('LGPL')
depends=('gtk2')
makedepends=('cmake')
source=("http://download.kde.org/stable/${pkgname}/${pkgver}/src/${pkgname}-${pkgver}.tar.bz2")
-md5sums=('61a7424e77785501df27b5c050e5f287')
+md5sums=('d20902809e634c820bebdfea49de19a1')
build() {
cd "${srcdir}"
diff --git a/extra/rasqal/PKGBUILD b/extra/rasqal/PKGBUILD
index d4c261db8..8a482fb92 100644
--- a/extra/rasqal/PKGBUILD
+++ b/extra/rasqal/PKGBUILD
@@ -1,10 +1,10 @@
-# $Id: PKGBUILD 136218 2011-08-24 20:33:47Z andyrtr $
+# $Id: PKGBUILD 142916 2011-11-18 08:48:56Z andyrtr $
# Maintainer: AndyRTR <andyrtr@archlinux.org>
# Contributor: Lawrence Lee <valheru@facticius.net>
pkgname=rasqal
epoch=1
-pkgver=0.9.27
+pkgver=0.9.28
pkgrel=1
pkgdesc="A free C library that handles Resource Description Framework (RDF) query syntaxes, query construction and query execution returning result bindings"
url="http://librdf.org/rasqal"
@@ -13,7 +13,7 @@ arch=('i686' 'x86_64')
depends=('raptor>=2.0.3' 'mpfr')
options=('!libtool')
source=(http://download.librdf.org/source/${pkgname}-${pkgver}.tar.gz)
-md5sums=('dd48b9a80947a6136fbdb79276d476e2')
+md5sums=('a3662b8d9efef9d8ef0a3c182450fba2')
build() {
cd ${srcdir}/${pkgname}-${pkgver}
@@ -23,6 +23,11 @@ build() {
make
}
+check() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make -k check || /bin/true # fails some checks - should be reported upstream
+}
+
package() {
cd ${srcdir}/${pkgname}-${pkgver}
make DESTDIR=${pkgdir} install
diff --git a/extra/telepathy-farstream/PKGBUILD b/extra/telepathy-farstream/PKGBUILD
index d31e534e9..a4354dac5 100644
--- a/extra/telepathy-farstream/PKGBUILD
+++ b/extra/telepathy-farstream/PKGBUILD
@@ -1,8 +1,8 @@
-# $Id: PKGBUILD 139433 2011-10-01 19:01:24Z ibiru $
+# $Id: PKGBUILD 142940 2011-11-18 18:23:32Z ibiru $
# Maintainer: Ionut Biru <ibiru@archlinux.org>
pkgname=telepathy-farstream
-pkgver=0.1.1
+pkgver=0.1.2
pkgrel=1
pkgdesc="A telepathy-backend to use stream engine."
arch=(i686 x86_64)
@@ -11,8 +11,8 @@ license=('LGPL2.1')
depends=('telepathy-glib' 'farsight2')
makedepends=('libxslt' 'python2')
options=('!libtool')
-source=(http://telepathy.freedesktop.org/releases/${pkgname}/${pkgname}-${pkgver}.tar.gz)
-md5sums=('da9179ee104bfb839cd813f66c23c066')
+source=(http://telepathy.freedesktop.org/releases/$pkgname/$pkgname-$pkgver.tar.gz)
+md5sums=('f858fc02e1981bb8ccd29c2bed567e50')
build() {
cd "$srcdir/$pkgname-$pkgver"
@@ -26,7 +26,7 @@ build() {
package() {
cd "$srcdir/$pkgname-$pkgver"
- make DESTDIR="$pkgdir/" install
+ make DESTDIR="$pkgdir" install
}
# vim:set ts=2 sw=2 et:
diff --git a/extra/varnish/PKGBUILD b/extra/varnish/PKGBUILD
index 05ab8890f..18ed8e7a4 100644
--- a/extra/varnish/PKGBUILD
+++ b/extra/varnish/PKGBUILD
@@ -5,20 +5,21 @@
# Contributor: Roberto Alsina <ralsina@kde.org>
pkgname=varnish
-pkgver=3.0.1
-pkgrel=1
+pkgver=3.0.2
+pkgrel=2
pkgdesc="High-performance HTTP accelerator"
arch=('i686' 'x86_64')
url="http://www.varnish-cache.org/"
license=('BSD')
depends=('gcc' 'libedit' 'pcre')
-backup=('etc/conf.d/varnish')
+backup=('etc/conf.d/varnish'
+ 'etc/varnish/default.vcl')
install=$pkgname.install
options=('!libtool')
source=("http://repo.varnish-cache.org/source/$pkgname-$pkgver.tar.gz"
"$pkgname.conf.d"
"rc.$pkgname")
-md5sums=('d01d9c1f2da2b2a1b18299a0b44c8580'
+md5sums=('c8eae0aabbe66b6daabdf3a1f58cd47a'
'd42eebc7f0ac429d9740125ff1e61daf'
'18b7747020ecfe2eac7445971a7014e3')
diff --git a/extra/xf86-input-joystick/PKGBUILD b/extra/xf86-input-joystick/PKGBUILD
index f908ac10f..7badf2933 100644
--- a/extra/xf86-input-joystick/PKGBUILD
+++ b/extra/xf86-input-joystick/PKGBUILD
@@ -1,25 +1,28 @@
-# $Id: PKGBUILD 140358 2011-10-11 21:29:48Z jgc $
+# $Id: PKGBUILD 142923 2011-11-18 09:36:49Z jgc $
# Maintainer: Jan de Groot <jgc@archlinux.org>
pkgname=xf86-input-joystick
pkgver=1.6.0
-pkgrel=2
+pkgrel=3
pkgdesc="X.Org Joystick input driver"
arch=(i686 x86_64)
url="http://xorg.freedesktop.org/"
license=('custom')
depends=('glibc')
-makedepends=('xorg-server-devel>=1.10.99.902')
-conflicts=('xorg-server<1.10.99.902')
+makedepends=('xorg-server-devel>=1.11.0')
+conflicts=('xorg-server<1.11.0')
groups=('xorg-drivers' 'xorg')
options=('!libtool')
source=(${url}/releases/individual/driver/${pkgname}-${pkgver}.tar.bz2
+ git-fixes.patch
50-joystick.conf)
sha1sums=('3b9aed1b8128e1fbd947fdcdd5e16efccad1c780'
+ '7812a34013a2333641bd7c5d044c46179490cb32'
'e1ff3699a0470c6bb78a53f718df9d8521621e11')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
+ patch -Np1 -i "${srcdir}/git-fixes.patch"
./configure --prefix=/usr
make
}
diff --git a/extra/xf86-input-joystick/git-fixes.patch b/extra/xf86-input-joystick/git-fixes.patch
new file mode 100644
index 000000000..b3afa06cc
--- /dev/null
+++ b/extra/xf86-input-joystick/git-fixes.patch
@@ -0,0 +1,399 @@
+From 204dcb86368b011824fc5006f87b9e394d03a394 Mon Sep 17 00:00:00 2001
+From: Terry Lambert <tlambert@chromium.org>
+Date: Sat, 16 Jul 2011 00:23:22 +0000
+Subject: Return proper default for unknown values in pInfo->device_control.
+
+Signed-off-by: Terry Lambert <tlambert@chromium.org>
+Reviewed-by: Stephane Marchesin <marcheu@chromium.org>
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+---
+diff --git a/src/jstk.c b/src/jstk.c
+index ec6b79a..6db0e7c 100644
+--- a/src/jstk.c
++++ b/src/jstk.c
+@@ -419,8 +419,7 @@ jstkDeviceControlProc(DeviceIntPtr pJstk,
+
+ default:
+ ErrorF("unsupported mode=%d\n", what);
+- return !Success;
+- break;
++ return BadValue;
+ } /* switch (what) */
+ return Success;
+ }
+diff --git a/src/jstk_key.c b/src/jstk_key.c
+index 3c471ce..d699dcd 100644
+--- a/src/jstk_key.c
++++ b/src/jstk_key.c
+@@ -169,6 +169,8 @@ jstkKeyboardDeviceControlProc(DeviceIntPtr dev,
+ DBG(2, ErrorF("jstkKeyboardDeviceControlProc what=DEVICE_CLOSE\n"));
+ dev->public.on = FALSE;
+ break;
++ default:
++ return BadValue;
+ }
+
+ return Success;
+--
+cgit v0.9.0.2-2-gbebe
+From b3b62328cf3f36c20c54a298f8a921e6eef42c4d Mon Sep 17 00:00:00 2001
+From: Devin J. Pohly <djpohly+xorg@gmail.com>
+Date: Sat, 03 Sep 2011 23:00:07 +0000
+Subject: unify capitalization of joystick properties
+
+the axis keys high/low properties were inconsistently capitalized,
+leading to potential confusion as to why one works but not the other.
+
+Signed-off-by: Devin J. Pohly <djpohly+xorg@gmail.com>
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+---
+diff --git a/include/joystick-properties.h b/include/joystick-properties.h
+index 49ef800..36f4082 100644
+--- a/include/joystick-properties.h
++++ b/include/joystick-properties.h
+@@ -99,7 +99,7 @@ typedef enum _JSTK_MAPPING {
+
+ /** Scancodes for axis in high position */
+ /* 8 bit, 4 per axis */
+-#define JSTK_PROP_AXIS_KEYS_HIGH "Axis keys (high)"
++#define JSTK_PROP_AXIS_KEYS_HIGH "Axis Keys (high)"
+
+ /** Set the mapping of each button to
+ none, x, y, zx, zy, button, key, speed_multiply,
+--
+cgit v0.9.0.2-2-gbebe
+From b607c4ebeea4122694f02ba87f06e4cdb23114f1 Mon Sep 17 00:00:00 2001
+From: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date: Sat, 15 Oct 2011 22:47:52 +0000
+Subject: label buttons and axes
+
+Buttons are labeled "Button %d", starting with 0 and representing the button in X _after_ mapping.
+Mapping can be changed while running so the labels will be constant.
+
+Axes are labeled "Axis %d", starting with 1, representing the _physical_ axis that reports the valuator
+data. The raw valuators can't be dynamically mapped, the first two valuators always are labeled "Rel X"
+and "Rel Y", representing the aggregated post-calculation data from all axes.
+
+Signed-off-by: Sascha Hlusiak <saschahlusiak@arcor.de>
+---
+diff --git a/man/joystick.man b/man/joystick.man
+index da92ceb..b401de5 100644
+--- a/man/joystick.man
++++ b/man/joystick.man
+@@ -140,7 +140,11 @@ Neither
+ .B mode
+ nor
+ .B axis
+-needs to be set to generate extra valuator events.
++needs to be set to generate extra valuator events. The axis will be labelled according to it's physical axis number, beginning with
++.I 1
++, i.e.
++.I \*qAxis 1\*q
++for the first axis (being the 3rd valuator).
+ Default: not set.
+ .TP 7
+ .BI "\*qaxis="[<factor>]<axis> \*q
+@@ -318,6 +322,28 @@ and the second and fourth axis to the arrow keys
+ The keys for the first two axes will be generated in an interval according to the value of the axis. The autorepeat speed of the first axis will be half the speed of that of the second axis.
+ The keys for the third and fourth axis are generated once when the axis moves out of the deadzone and when it moves back into the deadzone. X.Org will autorepeat those keys according to current keyboard settings.
+
++.SH "XI2 Events"
++If you only care about raw events instead of using the joystick as a mouse replacement, don't forget to unmap and add valuators to all axes and map the remaining buttons:
++
++.nf
++.BI " Option \*qMapAxis1\*q \*q" "mode=none valuator" \*q
++.BI " Option \*qMapAxis2\*q \*q" "mode=none valuator" \*q
++.BI " Option \*qMapAxis3\*q \*q" "mode=none valuator" \*q
++.BI " Option \*qMapAxis4\*q \*q" "mode=none valuator" \*q
++\ \ ...
++.BI " Option \*qMapButton1\*q \*q" "button=1" \*q
++.BI " Option \*qMapButton2\*q \*q" "button=2" \*q
++.BI " Option \*qMapButton3\*q \*q" "button=3" \*q
++.BI " Option \*qMapButton4\*q \*q" "button=4" \*q
++.BI " Option \*qMapButton5\*q \*q" "button=5" \*q
++\ \ ...
++.fi
++
++You might also want to set the device "floating" to stop it from reporting core events:
++.nf
++.BI " Option \*qFloating\*q \*q" "true" \*q
++.fi
++
+ .SH "NOTES"
+ Configuration through
+ .I InputClass
+diff --git a/src/jstk.c b/src/jstk.c
+index 6db0e7c..772683f 100644
+--- a/src/jstk.c
++++ b/src/jstk.c
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2007-2009 by Sascha Hlusiak. <saschahlusiak@freedesktop.org>
++ * Copyright 2007-2011 by Sascha Hlusiak. <saschahlusiak@freedesktop.org>
+ * Copyright 1995-1999 by Frederic Lepied, France. <Lepied@XFree86.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+@@ -21,7 +21,6 @@
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+-
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+@@ -300,6 +299,7 @@ jstkDeviceControlProc(DeviceIntPtr pJstk,
+ switch (what) {
+ case DEVICE_INIT: {
+ int m;
++ char str[32];
+ CARD8 buttonmap[BUTTONMAP_SIZE+1];
+ DBG(1, ErrorF("jstkDeviceControlProc what=INIT\n"));
+ /* Probe device and return if error */
+@@ -312,11 +312,14 @@ jstkDeviceControlProc(DeviceIntPtr pJstk,
+ }
+
+ for (m=0; m<=BUTTONMAP_SIZE; m++) {
++ sprintf(str, "Button %d", m);
++
+ buttonmap[m] = m;
+- }
++ btn_labels[m] = MakeAtom(str, strlen(str), TRUE);
++ }
++
++
+
+-
+-
+ if (InitButtonClassDeviceStruct(pJstk, BUTTONMAP_SIZE,
+ btn_labels,
+ buttonmap) == FALSE) {
+@@ -331,7 +334,9 @@ jstkDeviceControlProc(DeviceIntPtr pJstk,
+ if (priv->axis[i].valuator != -1)
+ {
+ DBG(3, ErrorF("Axis %d will be valuator %d\n", i, m));
++ sprintf(str, "Axis %d", i + 1);
+ priv->axis[i].valuator = m++;
++ axes_labels[i] = MakeAtom(str, strlen(str), TRUE);
+ }
+
+ if (InitValuatorClassDeviceStruct(pJstk, m, axes_labels,
+@@ -719,7 +724,6 @@ static XF86ModuleVersionInfo jstkVersionRec =
+ /* a tool */
+ };
+
+-
+ /*
+ ***************************************************************************
+ *
+@@ -732,3 +736,6 @@ _X_EXPORT XF86ModuleData joystickModuleData = {
+ jstkDriverPlug,
+ jstkDriverUnplug
+ };
++
++/* vim: set filetype=c.doxygen ts=4 et: */
++
+--
+cgit v0.9.0.2-2-gbebe
+From e0193debf8f5a72b0a06977d5dea3365ad9cafbe Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Mon, 31 Oct 2011 04:27:22 +0000
+Subject: Fix option type for option duplication
+
+xf86OptionListDuplicate() duplicates an XF86Option list, not an InputOption
+list.
+
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+---
+diff --git a/src/jstk_key.c b/src/jstk_key.c
+index d699dcd..e842941 100644
+--- a/src/jstk_key.c
++++ b/src/jstk_key.c
+@@ -253,26 +253,26 @@ jstkKeyboardHotplug(InputInfoPtr pInfo, int flags)
+ int rc;
+ char name[512] = {0};
+ InputAttributes *attrs = NULL;
+- InputOption *options;
+ InputOption *iopts = NULL, *tmp;
+ DeviceIntPtr dev;
++ XF86OptionPtr opts;
+
+ /* duplicate option list, append to name */
+- options = xf86OptionListDuplicate(pInfo->options);
++ opts = xf86OptionListDuplicate(pInfo->options);
+ strcpy(name, pInfo->name);
+ strcat(name, " (keys)");
+- options = xf86ReplaceStrOption(options, "Name", name);
+- options = xf86ReplaceStrOption(options, "_source", "_driver/joystick");
++ opts = xf86ReplaceStrOption(opts, "Name", name);
++ opts = xf86ReplaceStrOption(opts, "_source", "_driver/joystick");
+
+- while(options)
++ while(opts)
+ {
+ tmp = calloc(1, sizeof(InputOption));
+
+- tmp->key = xf86OptionName(options);
+- tmp->value = xf86OptionValue(options);
++ tmp->key = xf86OptionName(opts);
++ tmp->value = xf86OptionValue(opts);
+ tmp->next = iopts;
+ iopts = tmp;
+- options = xf86NextOption(options);
++ opts = xf86NextOption(opts);
+ }
+
+ /* duplicate attribute list */
+--
+cgit v0.9.0.2-2-gbebe
+From 7ccf3a75292d71104c976bf6afb389cccaac1a7d Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Mon, 31 Oct 2011 04:33:08 +0000
+Subject: Deal with opaque input option types.
+
+ABI 14 made the InputOption type opaque, move the existing code to ifdefs
+and use the new function calls otherwise.
+
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
+---
+diff --git a/src/jstk_key.c b/src/jstk_key.c
+index e842941..a71275a 100644
+--- a/src/jstk_key.c
++++ b/src/jstk_key.c
+@@ -247,13 +247,46 @@ int jstkKeyboardPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+ return Success;
+ }
+
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 14
++static InputOption*
++input_option_new(InputOption* list, char *key, char *value)
++{
++ InputOption *tmp;
++
++ tmp = calloc(1, sizeof(*tmp));
++ tmp->key = key;
++ tmp->value = value;
++ tmp->next = list;
++
++ return tmp;
++}
++
++static void
++input_option_free_list(InputOption **list)
++{
++ InputOption *iopts = *list;
++
++ while(iopts)
++ {
++ InputOption *tmp = iopts->next;
++ free(iopts->key);
++ free(iopts->value);
++ free(iopts);
++ iopts = tmp;
++ }
++
++ *list = NULL;
++}
++
++#endif
++
+ InputInfoPtr
+ jstkKeyboardHotplug(InputInfoPtr pInfo, int flags)
+ {
+ int rc;
+ char name[512] = {0};
+ InputAttributes *attrs = NULL;
+- InputOption *iopts = NULL, *tmp;
++ InputOption *iopts = NULL;
+ DeviceIntPtr dev;
+ XF86OptionPtr opts;
+
+@@ -266,12 +299,9 @@ jstkKeyboardHotplug(InputInfoPtr pInfo, int flags)
+
+ while(opts)
+ {
+- tmp = calloc(1, sizeof(InputOption));
+-
+- tmp->key = xf86OptionName(opts);
+- tmp->value = xf86OptionValue(opts);
+- tmp->next = iopts;
+- iopts = tmp;
++ iopts = input_option_new(iopts,
++ xf86OptionName(opts),
++ xf86OptionValue(opts));
+ opts = xf86NextOption(opts);
+ }
+
+@@ -280,14 +310,7 @@ jstkKeyboardHotplug(InputInfoPtr pInfo, int flags)
+
+ rc = NewInputDeviceRequest(iopts, attrs, &dev);
+
+- while(iopts)
+- {
+- tmp = iopts->next;
+- free(iopts->key);
+- free(iopts->value);
+- free(iopts);
+- iopts = tmp;
+- }
++ input_option_free_list(&iopts);
+
+ FreeInputAttributes(attrs);
+
+--
+cgit v0.9.0.2-2-gbebe
+From 411c1838456c055d3f911c54ed58bb11a6bf0da3 Mon Sep 17 00:00:00 2001
+From: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date: Sun, 13 Nov 2011 17:04:25 +0000
+Subject: man: valuators are not added automatically
+
+---
+diff --git a/man/joystick.man b/man/joystick.man
+index b401de5..9f38ceb 100644
+--- a/man/joystick.man
++++ b/man/joystick.man
+@@ -129,9 +129,6 @@ can be one of:
+
+ .B none, relative, accelerated, absolute
+
+-Every axis which's mode is not
+-.B none
+-will be reported as an additional valuator.
+ .TP 7
+ .B \*qvaluator\*q
+ Send extra valuator events for this axis. The valuators will be numbered ascending, starting with 2 (valuator 0 and 1 are reserved for pointer movement). The range of the valuators is always
+--
+cgit v0.9.0.2-2-gbebe
+From b217fabdef1714ed4898e08de4c2a6b9cc8d4f0f Mon Sep 17 00:00:00 2001
+From: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date: Sun, 13 Nov 2011 19:36:07 +0000
+Subject: Copy pInfo->driver to option list to fix hotplugging of keyboard device
+
+udev does copy the Driver line to the list of options, but when manually
+specifying the driver in xorg.conf, the option "Driver" is unset. Because we
+do hotplug a sub-device from within the core device, we need the "Driver"
+option to be present in the list.
+
+This should fix archlinux bug #23577:
+ https://bugs.archlinux.org/task/23577
+
+Thanks to Malek for coming up with a fix.
+
+Signed-off-by: Sascha Hlusiak <contact@saschahlusiak.de>
+---
+diff --git a/src/jstk_key.c b/src/jstk_key.c
+index a71275a..241b15d 100644
+--- a/src/jstk_key.c
++++ b/src/jstk_key.c
+@@ -296,6 +296,7 @@ jstkKeyboardHotplug(InputInfoPtr pInfo, int flags)
+ strcat(name, " (keys)");
+ opts = xf86ReplaceStrOption(opts, "Name", name);
+ opts = xf86ReplaceStrOption(opts, "_source", "_driver/joystick");
++ opts = xf86AddNewOption(opts, "Driver", pInfo->driver);
+
+ while(opts)
+ {
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/extra/xorg-server/PKGBUILD b/extra/xorg-server/PKGBUILD
index 7145bb168..a55107e61 100644
--- a/extra/xorg-server/PKGBUILD
+++ b/extra/xorg-server/PKGBUILD
@@ -1,20 +1,22 @@
-# $Id: PKGBUILD 142252 2011-11-07 09:31:56Z andyrtr $
+# $Id: PKGBUILD 142918 2011-11-18 09:17:26Z jgc $
# Maintainer: Jan de Groot <jgc@archlinux.org>
pkgbase=xorg-server
pkgname=('xorg-server' 'xorg-server-xephyr' 'xorg-server-xdmx' 'xorg-server-xvfb' 'xorg-server-xnest' 'xorg-server-common' 'xorg-server-devel')
pkgver=1.11.2
-pkgrel=1
+pkgrel=2
arch=('i686' 'x86_64')
license=('custom')
url="http://xorg.freedesktop.org"
-makedepends=('pixman' 'libx11' 'mesa' 'libgl' 'xf86driproto' 'xcmiscproto' 'xtrans' 'bigreqsproto' 'randrproto' 'inputproto' 'fontsproto' 'videoproto' 'compositeproto' 'recordproto' 'scrnsaverproto' 'resourceproto' 'xineramaproto' 'libxkbfile' 'libxfont' 'renderproto' 'libpciaccess' 'libxv' 'xf86dgaproto' 'libxmu' 'libxrender' 'libxi' 'dmxproto' 'libxaw' 'libdmx' 'libxtst' 'libxres' 'xorg-xkbcomp' 'xorg-util-macros' 'xorg-font-util' 'glproto' 'dri2proto')
+makedepends=('pixman' 'libx11' 'mesa' 'libgl' 'xf86driproto' 'xcmiscproto' 'xtrans' 'bigreqsproto' 'randrproto' 'inputproto' 'fontsproto' 'videoproto' 'compositeproto' 'recordproto' 'scrnsaverproto' 'resourceproto' 'xineramaproto' 'libxkbfile' 'libxfont' 'renderproto' 'libpciaccess' 'libxv' 'xf86dgaproto' 'libxmu' 'libxrender' 'libxi' 'dmxproto' 'libxaw' 'libdmx' 'libxtst' 'libxres' 'xorg-xkbcomp' 'xorg-util-macros' 'xorg-font-util' 'glproto' 'dri2proto' 'udev' 'libgcrypt')
options=('!libtool')
source=(${url}/releases/individual/xserver/${pkgbase}-${pkgver}.tar.bz2
autoconfig-nvidia.patch
autoconfig-sis.patch
revert-trapezoids.patch
git-fixes.patch
+ xserver-1.11.2-record-crasher.patch
+ Xi-allow-passive-keygrabs-on-the-XIAll-Master-Device.patch
xvfb-run
xvfb-run.1
10-quirks.conf)
@@ -22,7 +24,9 @@ md5sums=('8796fff441e5435ee36a72579008af24'
'6c7e87d63ac4b535e19a80c89d0cf091'
'f8194638ca4872c2b0a67862a70bcebf'
'f6c84f4936f8e00abdfbd9fb4eda83fb'
- 'b9cdb3855cc2b2e974a98b9a20d1ec2b'
+ '6fb42ec979ecd6125b6599f54dc00d14'
+ '3f9de4dbfee2da90167192d8ca9eb2b4'
+ '47f9b979fe38043b42ff86eeee6fd0d0'
'52fd3effd80d7bc6c1660d4ecf23d31c'
'376c70308715cd2643f7bff936d9934b'
'd4f7dfc6be4ef4e2c6dd7632a9d88abe')
@@ -42,6 +46,14 @@ build() {
# Add post-release patches from 1.11 branch
patch -Np1 -i "${srcdir}/git-fixes.patch"
+ # From Fedora.
+ # Upstream URL: http://patchwork.freedesktop.org/patch/7866/
+ patch -Np1 -i "${srcdir}/xserver-1.11.2-record-crasher.patch"
+
+ # From Fedora.
+ # Upstream URL: https://bugs.freedesktop.org/show_bug.cgi?id=42298
+ patch -Np1 -i "${srcdir}/Xi-allow-passive-keygrabs-on-the-XIAll-Master-Device.patch"
+
autoreconf -fi
./configure --prefix=/usr \
--enable-ipv6 \
diff --git a/extra/xorg-server/Xi-allow-passive-keygrabs-on-the-XIAll-Master-Device.patch b/extra/xorg-server/Xi-allow-passive-keygrabs-on-the-XIAll-Master-Device.patch
new file mode 100644
index 000000000..8bddb2945
--- /dev/null
+++ b/extra/xorg-server/Xi-allow-passive-keygrabs-on-the-XIAll-Master-Device.patch
@@ -0,0 +1,31 @@
+From 97f2af5876dab0dfab06be735416f3fc950ed39e Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Thu, 27 Oct 2011 11:03:39 +1000
+Subject: [PATCH] Xi: allow passive keygrabs on the XIAll(Master)Devices fake
+ devices
+
+They don't have a KeyClassRec, but we must still allow passive grabs on
+them.
+
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+Tested-by: Bastien Nocera <hadess@hadess.net>
+---
+ Xi/exevents.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/Xi/exevents.c b/Xi/exevents.c
+index 053c76f..edf2c39 100644
+--- a/Xi/exevents.c
++++ b/Xi/exevents.c
+@@ -1495,7 +1495,7 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
+ rc = CheckGrabValues(client, param);
+ if (rc != Success)
+ return rc;
+- if (k == NULL)
++ if ((dev->id != XIAllDevices && dev->id != XIAllMasterDevices) && k == NULL)
+ return BadMatch;
+ if (grabtype == GRABTYPE_XI)
+ {
+--
+1.7.7
+
diff --git a/extra/xorg-server/git-fixes.patch b/extra/xorg-server/git-fixes.patch
index 9629b3040..27da61eca 100644
--- a/extra/xorg-server/git-fixes.patch
+++ b/extra/xorg-server/git-fixes.patch
@@ -115,3 +115,47 @@ index 31ed505..dce3f84 100644
miSetPixmapDepths ();
--
cgit v0.9.0.2-2-gbebe
+From 34bb83b9df20ff63dbb147ed661f39efb8bae8e4 Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Mon, 24 Oct 2011 02:00:32 +0000
+Subject: dix: block signals when closing all devices
+
+When closing down all devices, we manually unset master for all attached
+devices, but the device's sprite info still points to the master's sprite
+info. This leaves us a window where the master is freed already but the
+device isn't yet. A signal during that window causes dereference of the
+already freed spriteInfo in mieqEnqueue's EnqueueScreen macro.
+
+Simply block signals when removing all devices. It's not like we're really
+worrying about high-responsive input at this stage.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=737031
+
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+Reviewed-by: Julien Cristau <jcristau@debian.org>
+(cherry picked from commit d7c44a7c9760449bef263413ad3b20f19b1dc95a)
+---
+diff --git a/dix/devices.c b/dix/devices.c
+index 0ccf252..cbdd4ea 100644
+--- a/dix/devices.c
++++ b/dix/devices.c
+@@ -982,6 +982,8 @@ CloseDownDevices(void)
+ {
+ DeviceIntPtr dev;
+
++ OsBlockSignals();
++
+ /* Float all SDs before closing them. Note that at this point resources
+ * (e.g. cursors) have been freed already, so we can't just call
+ * AttachDevice(NULL, dev, NULL). Instead, we have to forcibly set master
+@@ -1004,6 +1006,8 @@ CloseDownDevices(void)
+ inputInfo.keyboard = NULL;
+ inputInfo.pointer = NULL;
+ XkbDeleteRulesDflts();
++
++ OsReleaseSignals();
+ }
+
+ /**
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/extra/xorg-server/xserver-1.11.2-record-crasher.patch b/extra/xorg-server/xserver-1.11.2-record-crasher.patch
new file mode 100644
index 000000000..3af207bb9
--- /dev/null
+++ b/extra/xorg-server/xserver-1.11.2-record-crasher.patch
@@ -0,0 +1,241 @@
+From patchwork Tue Nov 8 18:22:13 2011
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 8bit
+Subject: Save major/minor opcodes in ClientRec for RecordAReply
+Date: Tue, 08 Nov 2011 18:22:13 -0000
+From: Keith Packard <keithp@keithp.com>
+X-Patchwork-Id: 7866
+Message-Id: <1320776533-3120-1-git-send-email-keithp@keithp.com>
+To: xorg-devel@lists.freedesktop.org
+
+The record extension needs the major and minor opcodes in the reply
+hook, but the request buffer may have been freed by the time the hook
+is invoked. Saving the request major and minor codes as the request is
+executed avoids fetching from the defunct request buffer.
+
+This patch also eliminates the public MinorOpcodeOfRequest function,
+making it static to dispatch. Usages of that function have been
+replaced with direct access to the new ClientRec field.
+
+Signed-off-by: Keith Packard <keithp@keithp.com>
+Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
+
+---
+Here's what I was thinking of to fix this -- just record the major and
+minor opcodes of the request in the ClientRec during Dispatch and then
+using those fields in RecordAReply instead of fetching the discarded
+request buffer.
+
+This is entirely untested; I don't know how to make the old code break.
+
+ Xext/security.c | 4 +---
+ Xext/xselinux_hooks.c | 4 ++--
+ dix/dispatch.c | 31 ++++++++++++++++++++++---------
+ dix/extension.c | 14 --------------
+ include/dixstruct.h | 1 +
+ include/extension.h | 2 --
+ record/record.c | 8 +++-----
+ 7 files changed, 29 insertions(+), 35 deletions(-)
+
+[ fedora: technically this is an ABI breaker since it's changing ClientRec,
+ but hopefully not in a way that matters. If it does matter, easiest thing
+ to do is have Record add a hook for XaceHookDispatch. - ajax ]
+
+diff --git a/Xext/security.c b/Xext/security.c
+index 08d8158..b0d82ab 100644
+--- a/Xext/security.c
++++ b/Xext/security.c
+@@ -148,9 +148,7 @@ SecurityLabelInitial(void)
+ static _X_INLINE const char *
+ SecurityLookupRequestName(ClientPtr client)
+ {
+- int major = ((xReq *)client->requestBuffer)->reqType;
+- int minor = MinorOpcodeOfRequest(client);
+- return LookupRequestName(major, minor);
++ return LookupRequestName(client->majorOp, client->minorOp);
+ }
+
+
+diff --git a/Xext/xselinux_hooks.c b/Xext/xselinux_hooks.c
+index f1d8e5d..0d4c9ab 100644
+--- a/Xext/xselinux_hooks.c
++++ b/Xext/xselinux_hooks.c
+@@ -263,8 +263,8 @@ SELinuxAudit(void *auditdata,
+ if (client) {
+ REQUEST(xReq);
+ if (stuff) {
+- major = stuff->reqType;
+- minor = MinorOpcodeOfRequest(client);
++ major = client->majorOp;
++ minor = client->minorOp;
+ }
+ }
+ if (audit->id)
+diff --git a/dix/dispatch.c b/dix/dispatch.c
+index 6e33615..3600acd 100644
+--- a/dix/dispatch.c
++++ b/dix/dispatch.c
+@@ -337,7 +337,20 @@ DisableLimitedSchedulingLatency(void)
+ SmartScheduleLatencyLimited = 0;
+ }
+
+-#define MAJOROP ((xReq *)client->requestBuffer)->reqType
++static inline unsigned short
++MinorOpcodeOfRequest(ClientPtr client)
++{
++ unsigned char major;
++ ExtensionEntry *ext;
++
++ major = ((xReq *)client->requestBuffer)->reqType;
++ if (major < EXTENSION_BASE)
++ return 0;
++ ext = GetExtensionEntry(major);
++ if (!ext)
++ return 0;
++ return ext->MinorOpcode (client);
++}
+
+ void
+ Dispatch(void)
+@@ -419,21 +432,23 @@ Dispatch(void)
+ }
+
+ client->sequence++;
++ client->majorOp = ((xReq *)client->requestBuffer)->reqType;
++ client->minorOp = MinorOpcodeOfRequest(client);
+ #ifdef XSERVER_DTRACE
+- XSERVER_REQUEST_START(LookupMajorName(MAJOROP), MAJOROP,
++ XSERVER_REQUEST_START(LookupMajorName(client->majorOp), client->majorOp,
+ ((xReq *)client->requestBuffer)->length,
+ client->index, client->requestBuffer);
+ #endif
+ if (result > (maxBigRequestSize << 2))
+ result = BadLength;
+ else {
+- result = XaceHookDispatch(client, MAJOROP);
++ result = XaceHookDispatch(client, client->majorOp);
+ if (result == Success)
+- result = (* client->requestVector[MAJOROP])(client);
++ result = (* client->requestVector[client->majorOp])(client);
+ XaceHookAuditEnd(client, result);
+ }
+ #ifdef XSERVER_DTRACE
+- XSERVER_REQUEST_DONE(LookupMajorName(MAJOROP), MAJOROP,
++ XSERVER_REQUEST_DONE(LookupMajorName(client->majorOp), client->majorOp,
+ client->sequence, client->index, result);
+ #endif
+
+@@ -444,8 +459,8 @@ Dispatch(void)
+ }
+ else if (result != Success)
+ {
+- SendErrorToClient(client, MAJOROP,
+- MinorOpcodeOfRequest(client),
++ SendErrorToClient(client, client->majorOp,
++ client->minorOp,
+ client->errorValue, result);
+ break;
+ }
+@@ -466,8 +481,6 @@ Dispatch(void)
+ SmartScheduleLatencyLimited = 0;
+ }
+
+-#undef MAJOROP
+-
+ static int VendorRelease = VENDOR_RELEASE;
+ static char *VendorString = VENDOR_NAME;
+
+diff --git a/dix/extension.c b/dix/extension.c
+index c7bbac5..b677cdb 100644
+--- a/dix/extension.c
++++ b/dix/extension.c
+@@ -228,20 +228,6 @@ StandardMinorOpcode(ClientPtr client)
+ return ((xReq *)client->requestBuffer)->data;
+ }
+
+-unsigned short
+-MinorOpcodeOfRequest(ClientPtr client)
+-{
+- unsigned char major;
+-
+- major = ((xReq *)client->requestBuffer)->reqType;
+- if (major < EXTENSION_BASE)
+- return 0;
+- major -= EXTENSION_BASE;
+- if (major >= NumExtensions)
+- return 0;
+- return (*extensions[major]->MinorOpcode)(client);
+-}
+-
+ void
+ CloseDownExtensions(void)
+ {
+diff --git a/include/dixstruct.h b/include/dixstruct.h
+index 6cc9614..0a85f40 100644
+--- a/include/dixstruct.h
++++ b/include/dixstruct.h
+@@ -122,6 +122,7 @@ typedef struct _Client {
+
+ DeviceIntPtr clientPtr;
+ ClientIdPtr clientIds;
++ unsigned short majorOp, minorOp;
+ } ClientRec;
+
+ /*
+diff --git a/include/extension.h b/include/extension.h
+index 29a11c3..9249951 100644
+--- a/include/extension.h
++++ b/include/extension.h
+@@ -52,8 +52,6 @@ _XFUNCPROTOBEGIN
+
+ extern _X_EXPORT unsigned short StandardMinorOpcode(ClientPtr /*client*/);
+
+-extern _X_EXPORT unsigned short MinorOpcodeOfRequest(ClientPtr /*client*/);
+-
+ extern _X_EXPORT Bool EnableDisableExtension(char *name, Bool enable);
+
+ extern _X_EXPORT void EnableDisableExtensionError(char *name, Bool enable);
+diff --git a/record/record.c b/record/record.c
+index 68311ac..4a0fe23 100644
+--- a/record/record.c
++++ b/record/record.c
+@@ -546,7 +546,7 @@ RecordARequest(ClientPtr client)
+ }
+ else /* extension, check minor opcode */
+ {
+- int minorop = MinorOpcodeOfRequest(client);
++ int minorop = client->minorOp;
+ int numMinOpInfo;
+ RecordMinorOpPtr pMinorOpInfo = pRCAP->pRequestMinOpInfo;
+
+@@ -603,12 +603,9 @@ RecordAReply(CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
+ RecordContextPtr pContext;
+ RecordClientsAndProtocolPtr pRCAP;
+ int eci;
+- int majorop;
+ ReplyInfoRec *pri = (ReplyInfoRec *)calldata;
+ ClientPtr client = pri->client;
+- REQUEST(xReq);
+
+- majorop = stuff->reqType;
+ for (eci = 0; eci < numEnabledContexts; eci++)
+ {
+ pContext = ppAllContexts[eci];
+@@ -616,6 +613,7 @@ RecordAReply(CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
+ NULL);
+ if (pRCAP)
+ {
++ int majorop = client->majorOp;
+ if (pContext->continuedReply)
+ {
+ RecordAProtocolElement(pContext, client, XRecordFromServer,
+@@ -635,7 +633,7 @@ RecordAReply(CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
+ }
+ else /* extension, check minor opcode */
+ {
+- int minorop = MinorOpcodeOfRequest(client);
++ int minorop = client->minorOp;
+ int numMinOpInfo;
+ RecordMinorOpPtr pMinorOpInfo = pRCAP->pReplyMinOpInfo;
+ assert (pMinorOpInfo);