mirror of
https://github.com/wavetermdev/homebrew-cask.git
synced 2026-08-05 13:43:24 -07:00
47 lines
1.3 KiB
Ruby
47 lines
1.3 KiB
Ruby
cask "musescore" do
|
|
version "4.1.1.232071203"
|
|
sha256 "31340ce562e40ba275d5e6be4593f4828231be61bc7ca1f22b5424dc2fba18fd"
|
|
|
|
url "https://github.com/musescore/MuseScore/releases/download/v#{version.major_minor_patch}/MuseScore-#{version}.dmg",
|
|
verified: "github.com/musescore/MuseScore/"
|
|
name "MuseScore"
|
|
desc "Open-source music notation software"
|
|
homepage "https://musescore.org/"
|
|
|
|
livecheck do
|
|
url :url
|
|
regex(/^MuseScore[._-]v?(\d+(?:\.\d+)+)\.dmg$/i)
|
|
strategy :github_latest do |json, regex|
|
|
json["assets"]&.map do |asset|
|
|
match = asset["name"]&.match(regex)
|
|
next if match.blank?
|
|
|
|
match[1]
|
|
end
|
|
end
|
|
end
|
|
|
|
auto_updates true
|
|
depends_on macos: ">= :mojave"
|
|
|
|
app "MuseScore #{version.major}.app"
|
|
# shim script (https://github.com/caskroom/homebrew-cask/issues/18809)
|
|
shimscript = "#{staged_path}/mscore.wrapper.sh"
|
|
binary shimscript, target: "mscore"
|
|
|
|
preflight do
|
|
File.write shimscript, <<~EOS
|
|
#!/bin/sh
|
|
exec '#{appdir}/MuseScore #{version.major}.app/Contents/MacOS/mscore' "$@"
|
|
EOS
|
|
end
|
|
|
|
zap trash: [
|
|
"~/Library/Application Support/MuseScore",
|
|
"~/Library/Caches/MuseScore",
|
|
"~/Library/Caches/org.musescore.MuseScore",
|
|
"~/Library/Preferences/org.musescore.MuseScore*.plist",
|
|
"~/Library/Saved Application State/org.musescore.MuseScore.savedState",
|
|
]
|
|
end
|