28 , scriptingSupport ? true
32 , alsaSupport ? stdenv.isLinux
34 , pulseaudioSupport ? config.pulseaudio or stdenv.isLinux
38 , pipewireSupport ? stdenv.isLinux
51 , decklinkSupport ? false
52 , blackmagic-desktop-video
60 inherit (lib) optional optionals;
63 stdenv.mkDerivation (finalAttrs: {
67 src = fetchFromGitHub {
69 repo = finalAttrs.pname;
70 rev = finalAttrs.version;
71 sha256 = "sha256-M4IINBoYrgkM37ykb4boHyWP8AxwMX0b7IAeeNIw9Qo=";
72 fetchSubmodules = true;
76 # Lets obs-browser build against CEF 90.1.0+
77 ./Enable-file-access-and-universal-access-for-file-URL.patch
78 ./fix-nix-plugin-path.patch
80 # Fix libobs.pc for plugins on non-x86 systems
82 name = "fix-arm64-cmake.patch";
83 url = "https://git.alpinelinux.org/aports/plain/community/obs-studio/broken-config.patch?id=a92887564dcc65e07b6be8a6224fda730259ae2b";
84 hash = "sha256-yRSw4VWDwMwysDB3Hw/tsmTjEQUhipvrVRQcZkbtuoI=";
85 includes = [ "*/CompilerConfig.cmake" ];
96 ++ optional scriptingSupport swig4;
128 ++ optionals scriptingSupport [ luajit python3 ]
129 ++ optional alsaSupport alsa-lib
130 ++ optional pulseaudioSupport libpulseaudio
131 ++ optionals pipewireSupport [ pipewire libdrm ]
132 ++ optional withFdk fdk_aac;
134 # Copied from the obs-linuxbrowser
136 mkdir -p cef/Release cef/Resources cef/libcef_dll_wrapper/
137 for i in ${libcef}/share/cef/*; do
138 ln -s $i cef/Release/
139 ln -s $i cef/Resources/
141 ln -s ${libcef}/lib/libcef.so cef/Release/
142 ln -s ${libcef}/lib/libcef_dll_wrapper.a cef/libcef_dll_wrapper/
143 ln -s ${libcef}/include cef/
147 "-DOBS_VERSION_OVERRIDE=${finalAttrs.version}"
148 "-Wno-dev" # kill dev warnings that are useless for packaging
149 # Add support for browser source
151 "-DCEF_ROOT_DIR=../../cef"
153 (lib.cmakeBool "ENABLE_QSV11" stdenv.hostPlatform.isx86_64)
154 (lib.cmakeBool "ENABLE_LIBFDK" withFdk)
155 (lib.cmakeBool "ENABLE_ALSA" alsaSupport)
156 (lib.cmakeBool "ENABLE_PULSEAUDIO" pulseaudioSupport)
157 (lib.cmakeBool "ENABLE_PIPEWIRE" pipewireSupport)
160 env.NIX_CFLAGS_COMPILE = toString [
161 "-Wno-error=sign-compare" # https://github.com/obsproject/obs-studio/issues/10200
164 dontWrapGApps = true;
170 ] ++ optionals decklinkSupport [
171 blackmagic-desktop-video
174 # Remove libcef before patchelf, otherwise it will fail
175 rm $out/lib/obs-plugins/libcef.so
178 --prefix LD_LIBRARY_PATH : "$out/lib:${lib.makeLibraryPath wrapperLibraries}"
179 ''${gappsWrapperArgs[@]}
183 postFixup = lib.optionalString stdenv.isLinux ''
184 addOpenGLRunpath $out/lib/lib*.so
185 addOpenGLRunpath $out/lib/obs-plugins/*.so
187 # Link libcef again after patchelfing other libs
188 ln -s ${libcef}/lib/* $out/lib/obs-plugins/
191 passthru.updateScript = nix-update-script { };
194 description = "Free and open source software for video recording and live streaming";
196 This project is a rewrite of what was formerly known as "Open Broadcaster
197 Software", software originally designed for recording and streaming live
198 video content, efficiently
200 homepage = "https://obsproject.com";
201 maintainers = with maintainers; [ eclairevoyant jb55 MP2E materus fpletz ];
202 license = with licenses; [ gpl2Plus ] ++ optional withFdk fraunhofer-fdk;
203 platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];