-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
/
sage.rb
49 lines (41 loc) · 1.6 KB
/
sage.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
cask "sage" do
arch arm: "arm64", intel: "x86_64"
version "10.3,2.3.2"
sha256 arm: "22c72fd3e35c03e0c8d188a40c7877c59a1242f712b7bceeeda30bd9f20d473a",
intel: "025592850e925ddb6fc2e74f0713035c3994c4085f357379c497a696e9b7b181"
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