about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/video/obs-studio/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/video/obs-studio/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/video/obs-studio/default.nix62
1 files changed, 47 insertions, 15 deletions
diff --git a/nixpkgs/pkgs/applications/video/obs-studio/default.nix b/nixpkgs/pkgs/applications/video/obs-studio/default.nix
index a19e996064a0..74b19296dbdf 100644
--- a/nixpkgs/pkgs/applications/video/obs-studio/default.nix
+++ b/nixpkgs/pkgs/applications/video/obs-studio/default.nix
@@ -2,10 +2,11 @@
 , lib
 , stdenv
 , fetchFromGitHub
+, fetchpatch
 , addOpenGLRunpath
 , cmake
 , fdk_aac
-, ffmpeg_4
+, ffmpeg
 , jansson
 , libjack2
 , libxkbcommon
@@ -35,6 +36,7 @@
 , libcef
 , pciutils
 , pipewireSupport ? stdenv.isLinux
+, withFdk ? true
 , pipewire
 , libdrm
 , libajantv2
@@ -48,21 +50,24 @@
 , asio
 , decklinkSupport ? false
 , blackmagic-desktop-video
+, libdatachannel
+, libvpl
+, qrcodegencpp
 }:
 
 let
   inherit (lib) optional optionals;
-
 in
-stdenv.mkDerivation rec {
+
+stdenv.mkDerivation (finalAttrs: {
   pname = "obs-studio";
-  version = "29.1.3";
+  version = "30.0.2";
 
   src = fetchFromGitHub {
     owner = "obsproject";
-    repo = "obs-studio";
-    rev = version;
-    sha256 = "sha256-D0DPueMtopwz5rLgM8QcPT7DgTKcJKQHnst69EY9V6Q=";
+    repo = finalAttrs.pname;
+    rev = finalAttrs.version;
+    sha256 = "sha256-8pX1kqibrtDIaE1+/Pey1A5bu6MwFTXLrBOah4rsF+4=";
     fetchSubmodules = true;
   };
 
@@ -70,6 +75,25 @@ stdenv.mkDerivation rec {
     # Lets obs-browser build against CEF 90.1.0+
     ./Enable-file-access-and-universal-access-for-file-URL.patch
     ./fix-nix-plugin-path.patch
+
+    # Backport ffmpeg 6.1 / GCC 13 build fixes
+    # FIXME: remove in next release
+    (fetchpatch {
+      url = "https://github.com/obsproject/obs-studio/commit/cd784644f5e82b9988043f229c19603289c6d32c.patch";
+      hash = "sha256-S4JE5kgr4x3uMHY2GRh0GBJpb7o/wYZb/v0CDITFNnQ=";
+    })
+    (fetchpatch {
+      url = "https://github.com/obsproject/obs-studio/commit/758b47d4ed9a25b8d64ad481d8d039990b9e57c9.patch";
+      hash = "sha256-jYpjwhx6e+dhN3kzbd6FcdjQ+WhIX0/BOu9PSkt+2yI=";
+    })
+    (fetchpatch {
+      url = "https://github.com/obsproject/obs-studio/commit/4b5be75c7e4b8cee908ed4a02fe0078285b4e8c9.patch";
+      hash = "sha256-tuOevhyxchwG42ilrplbiWoiDAKaY4HgzShlvp4VSQI=";
+    })
+    (fetchpatch {
+      url = "https://github.com/obsproject/obs-studio/commit/6e080a68067b27fe5463f0f4eee7df690451f3d7.patch";
+      hash = "sha256-nbn/q3uszoHaDvaW8Et1MS1sgQzMsJRmjGSMHzUxV70=";
+    })
   ];
 
   nativeBuildInputs = [
@@ -83,8 +107,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     curl
-    fdk_aac
-    ffmpeg_4
+    ffmpeg
     jansson
     libcef
     libjack2
@@ -108,11 +131,15 @@ stdenv.mkDerivation rec {
     nlohmann_json
     websocketpp
     asio
+    libdatachannel
+    libvpl
+    qrcodegencpp
   ]
   ++ optionals scriptingSupport [ luajit python3 ]
   ++ optional alsaSupport alsa-lib
   ++ optional pulseaudioSupport libpulseaudio
-  ++ optionals pipewireSupport [ pipewire libdrm ];
+  ++ optionals pipewireSupport [ pipewire libdrm ]
+  ++ optional withFdk fdk_aac;
 
   # Copied from the obs-linuxbrowser
   postUnpack = ''
@@ -127,12 +154,17 @@ stdenv.mkDerivation rec {
   '';
 
   cmakeFlags = [
-    "-DOBS_VERSION_OVERRIDE=${version}"
+    "-DOBS_VERSION_OVERRIDE=${finalAttrs.version}"
     "-Wno-dev" # kill dev warnings that are useless for packaging
     # Add support for browser source
     "-DBUILD_BROWSER=ON"
     "-DCEF_ROOT_DIR=../../cef"
     "-DENABLE_JACK=ON"
+    (lib.cmakeBool "ENABLE_QSV11" stdenv.hostPlatform.isx86_64)
+    (lib.cmakeBool "ENABLE_LIBFDK" withFdk)
+    (lib.cmakeBool "ENABLE_ALSA" alsaSupport)
+    (lib.cmakeBool "ENABLE_PULSEAUDIO" pulseaudioSupport)
+    (lib.cmakeBool "ENABLE_PIPEWIRE" pipewireSupport)
   ];
 
   dontWrapGApps = true;
@@ -159,7 +191,7 @@ stdenv.mkDerivation rec {
     addOpenGLRunpath $out/lib/obs-plugins/*.so
 
     # Link libcef again after patchelfing other libs
-    ln -s ${libcef}/lib/libcef.so $out/lib/obs-plugins/libcef.so
+    ln -s ${libcef}/lib/* $out/lib/obs-plugins/
   '';
 
   meta = with lib; {
@@ -170,9 +202,9 @@ stdenv.mkDerivation rec {
       video content, efficiently
     '';
     homepage = "https://obsproject.com";
-    maintainers = with maintainers; [ jb55 MP2E materus ];
-    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ eclairevoyant jb55 MP2E materus fpletz ];
+    license = with licenses; [ gpl2Plus ] ++ optional withFdk fraunhofer-fdk;
     platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];
     mainProgram = "obs";
   };
-}
+})