homebrew-cask/Casks/o/obs@beta.rb

47 lines
1.6 KiB
Ruby

cask "obs@beta" do
arch arm: "apple", intel: "intel"
livecheck_folder = on_arch_conditional arm: "arm64", intel: "x86_64"
version "30.2.0-beta3"
sha256 arm: "7a348c9cba347978e3d75955373e49c09afec979020705044e70cedd0a70dcd7",
intel: "9d13ea54145e4501178b4f9963b777b51c2e07992909f92dba79f13d089f9a90"
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.find { |item| item.channel == "beta" }&.url&.scan(regex)&.flatten
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