From cc4cb80ff526d4ec26890e17941279889f17a6ef Mon Sep 17 00:00:00 2001 From: calvinit <541298948@qq.com> Date: Sat, 2 Nov 2024 01:22:43 +0800 Subject: [PATCH 1/2] openjdk@8 1.8.0-432 --- Formula/o/openjdk@8.rb | 66 +++++++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/Formula/o/openjdk@8.rb b/Formula/o/openjdk@8.rb index 5e64b30ab491f..fb7e5681b7852 100644 --- a/Formula/o/openjdk@8.rb +++ b/Formula/o/openjdk@8.rb @@ -1,9 +1,10 @@ class OpenjdkAT8 < Formula desc "Development kit for the Java programming language" homepage "https://openjdk.java.net/" - url "https://github.com/openjdk/jdk8u/archive/refs/tags/jdk8u422-ga.tar.gz" - version "1.8.0-422" - sha256 "3931898b4336f0e583a5e97df7e5c339d859d53afaff6dafe20124107e836ebe" + url "https://github.com/openjdk/jdk8u/archive/refs/tags/jdk8u432-ga.tar.gz" + version "1.8.0-432" + BUILD_NUMBER = "b06".freeze # Please update when a new GA release is available: https://wiki.openjdk.org/display/jdk8u. + sha256 "6ac8ee2b6932e4632ea2c33fe2320d6ceaca50a67521fac02a67027e40437460" license "GPL-2.0-only" livecheck do @@ -49,8 +50,8 @@ class OpenjdkAT8 < Formula depends_on "libxtst" end - # Oracle doesn't serve JDK 7 downloads anymore, so we use Zulu JDK 7 for bootstrapping. - # https://www.azul.com/downloads/?version=java-7-lts&package=jdk + # NOTE: Oracle doesn't serve JDK 7 downloads anymore, so we use Zulu JDK 7 for bootstrapping. + # https://www.azul.com/downloads/?version=java-7-lts&package=jdk&show-old-builds=true#zulu resource "boot-jdk" do on_macos do url "https://cdn.azul.com/zulu/bin/zulu7.56.0.11-ca-jdk7.0.352-macosx_x64.tar.gz" @@ -62,7 +63,16 @@ class OpenjdkAT8 < Formula end end - # Fix `clang++ -std=gnu++11` compile failure issue on MacOS. + # NOTE: Since macOS Sonoma or newer don’t include the required headers for JNF (JavaNativeFoundation.framework), + # we will use the headers provided at https://github.com/apple/openjdk. + resource "JavaNativeFoundation" do + on_sonoma :or_newer do + url "https://github.com/apple/openjdk/archive/refs/tags/iTunesOpenJDK-1014.0.2.12.1.tar.gz" + sha256 "e8556a73ea36c75953078dfc1bafc9960e64593bc01e733bc772d2e6b519fd4a" + end + end + + # Fix `clang++ -std=gnu++11` compile failure issue on macOS. patch :p0 do url "https://raw.githubusercontent.com/macports/macports-ports/04ad4a17332e391cd359271965d4c6dac87a7eb2/java/openjdk8/files/0001-8181503-Can-t-compile-hotspot-with-c-11.patch" sha256 "a02e0ea7c70390796e46b8b6565f986fedc17a08aa039ee3306438a39a60538a" @@ -79,8 +89,7 @@ def install resource("boot-jdk").stage boot_jdk java_options = ENV.delete("_JAVA_OPTIONS") - # Work around clashing -I/usr/include and -isystem headers, - # as superenv already handles this detail for us. + # Work around clashing -I/usr/include and -isystem headers, as superenv already handles this detail for us. inreplace "common/autoconf/flags.m4", '-isysroot \"$SYSROOT\"', "" inreplace "common/autoconf/toolchain.m4", @@ -96,7 +105,7 @@ def install s.gsub! "MACOSX_VERSION_MIN=10.7.0", "MACOSX_VERSION_MIN=#{MacOS.version}" end else - # Fix linker errors on brewed GCC + # Fix linker errors on brewed GCC. inreplace "common/autoconf/flags.m4", "-Xlinker -O1", "" inreplace "hotspot/make/linux/makefiles/gcc.make", "-Xlinker -O1", "" end @@ -110,6 +119,7 @@ def install --with-milestone=fcs --with-native-debug-symbols=none --with-update-version=#{update} + --with-build-number=#{BUILD_NUMBER} --with-vendor-bug-url=#{tap.issues_url} --with-vendor-name=#{tap.user} --with-vendor-url=#{tap.issues_url} @@ -124,25 +134,27 @@ def install --with-zlib=system ] - # Work around SDK issues with JavaVM framework. - if MacOS.version <= :catalina - sdk_path = MacOS::CLT.sdk_path(MacOS.version) - ENV["SDKPATH"] = ENV["SDKROOT"] = sdk_path - javavm_framework_path = sdk_path/"System/Library/Frameworks/JavaVM.framework/Frameworks" - args += %W[ - --with-extra-cflags=-F#{javavm_framework_path} - --with-extra-cxxflags=-F#{javavm_framework_path} - ] - ldflags << "-F#{javavm_framework_path}" - # Fix "'JavaNativeFoundation/JavaNativeFoundation.h' file not found" issue on MacOS Sonoma. - elsif MacOS.version == :sonoma - javavm_framework_path = "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks" - args += %W[ - --with-extra-cflags=-F#{javavm_framework_path} - --with-extra-cxxflags=-F#{javavm_framework_path} - ] - ldflags << "-F#{javavm_framework_path}" + extra_cflags = [] + extra_cxxflags = [] + + # On macOS Sonoma or newer, we provide the missing JNF headers from an external resource. + if MacOS.version >= :sonoma + resource("JavaNativeFoundation").stage do + jnf_headers = buildpath/"jnf-headers" + jnf_headers.install Pathname.pwd/"apple/JavaNativeFoundation/JavaNativeFoundation" + # Work around for missing 'JavaNativeFoundation/JavaNativeFoundation.h' in MacosxDebuggerLocal.m. + (buildpath/"hotspot/agent/src/os/bsd").install_symlink jnf_headers + # Add JNF headers to extra flags. + extra_cflags << "-I#{jnf_headers}" + extra_cxxflags << "-I#{jnf_headers}" + end end + + # Work around Xcode 16 bug: https://bugs.openjdk.org/browse/JDK-8340341. + extra_cflags << "-mllvm -enable-constraint-elimination=0" if DevelopmentTools.clang_build_version == 1600 + + args << "--with-extra-cflags=#{extra_cflags.join(" ")}" unless extra_cflags.empty? + args << "--with-extra-cxxflags=#{extra_cxxflags.join(" ")}" unless extra_cxxflags.empty? else args += %W[ --with-toolchain-type=gcc From 09b5833361d09a1f0d7e8757d27ba8372cc75c09 Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Thu, 14 Nov 2024 05:47:51 +0000 Subject: [PATCH 2/2] openjdk@8: update 1.8.0-432 bottle. --- Formula/o/openjdk@8.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Formula/o/openjdk@8.rb b/Formula/o/openjdk@8.rb index fb7e5681b7852..db4fdde0a4cad 100644 --- a/Formula/o/openjdk@8.rb +++ b/Formula/o/openjdk@8.rb @@ -16,10 +16,9 @@ class OpenjdkAT8 < Formula end bottle do - sha256 cellar: :any, sonoma: "cb987dc52503fcabc91b10c4700fc5c46d10f32c36caf3698d850a6d57124026" - sha256 cellar: :any, ventura: "25366b96f7324d1499663cb679cacd0d826d174e05d9f69b4c2e4f9e5fe44507" - sha256 cellar: :any, monterey: "4f75d93506ba05e827ab68b1e6e415584bed506eb881c7088f3f27b621e4aac3" - sha256 cellar: :any_skip_relocation, x86_64_linux: "1bc71861ff5e8041f23f12b299f45b6bcf4b47cfba392500f800add2b7693d50" + sha256 cellar: :any, sonoma: "74fcd1c6fb4f0525f752cbadb57405ecac2dc63c9eab76a142b3c5f0fd2fd841" + sha256 cellar: :any, ventura: "d80f5850880120a4614a938aed49d8475d639676b2f4726cfa47e106a04973c6" + sha256 cellar: :any_skip_relocation, x86_64_linux: "29e82fd950a5da51998d665b1cb124daf4163bff8d1012fb1fdb9ce0166b9845" end keg_only :versioned_formula