# This file was generated by GoReleaser. DO NOT EDIT. cask "offscreen" do depends_on macos: :sonoma app "Offscreen.app" binary "offscreen", target: "ofs" version "0.0.5" on_macos do on_arm do sha256 "f682b90b77994386c31d6a3a83c5ca18a15b704b22a6e681e2c69e376743910f" url "https://github.com/markphelps/offscreen/releases/download/v#{version}/offscreen_#{version}_darwin_arm64.tar.gz" end end name "offscreen" desc "Run GUI jobs in disposable virtual machines" homepage "https://github.com/markphelps/offscreen" livecheck do skip "Auto-generated on release." end depends_on formula: [ "openai/tools/tart", ] binary "offscreen" binary "offscreend" postflight do ["#{staged_path}/offscreen", "#{staged_path}/offscreend", "#{appdir}/Offscreen.app"].each do |path| system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", path] end path = ["#{HOMEBREW_PREFIX}/bin", "#{HOMEBREW_PREFIX}/sbin", "/usr/bin", "/bin", "/usr/sbin", "/sbin"].join(":") result = system_command "#{staged_path}/offscreen", args: ["daemon", "install"], env: { "PATH" => path }, print_stderr: true unless result.success? opoo "offscreen daemon install failed; run it again to fix it." end # An upgrade's uninstall unloads the Start at Login job, and macOS # won't start a new build from the old registration. If Start at # Login is on, this starts a detached renewal that waits for brew to # exit, since brew's purge of the old version removes macOS's record # first; launchd then starts the new Offscreen. Otherwise it does # nothing. It always exits 0. system_command "#{appdir}/Offscreen.app/Contents/MacOS/Offscreen", args: ["--renew-start-at-login"], print_stderr: true end uninstall_preflight do system_command "#{staged_path}/offscreen", args: ["daemon", "uninstall"], print_stderr: true end uninstall launchctl: [ "io.latentsignal.offscreen", "io.latentsignal.offscreend", ], quit: [ "io.latentsignal.offscreen", ] zap trash: [ "~/Library/Application Support/offscreen", "~/Library/Preferences/io.latentsignal.offscreen.plist", ] caveats <<~EOS Offscreen is ad-hoc signed, not notarized. This cask removes the quarantine attribute from offscreen, offscreend and Offscreen.app so macOS opens them. To start Offscreen at login, turn on Start at Login in its menu. launchd then also relaunches it if it crashes. If you added Offscreen to Open at Login in System Settings by hand, remove that entry. An upgrade renews Start at Login and starts the new version about 25 seconds after brew finishes. Turn Start at Login off before brew uninstall. After an upgrade, macOS may ask again for Local Network, Notifications or Input Monitoring. Grant them in System Settings > Privacy & Security. EOS end