cask "sage" do arch arm: "arm64", intel: "x86_64" version "10.4,2.4.0" sha256 arm: "0d6d9925153a8721ae043898565877908360cdef51d67a990e82f5348ecab330", intel: "031b4a3e58c9563f098a71091b33fbabaf2230118d22f2c94379d70b038dc978" url "https://github.com/3-manifolds/Sage_macOS/releases/download/v#{version.csv.second}/SageMath-#{version.csv.first}_#{arch}.dmg", verified: "github.com/3-manifolds/Sage_macOS/" name "Sage" desc "Mathematics software system" homepage "https://www.sagemath.org/" livecheck do url :url regex(%r{/v?(\d+(?:\.\d+)+)/SageMath[._-]v?(\d+(?:\.\d+)+)[._-].*?#{arch}\.dmg$}i) strategy :github_latest do |json, regex| json["assets"]&.map do |asset| match = asset["browser_download_url"]&.match(regex) next if match.blank? "#{match[2]},#{match[1]}" end end end depends_on macos: ">= :sierra" app "SageMath-#{version.csv.first.dots_to_hyphens}.app" pkg "Recommended_#{version.csv.first.dots_to_underscores}.pkg" uninstall quit: [ "com.tcltk.tcllibrary", "com.tcltk.tklibrary", "org.computop.sage", "org.computop.SageMath", ], pkgutil: [ "org.computop.SageMath.#{version.csv.first.dots_to_underscores}.bin", "org.computop.SageMath.#{version.csv.first.dots_to_underscores}.share", "org.computop.SageMath.#{version.csv.first.dots_to_underscores}.texlive", ] zap trash: [ "~/.sage", "~/Library/Application Support/SageMath", "~/Library/Preferences/SageMath.plist", ] end