excalidrawz 1.2.5
[Homebrew/homebrew-cask.git] / Casks / r / r.rb
blobfadc93300ad4858bf0cf55c5f09e3a186fe609cd
1 cask "r" do
2   arch arm: "arm64", intel: "x86_64"
3   folder = on_arch_conditional arm: "big-sur-arm64/"
4   arch_legacy = on_arch_conditional arm: "-arm64"
6   on_sierra :or_older do
7     version "3.6.3.nn"
8     sha256 "f2b771e94915af0fe0a6f042bc7a04ebc84fb80cb01aad5b7b0341c4636336dd"
10     url "https://cloud.r-project.org/bin/macosx/R-#{version}.pkg"
12     livecheck do
13       skip "Legacy version"
14     end
16     pkg "R-#{version}.pkg"
17   end
18   on_high_sierra do
19     version "4.2.3"
20     sha256 arm:   "e61f25b529940e229b69c19e01428505d7f59cc1e1209ed41dca39452b56fb98",
21            intel: "dd96e8dcae20cf3c9cde429dd29f252b87af69028a6a403ec867eb92bb8eb659"
23     url "https://cloud.r-project.org/bin/macosx/#{folder}base/R-#{version}#{arch_legacy}.pkg"
25     livecheck do
26       skip "Legacy version"
27     end
29     pkg "R-#{version}#{arch_legacy}.pkg"
30   end
31   on_mojave do
32     version "4.2.3"
33     sha256 arm:   "e61f25b529940e229b69c19e01428505d7f59cc1e1209ed41dca39452b56fb98",
34            intel: "dd96e8dcae20cf3c9cde429dd29f252b87af69028a6a403ec867eb92bb8eb659"
36     url "https://cloud.r-project.org/bin/macosx/#{folder}base/R-#{version}#{arch_legacy}.pkg"
38     livecheck do
39       skip "Legacy version"
40     end
42     pkg "R-#{version}#{arch_legacy}.pkg"
43   end
44   on_catalina do
45     version "4.2.3"
46     sha256 arm:   "e61f25b529940e229b69c19e01428505d7f59cc1e1209ed41dca39452b56fb98",
47            intel: "dd96e8dcae20cf3c9cde429dd29f252b87af69028a6a403ec867eb92bb8eb659"
49     url "https://cloud.r-project.org/bin/macosx/#{folder}base/R-#{version}#{arch_legacy}.pkg"
51     livecheck do
52       skip "Legacy version"
53     end
55     pkg "R-#{version}#{arch_legacy}.pkg"
56   end
57   on_big_sur :or_newer do
58     version "4.4.2"
59     sha256 arm:   "0c2c6cc57b1976746cf3f0937a1764120648fd4cac0be53cc9bf99d215a5f213",
60            intel: "d7704eaab96f00612af6eb588911bc1e536d93b8d47ac44b519d7520fd58d573"
62     url "https://cloud.r-project.org/bin/macosx/big-sur-#{arch}/base/R-#{version}-#{arch}.pkg"
64     livecheck do
65       url "https://cloud.r-project.org/bin/macosx/"
66       regex(/href=.*?R[._-]v?(\d+(?:\.\d+)*)([._-]#{arch})?\.pkg/i)
67     end
69     pkg "R-#{version}-#{arch}.pkg"
70   end
72   name "R"
73   desc "Environment for statistical computing and graphics"
74   homepage "https://www.r-project.org/"
76   depends_on macos: ">= :el_capitan"
78   uninstall pkgutil: [
79               "org.r-project*",
80               "org.R-project*",
81             ],
82             delete:  [
83               "/usr/bin/R",
84               "/usr/bin/Rscript",
85             ]
87   zap delete: "/Library/Frameworks/R.Framework",
88       trash:  [
89         "~/.R",
90         "~/.Rapp.history",
91         "~/.RData",
92         "~/.Rhistory",
93         "~/.Rprofile",
94         "~/Library/Caches/org.R-project.R",
95         "~/Library/R",
96       ]
98   caveats do
99     files_in_usr_local
100   end