Skip to content

Commit

Permalink
openjdk@8 1.8.0-432
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinit committed Oct 30, 2024
1 parent e7ea73c commit 88bbd2a
Showing 1 changed file with 53 additions and 23 deletions.
76 changes: 53 additions & 23 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 lacks the necessary headers
# to compile `openjdk@8`, we'll use our pre-built JNF 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 @@ -50,7 +60,7 @@ class OpenjdkAT8 < Formula
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
# 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 @@ -73,6 +83,14 @@ class OpenjdkAT8 < Formula
end
patch :p0, :DATA

def install_symlinks(source_path, target_path, exclude_list)
Dir.foreach(source_path) do |entry|
next if exclude_list.include?(entry)

target_path.install_symlink source_path/entry => entry
end
end

def install

Check failure on line 94 in Formula/o/[email protected]

View workflow job for this annotation

GitHub Actions / macOS 14-x86_64

`brew install --verbose --formula --build-bottle openjdk@8` failed on macOS Sonoma (14)!

Aliases: Table size 1024 (10 bits), shift 0, max chain depth 3 Classes: Table size 32 (5 bits), shift 1, max chain depth 3 Cache: Table size 32 (5 bits), shift 1, max chain depth 3 Generating beaninfo Generating Nimbus source files /private/tmp/openjdkA8-20241030-6464-bluhzw/jdk8u-jdk8u432-ga/jdk/src/share/classes/sun/util/resources/LocaleData.java:53: error: cannot find symbol import sun.util.locale.provider.LocaleDataMetaInfo; ^ symbol: class LocaleDataMetaInfo location: package sun.util.locale.provider Generating HTML DTD file Compiling 4 files for BUILD_BREAKITERATOR [Parsed DTD html32 in 164ms] Compiling 9863 files for BUILD_JDK Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Compiling 237 files for BUILD_SECURITY Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Compiling 195 files for BUILD_BOOTSTRAP_RMIC Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Warning: generation and use of skeletons and static stubs for JRMP is deprecated. Skeletons are unnecessary, and static stubs have been superseded by dynamically generated stubs. Users are encouraged to migrate away from using rmic to generate skeletons and static stubs. See the documentation for java.rmi.server.UnicastRemoteObject. Warning: generation and use of skeletons and static stubs for JRMP is deprecated. Skeletons are unnecessary, and static stubs have been superseded by dynamically generated stubs. Users are encouraged to migrate away from using rmic to generate skeletons and static stubs. See the documentation for java.rmi.server.UnicastRemoteObject. Warning: generation and use of skeletons and static stubs for JRMP is deprecated. Skeletons are unnecessary, and static stubs have been superseded by dynamically generated stubs. Users are encouraged to migrate away from using rmic to generate skeletons and static stubs. See the documentation for java.rmi.server.UnicastRemoteObject. Creating jdk/jce/unsigned/policy/unlimited/US_export_policy.jar Creating jdk/jce/unsigned/policy/unlimited/local_policy.jar Creating jdk/jce/unsigned/policy/limited/local_policy.jar Creating jdk/jce/unsigned/sunec.jar Creating jdk/jce/unsigned/sunpkcs11.jar Creating jdk/jce/unsigned/sunjce_provider.jar Creating jdk/jce/unsigned/jce.jar ## Finished jdk (build time 00:05:14) ## Starting demos Compiling 1 files for BUILD_DEMO_APPLET_ArcTest Compiling 1 files for BUILD_DEMO_APPLET_Blink Compiling 1 files for BUILD_DEMO_APPLET_BarChart Compiling 1 files for BUILD_DEMO_APPLET_CardTest Compiling 1 files for BUILD_DEMO_APPLET_Clock Compiling 1 files for BUILD_DEMO_APPLET_DitherTest Compiling 1 files for BUILD_DEMO_APPLET_DrawTest Compiling 1 files for BUILD_DEMO_APPLET_Fractal Compiling 2 files for BUILD_DEMO_APPLET_GraphicsTest Compiling 1 files for BUILD_DEMO_APPLET_NervousText Compiling 1 files for BUILD_DEMO_APPLET_SimpleGraph Compiling 5 files for BUILD_DEMO_APPLET_SortDemo Compiling 1 files for BUILD_DEMO_APPLET_SpreadSheet Updating jdk/demo/jfc/CodePointIM/src.zip Compiling 3 files for BUILD_DEMO_CodePointIM Updating jdk/demo/applets/MoleculeViewer/src.zip Compiling 2 files for BUILD_DEMO_MoleculeViewer Updating jdk/demo/applets/WireFrame/src.zip Compiling 2 files for BUILD_DEMO_WireFrame Updating jdk/demo/jfc/SwingApplet/src.zip Compiling 1 files for BUILD_DEMO_SwingApplet Compiling 3 files for BUILD_DEMO_FileChooserDemo Updating jdk/demo/jfc/FileChooserDemo/src.zip Compiling 4 files for BUILD_DEMO_Font2DTest Updating jdk/demo/jfc/Font2DTest/src.zip Updating jdk/demo/jfc/Metalworks/src.zip Compiling 15 files for BUILD_DEMO_Metalworks Updating jdk/demo/jfc/Notepad/src.zip
_, _, update = version.to_s.rpartition("-")
boot_jdk = buildpath/"boot-jdk"
Expand Down Expand Up @@ -123,25 +141,37 @@ def install
--with-toolchain-type=clang
--with-zlib=system
]
# Work around Xcode 16 bug: https://bugs.openjdk.org/browse/JDK-8340341
DevelopmentTools.clang_build_version == 1600 &&
ENV.append_to_cflags("-mllvm -enable-constraint-elimination=0")
# Pre-build JNF (JavaNativeFoundation.framework) in macOS Sonoma or newer
# to fix the issue of its necessary headers not being found.
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_sdk_path = buildpath/"PrebuiltSDKs/MacOSX.sdk"
my_framework_path = my_sdk_path/"System/Library/Frameworks"
my_framework_path.install "build/Release/JavaNativeFoundation.framework"

sys_sdk_path = Pathname.new(`xcrun --show-sdk-path`.chomp)

install_symlinks(sys_sdk_path/"System/Library/Frameworks", my_framework_path,
%w[. .. JavaNativeFoundation.framework])
install_symlinks(sys_sdk_path/"System/Library", my_sdk_path/"System/Library",
%w[. .. Frameworks])
install_symlinks(sys_sdk_path/"System", my_sdk_path/"System",
%w[. .. Library])
install_symlinks(sys_sdk_path, my_sdk_path,
%w[. .. 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}"
ENV["SDKPATH"] = ENV["SDKROOT"] = ENV["HOMEBREW_SDKROOT"] = my_sdk_path
ENV["DYLD_FALLBACK_FRAMEWORK_PATH"] = my_framework_path
end
end
end
else
args += %W[
Expand Down

0 comments on commit 88bbd2a

Please sign in to comment.