homebrew-cask/Casks/sage.rb

51 lines
1.5 KiB
Ruby

cask "sage" do
arch = Hardware::CPU.intel? ? "x86_64" : "arm64"
version "9.5,1.3"
if Hardware::CPU.intel?
sha256 "035a882ec96f190e4ec6929913bdd8880035494f9ffe27e109c828eefb35945b"
else
sha256 "a134fe93a5fa61de58bf6d512f9867663b565bb2b72eea5c77b8cf8a0fc8cb81"
end
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 "https://github.com/3-manifolds/Sage_macOS/releases"
strategy :page_match do |page|
match = page.match(%r{href=.*?/v?(\d+(?:\.\d+)+)/SageMath[._-]v?(\d+(?:\.\d+)+)\+?[._-]#{arch}\.dmg}i)
next if match.blank?
"#{match[2]},#{match[1]}"
end
end
depends_on macos: ">= :high_sierra"
app "SageMath-#{version.csv.first.dots_to_hyphens}.app"
pkg "Recommended_#{version.csv.first.dots_to_underscores}.pkg"
uninstall quit: [
"org.computop.sage",
"org.computop.SageMath",
"com.tcltk.tcllibrary",
"com.tcltk.tklibrary",
],
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