You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

49 lines
2.5 KiB

cask 'zulu8' do
version '1.8.0_144,8.23.0.3'
sha256 '851800b6a65d23d32d6142ef698146ff14e870038112d31d8a7d4c41a0c9a8a1'
url "https://cdn.azul.com/zulu/bin/zulu#{version.after_comma}-jdk#{version.minor}.#{version.patch}.#{version.before_comma.sub(%r{.*_}, '')}-macosx_x64.dmg",
referer: 'https://www.azul.com/downloads/zulu/zulu-mac/'
name 'Azul Zulu Java Standard Edition Development Kit'
homepage 'https://www.azul.com/downloads/zulu/zulu-mac/'
pkg "Double-Click to Install Zulu #{version.minor}.pkg"
postflight do
system_command '/bin/mv',
args: ['-f', '--', "/Library/Java/JavaVirtualMachines/zulu-#{version.minor}.jdk", "/Library/Java/JavaVirtualMachines/zulu#{version.before_comma}.jdk"],
sudo: true
system_command '/bin/ln',
args: ['-nsf', '--', "/Library/Java/JavaVirtualMachines/zulu#{version.before_comma}.jdk", "/Library/Java/JavaVirtualMachines/zulu-#{version.minor}.jdk"],
sudo: true
system_command '/bin/ln',
args: ['-nsf', '--', "/Library/Java/JavaVirtualMachines/zulu#{version.before_comma}.jdk/Contents/Home", '/Library/Java/Home'],
sudo: true
system_command '/usr/libexec/PlistBuddy',
args: ['-c', 'Add :JavaVM:JVMCapabilities: string JNI', "/Library/Java/JavaVirtualMachines/zulu#{version.before_comma}.jdk/Contents/Info.plist"],
sudo: true
if MacOS.version <= :mavericks
system_command '/bin/rm',
args: ['-rf', '--', '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK'],
sudo: true
system_command '/bin/ln',
args: ['-nsf', '--', "/Library/Java/JavaVirtualMachines/zulu#{version.before_comma}.jdk/Contents", '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK'],
sudo: true
end
end
uninstall pkgutil: [
"com.azulsystems.zulu.#{version.minor}",
],
delete: [
"/Library/Java/JavaVirtualMachines/zulu#{version.before_comma}.jdk",
"/Library/Java/JavaVirtualMachines/zulu-#{version.minor}.jdk",
'/Library/Java/Home',
if MacOS.version <= :mavericks
[
'/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK',
]
end,
].keep_if { |v| !v.nil? }
end