Fix upside-down touchscreen on Ubuntu 12.10 / XPS 12

When inverting the screen on the XPS 12, the touchscreen digitizer gets awfully confused and reflects all of the co-ordinates. In order to fix that, you can run

$ xinput --set-prop 'Atmel Atmel maXTouch Digitizer' 'Evdev Axis Inversion' 1 1

However, this is ignored in Ubuntu 12.10, due to what appears to be a bug. When I tried to compile xf86-input-evdev, the errors were not as useful as they appeared to be (because the package names weren't as the errors suggested, mainly):

  1. Must install xorg-macros 1.8 or later before running autoconf/autogen
  2. No package 'xorg-server' found

Here's the full solution to get it working:

$ wget http://cgit.freedesktop.org/xorg/driver/xf86-input-evdev/snapshot/xf86-input-evdev-xf86-input-evdev-2.8.1.tar.gz

$ tar xf xf86-input-evdev-xf86-input-evdev-2.8.1.tar.gz

$ cd xf86-input-evdev-xf86-input-evdev-2.8.1

$ sudo apt-get install xutils-dev 

$ sudo apt-get build-dep xserver-xorg-input-evdev

$ ./autogen.sh

$ make

At this point, you have it the module built. However, given its nature, I preferred to install it myself (backing up the original in the process). Before running this, make sure you've got all your work saved (because it threw me back to the login screen):

$ cp /usr/lib/xorg/modules/input/evdev_drv.so{,.bak}

$ cp ./src/.libs/evdev_drv.so /usr/lib/xorg/modules/input/evdev_drv.so