Merge pull request #200213 from Homebrew/bump-tidelift-1.14.0
[Homebrew/homebrew-cask.git] / Casks / u / unity.rb
blob765b5ac3b5dc1733b70a27055178eff403422396
1 cask "unity" do
2   arch arm: "Arm64"
4   version "2023.2.20f1,0e25a174756c"
5   sha256 arm:   "432b014d7bf50f82cb2a0978571df5f1f515c59a2f6826761cb20c32d196763f",
6          intel: "c7e203a316b308acab23a81bba16c17be94c65fa210a4c0e5f083d83f2c10b3f"
8   url "https://download.unity3d.com/download_unity/#{version.csv.second}/MacEditorInstaller#{arch}/Unity-#{version.csv.first}.pkg",
9       verified: "download.unity3d.com/download_unity/"
10   name "Unity Editor"
11   desc "Platform for 3D content"
12   homepage "https://unity.com/"
14   livecheck do
15     url "https://public-cdn.cloud.unity3d.com/hub/prod/releases-darwin.json"
16     regex(%r{/(\h+)/MacEditorInstaller/Unity[._-]v?(\d+(?:\.\d+)+(?:f\d+)?)\.pkg}i)
17     strategy :json do |json, regex|
18       json["official"]&.map do |release|
19         # Only use 202X.X.XfX versions until Unity 6 (6000) is a full release
20         next unless release["version"]&.start_with?("202")
22         match = release["downloadUrl"]&.match(regex)
23         next if match.blank?
25         "#{match[2]},#{match[1]}"
26       end
27     end
28   end
30   depends_on cask: "unity-hub"
32   pkg "Unity-#{version.csv.first}.pkg"
34   uninstall quit:    "com.unity3d.UnityEditor5.x",
35             pkgutil: "com.unity3d.UnityEditor5.x",
36             delete:  "/Applications/Unity"
38   zap trash: [
39     "/Library/Application Support/Unity",
40     "~/Library/Application Support/Unity*",
41     "~/Library/Caches/com.unity3d.UnityEditor",
42     "~/Library/Logs/Unity",
43     "~/Library/Preferences/com.unity.BugReporterV2.plist",
44     "~/Library/Preferences/com.unity3d.UnityEditor5.x.plist",
45     "~/Library/Preferences/com.unity3d.unityhub.plist",
46     "~/Library/Preferences/unity.DefaultCompany.*",
47     "~/Library/Saved Application State/com.unity3d.unityhub.savedState",
48     "~/Library/Unity",
49   ]
50 end