about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/inputmethods/footswitch/default.nix
blob: 9cfdbd393bd9445a918d9941c63397dc9d0d8808 (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
{ lib, stdenv, fetchFromGitHub, pkg-config, hidapi }:

stdenv.mkDerivation {
  pname = "footswitch";
  version = "unstable-20201-03-17";

  src = fetchFromGitHub {
    owner = "rgerganov";
    repo = "footswitch";
    rev = "aa0b10f00d3e76dac27b55b88c8d44c0c406f7f0";
    sha256 = "sha256-SikYiBN7jbH5I1x5wPCF+buwFp1dt35cVxAN6lWkTN0=";
  };

  nativeBuildInputs = [ pkg-config ];
  buildInputs = [ hidapi ];

  postPatch = ''
    substituteInPlace Makefile \
      --replace /usr/local $out \
      --replace /usr/bin/install install \
      --replace /etc/udev/rules.d $out/lib/udev/rules.d
  '';

  preInstall = ''
    mkdir -p $out/bin $out/lib/udev/rules.d
  '';

  meta = with lib; {
    description = "Command line utlities for programming PCsensor and Scythe foot switches.";
    homepage    = "https://github.com/rgerganov/footswitch";
    license     = licenses.mit;
    platforms   = platforms.linux;
    maintainers = with maintainers; [ baloo ];
  };
}