diff --git a/third_party/nixpkgs/pkgs/applications/video/obs-studio/Provide-runtime-plugin-destination-as-relative-path.patch b/third_party/nixpkgs/pkgs/applications/video/obs-studio/Provide-runtime-plugin-destination-as-relative-path.patch index b39cb04a89..062a58b42d 100644 --- a/third_party/nixpkgs/pkgs/applications/video/obs-studio/Provide-runtime-plugin-destination-as-relative-path.patch +++ b/third_party/nixpkgs/pkgs/applications/video/obs-studio/Provide-runtime-plugin-destination-as-relative-path.patch @@ -1,26 +1,41 @@ +From e8c4b54f753e57382ec756f07c114202bd9a19b8 Mon Sep 17 00:00:00 2001 +From: Luke Granger-Brown +Date: Thu, 6 Jul 2023 15:30:49 +0100 +Subject: [PATCH] Provide runtime plugin destination as relative path + +--- + libobs/CMakeLists.txt | 2 ++ + libobs/obsconfig.h.in | 2 +- + 2 files changed, 3 insertions(+), 1 deletion(-) + diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt -index 790583cd5..763cf3548 100644 +index 1c092e1b8..3916a6216 100644 --- a/libobs/CMakeLists.txt +++ b/libobs/CMakeLists.txt -@@ -455,6 +455,8 @@ elseif(OS_POSIX) - libobs PROPERTIES BUILD_RPATH "$") +@@ -253,6 +253,8 @@ elseif(OS_FREEBSD) + include(cmake/os-freebsd.cmake) endif() -+string(REGEX REPLACE "^${OBS_INSTALL_PREFIX}" "" OBS_PLUGIN_DESTINATION_RELATIVE ${OBS_PLUGIN_DESTINATION}) ++set(OBS_PLUGIN_DESTINATION_RELATIVE "lib/obs-plugins") + - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/obsconfig.h.in - ${CMAKE_BINARY_DIR}/config/obsconfig.h) - + configure_file(obsconfig.h.in "${CMAKE_BINARY_DIR}/config/obsconfig.h" @ONLY) + target_include_directories(libobs PUBLIC "$" + "$") diff --git a/libobs/obsconfig.h.in b/libobs/obsconfig.h.in -index 4a664285a..5cff2ca53 100644 +index b4de06623..c6dd9aba8 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@ +@@ -2,7 +2,9 @@ - #cmakedefine LINUX_PORTABLE + #cmakedefine OBS_DATA_PATH "@OBS_DATA_PATH@" + #cmakedefine OBS_PLUGIN_PATH "@OBS_PLUGIN_PATH@" +-#cmakedefine OBS_PLUGIN_DESTINATION "@OBS_PLUGIN_DESTINATION@" ++#define OBS_PLUGIN_DESTINATION "lib/obs-plugins" ++#cmakedefine OBS_PLUGIN_DESTINATION_ORIG "@OBS_PLUGIN_DESTINATION@" ++#cmakedefine OBS_INSTALL_PREFIX "@OBS_INSTALL_PREFIX@" + + #cmakedefine GIO_FOUND + #cmakedefine PULSEAUDIO_FOUND +-- +2.40.1 + diff --git a/third_party/nixpkgs/pkgs/applications/video/obs-studio/default.nix b/third_party/nixpkgs/pkgs/applications/video/obs-studio/default.nix index 2ac85084b4..6270fd6cb9 100644 --- a/third_party/nixpkgs/pkgs/applications/video/obs-studio/default.nix +++ b/third_party/nixpkgs/pkgs/applications/video/obs-studio/default.nix @@ -25,7 +25,7 @@ , wrapGAppsHook , scriptingSupport ? true , luajit -, swig +, swig4 , python3 , alsaSupport ? stdenv.isLinux , alsa-lib @@ -42,6 +42,10 @@ , srt , qtwayland , wrapQtAppsHook +, nlohmann_json +, websocketpp +, asio +, libdatachannel }: let @@ -50,19 +54,17 @@ let in stdenv.mkDerivation rec { pname = "obs-studio"; - version = "29.0.2"; + version = "unstable-2023-07-06"; src = fetchFromGitHub { owner = "obsproject"; repo = "obs-studio"; - rev = version; - sha256 = "sha256-TIUSjyPEsKRNTSLQXuLJGEgD989hJ5GhOsqJ4nkKVsY="; + rev = "e4a3f80f9fc90b0c9a65c96d343322ba3f1e6bcd"; + sha256 = "sha256:0gs44bqvz776jw7kl8r59y6n392rhmgznhzwv5ap9y8gc3nggvga"; fetchSubmodules = true; }; patches = [ - # Lets obs-browser build against CEF 90.1.0+ - ./Enable-file-access-and-universal-access-for-file-URL.patch ./Provide-runtime-plugin-destination-as-relative-path.patch ]; @@ -73,7 +75,7 @@ stdenv.mkDerivation rec { wrapGAppsHook wrapQtAppsHook ] - ++ optional scriptingSupport swig; + ++ optional scriptingSupport swig4; buildInputs = [ curl @@ -99,6 +101,10 @@ stdenv.mkDerivation rec { libva srt qtwayland + nlohmann_json + websocketpp + asio + libdatachannel ] ++ optionals scriptingSupport [ luajit python3 ] ++ optional alsaSupport alsa-lib @@ -121,14 +127,16 @@ stdenv.mkDerivation rec { # DL_OPENGL is an explicit path. Not sure if there's a better way # to handle this. cmakeFlags = [ - "-DCMAKE_CXX_FLAGS=-DDL_OPENGL=\\\"$(out)/lib/libobs-opengl.so\\\"" - "-DOBS_VERSION_OVERRIDE=${version}" + "-DOBS_VERSION_OVERRIDE=30.0.0" "-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" ]; + preConfigure = '' + cmakeFlagsArray+=("-DCMAKE_CXX_FLAGS=-UDL_OPENGL -DDL_OPENGL=\\\"$out/lib/libobs-opengl.so\\\"") + ''; dontWrapGApps = true; preFixup = '' diff --git a/third_party/nixpkgs/pkgs/development/libraries/libdatachannel/default.nix b/third_party/nixpkgs/pkgs/development/libraries/libdatachannel/default.nix new file mode 100644 index 0000000000..ded8e2732d --- /dev/null +++ b/third_party/nixpkgs/pkgs/development/libraries/libdatachannel/default.nix @@ -0,0 +1,43 @@ +{ stdenv +, lib +, fetchFromGitHub +, cmake +, openssl +, srtp +, usrsctp +, plog +, nlohmann_json +, libnice +}: + +stdenv.mkDerivation rec { + pname = "libdatachannel"; + version = "0.19.0-alpha.4"; + + src = fetchFromGitHub { + owner = "paullouisageneau"; + repo = "libdatachannel"; + rev = "v${version}"; + sha256 = "sha256-PRH0XfO+nr6KQfWmeV5S7VsWF6HxFB44DSrO1I9CI6g="; + }; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ + openssl srtp usrsctp plog nlohmann_json libnice + ]; + + cmakeFlags = [ + "-DPREFER_SYSTEM_LIB=ON" + "-DUSE_NICE=ON" + "-DNO_EXAMPLES=ON" + "-DNO_TESTS=ON" # wants ICE/STUN server on the internet + ]; + + meta = with lib; { + description = "C/C++ WebRTC network library"; + maintainers = with maintainers; [ lukegb ]; + platforms = platforms.all; + license = with licenses; [ mpl20 ]; + }; + +} diff --git a/third_party/nixpkgs/pkgs/development/libraries/plog/default.nix b/third_party/nixpkgs/pkgs/development/libraries/plog/default.nix new file mode 100644 index 0000000000..6afa21cc34 --- /dev/null +++ b/third_party/nixpkgs/pkgs/development/libraries/plog/default.nix @@ -0,0 +1,31 @@ +{ stdenv +, lib +, fetchFromGitHub +, cmake +, openssl +, srtp +, usrsctp +, plog # todo +, nlohmann_json +}: + +stdenv.mkDerivation rec { + pname = "plog"; + version = "1.1.9"; + + src = fetchFromGitHub { + owner = "SergiusTheBest"; + repo = "plog"; + rev = version; + sha256 = "sha256-CARTr1EEqXNJtp6XwHhr7aiRBiYR0cClzexpNCMaQJc="; + }; + + nativeBuildInputs = [ cmake ]; + + meta = with lib; { + description = "Portable, simple and extensible C++ logging library"; + maintainers = with maintainers; [ lukegb ]; + platforms = platforms.all; + license = with licenses; [ mit ]; + }; +} diff --git a/third_party/nixpkgs/pkgs/top-level/all-packages.nix b/third_party/nixpkgs/pkgs/top-level/all-packages.nix index 26e08cfb69..0b9cf4b5d5 100644 --- a/third_party/nixpkgs/pkgs/top-level/all-packages.nix +++ b/third_party/nixpkgs/pkgs/top-level/all-packages.nix @@ -33136,6 +33136,9 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) Foundation; }; + plog = callPackage ../development/libraries/plog { }; + libdatachannel = callPackage ../development/libraries/libdatachannel { }; + obs-studio = qt6Packages.callPackage ../applications/video/obs-studio { ffmpeg_4 = ffmpeg-full; };