excalidrawz 1.2.5
[Homebrew/homebrew-cask.git] / Casks / w / wine@devel.rb
blob661116fd26a7d6aa9a11180de5ace8c5702d853f
1 cask "wine@devel" do
2   version "9.21"
3   sha256 "f0dc65b24e2fd9e569e23029f3b6f66bde495fa5793d00955714360bae4c1926"
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}/wine-devel-#{version}-osx64.tar.xz",
9       verified: "github.com/Gcenx/macOS_Wine_builds/"
10   name "WineHQ-devel"
11   desc "Compatibility layer to run Windows applications"
12   homepage "https://wiki.winehq.org/MacOS"
14   # Not every GitHub release provides a `wine-devel` 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[._-]devel[._-].*?$/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@staging",
37   ]
38   depends_on cask: "gstreamer-runtime"
39   depends_on macos: ">= :catalina"
41   app "Wine Devel.app"
42   dir_path = "#{appdir}/Wine Devel.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-devel.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