summary refs log tree commit diff
path: root/pkgs/os-specific/linux/xf86-input-multitouch/default.nix
blob: 8b10136309cdbe2719d45d6a2e7ebd807a4836d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{ stdenv
, fetchgit
, mtdev
, xorgserver
, xproto
, pixman
, xextproto
, inputproto
, randrproto
, libpciaccess
}:

assert stdenv.isLinux;

stdenv.mkDerivation {
  name = "xf86-input-multitouch-20110312";

  src = fetchgit {
    url = http://bitmath.org/git/multitouch.git;
    rev = "4d87c041f6a232aa30528d70d4b9946d1824b4ed";
    sha256 = "79397c8f99deb2a415e8c9008a2847d973ad19ea004e732613baed707df46fc9";
  };

  # Configuration from http://bitmath.org/code/multitouch/
  confFile = ''
    Section "InputClass"
        MatchIsTouchpad "true"
        Identifier "Multitouch Touchpad"
        Driver "multitouch"
    EndSection
  '';

  buildInputs = [ mtdev xproto xextproto inputproto libpciaccess randrproto ];

  buildPhase = ''
    make INCLUDE="$NIX_CFLAGS_COMPILE -I${xorgserver.dev}/include/xorg -I${pixman}/include/pixman-1 -Iinclude"
  '';

  installPhase = ''
    make DESTDIR="$out" LIBDIR="lib" install
    mkdir -p $out/include/xorg
    echo -n "$confFile" > $out/include/xorg/10-multitouch.conf
  '';

  meta = {
    homepage = http://bitmath.org/code/multitouch/;

    description = "Brings multitouch gestures to the Linux desktop";

    license = stdenv.lib.licenses.gpl2;
  };
}