From df751a35b6fe362765cedbc0a9fdc0021dbc9fbb Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Fri, 11 Nov 2022 04:41:41 +0100 Subject: [PATCH] obs-studio-plugins.obs-multi-rtmp: add OBS28 support Co-authored-by: Raphael Robatsch --- .../video/obs-studio/plugins/default.nix | 4 +- .../default.nix} | 9 ++-- .../plugins/obs-multi-rtmp/fix-build.patch | 54 +++++++++++++++++++ 3 files changed, 61 insertions(+), 6 deletions(-) rename pkgs/applications/video/obs-studio/plugins/{obs-multi-rtmp.nix => obs-multi-rtmp/default.nix} (76%) create mode 100644 pkgs/applications/video/obs-studio/plugins/obs-multi-rtmp/fix-build.patch diff --git a/pkgs/applications/video/obs-studio/plugins/default.nix b/pkgs/applications/video/obs-studio/plugins/default.nix index 846a03897ba9..923013d8b527 100644 --- a/pkgs/applications/video/obs-studio/plugins/default.nix +++ b/pkgs/applications/video/obs-studio/plugins/default.nix @@ -1,4 +1,4 @@ -{ callPackage, libsForQt5, pkgsi686Linux }: +{ callPackage, libsForQt5, qt6Packages, pkgsi686Linux }: # When adding new plugins: # - Respect alphabetical order. On diversion, file a PR. @@ -16,7 +16,7 @@ obs-move-transition = callPackage ./obs-move-transition.nix { }; - obs-multi-rtmp = libsForQt5.callPackage ./obs-multi-rtmp.nix { }; + obs-multi-rtmp = qt6Packages.callPackage ./obs-multi-rtmp { }; obs-ndi = libsForQt5.callPackage ./obs-ndi.nix { }; diff --git a/pkgs/applications/video/obs-studio/plugins/obs-multi-rtmp.nix b/pkgs/applications/video/obs-studio/plugins/obs-multi-rtmp/default.nix similarity index 76% rename from pkgs/applications/video/obs-studio/plugins/obs-multi-rtmp.nix rename to pkgs/applications/video/obs-studio/plugins/obs-multi-rtmp/default.nix index a6c84cbbbef0..e7c0d144b41d 100644 --- a/pkgs/applications/video/obs-studio/plugins/obs-multi-rtmp.nix +++ b/pkgs/applications/video/obs-studio/plugins/obs-multi-rtmp/default.nix @@ -2,20 +2,21 @@ stdenv.mkDerivation rec { pname = "obs-multi-rtmp"; - version = "0.2.8.1"; + version = "0.2.8.1-OBS28"; src = fetchFromGitHub { owner = "sorayuki"; repo = "obs-multi-rtmp"; rev = version; - sha256 = "sha256-OhatuSlDJ2VDNorM4QfoKPYKyv5YpN8EnIelLdBTlZ0="; + sha256 = "sha256-1W+c8Y0AmtKQmCIg8IDAaYYStQzDpZRuqw3vZEY5ncU="; }; nativeBuildInputs = [ cmake ]; buildInputs = [ obs-studio qtbase ]; - cmakeFlags = [ - "-DLIBOBS_INCLUDE_DIR=${obs-studio}/include/obs" + patches = [ + # Patch cmake file to link against the obs build output, instead of its sources + ./fix-build.patch ]; dontWrapQtApps = true; diff --git a/pkgs/applications/video/obs-studio/plugins/obs-multi-rtmp/fix-build.patch b/pkgs/applications/video/obs-studio/plugins/obs-multi-rtmp/fix-build.patch new file mode 100644 index 000000000000..dd40fc7e9595 --- /dev/null +++ b/pkgs/applications/video/obs-studio/plugins/obs-multi-rtmp/fix-build.patch @@ -0,0 +1,54 @@ +From 72aeddb52c2b656bfec918097ad07a0ff092008b Mon Sep 17 00:00:00 2001 +From: Raphael Robatsch +Date: Thu, 13 Oct 2022 21:34:21 +0200 +Subject: [PATCH] Link against OBS public interface instead of sources + +--- + CMakeLists.txt | 22 ++++------------------ + 1 file changed, 4 insertions(+), 18 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 27e20f8..8725c5b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -65,15 +65,9 @@ if (WIN32) + "/def:${CMAKE_CURRENT_BINARY_DIR}/obs-frontend-api.def" + "/out:${CMAKE_CURRENT_BINARY_DIR}/obs-frontend-api.lib" + ) +-elseif (APPLE) +- # macOS +- find_library(_LIB_OBS "${LIB_OBS}.0.dylib" PATHS ${OBS_BIN_DIR} REQUIRED) +- set(LIB_OBS "${_LIB_OBS}") +-elseif (UNIX) +- # Linux +- find_package(LibObs REQUIRED) + else () +- message(FATAL_ERROR "Unsupported OS!") ++ find_package(libobs REQUIRED) ++ find_package(obs-frontend-api REQUIRED) + endif () + + +@@ -96,18 +90,10 @@ if (WIN32) + "${CMAKE_CURRENT_BINARY_DIR}/version.rc" + ) + endif () +-target_include_directories(obs-multi-rtmp PRIVATE +- "${OBS_SRC_DIR}/libobs" +- "${OBS_SRC_DIR}/UI/obs-frontend-api" +-) +-target_link_directories(obs-multi-rtmp PRIVATE +- "${CMAKE_CURRENT_BINARY_DIR}" +- ${OBS_BIN_DIR} +-) + target_link_libraries(obs-multi-rtmp PRIVATE + Qt6::Widgets +- ${LIB_OBS} +- obs-frontend-api ++ OBS::libobs ++ OBS::obs-frontend-api + ) + + if (WIN32) +-- +2.37.3