Skip to content

Commit

Permalink
Merge pull request #194578 from SebTM/update/obs2803
Browse files Browse the repository at this point in the history
  • Loading branch information
fpletz committed Nov 11, 2022
2 parents 164db2b + 9f7914a commit d28a094
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 74 deletions.
7 changes: 7 additions & 0 deletions pkgs/applications/video/obs-studio/27.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{ callPackage, qtx11extras, ... } @ args:

callPackage ./generic.nix (args // {
version = "27.2.4";
sha256 = "sha256-OiSejQovSmhItrnrQlcVp9PCDRgAhuxTinSpXbH8bo0=";
extraBuildInputs = [ qtx11extras ];
})
22 changes: 22 additions & 0 deletions pkgs/applications/video/obs-studio/28.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ callPackage
, libajantv2
, librist
, srt
, qtwayland
, ...
} @ args:

callPackage ./generic.nix (args // {
version = "28.0.3";
sha256 = "sha256-+4H1BjEgxqkAEvRyr2Tg3wXutnMvlYQEdT5jz644fMA=";
extraPatches = [ ./Provide-runtime-plugin-destination-as-relative-path.patch ];
extraBuildInputs = [
libajantv2
librist
srt
qtwayland
];
extraCMakeFlags = [
"-DENABLE_JACK=ON"
];
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt
index 790583cd5..763cf3548 100644
--- a/libobs/CMakeLists.txt
+++ b/libobs/CMakeLists.txt
@@ -455,6 +455,8 @@ elseif(OS_POSIX)
libobs PROPERTIES BUILD_RPATH "$<TARGET_FILE_DIR:OBS::libobs-opengl>")
endif()

+string(REGEX REPLACE "^${OBS_INSTALL_PREFIX}" "" OBS_PLUGIN_DESTINATION_RELATIVE ${OBS_PLUGIN_DESTINATION})
+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/obsconfig.h.in
${CMAKE_BINARY_DIR}/config/obsconfig.h)

diff --git a/libobs/obsconfig.h.in b/libobs/obsconfig.h.in
index 4a664285a..5cff2ca53 100644
--- a/libobs/obsconfig.h.in
+++ b/libobs/obsconfig.h.in
@@ -13,7 +13,7 @@
#define OBS_VERSION_CANONICAL "@OBS_VERSION_CANONICAL@"
#define OBS_DATA_PATH "@OBS_DATA_PATH@"
#define OBS_INSTALL_PREFIX "@OBS_INSTALL_PREFIX@"
-#define OBS_PLUGIN_DESTINATION "@OBS_PLUGIN_DESTINATION@"
+#define OBS_PLUGIN_DESTINATION "@OBS_PLUGIN_DESTINATION_RELATIVE@"
#define OBS_QT_VERSION @_QT_VERSION@

#cmakedefine LINUX_PORTABLE
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{ config
{ version
, sha256
, extraPatches ? [ ]
, extraBuildInputs ? [ ]
, extraCMakeFlags ? [ ]
, config
, lib
, stdenv
, mkDerivation
, fetchFromGitHub
, addOpenGLRunpath
, cmake
Expand All @@ -13,7 +17,6 @@
, libpthreadstubs
, libXdmcp
, qtbase
, qtx11extras
, qtsvg
, speex
, libv4l
Expand All @@ -38,34 +41,37 @@
, pipewireSupport ? stdenv.isLinux
, pipewire
, libdrm
, wrapQtAppsHook
, ...
}:

let
inherit (lib) optional optionals;

in
mkDerivation rec {
stdenv.mkDerivation rec {
pname = "obs-studio";
version = "27.2.4";
inherit version;

src = fetchFromGitHub {
owner = "obsproject";
repo = "obs-studio";
rev = version;
sha256 = "sha256-OiSejQovSmhItrnrQlcVp9PCDRgAhuxTinSpXbH8bo0=";
inherit sha256;
fetchSubmodules = true;
};

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

nativeBuildInputs = [
addOpenGLRunpath
cmake
pkg-config
wrapGAppsHook
wrapQtAppsHook
]
++ optional scriptingSupport swig;

Expand All @@ -81,7 +87,6 @@ mkDerivation rec {
libpthreadstubs
libXdmcp
qtbase
qtx11extras
qtsvg
speex
wayland
Expand All @@ -90,6 +95,7 @@ mkDerivation rec {
mbedtls
pciutils
]
++ extraBuildInputs
++ optionals scriptingSupport [ luajit python3 ]
++ optional alsaSupport alsa-lib
++ optional pulseaudioSupport libpulseaudio
Expand Down Expand Up @@ -117,7 +123,7 @@ mkDerivation rec {
# Add support for browser source
"-DBUILD_BROWSER=ON"
"-DCEF_ROOT_DIR=../../cef"
];
] ++ extraCMakeFlags;

dontWrapGApps = true;
preFixup = ''
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/video/obs-studio/plugins/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
obs-vkcapture32 = pkgsi686Linux.obs-studio-plugins.obs-vkcapture;
};

obs-websocket = libsForQt5.callPackage ./obs-websocket.nix { };
obs-websocket = throw "obs-websocket has been removed: Functionality has been integrated into obs-studio itself.";

wlrobs = callPackage ./wlrobs.nix { };
}
63 changes: 0 additions & 63 deletions pkgs/applications/video/obs-studio/plugins/obs-websocket.nix

This file was deleted.

9 changes: 8 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30962,9 +30962,16 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) Foundation;
};

obs-studio = libsForQt5.callPackage ../applications/video/obs-studio {
obs-studio27 = libsForQt5.callPackage ../applications/video/obs-studio/27.nix {
ffmpeg_4 = ffmpeg-full;
};

obs-studio28 = qt6Packages.callPackage ../applications/video/obs-studio/28.nix {
ffmpeg_4 = ffmpeg-full;
};

obs-studio = obs-studio28;

obs-studio-plugins = recurseIntoAttrs (callPackage ../applications/video/obs-studio/plugins {});
wrapOBS = callPackage ../applications/video/obs-studio/wrapper.nix {};

Expand Down

0 comments on commit d28a094

Please sign in to comment.