summary refs log tree commit diff
path: root/pkgs/tools/misc/sixpair/default.nix
blob: fafee99db5af895168ea0871d17a5a17db63d0c2 (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
{ stdenv, fetchurl, libusb }:
stdenv.mkDerivation {
  name = "sixpair-2007-04-18";

  src = fetchurl {
    url = "http://www.pabr.org/sixlinux/sixpair.c";
    sha256 = "1b0a3k7gs544cbji7n29jxlrsscwfx6s1r2sgwdl6hmkc1l9gagr";
  };

  # hcitool is depricated
  patches = [ ./hcitool.patch ];

  buildInputs = [ libusb ];

  unpackPhase = ''
    cp $src sixpair.c
  '';

  buildPhase = ''
    cc -o sixpair sixpair.c -lusb
  '';

  installPhase = ''
    mkdir -p $out/bin
    cp sixpair $out/bin/sixpair
  '';

  meta = {
    description = "Pair with SIXAXIS controllers over USB";
    longDescription = ''
      This command-line utility searches USB buses for SIXAXIS controllers and tells them to connect to a new Bluetooth master.
    '';
    homepage = "http://www.pabr.org/sixlinux/";
    license = stdenv.lib.licenses.gpl2;
    maintainers = [ stdenv.lib.maintainers.tomsmeets ];
    platforms = stdenv.lib.platforms.linux;
  };
}