cask "sage" do arch arm: "arm64", intel: "x86_64" version "10.9,10.9.1" sha256 arm: "630c028d582626bb18fd74d5bd2499b944649caf6aeb4510d46920c4366e73ac", intel: "d8424f0401df2d5efe94c6fc8d8b8aabd53034fc9a050cb442bda09cc10e12e6" url "https://github.com/3-manifolds/Sage_macOS/releases/download/v#{version.csv.second}/SageMath-#{version.csv.first}_#{arch}.dmg" 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 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