summary refs log tree commit diff
path: root/pkgs/applications/video/obs-studio
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-01-28 12:23:55 +0000
committerGitHub <noreply@github.com>2021-01-28 12:23:55 +0000
commit2e78c8c736d2e4b66f056953f3687888769ab325 (patch)
treea09931e897b8f5073570c9210d96b5f04c813ca1 /pkgs/applications/video/obs-studio
parent7e0ff70afd6d556eaa831e35a71f851a2eb9f3f2 (diff)
parent2e6c34fd11a81b4e3ef73df28a1b4b605a51e776 (diff)
downloadnixpkgs-2e78c8c736d2e4b66f056953f3687888769ab325.tar
nixpkgs-2e78c8c736d2e4b66f056953f3687888769ab325.tar.gz
nixpkgs-2e78c8c736d2e4b66f056953f3687888769ab325.tar.bz2
nixpkgs-2e78c8c736d2e4b66f056953f3687888769ab325.tar.lz
nixpkgs-2e78c8c736d2e4b66f056953f3687888769ab325.tar.xz
nixpkgs-2e78c8c736d2e4b66f056953f3687888769ab325.tar.zst
nixpkgs-2e78c8c736d2e4b66f056953f3687888769ab325.zip
Merge staging-next into staging
Diffstat (limited to 'pkgs/applications/video/obs-studio')
-rw-r--r--pkgs/applications/video/obs-studio/obs-gstreamer.nix44
1 files changed, 44 insertions, 0 deletions
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 00000000000..e32ec7575b2
--- /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" ];
+  };
+}