summary refs log tree commit diff
path: root/pkgs/tools/wayland/wl-mirror/default.nix
blob: 0836723760e7769523603a421ca74b4cf25e979f (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
{ lib
, stdenv
, fetchFromGitHub
, cmake
, pkg-config
, wayland
, wayland-protocols
, wayland-scanner
, wlr-protocols
, libGL
}:

stdenv.mkDerivation rec {
  pname = "wl-mirror";
  version = "0.5.0";

  src = fetchFromGitHub {
    owner = "Ferdi265";
    repo = "wl-mirror";
    rev = "v${version}";
    sha256 = "1wjdjzj6h1q51yg70gdrq2yrgg6ihamcwhizxfrjq8955yy2y6ly";
  };

  patchPhase = ''
    substituteInPlace CMakeLists.txt \
      --replace 'WL_PROTOCOL_DIR "/usr' 'WL_PROTOCOL_DIR "${wayland-protocols}' \
      --replace 'WLR_PROTOCOL_DIR "/usr' 'WLR_PROTOCOL_DIR "${wlr-protocols}'
  '';

  nativeBuildInputs = [ cmake pkg-config wayland-scanner ];
  buildInputs = [
    libGL
    wayland
    wayland-protocols
    wlr-protocols
  ];

  meta = with lib; {
    homepage = "https://github.com/Ferdi265/wl-mirror";
    description = "Mirrors an output onto a Wayland surface.";
    license = licenses.gpl3;
    maintainers = with maintainers; [ twitchyliquid64 ];
    platforms = platforms.linux;
  };
}