From bd2bd5d5a69a16580ac247ded431f8fe495f4629 Mon Sep 17 00:00:00 2001 From: Justin Krehel <39449589+krehel@users.noreply.github.com> Date: Sun, 10 Nov 2024 18:53:43 -0500 Subject: [PATCH] coqide: rename to `coq-platform`, update * Renames the cask from `coqide` to `coq-platform` * Adds the latest version for both ARM and Intel * Update URL and livecheck --- Casks/c/coq-platform.rb | 47 +++++++++++++++++++++++++++++++++++++++++ Casks/c/coqide.rb | 22 ------------------- cask_renames.json | 1 + 3 files changed, 48 insertions(+), 22 deletions(-) create mode 100644 Casks/c/coq-platform.rb delete mode 100644 Casks/c/coqide.rb diff --git a/Casks/c/coq-platform.rb b/Casks/c/coq-platform.rb new file mode 100644 index 000000000000..c64d03fb3465 --- /dev/null +++ b/Casks/c/coq-platform.rb @@ -0,0 +1,47 @@ +cask "coq-platform" do + arch arm: "arm64", intel: "x86_64" + + on_arm do + version "2024.10.0,8.19.2024.10" + sha256 "20cee7656b1c2d5dee50c0eede2fbb860a96354dcab2d32ecba6f1186ec03cf8" + end + on_intel do + version "2023.11.0,8.18.2023.11" + sha256 "cf63fd3031e0593d76431918427591c384591bfabf8fe9dbd385f92c0f0a0065" + end + + url "https://github.com/coq/platform/releases/download/#{version.csv.first}/coq-Platform-release-#{version.csv.first}-version.#{version.csv.second}-MacOS-#{arch}.dmg", + verified: "github.com/coq/platform/" + name "Coq" + desc "Formal proof management system" + homepage "https://coq.inria.fr/" + + # Not every GitHub release provides a file for macOS or each arch + # so we check multiple recent releases instead of only the "latest" release. + livecheck do + url :url + regex(/release[._-]v?(\d+(?:\.\d+)+)[._-]version[._-](\d+(?:\.\d+)+)[._-]Macos[._-]#{arch}\.dmg/i) + strategy :github_releases do |json, regex| + json.map do |release| + next if release["draft"] || release["prerelease"] + + release["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.blank? + + "#{match[1]},#{match[2]}" + end + end.flatten + end + end + + depends_on macos: ">= :sierra" + + app "Coq-Platform~#{version.csv.second.major_minor}~#{version.csv.first.major_minor}.app" + + zap trash: [ + "~/.config/coq", + "~/Library/Application Support/coq", + "~/Library/Saved Application State/fr.inria.coq.coqide.savedState", + ] +end diff --git a/Casks/c/coqide.rb b/Casks/c/coqide.rb deleted file mode 100644 index 0baf87f6ca2c..000000000000 --- a/Casks/c/coqide.rb +++ /dev/null @@ -1,22 +0,0 @@ -cask "coqide" do - version "8.13.1" - sha256 "7e5a132a69b9e6234063dd4e2985c84952bb9a67b99d4e006f77bc3a95a7b586" - - url "https://github.com/coq/coq/releases/download/V#{version}/coq-#{version}-installer-macos.dmg", - verified: "github.com/coq/coq/" - name "Coq" - desc "Formal proof management system" - homepage "https://coq.inria.fr/" - - livecheck do - skip "No reliable way to get version info" - end - - depends_on macos: ">= :sierra" - - app "CoqIDE_#{version.major_minor_patch}.app" - - caveats do - requires_rosetta - end -end diff --git a/cask_renames.json b/cask_renames.json index fce58298bc4e..6f3675a8501c 100644 --- a/cask_renames.json +++ b/cask_renames.json @@ -8,6 +8,7 @@ "clinq": "sipgate-clinq", "cloudapp": "zight", "codewhisperer": "amazon-q", + "coqide": "coq-platform", "cron": "notion-calendar", "easy-move-plus-resize": "easy-move+resize", "emby-server": "embyserver",