From 9f7914afa2cd3ddf95621731e486eff2d3993c14 Mon Sep 17 00:00:00 2001 From: Sebastian Sellmeier Date: Wed, 5 Oct 2022 12:36:25 +0200 Subject: obs-studio: add 28.0.3 (parallel to 27.x) --- pkgs/applications/video/obs-studio/27.nix | 7 + pkgs/applications/video/obs-studio/28.nix | 22 +++ ...ntime-plugin-destination-as-relative-path.patch | 26 ++++ pkgs/applications/video/obs-studio/default.nix | 148 -------------------- pkgs/applications/video/obs-studio/generic.nix | 154 +++++++++++++++++++++ .../video/obs-studio/plugins/default.nix | 2 +- .../video/obs-studio/plugins/obs-websocket.nix | 63 --------- 7 files changed, 210 insertions(+), 212 deletions(-) create mode 100644 pkgs/applications/video/obs-studio/27.nix create mode 100644 pkgs/applications/video/obs-studio/28.nix create mode 100644 pkgs/applications/video/obs-studio/Provide-runtime-plugin-destination-as-relative-path.patch delete mode 100644 pkgs/applications/video/obs-studio/default.nix create mode 100644 pkgs/applications/video/obs-studio/generic.nix delete mode 100644 pkgs/applications/video/obs-studio/plugins/obs-websocket.nix (limited to 'pkgs/applications/video') diff --git a/pkgs/applications/video/obs-studio/27.nix b/pkgs/applications/video/obs-studio/27.nix new file mode 100644 index 0000000000000..7be6f46b9d9d1 --- /dev/null +++ b/pkgs/applications/video/obs-studio/27.nix @@ -0,0 +1,7 @@ +{ callPackage, qtx11extras, ... } @ args: + +callPackage ./generic.nix (args // { + version = "27.2.4"; + sha256 = "sha256-OiSejQovSmhItrnrQlcVp9PCDRgAhuxTinSpXbH8bo0="; + extraBuildInputs = [ qtx11extras ]; +}) diff --git a/pkgs/applications/video/obs-studio/28.nix b/pkgs/applications/video/obs-studio/28.nix new file mode 100644 index 0000000000000..edf40b14879c6 --- /dev/null +++ b/pkgs/applications/video/obs-studio/28.nix @@ -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" + ]; +}) diff --git a/pkgs/applications/video/obs-studio/Provide-runtime-plugin-destination-as-relative-path.patch b/pkgs/applications/video/obs-studio/Provide-runtime-plugin-destination-as-relative-path.patch new file mode 100644 index 0000000000000..b39cb04a899c9 --- /dev/null +++ b/pkgs/applications/video/obs-studio/Provide-runtime-plugin-destination-as-relative-path.patch @@ -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 "$") + 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 diff --git a/pkgs/applications/video/obs-studio/default.nix b/pkgs/applications/video/obs-studio/default.nix deleted file mode 100644 index 044967b2e526b..0000000000000 --- a/pkgs/applications/video/obs-studio/default.nix +++ /dev/null @@ -1,148 +0,0 @@ -{ config -, lib -, stdenv -, mkDerivation -, fetchFromGitHub -, addOpenGLRunpath -, cmake -, fdk_aac -, ffmpeg_4 -, jansson -, libjack2 -, libxkbcommon -, libpthreadstubs -, libXdmcp -, qtbase -, qtx11extras -, qtsvg -, speex -, libv4l -, x264 -, curl -, wayland -, xorg -, pkg-config -, libvlc -, mbedtls -, wrapGAppsHook -, scriptingSupport ? true -, luajit -, swig -, python3 -, alsaSupport ? stdenv.isLinux -, alsa-lib -, pulseaudioSupport ? config.pulseaudio or stdenv.isLinux -, libpulseaudio -, libcef -, pciutils -, pipewireSupport ? stdenv.isLinux -, pipewire -, libdrm -}: - -let - inherit (lib) optional optionals; - -in -mkDerivation rec { - pname = "obs-studio"; - version = "27.2.4"; - - src = fetchFromGitHub { - owner = "obsproject"; - repo = "obs-studio"; - rev = version; - sha256 = "sha256-OiSejQovSmhItrnrQlcVp9PCDRgAhuxTinSpXbH8bo0="; - fetchSubmodules = true; - }; - - patches = [ - # Lets obs-browser build against CEF 90.1.0+ - ./Enable-file-access-and-universal-access-for-file-URL.patch - ]; - - nativeBuildInputs = [ - addOpenGLRunpath - cmake - pkg-config - wrapGAppsHook - ] - ++ optional scriptingSupport swig; - - buildInputs = [ - curl - fdk_aac - ffmpeg_4 - jansson - libcef - libjack2 - libv4l - libxkbcommon - libpthreadstubs - libXdmcp - qtbase - qtx11extras - qtsvg - speex - wayland - x264 - libvlc - mbedtls - pciutils - ] - ++ optionals scriptingSupport [ luajit python3 ] - ++ optional alsaSupport alsa-lib - ++ optional pulseaudioSupport libpulseaudio - ++ optionals pipewireSupport [ pipewire libdrm ]; - - # Copied from the obs-linuxbrowser - postUnpack = '' - mkdir -p cef/Release cef/Resources cef/libcef_dll_wrapper/ - for i in ${libcef}/share/cef/*; do - cp -r $i cef/Release/ - cp -r $i cef/Resources/ - done - cp -r ${libcef}/lib/libcef.so cef/Release/ - cp -r ${libcef}/lib/libcef_dll_wrapper.a cef/libcef_dll_wrapper/ - cp -r ${libcef}/include cef/ - ''; - - # obs attempts to dlopen libobs-opengl, it fails unless we make sure - # 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}" - "-Wno-dev" # kill dev warnings that are useless for packaging - # Add support for browser source - "-DBUILD_BROWSER=ON" - "-DCEF_ROOT_DIR=../../cef" - ]; - - dontWrapGApps = true; - preFixup = '' - qtWrapperArgs+=( - --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ xorg.libX11 libvlc ]}" - ''${gappsWrapperArgs[@]} - ) - ''; - - postFixup = lib.optionalString stdenv.isLinux '' - addOpenGLRunpath $out/lib/lib*.so - addOpenGLRunpath $out/lib/obs-plugins/*.so - ''; - - meta = with lib; { - description = "Free and open source software for video recording and live streaming"; - longDescription = '' - This project is a rewrite of what was formerly known as "Open Broadcaster - Software", software originally designed for recording and streaming live - video content, efficiently - ''; - homepage = "https://obsproject.com"; - maintainers = with maintainers; [ jb55 MP2E V miangraham ]; - license = licenses.gpl2Plus; - platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" ]; - mainProgram = "obs"; - }; -} diff --git a/pkgs/applications/video/obs-studio/generic.nix b/pkgs/applications/video/obs-studio/generic.nix new file mode 100644 index 0000000000000..e638cacd06d97 --- /dev/null +++ b/pkgs/applications/video/obs-studio/generic.nix @@ -0,0 +1,154 @@ +{ version +, sha256 +, extraPatches ? [ ] +, extraBuildInputs ? [ ] +, extraCMakeFlags ? [ ] +, config +, lib +, stdenv +, fetchFromGitHub +, addOpenGLRunpath +, cmake +, fdk_aac +, ffmpeg_4 +, jansson +, libjack2 +, libxkbcommon +, libpthreadstubs +, libXdmcp +, qtbase +, qtsvg +, speex +, libv4l +, x264 +, curl +, wayland +, xorg +, pkg-config +, libvlc +, mbedtls +, wrapGAppsHook +, scriptingSupport ? true +, luajit +, swig +, python3 +, alsaSupport ? stdenv.isLinux +, alsa-lib +, pulseaudioSupport ? config.pulseaudio or stdenv.isLinux +, libpulseaudio +, libcef +, pciutils +, pipewireSupport ? stdenv.isLinux +, pipewire +, libdrm +, wrapQtAppsHook +, ... +}: + +let + inherit (lib) optional optionals; + +in +stdenv.mkDerivation rec { + pname = "obs-studio"; + inherit version; + + src = fetchFromGitHub { + owner = "obsproject"; + repo = "obs-studio"; + rev = version; + 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; + + buildInputs = [ + curl + fdk_aac + ffmpeg_4 + jansson + libcef + libjack2 + libv4l + libxkbcommon + libpthreadstubs + libXdmcp + qtbase + qtsvg + speex + wayland + x264 + libvlc + mbedtls + pciutils + ] + ++ extraBuildInputs + ++ optionals scriptingSupport [ luajit python3 ] + ++ optional alsaSupport alsa-lib + ++ optional pulseaudioSupport libpulseaudio + ++ optionals pipewireSupport [ pipewire libdrm ]; + + # Copied from the obs-linuxbrowser + postUnpack = '' + mkdir -p cef/Release cef/Resources cef/libcef_dll_wrapper/ + for i in ${libcef}/share/cef/*; do + cp -r $i cef/Release/ + cp -r $i cef/Resources/ + done + cp -r ${libcef}/lib/libcef.so cef/Release/ + cp -r ${libcef}/lib/libcef_dll_wrapper.a cef/libcef_dll_wrapper/ + cp -r ${libcef}/include cef/ + ''; + + # obs attempts to dlopen libobs-opengl, it fails unless we make sure + # 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}" + "-Wno-dev" # kill dev warnings that are useless for packaging + # Add support for browser source + "-DBUILD_BROWSER=ON" + "-DCEF_ROOT_DIR=../../cef" + ] ++ extraCMakeFlags; + + dontWrapGApps = true; + preFixup = '' + qtWrapperArgs+=( + --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ xorg.libX11 libvlc ]}" + ''${gappsWrapperArgs[@]} + ) + ''; + + postFixup = lib.optionalString stdenv.isLinux '' + addOpenGLRunpath $out/lib/lib*.so + addOpenGLRunpath $out/lib/obs-plugins/*.so + ''; + + meta = with lib; { + description = "Free and open source software for video recording and live streaming"; + longDescription = '' + This project is a rewrite of what was formerly known as "Open Broadcaster + Software", software originally designed for recording and streaming live + video content, efficiently + ''; + homepage = "https://obsproject.com"; + maintainers = with maintainers; [ jb55 MP2E V miangraham ]; + license = licenses.gpl2Plus; + platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" ]; + mainProgram = "obs"; + }; +} diff --git a/pkgs/applications/video/obs-studio/plugins/default.nix b/pkgs/applications/video/obs-studio/plugins/default.nix index b9be0a2b6eb1e..a661ce0b9a3cf 100644 --- a/pkgs/applications/video/obs-studio/plugins/default.nix +++ b/pkgs/applications/video/obs-studio/plugins/default.nix @@ -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 { }; } diff --git a/pkgs/applications/video/obs-studio/plugins/obs-websocket.nix b/pkgs/applications/video/obs-studio/plugins/obs-websocket.nix deleted file mode 100644 index d747268cc5567..0000000000000 --- a/pkgs/applications/video/obs-studio/plugins/obs-websocket.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ lib -, stdenv -, fetchFromGitHub -, fetchpatch -, cmake -, qtbase -, qtsvg -, obs-studio -, asio_1_10 -, websocketpp -, nlohmann_json -}: - -stdenv.mkDerivation rec { - pname = "obs-websocket"; - - # We have updated to the alpha version when OBS Studio 27.2 was - # released, because this is the only version of obs-websocket that - # builds against the new OBS Studio. - version = "5.0.0-alpha3"; - - src = fetchFromGitHub { - owner = "Palakis"; - repo = "obs-websocket"; - rev = version; - sha256 = "Lr6SBj5rRTAWmn9Tnlu4Sl7SAkOCRCTP6sFWSp4xB+I="; - fetchSubmodules = true; - }; - - patches = [ - # This patch can be dropped when obs-websocket is updated to the - # next version. - (fetchpatch { - url = "https://github.com/obsproject/obs-websocket/commit/13c7b83c34eb67b2ee80af05071d81f10d0d2997.patch"; - sha256 = "TNap/T8+058vhfWzRRr4vmlblFk9tHMUNyG6Ob5PwiM="; - name = "obs-addref-werror-fix.patch"; - }) - ]; - - nativeBuildInputs = [ cmake ]; - buildInputs = [ - qtbase - qtsvg - obs-studio - asio_1_10 - websocketpp - nlohmann_json - ]; - - dontWrapQtApps = true; - - cmakeFlags = [ - "-DLIBOBS_INCLUDE_DIR=${obs-studio.src}/libobs" - ]; - - meta = with lib; { - description = "Remote-control OBS Studio through WebSockets"; - homepage = "https://github.com/Palakis/obs-websocket"; - maintainers = with maintainers; [ erdnaxe ]; - license = licenses.gpl2Plus; - platforms = [ "x86_64-linux" "i686-linux" ]; - }; -} -- cgit 1.4.1