openjdk@11 11.0.5+10 (new formula)

This commit is contained in:
Markus Reiter 2019-10-27 14:22:33 +01:00 committed by FX Coudert
parent 2c9111f0b3
commit 7597fe1407

65
Formula/openjdk@11.rb Normal file
View file

@ -0,0 +1,65 @@
class OpenjdkAT11 < Formula
desc "Development kit for the Java programming language"
homepage "https://openjdk.java.net/"
url "https://hg.openjdk.java.net/jdk-updates/jdk11u/archive/jdk-11.0.5+10.tar.bz2"
version "11.0.5+10"
sha256 "5375ca18b2c9f301e8ae6f77192962a5ec560d808f3e899bb17719c82eae5407"
keg_only :versioned_formula
depends_on "autoconf" => :build
resource "boot-jdk" do
url "https://download.java.net/java/GA/jdk10/10.0.2/19aef61b38124481863b1413dce1855f/13/openjdk-10.0.2_osx-x64_bin.tar.gz"
sha256 "77ea7675ee29b85aa7df138014790f91047bfdafbc997cb41a1030a0417356d7"
end
def install
boot_jdk_dir = Pathname.pwd/"boot-jdk"
resource("boot-jdk").stage boot_jdk_dir
boot_jdk = boot_jdk_dir/"Contents/Home"
java_options = ENV.delete("_JAVA_OPTIONS")
short_version, _, build = version.to_s.rpartition("+")
chmod 0755, "configure"
system "./configure", "--without-version-pre",
"--without-version-opt",
"--with-version-build=#{build}",
"--with-toolchain-path=/usr/bin",
"--with-extra-ldflags=-headerpad_max_install_names",
"--with-boot-jdk=#{boot_jdk}",
"--with-boot-jdk-jvmargs=#{java_options}",
"--with-debug-level=release",
"--with-native-debug-symbols=none",
"--enable-dtrace=auto",
"--with-jvm-variants=server"
ENV["MAKEFLAGS"] = "JOBS=#{ENV.make_jobs}"
system "make", "images"
libexec.install "build/macosx-x86_64-normal-server-release/images/jdk-bundle/jdk-#{short_version}.jdk" => "openjdk.jdk"
bin.install_symlink Dir["#{libexec}/openjdk.jdk/Contents/Home/bin/*"]
end
def caveats
<<~EOS
For the system Java wrappers to find this JDK, symlink it with
sudo ln -sfn #{opt_libexec}/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-11.jdk
EOS
end
test do
(testpath/"HelloWorld.java").write <<~EOS
class HelloWorld {
public static void main(String args[]) {
System.out.println("Hello, world!");
}
}
EOS
system bin/"javac", "HelloWorld.java"
assert_match "Hello, world!", shell_output("#{bin}/java HelloWorld")
end
end