about summary refs log tree commit diff
path: root/pkgs/by-name/yd/ydotool/package.nix
blob: 137a701d87a363cdb4a96c69f885a752bf5148e4 (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
{
  lib,
  stdenv,
  fetchFromGitHub,
  cmake,
  scdoc,
  util-linux,
  xorg,
  nixosTests,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "ydotool";
  version = "1.0.4";

  src = fetchFromGitHub {
    owner = "ReimuNotMoe";
    repo = "ydotool";
    rev = "v${finalAttrs.version}";
    hash = "sha256-MtanR+cxz6FsbNBngqLE+ITKPZFHmWGsD1mBDk0OVng=";
  };

  postPatch = ''
    substituteInPlace Daemon/ydotoold.c \
      --replace "/usr/bin/xinput" "${xorg.xinput}/bin/xinput"
    substituteInPlace Daemon/ydotool.service.in \
      --replace "/usr/bin/kill" "${util-linux}/bin/kill"
  '';

  strictDeps = true;
  nativeBuildInputs = [
    cmake
    scdoc
  ];

  passthru.tests.basic = nixosTests.ydotool;

  meta = {
    description = "Generic Linux command-line automation tool";
    homepage = "https://github.com/ReimuNotMoe/ydotool";
    license = lib.licenses.agpl3Plus;
    mainProgram = "ydotool";
    maintainers = with lib.maintainers; [
      willibutz
      kraem
    ];
    platforms = lib.platforms.linux;
  };
})