cask "sage" do arch arm: "arm64", intel: "x86_64" version "10.6,2.6.0" sha256 arm: "bb6b23f91f805bd721de99e11e2f2d8acc4b8cc8a81051f0b17164fca29718ab", intel: "7d8367d2cd34c8b94e25db7fe5447de137153799a9cc280708cf3fc9352fc800" 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 no_autobump! because: :requires_manual_review 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