2022-03-27 12:00:23 +05:30
|
|
|
# -*- 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 15:03:27 +02:00
|
|
|
PortGroup github 1.0
|
2022-03-27 12:00:23 +05:30
|
|
|
|
2024-10-20 15:48:43 +02:00
|
|
|
set feature 17
|
|
|
|
|
name openjdk${feature}
|
2025-10-22 15:03:27 +02:00
|
|
|
|
|
|
|
|
# See https://github.com/openjdk/jdk17u/tags for the version and build number that matches the latest tag that ends with '-ga'
|
2026-04-24 01:55:38 +02:00
|
|
|
set openjdk_version ${feature}.0.19
|
|
|
|
|
set build 10
|
2024-10-20 15:48:43 +02:00
|
|
|
revision 0
|
2025-10-22 15:03:27 +02:00
|
|
|
|
|
|
|
|
github.setup openjdk jdk${feature}u jdk-${openjdk_version}+${build}
|
|
|
|
|
github.tarball_from archive
|
|
|
|
|
version ${openjdk_version}
|
|
|
|
|
|
|
|
|
|
|
2022-03-27 12:00:23 +05:30
|
|
|
categories java devel
|
|
|
|
|
supported_archs x86_64 arm64
|
|
|
|
|
license GPL-2+
|
2025-10-22 15:03:27 +02:00
|
|
|
maintainers {breun @breun} openmaintainer
|
|
|
|
|
description OpenJDK ${feature} (Long Term Support)
|
|
|
|
|
long_description {*}${description} \
|
|
|
|
|
\n\nJDK ${feature} builds of OpenJDK, the Open-Source implementation \
|
|
|
|
|
of the Java Platform, Standard Edition, and related projects.
|
2024-10-20 15:48:43 +02:00
|
|
|
homepage https://openjdk.org/projects/jdk/${feature}/
|
2022-05-15 15:34:31 +05:30
|
|
|
|
2026-04-24 01:55:38 +02:00
|
|
|
checksums rmd160 a7dd196e2432a5921f7a285957f8f078f4fca333 \
|
|
|
|
|
sha256 87dfd1c72a3c9edec212176fd051dec2249bc42202b539b1cb308f0cc7565b74 \
|
|
|
|
|
size 108206305
|
2022-05-15 15:34:31 +05:30
|
|
|
|
2025-04-17 14:55:50 -04:00
|
|
|
set port_jdk_build openjdk${feature}-zulu
|
|
|
|
|
|
2024-01-21 01:54:18 +01:00
|
|
|
depends_lib port:freetype \
|
|
|
|
|
port:libiconv
|
2025-04-17 14:55:50 -04:00
|
|
|
depends_build port:${port_jdk_build} \
|
2023-05-17 02:18:35 -07:00
|
|
|
port:autoconf \
|
2022-04-01 09:32:30 +05:30
|
|
|
port:gmake \
|
2023-05-17 02:18:35 -07:00
|
|
|
port:bash
|
2022-04-09 21:26:01 +05:30
|
|
|
|
2025-04-17 14:55:50 -04:00
|
|
|
# Don't block binary distribution, due to build JDK
|
|
|
|
|
# See: https://trac.macports.org/ticket/72359
|
|
|
|
|
license_noconflict-append \
|
|
|
|
|
${port_jdk_build}
|
|
|
|
|
|
2022-05-15 15:34:31 +05:30
|
|
|
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
|
|
|
|
|
}
|
2022-04-01 09:32:30 +05:30
|
|
|
|
2025-01-24 01:11:13 +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
|
2024-10-08 23:21:52 +11:00
|
|
|
patchfiles JDK-8340341-clang-16-workaround.patch \
|
2024-10-23 02:23:00 +02:00
|
|
|
JDK-8342071-undecl-ident-nsbun-arm64-workaround.patch
|
2024-10-07 01:37:14 +02:00
|
|
|
|
2023-08-20 19:53:53 +02:00
|
|
|
set tpath ${prefix}/Library/Java
|
2022-03-27 12:00:23 +05:30
|
|
|
use_xcode yes
|
|
|
|
|
use_configure yes
|
2022-04-01 09:32:30 +05:30
|
|
|
configure.cmd ${prefix}/bin/bash configure
|
2022-03-27 12:00:23 +05:30
|
|
|
configure.pre_args --prefix=${tpath}
|
2022-04-09 21:26:01 +05:30
|
|
|
set bug_url "https://trac.macports.org/newticket?port=${name}"
|
2022-04-08 05:55:19 -07:00
|
|
|
# default configure args
|
2022-03-27 12:00:23 +05:30
|
|
|
configure.args --with-debug-level=release \
|
|
|
|
|
--with-native-debug-symbols=none \
|
2022-05-15 15:34:31 +05:30
|
|
|
--with-version-string=${version}+${build} \
|
2022-03-29 16:24:42 +05:30
|
|
|
--with-sysroot=`xcrun --sdk macosx --show-sdk-path` \
|
2022-05-15 15:34:31 +05:30
|
|
|
--with-extra-cflags="${configure.cflags}" \
|
|
|
|
|
--with-extra-cxxflags="${configure.cxxflags}" \
|
|
|
|
|
--with-extra-ldflags="${configure.ldflags}" \
|
2025-04-16 09:37:39 +02:00
|
|
|
--with-boot-jdk=/Library/Java/JavaVirtualMachines/openjdk${feature}-zulu/Contents/Home \
|
2022-05-15 15:34:31 +05:30
|
|
|
--with-freetype=system \
|
|
|
|
|
--with-freetype-include=${prefix}/include/freetype2 \
|
|
|
|
|
--with-freetype-lib=${prefix}/lib \
|
2022-03-27 12:00:23 +05:30
|
|
|
--disable-warnings-as-errors \
|
2023-05-17 02:18:35 -07:00
|
|
|
--disable-precompiled-headers \
|
2023-01-17 20:20:12 +01:00
|
|
|
--with-vendor-name="MacPorts" \
|
|
|
|
|
--with-vendor-url="https://www.macports.org" \
|
2022-04-09 21:26:01 +05:30
|
|
|
--with-vendor-bug-url="${bug_url}" \
|
|
|
|
|
--with-vendor-vm-bug-url="${bug_url}" \
|
|
|
|
|
--with-conf-name=release
|
2022-04-01 09:32:30 +05:30
|
|
|
|
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
|
|
|
}
|
2022-04-01 09:32:30 +05:30
|
|
|
|
|
|
|
|
variant release \
|
2022-05-05 06:44:27 -05:00
|
|
|
conflicts debug optimized \
|
2022-05-15 15:34:31 +05:30
|
|
|
description {OpenJDK with no debug information, all optimizations and no asserts} {
|
|
|
|
|
configure.args-append --with-debug-level=release
|
|
|
|
|
}
|
2022-04-01 09:32:30 +05:30
|
|
|
|
|
|
|
|
variant optimized \
|
2022-05-05 06:44:27 -05:00
|
|
|
conflicts debug release \
|
2022-04-01 09:32:30 +05:30
|
|
|
description {OpenJDK with no debug information, all optimizations, no asserts and HotSpot is 'optimized'} {
|
2022-05-15 15:34:31 +05:30
|
|
|
configure.args-append --with-debug-level=optimized
|
2022-04-01 09:32:30 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variant debug \
|
2022-05-05 06:44:27 -05:00
|
|
|
conflicts optimized release \
|
2022-04-01 09:32:30 +05:30
|
|
|
description {OpenJDK with debug information, all optimizations and all asserts} {
|
2022-05-15 15:34:31 +05:30
|
|
|
configure.args-append --with-debug-level=fastdebug
|
2022-04-08 05:41:14 -07:00
|
|
|
configure.args-delete --with-native-debug-symbols=none
|
2022-04-01 09:32:30 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variant client \
|
2022-05-15 15:34:31 +05:30
|
|
|
conflicts core minimal server zero \
|
2022-04-01 09:32:30 +05:30
|
|
|
description {JVM with normal interpreter, C1 and no C2 compiler} {
|
2022-05-15 15:34:31 +05:30
|
|
|
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
|
2022-04-01 09:32:30 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variant minimal \
|
2022-05-15 15:34:31 +05:30
|
|
|
conflicts client core server zero \
|
2022-04-01 09:32:30 +05:30
|
|
|
description {JVM with reduced form of normal interpreter having C1, no C2 compiler and optional features stripped out} {
|
2022-05-15 15:34:31 +05:30
|
|
|
configure.args-append --with-jvm-variants=minimal
|
2022-04-01 09:32:30 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variant core \
|
2022-05-15 15:34:31 +05:30
|
|
|
conflicts client minimal server zero \
|
2022-04-01 09:32:30 +05:30
|
|
|
description {JVM with normal interpreter only and no compiler} {
|
2022-05-15 15:34:31 +05:30
|
|
|
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
|
2022-04-01 09:32:30 +05:30
|
|
|
}
|
|
|
|
|
|
2022-05-05 06:44:27 -05:00
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-27 12:00:23 +05:30
|
|
|
build.type gnu
|
|
|
|
|
build.target images
|
|
|
|
|
use_parallel_build no
|
|
|
|
|
set jdkn jdk-${version}.jdk
|
2022-04-09 21:26:01 +05:30
|
|
|
set bundle_dir build/release/images/jdk-bundle/${jdkn}/Contents
|
2022-03-27 12:00:23 +05:30
|
|
|
|
|
|
|
|
test.run yes
|
|
|
|
|
test.cmd ${bundle_dir}/Home/bin/java
|
|
|
|
|
test.target --version
|
|
|
|
|
|
|
|
|
|
set pathb ${tpath}/JavaVirtualMachines/${name}
|
2023-08-20 19:53:53 +02:00
|
|
|
set jvms /Library/Java/JavaVirtualMachines
|
|
|
|
|
set jdk ${jvms}/${name}
|
2022-03-27 12:00:23 +05:30
|
|
|
destroot {
|
|
|
|
|
xinstall -m 755 -d ${destroot}${pathb}
|
|
|
|
|
copy ${worksrcpath}/${bundle_dir} ${destroot}${pathb}
|
2023-08-20 19:53:53 +02:00
|
|
|
|
|
|
|
|
# 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 ${pathb} ${destroot}${jdk}
|
2022-03-27 12:00:23 +05:30
|
|
|
}
|
2023-08-20 19:53:53 +02:00
|
|
|
|
|
|
|
|
# macOS Java tools expect to find Java virtual machines under /Library/Java/JavaVirtualMachines, which is not under ${prefix}.
|
2022-03-27 12:00:23 +05:30
|
|
|
destroot.violate_mtree yes
|
|
|
|
|
|
|
|
|
|
post-destroot {
|
|
|
|
|
delete ${worksrcpath}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
notes "
|
2022-04-06 16:21:38 +02:00
|
|
|
If you want to make ${name} the default JDK, add this to shell profile:
|
2023-08-20 19:53:53 +02:00
|
|
|
export JAVA_HOME=${jdk}/Contents/Home
|
2022-03-27 12:00:23 +05:30
|
|
|
"
|
|
|
|
|
|
2022-08-21 17:37:24 +02:00
|
|
|
livecheck.type regex
|
2025-10-22 16:23:33 +02:00
|
|
|
livecheck.url https://github.com/openjdk/jdk${feature}u/tags
|
|
|
|
|
livecheck.regex jdk-(\[0-9.\]+)-ga
|
|
|
|
|
livecheck.version ${version}
|