Skip to content

Commit

Permalink
Merge pull request #59 from brahimhaddou/master
Browse files Browse the repository at this point in the history
Introduce GraalVM JDK 23
  • Loading branch information
ezzarghili authored Sep 17, 2024
2 parents d8d12ef + a3d13fa commit cc0fb87
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
os: [macos-14, macos-12] # M1 and Intel
java-version: [17, 20, 21, 22]
java-version: [17, 21, 23]
distribution: ['', '-community']
env:
CASK_NAME: 'graalvm${{ matrix.distribution }}-jdk${{ matrix.java-version }}'
Expand Down
43 changes: 43 additions & 0 deletions Casks/graalvm-community-jdk23.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
cask "graalvm-community-jdk23" do
arch arm: "aarch64", intel: "x64"

version "23"
sha256 arm: "cda587f6d15134dc237fbb1111c7e339c8a0b2f4c1a4817a436c7c15d8ba2a9b",
intel: "1338b838e5c845688643ed9e91bf2a0236e4d53bf1dc9cb4f693bde0409d4daa"

installation_dir = "graalvm-community-openjdk-#{version}+37.1".freeze
jvms_dir = "/Library/Java/JavaVirtualMachines".freeze
target_dir = "#{jvms_dir}/graalvm-community-openjdk-#{version.split(".").first}".freeze

# github.com/graalvm/graalvm-ce-builds was verified as official when first introduced to the cask
url "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-#{version}.0.0/graalvm-community-jdk-#{version}.0.0_macos-#{arch}_bin.tar.gz"
name "GraalVM Community Edition for JDK 23"
homepage "https://www.graalvm.org/"

artifact installation_dir, target: target_dir

postflight do
# Correct symlink
macos_dir = "#{target_dir}/Contents/MacOS"
libjli_filename = "libjli.dylib"
libjli_path = "#{target_dir}/Contents/Home/lib/#{libjli_filename}"
libjli_symlink_path = "#{macos_dir}/#{libjli_filename}"
system_command "/bin/mkdir", args: ["-p", macos_dir], sudo: true
system_command "/bin/ln", args: ["-s", "-f", libjli_path, libjli_symlink_path], sudo: true
end

caveats <<~EOS
Installing GraalVM CE for JDK 23 in #{jvms_dir} requires root permission.
You may be asked to enter your password to proceed.
To use GraalVM, you may want to change your $JAVA_HOME:
export JAVA_HOME="#{target_dir}/Contents/Home"
or you may want to add its `bin` directory to your $PATH:
export PATH="#{target_dir}/Contents/Home/bin:$PATH"
GraalVM CE is licensed under the GPL 2 with Classpath exception:
https://github.com/oracle/graal/blob/master/LICENSE
EOS
end
43 changes: 43 additions & 0 deletions Casks/graalvm-jdk23.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
cask "graalvm-jdk23" do
arch arm: "aarch64", intel: "x64"

version "23"
sha256 arm: "63290bf6242836ac46ca4c8c4ad048e4482fdb3f8276b9689088f059be430687",
intel: "d516ea854e361a821c7679d127ff7126c254b8c43c99e571e203df218df2764b"

installation_dir = "graalvm-jdk-#{version}+37.1".freeze
jvms_dir = "/Library/Java/JavaVirtualMachines".freeze
target_dir = "#{jvms_dir}/graalvm-jdk-#{version.split(".").first}".freeze

# download.oracle.com was verified as official when first introduced to the cask
url "https://download.oracle.com/graalvm/23/archive/graalvm-jdk-#{version}_macos-#{arch}_bin.tar.gz"
name "Oracle GraalVM for JDK 23"
homepage "https://www.graalvm.org/"

artifact installation_dir, target: target_dir

postflight do
# Correct symlink
macos_dir = "#{target_dir}/Contents/MacOS"
libjli_filename = "libjli.dylib"
libjli_path = "#{target_dir}/Contents/Home/lib/#{libjli_filename}"
libjli_symlink_path = "#{macos_dir}/#{libjli_filename}"
system_command "/bin/mkdir", args: ["-p", macos_dir], sudo: true
system_command "/bin/ln", args: ["-s", "-f", libjli_path, libjli_symlink_path], sudo: true
end

caveats <<~EOS
Installing Oracle GraalVM for JDK 23 in #{jvms_dir} requires root permission.
You may be asked to enter your password to proceed.
To use GraalVM, you may want to change your $JAVA_HOME:
export JAVA_HOME="#{target_dir}/Contents/Home"
or you may want to add its `bin` directory to your $PATH:
export PATH="#{target_dir}/Contents/Home/bin:$PATH"
Oracle GraalVM is licensed under the GraalVM Free Terms and Conditions:
https://www.oracle.com/downloads/licenses/graal-free-license.html
EOS
end

0 comments on commit cc0fb87

Please sign in to comment.