summary refs log tree commit diff
path: root/pkgs/applications/graphics/weylus/default.nix
blob: 092366652d4fa71ebf077e921df848cde58e803f (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{ lib
, dbus
, stdenv
, gst_all_1
, xorg
, libdrm
, libva
, fetchzip
, copyDesktopItems
, fontconfig
, libpng
, pipewire
, makeWrapper
, autoPatchelfHook
}:

stdenv.mkDerivation rec {
  pname = "weylus";
  version = "0.11.4";

  src = fetchzip {
    url = "https://github.com/H-M-H/Weylus/releases/download/v${version}/linux.zip";
    sha256 = "sha256-EW3TdI4F4d4X/BeSqI05QtS77ym1U5jdswFfNtSFyFk=";
    stripRoot = false;
  };

  installPhase = ''
    runHook preInstall

    install -Dm755 ./weylus $out/bin/weylus
    copyDesktopItems ./weylus.desktop

    runHook postInstall
  '';

  buildInputs = [
    libpng
    dbus
    libdrm
    fontconfig
    libva
    gst_all_1.gst-plugins-base
    pipewire
    # autoPatchelfHook complains if these are missing, even on wayland
    xorg.libXft
    xorg.libXinerama
    xorg.libXcursor
    xorg.libXrandr
    xorg.libXcomposite
    xorg.libXtst
  ];

  nativeBuildInputs = [ copyDesktopItems autoPatchelfHook makeWrapper ];

  postFixup = let
    GST_PLUGIN_PATH = lib.makeSearchPathOutput  "lib" "lib/gstreamer-1.0" [
      gst_all_1.gst-plugins-base
      pipewire
    ];
  in ''
    wrapProgram $out/bin/weylus --prefix GST_PLUGIN_PATH : ${GST_PLUGIN_PATH}
  '';

  meta = with lib; {
    description = "Use your tablet as graphic tablet/touch screen on your computer";
    homepage = "https://github.com/H-M-H/Weylus";
    license = with licenses; [ agpl3Only ];
    maintainers = with maintainers; [ lom ];
    platforms = [ "x86_64-linux" ];
  };
}