Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openjdk@8 1.8.0-432 #194719

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 43 additions & 29 deletions Formula/o/[email protected]
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
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"
sha256 "6ac8ee2b6932e4632ea2c33fe2320d6ceaca50a67521fac02a67027e40437460"
license "GPL-2.0-only"

livecheck do
Expand Down Expand Up @@ -33,6 +33,16 @@ class OpenjdkAT8 < Formula
uses_from_macos "unzip"
uses_from_macos "zip"

# NOTE: Since the JNF (JavaNativeFoundation.framework) in macOS Sonoma or newer is missing necessary headers,
# we'll use our pre-built version later on.
on_sonoma :or_newer do
depends_on xcode: :build
resource "JavaNativeFoundation" do
url "https://github.com/apple/openjdk/archive/refs/tags/iTunesOpenJDK-1014.0.2.12.1.tar.gz"
sha256 "e8556a73ea36c75953078dfc1bafc9960e64593bc01e733bc772d2e6b519fd4a"
end
end

on_monterey :or_newer do
depends_on "gawk" => :build
end
Expand All @@ -49,8 +59,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"
Expand All @@ -62,7 +72,7 @@ class OpenjdkAT8 < Formula
end
end

# Fix `clang++ -std=gnu++11` compile failure issue on MacOS.
# 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"
Expand All @@ -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",
Expand All @@ -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
Expand All @@ -123,25 +132,25 @@ def install
--with-toolchain-type=clang
--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}"
# Work around Xcode 16 bug: https://bugs.openjdk.org/browse/JDK-8340341
ENV.append_to_cflags("-mllvm -enable-constraint-elimination=0") if DevelopmentTools.clang_build_version == 1600
# Pre-built the JNF in macOS Sonoma or newer to fix the issue of missing necessary headers.
if MacOS.version >= :sonoma
resource("JavaNativeFoundation").stage do
cd "apple/JavaNativeFoundation" do
xcodebuild "-arch", Hardware::CPU.arch,
"OTHER_CFLAGS=-Wno-strict-prototypes",
"-project", "JavaNativeFoundation.xcodeproj"
my_jnf_path = libexec/"openjdk.jdk/Contents/Home/Frameworks"
my_jnf_path.install "build/Release/JavaNativeFoundation.framework"
args += %W[
--with-extra-cflags=-F#{my_jnf_path}
--with-extra-cxxflags=-F#{my_jnf_path}
]
ldflags << "-F#{my_jnf_path}" << "-Wl,-rpath,#{my_jnf_path}"
ENV["DYLD_FALLBACK_FRAMEWORK_PATH"] = ENV["DYLD_LIBRARY_PATH"] = my_jnf_path
calvinit marked this conversation as resolved.
Show resolved Hide resolved
end
end
end
else
args += %W[
Expand All @@ -167,7 +176,12 @@ def install
jdk = libexec

if OS.mac?
libexec.install Dir["j2sdk-bundle/*"].first => "openjdk.jdk"
if MacOS.version >= :sonoma
# The JNF has already been pre-installed in the `openjdk.jdk` directory.
cp_r "#{Dir["j2sdk-bundle/*"].first}/.", libexec/"openjdk.jdk"
else
libexec.install Dir["j2sdk-bundle/*"].first => "openjdk.jdk"
end
jdk /= "openjdk.jdk/Contents/Home"
else
libexec.install Dir["j2sdk-image/*"]
Expand Down
Loading