Unverified Commit fcebf19a authored by Franz Pletz's avatar Franz Pletz Committed by GitHub
Browse files

obs-studio: 31.1.2 -> 32.0.1 (#447035)

parents 3e9e89be 6bb697f1
Loading
Loading
Loading
Loading
+0 −33
Original line number Diff line number Diff line
From 0de0a90f8fe5e1e48fa4ec7aa7c825ef88770f9d Mon Sep 17 00:00:00 2001
From: Ryan Foster <RytoEX@gmail.com>
Date: Mon, 9 Sep 2019 23:55:02 -0400
Subject: [PATCH] Enable file access and universal access for file URLs

When loading a local file, instead of disabling CEF's web security,
enable file access and universal access for file URLs. This should allow
local files to make CORS requests without completely disabling CEF's
security model.
---
 obs-browser-source.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/obs-browser-source.cpp b/obs-browser-source.cpp
index 09b3017..1094340 100644
--- a/plugins/obs-browser/obs-browser-source.cpp
+++ b/plugins/obs-browser/obs-browser-source.cpp
@@ -239,9 +239,12 @@ bool BrowserSource::CreateBrowser()
 
 #if ENABLE_LOCAL_FILE_URL_SCHEME && CHROME_VERSION_BUILD < 4430
 		if (is_local) {
-			/* Disable web security for file:// URLs to allow
-			 * local content access to remote APIs */
-			cefBrowserSettings.web_security = STATE_DISABLED;
+			/* Enable file access and universal access from file://
+			 * URLs to allow local content access to remote APIs */
+			cefBrowserSettings.file_access_from_file_urls =
+				STATE_ENABLED;
+			cefBrowserSettings.universal_access_from_file_urls =
+				STATE_ENABLED;
 		}
 #endif
 		auto browser = CefBrowserHost::CreateBrowserSync(
+5 −4
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@
  libdatachannel,
  libvpl,
  qrcodegencpp,
  simde,
  nix-update-script,
  extra-cmake-modules,
}:
@@ -82,21 +83,19 @@ let
in
stdenv.mkDerivation (finalAttrs: {
  pname = "obs-studio";
  version = "31.1.2";
  version = "32.0.1";

  src = fetchFromGitHub {
    owner = "obsproject";
    repo = "obs-studio";
    rev = finalAttrs.version;
    hash = "sha256-QZoIyjliVruDPZj8hzTABaDn+nCTVs5qQCdBLtSOKvI=";
    hash = "sha256-99VAVV3hEMDI2R30OrX/in/9KtesUxMGOPg6yT5e4oM=";
    fetchSubmodules = true;
  };

  separateDebugInfo = true;

  patches = [
    # Lets obs-browser build against CEF 90.1.0+
    ./Enable-file-access-and-universal-access-for-file-URL.patch
    ./fix-nix-plugin-path.patch
  ];

@@ -156,6 +155,8 @@ stdenv.mkDerivation (finalAttrs: {
  ++ optional browserSupport cef
  ++ optional withFdk fdk_aac;

  propagatedBuildInputs = [ simde ];

  # Copied from the obs-linuxbrowser
  postUnpack = lib.optionalString browserSupport ''
    ln -s ${cef} cef
+0 −4
Original line number Diff line number Diff line
@@ -60,8 +60,6 @@

  obs-mute-filter = callPackage ./obs-mute-filter.nix { };

  obs-ndi = qt6Packages.callPackage ./obs-ndi { };

  obs-noise = callPackage ./obs-noise.nix { };

  obs-pipewire-audio-capture = callPackage ./obs-pipewire-audio-capture.nix { };
@@ -96,8 +94,6 @@

  obs-tuna = qt6Packages.callPackage ./obs-tuna { };

  obs-urlsource = qt6Packages.callPackage ./obs-urlsource.nix { };

  obs-vaapi = callPackage ./obs-vaapi { };

  obs-vertical-canvas = qt6Packages.callPackage ./obs-vertical-canvas.nix { };
+10 −7
Original line number Diff line number Diff line
@@ -6,23 +6,22 @@
  pkg-config,
  ninja,
  obs-studio,
  libuiohook,
  qtbase,
  xorg,
  libxkbcommon,
  libxkbfile,
  SDL2,
  sdl3,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "obs-input-overlay";
  version = "5.0.6";
  version = "5.1.0-unstable-2025-09-23";

  src = fetchFromGitHub {
    owner = "univrsal";
    repo = "input-overlay";
    tag = finalAttrs.version;
    hash = "sha256-ju4u7hhx+hTuq7Oh0DBPV8RRM8zqyyvYV74KymU0+2c=";
    rev = "4d62e7d0c55f8ff62c3a0e7b1a8f3092086b23b7";
    hash = "sha256-cUULaOoV4fffEvsHkcG3lnFCIHSvnv3LHg+SDuuVLao=";
    fetchSubmodules = true;
  };

@@ -34,9 +33,8 @@ stdenv.mkDerivation (finalAttrs: {

  buildInputs = [
    obs-studio
    libuiohook
    qtbase
    SDL2
    sdl3
    xorg.libX11
    xorg.libXau
    xorg.libXdmcp
@@ -57,6 +55,11 @@ stdenv.mkDerivation (finalAttrs: {
    sed -i '/set(CMAKE_CXX_FLAGS "-march=native")/d' 'source/CMakeLists.txt'
  '';

  preFixup = ''
    # Remove broken uiohook development files
    rm -r $out/lib/cmake $out/lib/pkgconfig
  '';

  dontWrapQtApps = true;

  meta = {
+0 −62
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  obs-studio,
  cmake,
  qtbase,
  ndi,
  curl,
}:

stdenv.mkDerivation rec {
  pname = "obs-ndi";
  version = "4.14.1";

  nativeBuildInputs = [
    cmake
    qtbase
  ];
  buildInputs = [
    obs-studio
    qtbase
    ndi
    curl
  ];

  src = fetchFromGitHub {
    owner = "Palakis";
    repo = "obs-ndi";
    rev = version;
    sha256 = "sha256-ex/fZmZpFM6GTKNBQClzSf6Ns0Yts5+0PAmf5mIQCwc=";
  };

  patches = [
    ./hardcode-ndi-path.patch
  ];

  postPatch = ''
    # Add path (variable added in hardcode-ndi-path.patch
    sed -i -e s,@NDI@,${ndi},g src/plugin-main.cpp

    # Replace bundled NDI SDK with the upstream version
    # (This fixes soname issues)
    rm -rf lib/ndi
    ln -s ${ndi}/include lib/ndi
  '';

  cmakeFlags = [ "-DENABLE_QT=ON" ];

  env.NIX_CFLAGS_COMPILE = "-Wno-deprecated-declarations";

  dontWrapQtApps = true;

  meta = with lib; {
    description = "Network A/V plugin for OBS Studio";
    homepage = "https://github.com/Palakis/obs-ndi";
    license = licenses.gpl2;
    maintainers = with maintainers; [ jshcmpbll ];
    platforms = platforms.linux;
    hydraPlatforms = ndi.meta.hydraPlatforms;
  };
}
Loading