cask "obs@beta" do arch arm: "apple", intel: "intel" livecheck_folder = on_arch_conditional arm: "arm64", intel: "x86_64" version "31.0.0-beta3" sha256 arm: "99740f9064a7ee254b0ab0818016dee9b818700c41d5d9a0e2aeea95724462d4", intel: "f8610a0745fcd32bf015c2fd545f9bef17bb0ec55e13f2c08e9a6c7577112973" url "https://cdn-fastly.obsproject.com/downloads/obs-studio-#{version}-macos-#{arch}.dmg" name "OBS" desc "Open-source software for live streaming and screen recording" homepage "https://obsproject.com/forum/list/test-builds.20/" livecheck do url "https://obsproject.com/osx_update/updates_#{livecheck_folder}_v2.xml" regex(/obs[._-]studio[._-](\d+(?:[.-]\d+)+(?:(?:-beta)|(?:-rc))\d+)[._-]macos/i) strategy :sparkle do |items, regex| items.map do |item| next if item.channel != "beta" item.url&.[](regex, 1) end end end auto_updates true conflicts_with cask: "obs" depends_on macos: ">= :big_sur" app "OBS.app" # shim script (https://github.com/Homebrew/homebrew-cask/issues/18809) shimscript = "#{staged_path}/obs.wrapper.sh" binary shimscript, target: "obs" preflight do File.write shimscript, <<~EOS #!/bin/bash exec '#{appdir}/OBS.app/Contents/MacOS/OBS' "$@" EOS end uninstall delete: "/Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin" zap trash: [ "~/Library/Application Support/obs-studio", "~/Library/HTTPStorages/com.obsproject.obs-studio", "~/Library/Preferences/com.obsproject.obs-studio.plist", "~/Library/Saved Application State/com.obsproject.obs-studio.savedState", ] end