cask "librewolf" do arch arm: "arm64", intel: "x86_64" os macos: "macos-#{arch}-package.dmg", linux: "linux-#{arch}-appimage.AppImage" version "157.0,1" sha256 arm: "6c3e809f47d29d9980c85a64e4bdeac9dc81b3a623019134bf9185cb9e0bc87d", intel: "bc69981de77421c5f918c43ad7a8b2cc34637308e173e9ec0e6d3ed6634b0c48", arm64_linux: "0dba536fdfe3d843ad4f2ed7e9591f80a826460f8c93014c871b92fe6652d30d", x86_64_linux: "02f8f9c7d5108e5e386a0645ce1111e92e46e9e28fa41c6a5b5af3969c4cba5d" 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