cask "librewolf" do arch arm: "arm64", intel: "x86_64" os macos: "macos-#{arch}-package.dmg", linux: "linux-#{arch}-appimage.AppImage" version "155.0,1" sha256 arm: "9082d7e2f79c33e5c8994975b73d6d9284594e2048d36f6b11c418b90158b96b", intel: "e075e6102d874b6679d26b8ad55e295fac7f916df5fb4f94177af70080e159de", arm64_linux: "f0209250903ab9b321b382167f1d42e55df0f83da939bdfcd3461139f73367cd", x86_64_linux: "8ff869236dd0b0324be2a4a9fad2d0c0c3db74d4f54fd5361cede8e72b23abc0" on_macos do app "LibreWolf.app" command_wrapper "librewolf", executable: "#{appdir}/LibreWolf.app/Contents/MacOS/librewolf" postflight do system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{appdir}/LibreWolf.app"] end zap trash: [ "~/.librewolf", "~/Library/Application Support/LibreWolf", "~/Library/Caches/LibreWolf Community", "~/Library/Caches/LibreWolf", "~/Library/Preferences/io.gitlab.librewolf-community.librewolf.plist", "~/Library/Saved Application State/io.gitlab.librewolf-community.librewolf.savedState", ] end on_linux do app_image "librewolf-#{version.tr(",", "-")}-linux-#{arch}-appimage.AppImage", target: "LibreWolf.AppImage" end url "https://codeberg.org/api/packages/librewolf/generic/librewolf/#{version.tr(",", "-")}/librewolf-#{version.tr(",", "-")}-#{os}" name "LibreWolf" desc "Web browser" homepage "https://librewolf.net/" # There can be a notable gap between when a version is tagged and a # corresponding release is created, so we check the "latest" release instead # of the Git tags. livecheck do url "https://codeberg.org/api/v1/repos/librewolf/bsys6/releases/latest" regex(/^v?(\d+(?:[.-]\d+)+)$/i) strategy :json do |json, regex| json["tag_name"]&.[](regex, 1)&.tr("-", ",") end end end