cask "librewolf" do arch arm: "arm64", intel: "x86_64" os macos: "macos-#{arch}-package.dmg", linux: "linux-#{arch}-appimage.AppImage" version "153.0.4,1" sha256 arm: "4971d23a262a7414d6d7de2bc0449832a7e39cb341fc3f9b7388fe181fbf24a1", intel: "7d856314effa69e6955f1db4b2e94209b30b9b3757f324499db5e3acef0ae609", arm64_linux: "eb14f8b37b454f88da8bb194717608ca1354bb4ef822824f44ca3216ba0b2731", x86_64_linux: "c1b836058ce9a626cb450644a5c1cedd94a6bf61df6c88c42cb114a782a44059" 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