obs-studio: add plugin wrapper (#125308)
* obs-studio: tidy things up a little * obs-studio: add plugin wrapper This allows users to install plugins into their OBS Studio, like so: wrapOBS { plugins = with obs-studio-plugins; [ wlrobs obs-multi-rtmp obs-gstreamer ]; } * obs-gstreamer: convert to plugin * obs-move-transition: convert to plugin * obs-multi-rtmp: convert to plugin * obs-ndi: convert to plugin * obs-v4l2sink: remove The functionality provided by this package is included in the upstream project as of version 26.1. Link: https://github.com/CatxFish/obs-v4l2sink/issues/56#issuecomment-753191690 Link: https://github.com/obsproject/obs-studio/releases/tag/26.1.0 * wlrobs: convert to plugin, unstable-2020-06-22 -> unstable-2021-05-13launchpad/nixpkgs/master
parent
b26545db7e
commit
e8e0255162
@ -0,0 +1,9 @@ |
||||
{ callPackage, libsForQt5 }: |
||||
|
||||
{ |
||||
obs-gstreamer = callPackage ./obs-gstreamer.nix {}; |
||||
obs-move-transition = callPackage ./obs-move-transition.nix {}; |
||||
obs-multi-rtmp = libsForQt5.callPackage ./obs-multi-rtmp.nix {}; |
||||
obs-ndi = libsForQt5.callPackage ./obs-ndi.nix {}; |
||||
wlrobs = callPackage ./wlrobs.nix {}; |
||||
} |
@ -1,10 +1,3 @@ |
||||
# We don't have a wrapper which can supply obs-studio plugins so you have to |
||||
# somewhat manually install this: |
||||
|
||||
# nix-env -f "<nixpkgs>" -iA obs-ndi |
||||
# mkdir -p ~/.config/obs-studio/plugins/bin |
||||
# ln -s ~/.nix-profile/lib/obs-plugins/obs-ndi.so ~/.config/obs-studio/plugins/bin/ |
||||
|
||||
{ lib, stdenv, fetchFromGitHub, obs-studio, cmake, qtbase, ndi }: |
||||
|
||||
stdenv.mkDerivation rec { |
@ -0,0 +1,26 @@ |
||||
{ lib, stdenv, fetchhg |
||||
, meson, pkg-config, ninja |
||||
, wayland, obs-studio, libX11 |
||||
}: |
||||
|
||||
stdenv.mkDerivation { |
||||
pname = "wlrobs"; |
||||
version = "unstable-2021-05-13"; |
||||
|
||||
src = fetchhg { |
||||
url = "https://hg.sr.ht/~scoopta/wlrobs"; |
||||
rev = "4184a4a8ea7dc054c993efa16007f3a75b2c6f51"; |
||||
sha256 = "146xirzd3nw1sd216y406v1riky9k08b6a0j4kwxrif5zyqa3adc"; |
||||
}; |
||||
|
||||
nativeBuildInputs = [ meson pkg-config ninja ]; |
||||
buildInputs = [ wayland obs-studio libX11 ]; |
||||
|
||||
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 V ]; |
||||
license = licenses.gpl3Plus; |
||||
platforms = [ "x86_64-linux" ]; |
||||
}; |
||||
} |
@ -1,57 +0,0 @@ |
||||
{ lib |
||||
, stdenv |
||||
, fetchFromGitHub |
||||
, fetchpatch |
||||
, cmake |
||||
, qtbase |
||||
, obs-studio |
||||
}: |
||||
|
||||
stdenv.mkDerivation rec { |
||||
pname = "obs-v4l2sink"; |
||||
version = "0.1.0-12-g1ec3c8a"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "CatxFish"; |
||||
repo = "obs-v4l2sink"; |
||||
rev = version; |
||||
sha256 = "03ah91cm1qz26k90mfx51l0d598i9bcmw39lkikjs1msm4c9dfxx"; |
||||
}; |
||||
|
||||
nativeBuildInputs = [ cmake ]; |
||||
buildInputs = [ qtbase obs-studio ]; |
||||
|
||||
dontWrapQtApps = true; |
||||
|
||||
patches = [ |
||||
# Fixes the segfault when stopping the plugin |
||||
(fetchpatch { |
||||
url = "https://github.com/CatxFish/obs-v4l2sink/commit/6604f01796d1b84a95714730ea51a6b8ac0e450b.diff"; |
||||
sha256 = "0crcvw02dj0aqy7hnhizjdsnhiw03zmg6cbdkasxz2mrrbyc3s88"; |
||||
}) |
||||
]; |
||||
|
||||
cmakeFlags = with lib; [ |
||||
"-DLIBOBS_INCLUDE_DIR=${obs-studio.src}/libobs" |
||||
]; |
||||
|
||||
# obs-studio expects the shared object to be located in bin/32bit or bin/64bit |
||||
# https://github.com/obsproject/obs-studio/blob/d60c736cb0ec0491013293c8a483d3a6573165cb/libobs/obs-nix.c#L48 |
||||
postInstall = let |
||||
pluginPath = { |
||||
i686-linux = "bin/32bit"; |
||||
x86_64-linux = "bin/64bit"; |
||||
}.${stdenv.targetPlatform.system} or (throw "Unsupported system: ${stdenv.targetPlatform.system}"); |
||||
in '' |
||||
mkdir -p $out/share/obs/obs-plugins/v4l2sink/${pluginPath} |
||||
ln -s $out/lib/obs-plugins/v4l2sink.so $out/share/obs/obs-plugins/v4l2sink/${pluginPath} |
||||
''; |
||||
|
||||
meta = with lib; { |
||||
description = "obs studio output plugin for Video4Linux2 device"; |
||||
homepage = "https://github.com/CatxFish/obs-v4l2sink"; |
||||
maintainers = with maintainers; [ colemickens peelz ]; |
||||
license = licenses.gpl2; |
||||
platforms = [ "x86_64-linux" "i686-linux" ]; |
||||
}; |
||||
} |
@ -1,42 +0,0 @@ |
||||
# (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, pkg-config, 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 pkg-config 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" ]; |
||||
}; |
||||
} |
@ -0,0 +1,21 @@ |
||||
{ obs-studio, symlinkJoin, makeWrapper }: |
||||
|
||||
{ plugins ? [] }: |
||||
|
||||
symlinkJoin { |
||||
name = "wrapped-${obs-studio.name}"; |
||||
|
||||
nativeBuildInputs = [ makeWrapper ]; |
||||
paths = [ obs-studio ] ++ plugins; |
||||
|
||||
postBuild = '' |
||||
wrapProgram $out/bin/obs \ |
||||
--set OBS_PLUGINS_PATH "$out/lib/obs-plugins" \ |
||||
--set OBS_PLUGINS_DATA_PATH "$out/share/obs/obs-plugins" |
||||
''; |
||||
|
||||
inherit (obs-studio) meta; |
||||
passthru = obs-studio.passthru // { |
||||
passthru.unwrapped = obs-studio; |
||||
}; |
||||
} |
Loading…
Reference in new issue