From 3344d206551b107513437d9307be6e767588f2b7 Mon Sep 17 00:00:00 2001 From: Ales Huzik Date: Wed, 27 Jan 2021 23:01:59 +1100 Subject: [PATCH] obs-gstreamer: init at 0.2.1 --- .../video/obs-studio/obs-gstreamer.nix | 44 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 46 insertions(+) create mode 100644 pkgs/applications/video/obs-studio/obs-gstreamer.nix diff --git a/pkgs/applications/video/obs-studio/obs-gstreamer.nix b/pkgs/applications/video/obs-studio/obs-gstreamer.nix new file mode 100644 index 000000000000..e32ec7575b2d --- /dev/null +++ b/pkgs/applications/video/obs-studio/obs-gstreamer.nix @@ -0,0 +1,44 @@ +{ lib +, stdenv +, fetchFromGitHub +, gst_all_1 +, pkg-config +, meson +, ninja +, obs-studio +}: + +stdenv.mkDerivation rec { + pname = "obs-gstreamer"; + version = "0.2.1"; + + src = fetchFromGitHub { + owner = "fzwoch"; + repo = "obs-gstreamer"; + rev = "v${version}"; + sha256 = "1fdpwr8br8x9cnrhr3j4f0l81df26n3bj2ibi3cg96rl86054nid"; + }; + + nativeBuildInputs = [ pkg-config meson ninja ]; + buildInputs = [ gst_all_1.gstreamermm obs-studio ]; + + # 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/obs-gstreamer/${pluginPath} + ln -s $out/lib/obs-plugins/obs-gstreamer.so $out/share/obs/obs-plugins/obs-gstreamer/${pluginPath} + ''; + + meta = with lib; { + description = "An OBS Studio source, encoder and video filter plugin to use GStreamer elements/pipelines in OBS Studio"; + homepage = "https://github.com/fswoch/obs-gstreamer"; + maintainers = with maintainers; [ ahuzik ]; + license = licenses.gpl2Plus; + platforms = [ "x86_64-linux" "i686-linux" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 73b42d95b288..34ec0591aaf3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23884,6 +23884,8 @@ in obs-wlrobs = callPackage ../applications/video/obs-studio/wlrobs.nix { }; + obs-gstreamer = callPackage ../applications/video/obs-studio/obs-gstreamer.nix { }; + obs-move-transition = callPackage ../applications/video/obs-studio/obs-move-transition.nix { }; obs-v4l2sink = libsForQt5.callPackage ../applications/video/obs-studio/v4l2sink.nix { };