Skip to content

Commit

Permalink
Add Azul's Zulu JDK bundle
Browse files Browse the repository at this point in the history
Zulu is a supported release of OpenJDK published by Azul systems.
  • Loading branch information
nathansgreen authored and adidalal committed Feb 7, 2016
1 parent 95c67a3 commit dc26dc0
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions Casks/zulu.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
cask 'zulu' do
version '1.8.0_72,8.13.0.5'
sha256 '1e6ab8b4660ad50248d5e1c9568566bb2d6206788d4ff913d6539b47520da0ac'

url "http://cdn.azul.com/zulu/bin/zulu#{version.after_comma}-jdk#{version[2..7].underscores_to_dots}-macosx_x64.dmg",
referer: 'http://www.azul.com/downloads/zulu/zulu-mac/'
name 'Azul Zulu Java Standard Edition Development Kit'
homepage 'http://www.azul.com/downloads/zulu/zulu-mac/'
license :gratis

conflicts_with cask: 'java'

pkg "Double-Click to Install Zulu #{version.minor}.pkg"

postflight do
system '/usr/bin/sudo', '-E', '--',
'/bin/mv', '-f', '--', "/Library/Java/JavaVirtualMachines/zulu-#{version.minor}.jdk", "/Library/Java/JavaVirtualMachines/zulu#{version.before_comma}.jdk"
system '/usr/bin/sudo', '-E', '--',
'/bin/ln', '-nsf', '--', "/Library/Java/JavaVirtualMachines/zulu#{version.before_comma}.jdk", "/Library/Java/JavaVirtualMachines/zulu-#{version.minor}.jdk"
system '/usr/bin/sudo', '-E', '--',
'/bin/ln', '-nsf', '--', "/Library/Java/JavaVirtualMachines/zulu#{version.before_comma}.jdk/Contents/Home", '/Library/Java/Home'
if MacOS.release <= :mavericks
system '/usr/bin/sudo', '-E', '--',
'/bin/rm', '-rf', '--', '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK'
system '/usr/bin/sudo', '-E', '--',
'/bin/ln', '-nsf', '--', "/Library/Java/JavaVirtualMachines/zulu#{version.before_comma}.jdk/Contents", '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK'
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.release <= :mavericks
[
'/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK',
]
end,
].keep_if { |v| !v.nil? }

caveats <<-EOS.undent
If this cask is upgraded, previous stale versions will be left under

This comment has been minimized.

Copy link
@vitorgalvao

vitorgalvao Feb 7, 2016

Member

This caveat both doesn’t consider #13201 and assumes how upgrade will work (i.e. won’t remove the old version). Both of those are wrong.

'Caskroom/zulu/{version}'. Stale versions may also be left under
'/Library/Java/JavaVirtualMachines/zulu{version}.jdk'. Removing them may
require manual deletion, e.g.
rm -rf /opt/homebrew-cask/Caskroom/zulu/
rm -rf /Library/Java/JavaVirtualMachines/zulu*.jdk
EOS
end

0 comments on commit dc26dc0

Please sign in to comment.