nixpkgs/pkgs/applications/video/obs-studio/wlrobs.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

43 lines
1.4 KiB
Nix

# (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 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" ];
};
}