summary refs log tree commit diff
path: root/pkgs/misc/drivers/steamcontroller/default.nix
blob: ca5607b530720e3f6eacd5a509a2cd7529275757 (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
{ stdenv, lib, fetchFromGitHub, python3Packages, libusb1, linuxHeaders
, GyroplotSupport ? false
}:

with python3Packages;

buildPythonApplication {
  pname = "steamcontroller";
  version = "2017-08-11";

  src = fetchFromGitHub {
    owner  = "ynsta";
    repo   = "steamcontroller";
    rev    = "80928ce237925e0d0d7a65a45b481435ba6b931e";
    sha256 = "0lv9j2zv8fmkmc0x9r7fa8zac2xrwfczms35qz1nfa1hr84wniid";
  };

  postPatch = ''
    substituteInPlace src/uinput.py --replace \
      "/usr/include" "${linuxHeaders}/include"
  '';

  buildInputs = [ libusb1 ];
  propagatedBuildInputs =
    [ psutil python3Packages.libusb1 ]
    ++ lib.optionals GyroplotSupport [ pyqtgraph pyside ];

  meta = with stdenv.lib; {
    description = "A standalone Steam controller driver";
    homepage    = "https://github.com/ynsta/steamcontroller";
    license     = licenses.mit;
    maintainers = with maintainers; [ rnhmjoj ];
    platforms   = platforms.linux;
  };
}