aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/applications/video/obs-studio/wlrobs.nix
blob: 14bc80dd3880966d8cec7c0a201c1b97b0b6649e (plain)
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
# (the following is somewhat lifted from ./linuxbrowser.nix)
# We don't have a wrapper which can supply obs-studio plugins so you have to
# somewhat manually install this:

# nix-env -f . -iA obs-wlrobs
# mkdir -p ~/.config/obs-studio/plugins/wlrobs/bin/64bit
# ln -s ~/.nix-profile/share/obs/obs-plugins/wlrobs/bin/64bit/libwlrobs.so ~/.config/obs-studio/plugins/wlrobs/bin/64bit
{ stdenv, fetchhg, wayland, obs-studio
, meson, ninja, pkgconfig, libX11
, dmabufSupport ? false, libdrm ? null, libGL ? null, lib}:

assert dmabufSupport -> libdrm != null && libGL != null;

stdenv.mkDerivation {
  pname = "obs-wlrobs";
  version = "20200622";

  src = fetchhg {
    url = "https://hg.sr.ht/~scoopta/wlrobs";
    rev = "1d3acaaf64049da3da9721aa8b9b47582fe0081b";
    sha256 = "0qrcf8024r4ynfjw0zx8vn59ygx9q5rb196s6nyxmy3gkv2lfxlq";
  };

  buildInputs = [ libX11 libGL libdrm meson ninja pkgconfig wayland obs-studio ];

  installPhase = ''
    mkdir -p $out/share/obs/obs-plugins/wlrobs/bin/64bit
    cp ./libwlrobs.so $out/share/obs/obs-plugins/wlrobs/bin/64bit/
  '';

  mesonFlags = [
    "-Duse_dmabuf=${lib.boolToString dmabufSupport}"
  ];

  meta = with stdenv.lib; {
    description = "An obs-studio plugin that allows you to screen capture on wlroots based wayland compositors";
    homepage = "https://hg.sr.ht/~scoopta/wlrobs";
    maintainers = with maintainers; [ grahamc ];
    license = licenses.gpl3;
    platforms = [ "x86_64-linux" ];
  };
}