cask "wine-stable" do version "9.0_3" sha256 "e352befbd159225d4ef7c45ad90ccc4efb9797bd4e842f99036a32e850d1b3de" # Current winehq packages are deprecated and these are packages from # the new maintainers that will eventually be pushed to Winehq. # See https://www.winehq.org/pipermail/wine-devel/2021-July/191504.html url "https://github.com/Gcenx/macOS_Wine_builds/releases/download/#{version}/wine-stable-#{version}-osx64.tar.xz", verified: "github.com/Gcenx/macOS_Wine_builds/" name "WineHQ-stable" desc "Compatibility layer to run Windows applications" homepage "https://wiki.winehq.org/MacOS" # Not every GitHub release provides a `wine-stable` file, so we check multiple # recent releases instead of only the "latest" release. livecheck do url :url regex(/^v?(\d+(?:[._-]\d+)+)$/i) strategy :github_releases do |json, regex| file_regex = /^wine[._-]stable[._-].*?$/i json.map do |release| next if release["draft"] || release["prerelease"] next unless release["assets"]&.any? { |asset| asset["name"]&.match?(file_regex) } match = release["tag_name"]&.match(regex) next if match.blank? match[1] end end end conflicts_with cask: [ "wine@devel", "wine@staging", ] depends_on cask: "gstreamer-runtime" depends_on macos: ">= :catalina" app "Wine Stable.app" binary "#{appdir}/Wine Stable.app/Contents/Resources/start/bin/appdb" binary "#{appdir}/Wine Stable.app/Contents/Resources/start/bin/winehelp" binary "#{appdir}/Wine Stable.app/Contents/Resources/wine/bin/msiexec" binary "#{appdir}/Wine Stable.app/Contents/Resources/wine/bin/notepad" binary "#{appdir}/Wine Stable.app/Contents/Resources/wine/bin/regedit" binary "#{appdir}/Wine Stable.app/Contents/Resources/wine/bin/regsvr32" binary "#{appdir}/Wine Stable.app/Contents/Resources/wine/bin/wine" binary "#{appdir}/Wine Stable.app/Contents/Resources/wine/bin/wine64" binary "#{appdir}/Wine Stable.app/Contents/Resources/wine/bin/wineboot" binary "#{appdir}/Wine Stable.app/Contents/Resources/wine/bin/winecfg" binary "#{appdir}/Wine Stable.app/Contents/Resources/wine/bin/wineconsole" binary "#{appdir}/Wine Stable.app/Contents/Resources/wine/bin/winedbg" binary "#{appdir}/Wine Stable.app/Contents/Resources/wine/bin/winefile" binary "#{appdir}/Wine Stable.app/Contents/Resources/wine/bin/winemine" binary "#{appdir}/Wine Stable.app/Contents/Resources/wine/bin/winepath" binary "#{appdir}/Wine Stable.app/Contents/Resources/wine/bin/wineserver" zap trash: [ "~/.local/share/applications/wine*", "~/.local/share/icons/hicolor/**/application-x-wine*", "~/.local/share/mime/application/x-wine*", "~/.local/share/mime/packages/x-wine*", "~/.wine", "~/.wine32", "~/Library/Saved Application State/org.winehq.wine-stable.wine.savedState", ], rmdir: [ "~/.local/share/applications", "~/.local/share/icons", "~/.local/share/mime", ] caveats do requires_rosetta end end