about summary refs log tree commit diff
path: root/pkgs/applications/video/flirc/default.nix
blob: b051bae6b0dccc40d64ddf1025e8b47a32e803b2 (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
53
{
  lib,
  stdenv,
  fetchurl,
  autoPatchelfHook,
  wrapQtAppsHook,
  hidapi,
  readline,
  qtsvg,
  qtxmlpatterns,
}:

stdenv.mkDerivation {
  pname = "flirc";
  version = "3.27.15";

  src = fetchurl {
    url = "https://web.archive.org/web/20240626115121/http://apt.flirc.tv/arch/x86_64/flirc.latest.x86_64.tar.gz";
    hash = "sha256-8bUsOsp5obJJdZU9QHfJnZKNAXJwi0nrHkSeDTE1Xa4=";
  };

  nativeBuildInputs = [
    autoPatchelfHook
    wrapQtAppsHook
  ];

  buildInputs = [
    hidapi
    readline
    qtsvg
    qtxmlpatterns
  ];

  dontConfigure = true;
  dontBuild = true;

  # udev rules don't appear in the official package
  # https://flirc.gitbooks.io/flirc-instructions/content/linux.html
  installPhase = ''
    install -D -t $out/bin/ Flirc flirc_util
    install -D ${./99-flirc.rules} $out/lib/udev/rules.d/99-flirc.rules
  '';

  meta = with lib; {
    homepage = "https://flirc.tv/more/flirc-usb";
    description = "Use any Remote with your Media Center";
    maintainers = with maintainers; [ aanderse ];
    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
    license = licenses.unfree;
    mainProgram = "Flirc";
    platforms = [ "x86_64-linux" ];
  };
}