From 2057421c2cb70dc086e319047301cc28d06f969c Mon Sep 17 00:00:00 2001 From: ellie is not coding in the slightest <166862894+eleanordoesntcode@users.noreply.github.com> Date: Sun, 19 Jan 2025 23:51:49 +0100 Subject: [PATCH] polyphone: add legacy version --- Casks/p/polyphone.rb | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/Casks/p/polyphone.rb b/Casks/p/polyphone.rb index 1a04f18a4a76c..5aaeec8c4399c 100644 --- a/Casks/p/polyphone.rb +++ b/Casks/p/polyphone.rb @@ -1,8 +1,18 @@ cask "polyphone" do - version "2.5.1,129" - sha256 "89a60fc2444a4502719d23f2d5404a1fa9677db64ef09267ebced0eddf77a0dc" + macos_version = "-MacOS_12" - url "https://www.polyphone.io/download/0/v#{version.csv.second}/Polyphone-MacOS_12-#{version.csv.first}.dmg", + on_big_sur :or_older do + version "2.5.1,130" + sha256 "03b3509f8a6af45a7de6b93aeaf62bf5fae552aba7806b0ac46cf24ba57f37e3" + + macos_version = "_MacOS_10.13" + end + on_monterey :or_newer do + version "2.5.1,129" + sha256 "89a60fc2444a4502719d23f2d5404a1fa9677db64ef09267ebced0eddf77a0dc" + end + + url "https://www.polyphone.io/download/0/v#{version.csv.second}/Polyphone#{macos_version}-#{version.csv.first}.dmg", user_agent: :browser name "Polyphone" desc "Soundfont editor for quickly designing musical instruments" @@ -10,17 +20,15 @@ livecheck do url "https://www.polyphone.io/en/software" - regex(/Polyphone\s+(\d+(?:\.\d+)+).*download\?file_id=(\d+).*Mac OS \(/im) + regex(/href=.*?file_id=(\d+).*?Polyphone#{macos_version}[._-]v?(\d+(?:\.\d+)+)\.dmg/i) strategy :page_match do |page, regex| match = page.match(regex) next if match.blank? - "#{match[1]},#{match[2]}" + "#{match[2]},#{match[1]}" end end - depends_on macos: ">= :monterey" - app "polyphone.app" zap trash: [