Files
homebrew-cask/Casks/t/temurin.rb
2023-10-25 14:34:23 +01:00

32 lines
1.3 KiB
Ruby

cask "temurin" do
arch arm: "aarch64", intel: "x64"
version "21.0.1,12"
sha256 arm: "850f760498edeb39b5340c04f7681ab4aa86f91a4fdbe2b7a02d0183e6aab5c1",
intel: "f2da3149da7df5a11f2f562320e17072ca1117c97696b60f59bd18722a578b69"
url "https://github.com/adoptium/temurin#{version.major}-binaries/releases/download/jdk-#{version.csv.first}%2B#{version.csv.second}/OpenJDK#{version.major}U-jdk_#{arch}_mac_hotspot_#{version.csv.first}_#{version.csv.second.major}.pkg",
verified: "github.com/adoptium/"
name "Eclipse Temurin Java Development Kit"
desc "JDK from the Eclipse Foundation (Adoptium)"
homepage "https://adoptium.net/"
livecheck do
url "https://api.adoptium.net/v3/info/release_versions?release_type=ga&architecture=#{arch}&image_type=jdk&jvm_impl=hotspot&os=mac&page=0&page_size=1&project=jdk&sort_method=DEFAULT&sort_order=DESC&vendor=eclipse"
strategy :json do |json|
json["versions"].map do |version|
match = version["openjdk_version"].match(/^(\d+(?:\.\d+)*)\+(\d+(?:\.\d+)*)(?:-LTS)?$/i)
next if match.blank?
"#{match[1]},#{match[2]}"
end.compact
end
end
pkg "OpenJDK#{version.major}U-jdk_#{arch}_mac_hotspot_#{version.csv.first}_#{version.csv.second.major}.pkg"
uninstall pkgutil: "net.temurin.#{version.major}.jdk"
# No zap stanza required
end