excalidrawz 1.2.5
[Homebrew/homebrew-cask.git] / Casks / w / wine@staging.rb
bloba0ee6a321f825f7c5f2aea6048ceaa80834c67d0
1 cask "wine@staging" do
2   version "9.21"
3   sha256 "b1c95978bff4acab025c422fab85f83543b4e30361a53b2d9b07927938f4f71a"
5   # Current winehq packages are deprecated and these are packages from
6   # the new maintainers that will eventually be pushed to Winehq.
7   # See https://www.winehq.org/pipermail/wine-devel/2021-July/191504.html
8   url "https://github.com/Gcenx/macOS_Wine_builds/releases/download/#{version.major_minor}/wine-staging-#{version}-osx64.tar.xz",
9       verified: "github.com/Gcenx/macOS_Wine_builds/"
10   name "WineHQ-staging"
11   desc "Compatibility layer to run Windows applications"
12   homepage "https://wiki.winehq.org/MacOS"
14   # Not every GitHub release provides a `wine-staging` file, so we check multiple
15   # recent releases instead of only the "latest" release.
16   livecheck do
17     url :url
18     regex(/^v?((?:\d+(?:\.\d+)+)(?:-RC\d)?)$/i)
19     strategy :github_releases do |json, regex|
20       file_regex = /^wine[._-]staging[._-].*?$/i
22       json.map do |release|
23         next if release["draft"] || release["prerelease"]
24         next unless release["assets"]&.any? { |asset| asset["name"]&.match?(file_regex) }
26         match = release["tag_name"]&.match(regex)
27         next if match.blank?
29         match[1]
30       end
31     end
32   end
34   conflicts_with cask: [
35     "wine-stable",
36     "wine@devel",
37   ]
38   depends_on cask: "gstreamer-runtime"
39   depends_on macos: ">= :catalina"
41   app "Wine Staging.app"
42   dir_path = "#{appdir}/Wine Staging.app/Contents/Resources"
43   binary "#{dir_path}/start/bin/appdb"
44   binary "#{dir_path}/start/bin/winehelp"
45   binary "#{dir_path}/wine/bin/msidb"
46   binary "#{dir_path}/wine/bin/msiexec"
47   binary "#{dir_path}/wine/bin/notepad"
48   binary "#{dir_path}/wine/bin/regedit"
49   binary "#{dir_path}/wine/bin/regsvr32"
50   binary "#{dir_path}/wine/bin/wine"
51   binary "#{dir_path}/wine/bin/wineboot"
52   binary "#{dir_path}/wine/bin/winecfg"
53   binary "#{dir_path}/wine/bin/wineconsole"
54   binary "#{dir_path}/wine/bin/winedbg"
55   binary "#{dir_path}/wine/bin/winefile"
56   binary "#{dir_path}/wine/bin/winemine"
57   binary "#{dir_path}/wine/bin/winepath"
58   binary "#{dir_path}/wine/bin/wineserver"
60   zap trash: [
61         "~/.local/share/applications/wine*",
62         "~/.local/share/icons/hicolor/**/application-x-wine*",
63         "~/.local/share/mime/application/x-wine*",
64         "~/.local/share/mime/packages/x-wine*",
65         "~/.wine",
66         "~/.wine32",
67         "~/Library/Saved Application State/org.winehq.wine-staging.wine.savedState",
68       ],
69       rmdir: [
70         "~/.local/share/applications",
71         "~/.local/share/icons",
72         "~/.local/share/mime",
73       ]
75   caveats do
76     requires_rosetta
77   end
78 end