Files

190 lines
7.0 KiB
Tcl
Raw Permalink Normal View History

2023-10-21 13:20:16 +02:00
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
2025-10-22 03:41:12 +02:00
PortGroup github 1.0
2023-10-21 13:20:16 +02:00
2024-09-23 01:07:19 +02:00
set feature 21
2025-10-22 03:41:12 +02:00
2024-09-23 01:07:19 +02:00
name openjdk${feature}
2025-10-22 03:41:12 +02:00
# See https://github.com/openjdk/jdk21u/tags for the latest '*-ga' tag and its corresponding build number
2026-04-24 01:24:44 +02:00
set openjdk_version ${feature}.0.11
set build 10
2025-10-22 03:41:12 +02:00
github.setup openjdk jdk${feature}u jdk-${openjdk_version}+${build}
github.tarball_from archive
version ${openjdk_version}
2024-10-20 15:21:37 +02:00
revision 0
2023-10-21 13:20:16 +02:00
categories java devel
supported_archs x86_64 arm64
license GPL-2+
maintainers {breun @breun} openmaintainer
2024-10-08 16:14:38 +02:00
# Builds on macOS 10.12.0+
# Mapping to Darwin version: https://trac.macports.org/wiki/PortfileRecipes#compare-osx-darwin-version
2024-10-08 16:14:38 +02:00
platforms { darwin >= 16 }
2024-09-23 01:07:19 +02:00
description OpenJDK ${feature} (Long Term Support)
long_description JDK ${feature} builds of OpenJDK, the Open-Source implementation \
2023-10-21 13:20:16 +02:00
of the Java Platform, Standard Edition, and related projects.
2024-09-23 01:07:19 +02:00
homepage https://openjdk.org/projects/jdk/${feature}/
2023-10-21 13:20:16 +02:00
2026-04-24 01:24:44 +02:00
checksums rmd160 9ce2dc7b847efd823831229dbafa141baf7b1242 \
sha256 18edf62aa95c99325725475c0ad5621d8de61f4c84fdb8d2b7efd015a6de8e42 \
size 114063214
2023-10-21 13:20:16 +02:00
2024-03-06 12:33:37 +01:00
set bootjdk_port openjdk21-zulu
depends_lib port:freetype \
port:libiconv
2024-03-06 12:33:37 +01:00
depends_build port:${bootjdk_port} \
2023-10-21 13:20:16 +02:00
port:autoconf \
port:gmake \
port:bash
2024-03-06 12:33:37 +01:00
# Boot JDK license/redistributability should not affect license/redistributability of this port
license_noconflict ${bootjdk_port}
2023-10-21 13:20:16 +02:00
pre-patch {
reinplace "s|libffi.so.?|libffi.?.dylib|g" ${worksrcpath}/make/autoconf/lib-ffi.m4
reinplace "s|xmacosx|xwindows|g" ${worksrcpath}/make/autoconf/lib-freetype.m4
}
2025-01-22 17:03:20 +01:00
# Workaround for clang 16.0-16.1: https://trac.macports.org/ticket/70819
# Workaround for undeclared enum in < 11.00: https://trac.macports.org/ticket/71049
patchfiles JDK-8340341-clang-16-workaround.patch \
2024-10-23 02:50:57 +02:00
JDK-8342071-undecl-ident-nsbun-arm64-workaround.patch
2024-09-23 01:07:19 +02:00
2023-10-21 13:20:16 +02:00
set tpath ${prefix}/Library/Java
use_xcode yes
use_configure yes
configure.cmd ${prefix}/bin/bash configure
configure.pre_args --prefix=${tpath}
set bug_url "https://trac.macports.org/newticket?port=${name}"
# default configure args
configure.args --with-debug-level=release \
--with-native-debug-symbols=none \
--with-version-string=${version}+${build} \
--with-sysroot=`xcrun --sdk macosx --show-sdk-path` \
--with-extra-cflags="${configure.cflags}" \
--with-extra-cxxflags="${configure.cxxflags}" \
--with-extra-ldflags="${configure.ldflags}" \
--with-boot-jdk=/Library/Java/JavaVirtualMachines/jdk-21-azul-zulu.jdk/Contents/Home \
--with-freetype=system \
--with-freetype-include=${prefix}/include/freetype2 \
--with-freetype-lib=${prefix}/lib \
--disable-warnings-as-errors \
--disable-precompiled-headers \
--with-vendor-name="MacPorts" \
--with-vendor-url="https://www.macports.org" \
--with-vendor-bug-url="${bug_url}" \
--with-vendor-vm-bug-url="${bug_url}" \
--with-conf-name=release
2023-12-10 08:49:44 +00:00
if {[option configure.ccache]} {
# replace MacPorts ccache integration into JDK
configure.ccache no
depends_build-append path:bin/ccache:ccache
configure.args-append --enable-ccache \
2023-12-13 00:03:04 -05:00
--with-ccache-dir=${ccache_dir}
2023-12-10 08:49:44 +00:00
}
2023-10-21 13:20:16 +02:00
variant release \
conflicts debug optimized \
description {OpenJDK with no debug information, all optimizations and no asserts} {
configure.args-append --with-debug-level=release
}
variant optimized \
conflicts debug release \
description {OpenJDK with no debug information, all optimizations, no asserts and HotSpot is 'optimized'} {
configure.args-append --with-debug-level=optimized
}
variant debug \
conflicts optimized release \
description {OpenJDK with debug information, all optimizations and all asserts} {
configure.args-append --with-debug-level=fastdebug
configure.args-delete --with-native-debug-symbols=none
}
variant client \
conflicts core minimal server zero \
description {JVM with normal interpreter, C1 and no C2 compiler} {
configure.args-append --with-jvm-variants=client
}
variant server \
conflicts client core minimal zero \
description {JVM with normal interpreter, and a tiered C1/C2 compiler} {
configure.args-append --with-jvm-variants=server
}
variant minimal \
conflicts client core server zero \
description {JVM with reduced form of normal interpreter having C1, no C2 compiler and optional features stripped out} {
configure.args-append --with-jvm-variants=minimal
}
variant core \
conflicts client minimal server zero \
description {JVM with normal interpreter only and no compiler} {
configure.args-append --with-jvm-variants=core
}
variant zero \
conflicts client core minimal server \
description {JVM with C++ based interpreter only, no compiler} {
configure.args-append --with-jvm-variants=zero \
--with-libffi=${prefix} \
--enable-libffi-bundling
depends_lib-append port:libffi
}
if {![variant_isset debug] && ![variant_isset optimized] && ![variant_isset release]} {
default_variants-append +release
}
if {![variant_isset client] && ![variant_isset core] && ![variant_isset minimal] && ![variant_isset server]} {
default_variants-append +server
}
build.type gnu
build.target images
use_parallel_build no
set jdkn jdk-${version}.jdk
set bundle_dir build/release/images/jdk-bundle/${jdkn}/Contents
test.run yes
test.cmd ${bundle_dir}/Home/bin/java
test.target --version
set jvms /Library/Java/JavaVirtualMachines
2024-09-23 01:07:19 +02:00
set jdk ${jvms}/jdk-${feature}-macports.jdk
2023-10-21 13:20:16 +02:00
destroot {
xinstall -m 755 -d ${destroot}${prefix}${jdk}
copy ${worksrcpath}/${bundle_dir} ${destroot}${prefix}${jdk}
# macOS Java tools expect to find Java virtual machines under /Library/Java/JavaVirtualMachines, so let's create a symlink there
xinstall -m 755 -d ${destroot}${jvms}
ln -s ${prefix}${jdk} ${destroot}${jdk}
}
# macOS Java tools expect to find Java virtual machines under /Library/Java/JavaVirtualMachines, which is not under ${prefix}.
destroot.violate_mtree yes
post-destroot {
delete ${worksrcpath}
}
notes "
If you want to make ${name} the default JDK, add this to shell profile:
export JAVA_HOME=${jdk}/Contents/Home
"
livecheck.type regex
2025-10-22 18:30:54 +02:00
livecheck.url https://github.com/openjdk/jdk${feature}u/tags
livecheck.regex jdk-(\[0-9.\]+)-ga
livecheck.version ${version}