lol

obs-studio: port to new build system

They would like builders to use CMake presets now; we inherit from their
Ubuntu and macOS presets respectively.

authored by

Luke Granger-Brown and committed by
Franz Pletz
48947b5d 9bfef531

+38 -4
+17
pkgs/applications/video/obs-studio/CMakeUserPresets.json
··· 1 + { 2 + "version": 3, 3 + "configurePresets": [ 4 + { 5 + "name": "nixpkgs-linux", 6 + "displayName": "Nixpkgs (Linux)", 7 + "inherits": ["ubuntu"], 8 + "binaryDir": "${sourceDir}/build" 9 + }, 10 + { 11 + "name": "nixpkgs-darwin", 12 + "displayName": "Nixpkgs (Darwin)", 13 + "inherits": ["macos"], 14 + "binaryDir": "${sourceDir}/build" 15 + } 16 + ] 17 + }
+21 -4
pkgs/applications/video/obs-studio/default.nix
··· 2 2 , uthash 3 3 , lib 4 4 , stdenv 5 + , ninja 5 6 , nv-codec-headers-12 6 7 , fetchFromGitHub 7 8 , fetchpatch ··· 42 43 , pipewire 43 44 , libdrm 44 45 , librist 46 + , cjson 45 47 , libva 46 48 , srt 47 49 , qtwayland ··· 107 109 nativeBuildInputs = [ 108 110 addDriverRunpath 109 111 cmake 112 + ninja 110 113 pkg-config 111 114 wrapGAppsHook3 112 115 wrapQtAppsHook ··· 132 135 mbedtls 133 136 pciutils 134 137 librist 138 + cjson 135 139 libva 136 140 srt 137 141 qtwayland ··· 157 161 ln -s $i cef/Release/ 158 162 ln -s $i cef/Resources/ 159 163 done 160 - ln -s ${libcef}/lib/libcef.so cef/Release/ 164 + ln -s ${libcef}/lib/*.so* cef/Release/ 165 + ln -s ${libcef}/libexec/cef/chrome-sandbox cef/Release/ 161 166 ln -s ${libcef}/lib/libcef_dll_wrapper.a cef/libcef_dll_wrapper/ 162 167 ln -s ${libcef}/include cef/ 163 168 ''; 164 169 170 + postPatch = '' 171 + cp ${./CMakeUserPresets.json} ./CMakeUserPresets.json 172 + ''; 173 + 165 174 cmakeFlags = [ 175 + "--preset" "nixpkgs-${if stdenv.hostPlatform.isDarwin then "darwin" else "linux"}" 166 176 "-DOBS_VERSION_OVERRIDE=${finalAttrs.version}" 167 177 "-Wno-dev" # kill dev warnings that are useless for packaging 168 178 # Add support for browser source 169 - "-DBUILD_BROWSER=ON" 179 + "-DENABLE_BROWSER=ON" 170 180 "-DCEF_ROOT_DIR=../../cef" 171 181 "-DENABLE_JACK=ON" 182 + "-DENABLE_WEBRTC=ON" 172 183 (lib.cmakeBool "ENABLE_QSV11" stdenv.hostPlatform.isx86_64) 173 184 (lib.cmakeBool "ENABLE_LIBFDK" withFdk) 174 185 (lib.cmakeBool "ENABLE_ALSA" alsaSupport) ··· 193 204 blackmagic-desktop-video 194 205 ]; 195 206 in '' 196 - # Remove libcef before patchelf, otherwise it will fail 207 + # Remove cef components before patchelf, otherwise it will fail 197 208 rm $out/lib/obs-plugins/libcef.so 209 + rm $out/lib/obs-plugins/libEGL.so 210 + rm $out/lib/obs-plugins/libGLESv2.so 211 + rm $out/lib/obs-plugins/libvk_swiftshader.so 212 + rm $out/lib/obs-plugins/libvulkan.so.1 213 + rm $out/lib/obs-plugins/chrome-sandbox 198 214 199 215 qtWrapperArgs+=( 200 216 --prefix LD_LIBRARY_PATH : "$out/lib:${lib.makeLibraryPath wrapperLibraries}" ··· 206 222 addDriverRunpath $out/lib/lib*.so 207 223 addDriverRunpath $out/lib/obs-plugins/*.so 208 224 209 - # Link libcef again after patchelfing other libs 225 + # Link cef components again after patchelfing other libs 210 226 ln -s ${libcef}/lib/* $out/lib/obs-plugins/ 227 + ln -s ${libcef}/libexec/cef/* $out/lib/obs-plugins/ 211 228 ''; 212 229 213 230 passthru.updateScript = nix-update-script { };