Files

189 lines
7.1 KiB
Tcl
Raw Permalink Normal View History

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 16:24:26 +02:00
PortGroup github 1.0
2022-03-27 12:00:23 +05:30
2024-10-23 00:57:32 +02:00
set feature 11
name openjdk${feature}
2025-10-22 16:24:26 +02:00
# See https://github.com/openjdk/jdk11u/tags for the version and build number that matches the latest tag that ends with '-ga'
2026-04-24 02:09:16 +02:00
set openjdk_version ${feature}.0.31
set build 11
2024-10-23 00:57:32 +02:00
revision 0
2025-10-22 16:24:26 +02:00
github.setup openjdk jdk${feature}u ${openjdk_version}+${build} jdk-
github.tarball_from archive
version ${openjdk_version}
2022-03-27 12:00:23 +05:30
categories java devel
2022-04-01 09:32:30 +05:30
supported_archs x86_64 arm64
2022-03-27 12:00:23 +05:30
license GPL-2+
2025-10-22 16:24:26 +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-23 00:57:32 +02:00
homepage https://openjdk.org/projects/jdk/${feature}/
2022-04-21 16:24:18 +05:30
2026-04-24 02:09:16 +02:00
checksums rmd160 47c8d67e7445a9f6ceae2f6a764f98a2ae610924 \
sha256 d409a47d58b5ab9deb344b185d48395b4cce8ab84ec4229aa4589b4f65ff59b4 \
size 116728518
2022-04-21 16:24:18 +05:30
depends_lib port:freetype \
port:libiconv
2022-03-27 12:00:23 +05:30
depends_build port:autoconf \
2022-04-01 09:32:30 +05:30
port:gmake \
2022-04-24 06:11:39 +05:30
port:bash \
2024-10-23 00:57:32 +02:00
port:openjdk${feature}-bootstrap
2022-04-09 21:16:58 +05:30
pre-patch {
2022-05-15 15:34:31 +05:30
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-09 21:16:58 +05:30
reinplace "s|assert|vmassert|g" ${worksrcpath}/src/hotspot/share/jfr/periodic/jfrNetworkUtilization.cpp
}
2022-04-01 09:32:30 +05:30
2025-01-24 01:11:27 +01:00
# Workaround for clang 16.0-16.1: https://trac.macports.org/ticket/70819
2024-10-07 02:16:02 +02:00
patchfiles JDK-8340341-clang-16-workaround.patch
set tpath ${prefix}/Library/Java
2022-03-27 12:00:23 +05:30
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:16:58 +05:30
set bug_url "https://trac.macports.org/newticket?port=${name}"
2022-03-27 12:00:23 +05:30
# default configure args
2022-03-29 16:24:42 +05:30
configure.args --with-debug-level=release \
2022-03-27 12:00:23 +05:30
--with-native-debug-symbols=none \
2022-05-15 15:34:31 +05:30
--with-version-string=${version}+${build} \
2022-04-09 21:16:58 +05:30
--with-target-bits=64 \
2022-03-27 12:00:23 +05:30
--with-sysroot=`xcrun --sdk macosx --show-sdk-path` \
2022-04-23 16:01:44 +05:30
--with-extra-cflags="${configure.cflags}" \
--with-extra-cxxflags="${configure.cxxflags}" \
--with-extra-ldflags="${configure.ldflags}" \
2024-10-23 00:57:32 +02:00
--with-boot-jdk=/Library/Java/JavaVirtualMachines/openjdk${feature}-bootstrap/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 \
2022-03-29 16:24:42 +05:30
--disable-precompiled-headers \
2023-01-18 15:14:42 +01:00
--with-vendor-name="MacPorts" \
--with-vendor-url="https://www.macports.org" \
2022-04-09 21:16:58 +05:30
--with-vendor-bug-url="${bug_url}" \
--with-vendor-vm-bug-url="${bug_url}" \
2024-10-23 00:57:32 +02:00
--with-conf-name=openjdk${feature}
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 \
conflicts debug optimized \
2022-04-21 16:24:18 +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 \
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-04-21 16:24:18 +05:30
configure.args-append --with-debug-level=optimized
2022-04-01 09:32:30 +05:30
}
variant debug \
conflicts optimized release \
2022-04-01 09:32:30 +05:30
description {OpenJDK with debug information, all optimizations and all asserts} {
2022-04-21 16:24:18 +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 \
conflicts core minimal server zero \
2022-04-01 09:32:30 +05:30
description {JVM with normal interpreter, C1 and no C2 compiler} {
2022-04-21 16:24:18 +05:30
configure.args-append --with-jvm-variants=client
}
variant server \
conflicts client core minimal zero \
2022-04-21 16:24:18 +05:30
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 \
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-04-21 16:24:18 +05:30
configure.args-append --with-jvm-variants=minimal
2022-04-01 09:32:30 +05:30
}
variant core \
conflicts client minimal server zero \
2022-04-01 09:32:30 +05:30
description {JVM with normal interpreter only and no compiler} {
2022-04-21 16:24:18 +05:30
configure.args-append --with-jvm-variants=core
}
variant zero \
conflicts client core minimal server \
2022-04-21 16:24:18 +05:30
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
}
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] && ![variant_isset zero]} {
if {${os.platform} eq "darwin" && ${os.major} < 16} {
default_variants-append +zero
} else {
default_variants-append +server
}
}
2022-04-01 09:32:30 +05:30
if {${configure.build_arch} eq "arm64"} {
2022-04-10 07:02:00 +05:30
configure.args-delete --with-target-bits=64
2022-05-15 15:34:31 +05:30
configure.args-append --openjdk-target=aarch64-apple-darwin
2022-04-01 09:32:30 +05:30
} elseif {${configure.build_arch} eq "x86_64"} {
2022-04-08 05:55:19 -07:00
configure.post_args
2022-04-01 09:32:30 +05:30
}
2022-03-27 12:00:23 +05:30
build.type gnu
build.target images
use_parallel_build no
2022-05-15 15:34:31 +05:30
set jdkn jdk-${version}.jdk
2024-10-23 00:57:32 +02:00
set bundle_dir build/openjdk${feature}/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}
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}
# 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
}
# 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:11:28 +02:00
If you want to make ${name} the default JDK, add this to shell profile:
export JAVA_HOME=${jdk}/Contents/Home
2022-03-27 12:00:23 +05:30
"
2022-08-21 17:27:44 +02:00
livecheck.type regex
2025-10-22 16:24:26 +02:00
livecheck.url https://github.com/openjdk/jdk${feature}u/tags
livecheck.regex jdk-(\[0-9.\]+)-ga
livecheck.version ${version}