From nobody Fri Dec 27 19:41:51 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YKbV752zDz5jDp6; Fri, 27 Dec 2024 19:41:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YKbV73r6sz4QKJ; Fri, 27 Dec 2024 19:41:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735328511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iA6tbhfLtogMRVRnf9ZwKroT1rzjiz9JUbFP3jpYqFM=; b=mA8tSSlPcKhVZOAAX3t7K6ESJVA0ZIloUESWp+FMalN2mOPopmtWBAYXs4MOSSf0ous8L4 rkI/ZUimpLXxdtSTIzhEaRE2GUrxp0bVL627t8gVsjnOckO/Nbb57kN/Cs6SzkTpaCXIy+ OQvm3JJQJsb1cF6hm0YbAm0bT9faUvPCxBmD9neYWs4GpEcVnNiHdG2HyjwCKCSKMzgaYk LM86RvBsBJ+lMBvbr7MnEqUXqQHVM7rQb/TNDcq9TdzhQb3Z965nzgVrKQWhAar4rSoMdK CgTc/g/cumYpK0eKoZ3XvSMtlVun8/gVem9gLrvbBRwIH6+iIruDg9RlB8oQMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735328511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iA6tbhfLtogMRVRnf9ZwKroT1rzjiz9JUbFP3jpYqFM=; b=U5Dxs4CX0s/7aVJ84eh0SLyVYheXH/skUPfAka0Hb6kv1BJlTUc6dg3yNZjCyJcpA6bFOH O0hZMRisBpdZel4X0kJPF4S915MDo7pTgAIL0yZb5pKe/rCqC+atCgSnnbV0hORX/2MAZy 9nJzYqGrZlH45TGvK22Xa2mRAoiOilrOeWzCmlwPrAw1oQHxFdYfiTg8tzRQzx/iiI3bvo HsjJygJet4Q/t1A5tfckib0ET1WncGn3Bc8bpREZHjmaWqgvs2b9hTJmx8zB6ZPZZLEYaN 3vFY7mBPPWvagNFPQY2uXzOfNut3rj5ckkJ8MvVGCIIy/h182hbyQNvV3+B2qQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1735328511; a=rsa-sha256; cv=none; b=KmQJu1wcf7lljIS2h4WIKJ4Ho7J8MsgFjwKCq0AexcvMKd5T1GUZzJykppXIa2SLYj4fRI VHMhIUf46BHSnd/b2RWo4cbqD0iD+7BWhmpP4aKs0IVlm4XO36miGldPxqVjLwYsmqgufg 34A6X8s2rpfV+Ob9MLQtboiCStJeLjoBc8Tb/rW68w3GjX1RxCccwV3s612yGGrIqF5DDy 0r7hinnRAB4SQGp46oSvQNW4w7hUf43bZuHh0AfvfJnA/e+OKOku41ArDXDsha+X8/bqyM ZswKX6tdSsh8eog1abjmDi5Be0kyfhkizIWC0/oB/aDVgLZY23rRTSWrqdhBjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YKbV73SFxzsfT; Fri, 27 Dec 2024 19:41:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BRJfpAP037955; Fri, 27 Dec 2024 19:41:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BRJfpuD037952; Fri, 27 Dec 2024 19:41:51 GMT (envelope-from git) Date: Fri, 27 Dec 2024 19:41:51 GMT Message-Id: <202412271941.4BRJfpuD037952@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Joseph Mingrone Subject: git: aa17c509fe7c - main - java/openjdk23: Add port List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa17c509fe7c4a011e832bd1e67257cf5d0ebc81 Auto-Submitted: auto-generated The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/ports/commit/?id=aa17c509fe7c4a011e832bd1e67257cf5d0ebc81 commit aa17c509fe7c4a011e832bd1e67257cf5d0ebc81 Author: Haral Eilertsen AuthorDate: 2024-12-27 19:07:01 +0000 Commit: Joseph Mingrone CommitDate: 2024-12-27 19:41:29 +0000 java/openjdk23: Add port Release notes: https://openjdk.org/projects/jdk/23/ Reviewed by: bofh, diizzy, emaste, glewis, jrm Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48194 --- Mk/bsd.default-versions.mk | 2 +- Mk/bsd.java.mk | 9 +- java/Makefile | 1 + java/openjdk23/Makefile | 183 ++++++++++++++++++ java/openjdk23/distinfo | 3 + java/openjdk23/files/patch-configure | 14 ++ .../files/patch-make_autoconf_flags-cflags.m4 | 13 ++ .../files/patch-make_autoconf_libraries.m4 | 15 ++ .../files/patch-src_hotspot_os_bsd_os__bsd.cpp | 11 ++ ...op_share_native_libfontmanager_freetypeScaler.c | 209 +++++++++++++++++++++ java/openjdk23/pkg-descr | 8 + java/openjdk23/pkg-message | 18 ++ 12 files changed, 482 insertions(+), 4 deletions(-) diff --git a/Mk/bsd.default-versions.mk b/Mk/bsd.default-versions.mk index d94468485761..072dfc30477a 100644 --- a/Mk/bsd.default-versions.mk +++ b/Mk/bsd.default-versions.mk @@ -73,7 +73,7 @@ GUILE_DEFAULT?= 2.2 # Format: version[-flavor] # Examples: 6-nox11, 7 IMAGEMAGICK_DEFAULT?= 7 -# Possible values: 8, 11, 17, 18, 19, 20, 21, 22 +# Possible values: 8, 11, 17, 18, 19, 20, 21, 22 23 JAVA_DEFAULT?= 8 # Possible values: 3.4.0, 3.99 . if (defined(WANT_LAZARUS_DEVEL) && !empty(WANT_LAZARUS_DEVEL)) || ${ARCH:Maarch64} diff --git a/Mk/bsd.java.mk b/Mk/bsd.java.mk index c0725d80f9f0..2c089c85785f 100644 --- a/Mk/bsd.java.mk +++ b/Mk/bsd.java.mk @@ -23,7 +23,7 @@ Java_Include_MAINTAINER= java@FreeBSD.org # JAVA_VERSION List of space-separated suitable java versions for the # port. An optional "+" allows you to specify a range of # versions. (allowed values: 8[+] 11[+] 17[+] 18[+] 19[+] -# 20[+] 21[+] 22[+]) +# 20[+] 21[+] 22[+] 23[+]) # # JAVA_OS List of space-separated suitable JDK port operating systems # for the port. (allowed values: native linux) @@ -160,7 +160,7 @@ SUB_LIST+= JAVA_OS="${JAVA_OS}" . endif # The complete list of Java versions, os and vendors supported. -__JAVA_VERSION_LIST= 8 11 17 18 19 20 21 22 +__JAVA_VERSION_LIST= 8 11 17 18 19 20 21 22 23 _JAVA_VERSION_LIST= ${__JAVA_VERSION_LIST} ${__JAVA_VERSION_LIST:S/$/+/} _JAVA_OS_LIST= native linux _JAVA_VENDOR_LIST= openjdk oracle @@ -183,6 +183,8 @@ _JAVA_PORT_NATIVE_OPENJDK_JDK_21_INFO= PORT=java/openjdk21 HOME=${LOCALBASE}/ VERSION=21 OS=native VENDOR=openjdk _JAVA_PORT_NATIVE_OPENJDK_JDK_22_INFO= PORT=java/openjdk22 HOME=${LOCALBASE}/openjdk22 \ VERSION=22 OS=native VENDOR=openjdk +_JAVA_PORT_NATIVE_OPENJDK_JDK_23_INFO= PORT=java/openjdk23 HOME=${LOCALBASE}/openjdk23 \ + VERSION=23 OS=native VENDOR=openjdk _JAVA_PORT_LINUX_ORACLE_JDK_8_INFO= PORT=java/linux-oracle-jdk18 HOME=${LOCALBASE}/linux-oracle-jdk1.8.0 \ VERSION=8 OS=linux VENDOR=oracle @@ -204,6 +206,7 @@ __JAVA_PORTS_ALL= \ JAVA_PORT_NATIVE_OPENJDK_JDK_20 \ JAVA_PORT_NATIVE_OPENJDK_JDK_21 \ JAVA_PORT_NATIVE_OPENJDK_JDK_22 \ + JAVA_PORT_NATIVE_OPENJDK_JDK_23 \ JAVA_PORT_LINUX_ORACLE_JDK_8 _JAVA_PORTS_ALL= ${JAVA_PREFERRED_PORTS} \ JAVA_PORT_NATIVE_OPENJDK_JDK_${JAVA_DEFAULT} \ @@ -278,7 +281,7 @@ JAVA_RUN= jre . undef _JAVA_PORTS_INSTALLED . undef _JAVA_PORTS_POSSIBLE . if defined(JAVA_VERSION) -_JAVA_VERSION= ${JAVA_VERSION:S/^8+/8 11+/:S/^11+/11 17+/:S/^17+/17 18+/:S/^18+/18 19+/:S/^19+/19 20+/:S/^20+/20 21+/:S/^21+/21 22+/:S/^22+/22/} +_JAVA_VERSION= ${JAVA_VERSION:S/^8+/8 11+/:S/^11+/11 17+/:S/^17+/17 18+/:S/^18+/18 19+/:S/^19+/19 20+/:S/^20+/20 21+/:S/^21+/21 22+/:S/^22+/22 23+/:S/^23+/23/} . else _JAVA_VERSION= ${__JAVA_VERSION_LIST} . endif diff --git a/java/Makefile b/java/Makefile index 6230375f2549..fe367ac20875 100644 --- a/java/Makefile +++ b/java/Makefile @@ -93,6 +93,7 @@ SUBDIR += openjdk20 SUBDIR += openjdk21 SUBDIR += openjdk22 + SUBDIR += openjdk23 SUBDIR += openjdk8 SUBDIR += openjdk8-jre SUBDIR += openjfx14 diff --git a/java/openjdk23/Makefile b/java/openjdk23/Makefile new file mode 100644 index 000000000000..d42316e5fd2d --- /dev/null +++ b/java/openjdk23/Makefile @@ -0,0 +1,183 @@ +PORTNAME= openjdk +DISTVERSIONPREFIX= jdk- +DISTVERSION= ${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_PATCH_VERSION}+${JDK_BUILD_NUMBER}-${BSD_JDK_VERSION} +CATEGORIES= java devel +PKGNAMESUFFIX?= ${JDK_MAJOR_VERSION} + +MAINTAINER= java@FreeBSD.org +COMMENT= Java Development Kit ${JDK_MAJOR_VERSION} +WWW= https://openjdk.java.net/projects/jdk/23/ + +LICENSE= GPLv2 + +ONLY_FOR_ARCHS= aarch64 amd64 i386 powerpc64 powerpc64le + +BUILD_DEPENDS= zip:archivers/zip \ + ${LOCALBASE}/include/cups/cups.h:print/cups \ + bash:shells/bash \ + gsed:textproc/gsed +LIB_DEPENDS= libasound.so:audio/alsa-lib \ + libfontconfig.so:x11-fonts/fontconfig \ + libfreetype.so:print/freetype2 \ + libgif.so:graphics/giflib \ + libharfbuzz.so:print/harfbuzz \ + liblcms2.so:graphics/lcms2 \ + libpng.so:graphics/png +RUN_DEPENDS= javavm:java/javavmwrapper \ + xorg-fonts-truetype>0:x11-fonts/xorg-fonts-truetype + +USES= autoreconf:build compiler:features cpe gmake iconv jpeg pkgconfig xorg +USE_XORG= x11 xext xi xrandr xrender xt xtst + +CPE_VENDOR= oracle + +USE_GITHUB= yes +GH_ACCOUNT= battleblow +GH_PROJECT= jdk23u + +NO_CCACHE= yes + +_MAKE_JOBS= # +USE_LOCALE="C" +MAKE_ENV= CLASSPATH="" \ + JAVA_HOME="" \ + LD_LIBRARY_PATH="" \ + MAKEFLAGS="" + +JDK_OSARCH= bsd-${ARCH:S/amd64/x86_64/:S/i386/x86/:S/powerpc64/ppc64/} +JDK_BUILDDIR= ${WRKSRC}/build/${JDK_OSARCH}-${JDK_BUILD_JVM}-${JDK_BUILD_TYPE} +.if defined(BUILD_JRE) +JDK_IMAGEDIR= ${JDK_BUILDDIR}/images/jre +.else +JDK_IMAGEDIR= ${JDK_BUILDDIR}/images/jdk +.endif +INSTALLDIR= ${PREFIX}/${PKGBASE} + +NOPRECIOUSMAKEVARS= yes + +JDK_MAJOR_VERSION= 23 +JDK_MINOR_VERSION= 0 +JDK_PATCH_VERSION= 1 +JDK_BUILD_NUMBER= 11 +BSD_JDK_VERSION= 1 + +JDK_BUG_URL= https://bugs.freebsd.org/bugzilla/enter_bug.cgi?product=Ports%20%26%20Packages&component=Individual%20Port(s)&short_desc=java/${PORTNAME}${JDK_MAJOR_VERSION}%3A%20 + +GNU_CONFIGURE= yes +CONFIGURE_ENV= ac_cv_path_SED=${LOCALBASE}/bin/gsed +CONFIGURE_ARGS= --with-boot-jdk=${BOOTSTRAPJDKDIR} \ + --disable-ccache \ + --disable-javac-server \ + --with-alsa=${LOCALBASE} \ + --with-cups=${LOCALBASE} \ + --with-fontconfig=${LOCALBASE} \ + --with-freetype=system \ + --with-libjpeg=system \ + --with-giflib=system \ + --with-giflib-include=${LOCALBASE}/include \ + --with-giflib-lib=${LOCALBASE}/lib \ + --with-harfbuzz=system \ + --with-libpng=system \ + --with-zlib=system \ + --with-lcms=system \ + --x-includes=${LOCALBASE}/include \ + --x-libraries=${LOCALBASE}/lib \ + --with-version-string=${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_PATCH_VERSION}+${JDK_BUILD_NUMBER}-${BSD_JDK_VERSION} \ + --with-native-debug-symbols=none \ + --with-debug-level=release \ + --with-vendor-name="OpenJDK BSD Porting Team" \ + --with-vendor-url="https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/" \ + --with-vendor-bug-url="${JDK_BUG_URL}" \ + --with-vendor-vm-bug-url="${JDK_BUG_URL}" + +JAVAVMS_COMMENT= OpenJDK${JDK_MAJOR_VERSION} + +.if defined(BUILD_JRE) +ALL_TARGET= legacy-images +.else +ALL_TARGET= images +.endif +JDK_BUILD_TYPE= release + +.include + +BOOTSTRAP_JDKS= ${LOCALBASE}/openjdk23 ${LOCALBASE}/openjdk22 + +# do we have valid native jdk installed? +.for BJDK in ${BOOTSTRAP_JDKS} +. if !defined(BOOTSTRAPJDKDIR) && exists(${BJDK}/bin/javac) +BOOTSTRAPJDKDIR= ${BJDK} +. endif +.endfor + +# if no valid jdk found, set dependency +.if !defined(BOOTSTRAPJDKDIR) +BOOTSTRAPJDKDIR?= ${LOCALBASE}/openjdk22 +BUILD_DEPENDS+= ${BOOTSTRAPJDKDIR}/bin/javac:java/openjdk22 +.endif + +JDK_BUILD_JVM= server + +MAKE_ENV+= --with-toolchain-type=${COMPILER_TYPE} +CONFIGURE_ARGS+= --with-toolchain-type=${COMPILER_TYPE} +CONFIGURE_ARGS+= --disable-warnings-as-errors + +.if ${COMPILER_TYPE} == gcc +USE_GCC= yes +CONFIGURE_ARGS+= --with-extra-ldflags="-Wl,-rpath=${LOCALBASE}/lib/gcc${GCC_DEFAULT} -L${LOCALBASE}/lib/gcc${GCC_DEFAULT}" \ + --with-extra-cflags="-Wl,-rpath=${LOCALBASE}/lib/gcc${GCC_DEFAULT}" \ + --with-extra-cxxflags="-Wl,-rpath=${LOCALBASE}/lib/gcc${GCC_DEFAULT}" +.else +MAKE_ENV+= USE_CLANG=true +EXTRA_CFLAGS+= -Wno-unused-but-set-parameter +EXTRA_CFLAGS+= -Wno-bitwise-instead-of-logical +EXTRA_CFLAGS+= -Wno-error=deprecated-non-prototype +CONFIGURE_ARGS+= --with-extra-cflags="${EXTRA_CFLAGS}" +CONFIGURE_ARGS+= --with-extra-cxxflags="${EXTRA_CFLAGS}" +.endif + +.if ${ARCH} == aarch64 +CONFIGURE_ARGS+= --with-boot-jdk-jvmargs=-XX:-UseCompressedClassPointers --disable-dtrace +MAKE_ENV+= JAVA_TOOL_OPTIONS="-XX:-UseCompressedClassPointers" +.endif + +.if empty(ICONV_LIB) +ICONV_CFLAGS= -DLIBICONV_PLUG +.else +ICONV_CFLAGS= -I${LOCALBASE}/include +ICONV_LDFLAGS= -L${LOCALBASE}/lib +ICONV_LIBS= ${ICONV_LIB} +.endif + +post-patch: + @${RM} ${WRKSRC}/src/hotspot/os_cpu/bsd_ppc/thread_bsd_ppc.cpp + @${MV} ${WRKSRC}/src/hotspot/os_cpu/bsd_ppc/thread_bsd_ppc.hpp \ + ${WRKSRC}/src/hotspot/os_cpu/bsd_ppc/javaThread_bsd_ppc.hpp + + @${FIND} ${WRKSRC} -name '*.orig' -delete + @${CHMOD} 755 ${WRKSRC}/configure + @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \ + ${WRKSRC}/configure \ + ${WRKSRC}/src/hotspot/os/bsd/os_bsd.cpp + @${REINPLACE_CMD} -e 's|%%ICONV_CFLAGS%%|${ICONV_CFLAGS}|' \ + -e 's|%%ICONV_LDFLAGS%%|${ICONV_LDFLAGS}|' \ + -e 's|%%ICONV_LIBS%%|${ICONV_LIBS}|' \ + ${WRKSRC}/make/autoconf/libraries.m4 + +post-build: +.if defined(OPENJDK_SYMLINK_CACERTS) + @${RM} ${JDK_IMAGEDIR}/lib/security/cacerts + @${LN} -sf ${OPENJDK_SYMLINK_CACERTS} ${JDK_IMAGEDIR}/lib/security/cacerts +.endif + +do-install: + @${MKDIR} ${STAGEDIR}${INSTALLDIR} + @cd ${JDK_IMAGEDIR} && ${COPYTREE_SHARE} . ${STAGEDIR}${INSTALLDIR} + @cd ${STAGEDIR}${INSTALLDIR} && \ + ${FIND} bin -type f -exec ${CHMOD} ${BINMODE} {} \; + @${CHMOD} ${BINMODE} ${STAGEDIR}${INSTALLDIR}/lib/jspawnhelper + @${ECHO} "@javavm ${INSTALLDIR}/bin/java" >> ${TMPPLIST} + @${FIND} ${STAGEDIR}${INSTALLDIR} -not -type d | ${SORT} | \ + ${SED} -e 's|^${STAGEDIR}${PREFIX}/||' >> ${TMPPLIST} + +.include diff --git a/java/openjdk23/distinfo b/java/openjdk23/distinfo new file mode 100644 index 000000000000..79fab4a58eb2 --- /dev/null +++ b/java/openjdk23/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1735117726 +SHA256 (battleblow-jdk23u-jdk-23.0.1+11-1_GH0.tar.gz) = 4341003687aa7c9f4b0175a30ffbb4c01c0bb7a68160ab4975e63d75168df4bc +SIZE (battleblow-jdk23u-jdk-23.0.1+11-1_GH0.tar.gz) = 117320724 diff --git a/java/openjdk23/files/patch-configure b/java/openjdk23/files/patch-configure new file mode 100644 index 000000000000..4bc4479f5e4a --- /dev/null +++ b/java/openjdk23/files/patch-configure @@ -0,0 +1,14 @@ +--- configure.orig 2019-03-12 12:38:39.648907000 -0700 ++++ configure 2019-03-12 12:39:04.275572000 -0700 +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!%%LOCALBASE%%/bin/bash + # + # Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. + # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +@@ -32,4 +32,4 @@ + # Delegate to wrapper, forcing wrapper to believe $0 is this script by using -c. + # This trick is needed to get autoconf to co-operate properly. + # The ${-:+-$-} construction passes on bash options. +-bash ${-:+-$-} -c ". $this_script_dir/make/autoconf/configure" $this_script_dir/configure CHECKME $this_script_dir "$@" ++%%LOCALBASE%%/bin/bash ${-:+-$-} -c ". $this_script_dir/make/autoconf/configure" $this_script_dir/configure CHECKME $this_script_dir "$@" diff --git a/java/openjdk23/files/patch-make_autoconf_flags-cflags.m4 b/java/openjdk23/files/patch-make_autoconf_flags-cflags.m4 new file mode 100644 index 000000000000..5156c18515da --- /dev/null +++ b/java/openjdk23/files/patch-make_autoconf_flags-cflags.m4 @@ -0,0 +1,13 @@ +--- make/autoconf/flags-cflags.m4.orig 2020-01-08 09:12:31 UTC ++++ make/autoconf/flags-cflags.m4 +@@ -770,6 +770,10 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP], + # for all archs except arm and ppc, prevent gcc to omit frame pointer + $1_CFLAGS_CPU_JDK="${$1_CFLAGS_CPU_JDK} -fno-omit-frame-pointer" + fi ++ elif test "x$OPENJDK_TARGET_OS_ENV" = xbsd.freebsd; then ++ if test "x$FLAGS_CPU" = xppc64; then ++ $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=powerpc64 -mtune=power5" ++ fi + fi + + elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then diff --git a/java/openjdk23/files/patch-make_autoconf_libraries.m4 b/java/openjdk23/files/patch-make_autoconf_libraries.m4 new file mode 100644 index 000000000000..0911464a6522 --- /dev/null +++ b/java/openjdk23/files/patch-make_autoconf_libraries.m4 @@ -0,0 +1,15 @@ +--- make/autoconf/libraries.m4~ 2019-08-12 19:10:36.292217000 -0700 ++++ make/autoconf/libraries.m4 2019-08-12 19:18:15.523606000 -0700 +@@ -188,9 +188,9 @@ + ICONV_LDFLAGS="-L/usr/local/lib" + ICONV_LIBS=-liconv + elif test "x$OPENJDK_TARGET_OS_ENV" = "xbsd.freebsd"; then +- ICONV_CFLAGS=-DLIBICONV_PLUG +- ICONV_LDFLAGS= +- ICONV_LIBS= ++ ICONV_CFLAGS=%%ICONV_CFLAGS%% ++ ICONV_LDFLAGS=%%ICONV_LDFLAGS%% ++ ICONV_LIBS=%%ICONV_LIBS%% + else + ICONV_CFLAGS= + ICONV_LDFLAGS= diff --git a/java/openjdk23/files/patch-src_hotspot_os_bsd_os__bsd.cpp b/java/openjdk23/files/patch-src_hotspot_os_bsd_os__bsd.cpp new file mode 100644 index 000000000000..402f0f475bc3 --- /dev/null +++ b/java/openjdk23/files/patch-src_hotspot_os_bsd_os__bsd.cpp @@ -0,0 +1,11 @@ +--- src/hotspot/os/bsd/os_bsd.cpp.orig 2021-09-29 21:25:10 UTC ++++ src/hotspot/os/bsd/os_bsd.cpp +@@ -361,7 +361,7 @@ + #elif defined(__NetBSD__) + #define DEFAULT_LIBPATH "/usr/lib:/usr/pkg/lib" + #else +- #define DEFAULT_LIBPATH "/usr/lib:/usr/local/lib" ++ #define DEFAULT_LIBPATH "/usr/lib:%%LOCALBASE%%/lib" + #endif + #else + #define DEFAULT_LIBPATH OVERRIDE_LIBPATH diff --git a/java/openjdk23/files/patch-src_java.desktop_share_native_libfontmanager_freetypeScaler.c b/java/openjdk23/files/patch-src_java.desktop_share_native_libfontmanager_freetypeScaler.c new file mode 100644 index 000000000000..537ecdc3047c --- /dev/null +++ b/java/openjdk23/files/patch-src_java.desktop_share_native_libfontmanager_freetypeScaler.c @@ -0,0 +1,209 @@ +--- src/java.desktop/share/native/libfontmanager/freetypeScaler.c.orig 2020-07-08 21:34:01 UTC ++++ src/java.desktop/share/native/libfontmanager/freetypeScaler.c +@@ -43,6 +43,7 @@ + #include FT_SYNTHESIS_H + #include FT_LCD_FILTER_H + #include FT_MODULE_H ++#include + + #include "fontscaler.h" + +@@ -87,6 +88,133 @@ typedef struct FTScalerContext { + int ptsz; /* size in points */ + } FTScalerContext; + ++typedef struct { ++ FT_Render_Mode ftRenderMode; ++ int ftLoadFlags; ++ FT_LcdFilter ftLcdFilter; ++} RenderingProperties; ++ ++static FcPattern* matchedPattern(const FcChar8* family, double ptSize) { ++ FcPattern* pattern = FcPatternCreate(); ++ if (!pattern) ++ return 0; ++ ++ FcPatternAddString(pattern, FC_FAMILY, family); ++ FcPatternAddBool(pattern, FC_SCALABLE, FcTrue); ++ FcPatternAddDouble(pattern, FC_SIZE, ptSize); ++ ++ FcConfigSubstitute(0, pattern, FcMatchPattern); ++ FcDefaultSubstitute(pattern); ++ ++ FcResult res; ++ FcPattern *match = FcFontMatch(0, pattern, &res); ++ FcPatternDestroy(pattern); ++ return (res == FcResultMatch) ? match : NULL; ++} ++ ++static void readFontconfig(const FcChar8* family, double ptSize, jint aaType, RenderingProperties* rp) { ++ FcPattern *pattern = matchedPattern(family, ptSize); ++ ++ FT_Render_Mode ftRenderMode = FT_RENDER_MODE_NORMAL; ++ int ftLoadFlags = FT_LOAD_DEFAULT; ++ FT_LcdFilter ftLcdFilter = FT_LCD_FILTER_DEFAULT; ++ FcBool fcAntialias = 0; ++ char horizontal = 1; ++ ++ // subpixel order ++ if (aaType == TEXT_AA_ON) ++ ftRenderMode = FT_RENDER_MODE_NORMAL; ++ else if (aaType == TEXT_AA_OFF) ++ ftRenderMode = FT_RENDER_MODE_MONO; ++ else { ++ int fcRGBA = FC_RGBA_UNKNOWN; ++ if (pattern) ++ FcPatternGetInteger(pattern, FC_RGBA, 0, &fcRGBA); ++ switch (fcRGBA) { ++ case FC_RGBA_NONE: ++ ftRenderMode = FT_RENDER_MODE_NORMAL; ++ break; ++ case FC_RGBA_RGB: ++ case FC_RGBA_BGR: ++ ftRenderMode = FT_RENDER_MODE_LCD; ++ horizontal = 1; ++ break; ++ case FC_RGBA_VRGB: ++ case FC_RGBA_VBGR: ++ ftRenderMode = FT_RENDER_MODE_LCD_V; ++ horizontal = 0; ++ break; ++ default: ++ ftRenderMode = FT_RENDER_MODE_NORMAL; ++ break; ++ } ++ } ++ ++ // loading mode ++ if (aaType == TEXT_AA_OFF) ++ ftLoadFlags |= FT_LOAD_TARGET_MONO; ++ else { ++ int fcHintStyle = FC_HINT_NONE; ++ if (pattern) ++ FcPatternGetInteger(pattern, FC_HINT_STYLE, 0, &fcHintStyle); ++ switch (fcHintStyle) { ++ case FC_HINT_NONE: ++ ftLoadFlags |= FT_LOAD_NO_HINTING; ++ break; ++ case FC_HINT_SLIGHT: ++ ftLoadFlags |= FT_LOAD_TARGET_LIGHT; ++ break; ++ case FC_HINT_MEDIUM: ++ ftLoadFlags |= FT_LOAD_TARGET_NORMAL; ++ break; ++ case FC_HINT_FULL: ++ if (aaType == TEXT_AA_ON) ++ ftLoadFlags |= FT_LOAD_TARGET_NORMAL; ++ else ++ ftLoadFlags |= horizontal ? FT_LOAD_TARGET_LCD : FT_LOAD_TARGET_LCD_V; ++ break; ++ default: ++ ftLoadFlags |= FT_LOAD_TARGET_NORMAL; ++ break; ++ } ++ } ++ ++ // autohinting ++ FcBool fcAutohint = 0; ++ if (pattern && FcPatternGetBool(pattern, FC_AUTOHINT, 0, &fcAutohint) == FcResultMatch) ++ if (fcAutohint) ++ ftLoadFlags |= FT_LOAD_FORCE_AUTOHINT; ++ ++ // LCD filter ++ int fcLCDFilter = FC_LCD_DEFAULT; ++ if (pattern) ++ FcPatternGetInteger(pattern, FC_LCD_FILTER, 0, &fcLCDFilter); ++ switch (fcLCDFilter) { ++ case FC_LCD_NONE: ++ ftLcdFilter = FT_LCD_FILTER_NONE; ++ break; ++ case FC_LCD_DEFAULT: ++ ftLcdFilter = FT_LCD_FILTER_DEFAULT; ++ break; ++ case FC_LCD_LIGHT: ++ ftLcdFilter = FT_LCD_FILTER_LIGHT; ++ break; ++ case FC_LCD_LEGACY: ++ ftLcdFilter = FT_LCD_FILTER_LEGACY; ++ break; ++ default: ++ ftLcdFilter = FT_LCD_FILTER_DEFAULT; ++ break; ++ } ++ ++ if (pattern) ++ FcPatternDestroy(pattern); ++ ++ rp->ftRenderMode = ftRenderMode; ++ rp->ftLoadFlags = ftLoadFlags; ++ rp->ftLcdFilter = ftLcdFilter; ++} ++ + #ifdef DEBUG + /* These are referenced in the freetype sources if DEBUG macro is defined. + To simplify work with debuging version of freetype we define +@@ -868,29 +996,12 @@ static jlong + renderFlags |= FT_LOAD_NO_HINTING; + } + +- if (!context->useSbits) { +- renderFlags |= FT_LOAD_NO_BITMAP; +- } ++ RenderingProperties renderingProperties; ++ readFontconfig((const FcChar8 *) scalerInfo->face->family_name, ++ context->ptsz, context->aaType, &renderingProperties); + +- /* NB: in case of non identity transform +- we might also prefer to disable transform before hinting, +- and apply it explicitly after hinting is performed. +- Or we can disable hinting. */ +- +- /* select appropriate hinting mode */ +- if (context->aaType == TEXT_AA_OFF) { +- target = FT_LOAD_TARGET_MONO; +- } else if (context->aaType == TEXT_AA_ON) { +- target = FT_LOAD_TARGET_NORMAL; +- } else if (context->aaType == TEXT_AA_LCD_HRGB || +- context->aaType == TEXT_AA_LCD_HBGR) { +- target = FT_LOAD_TARGET_LCD; +- } else { +- target = FT_LOAD_TARGET_LCD_V; +- } +- renderFlags |= target; +- +- error = FT_Load_Glyph(scalerInfo->face, glyphCode, renderFlags); ++ FT_Library_SetLcdFilter(scalerInfo->library, renderingProperties.ftLcdFilter); ++ error = FT_Load_Glyph(scalerInfo->face, glyphCode, renderingProperties.ftLoadFlags); + if (error) { + //do not destroy scaler yet. + //this can be problem of particular context (e.g. with bad transform) +@@ -915,11 +1026,11 @@ static jlong + glyphInfo = getNullGlyphImage(); + return ptr_to_jlong(glyphInfo); + } +- error = FT_Render_Glyph(ftglyph, FT_LOAD_TARGET_MODE(target)); +- if (error != 0) { +- return ptr_to_jlong(getNullGlyphImage()); +- } + } ++ error = FT_Render_Glyph(ftglyph, renderingProperties.ftRenderMode); ++ if (error != 0) { ++ return ptr_to_jlong(getNullGlyphImage()); ++ } + + if (renderImage) { + width = (UInt16) ftglyph->bitmap.width; +@@ -1134,9 +1245,11 @@ static FT_Outline* getFTOutline(JNIEnv* env, jobject f + return NULL; + } + +- renderFlags = FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP; ++ RenderingProperties renderingProperties; ++ readFontconfig((const FcChar8 *) scalerInfo->face->family_name, ++ context->ptsz, context->aaType, &renderingProperties); + +- error = FT_Load_Glyph(scalerInfo->face, glyphCode, renderFlags); ++ error = FT_Load_Glyph(scalerInfo->face, glyphCode, renderingProperties.ftLoadFlags); + if (error) { + return NULL; + } diff --git a/java/openjdk23/pkg-descr b/java/openjdk23/pkg-descr new file mode 100644 index 000000000000..b6e6b7ef9308 --- /dev/null +++ b/java/openjdk23/pkg-descr @@ -0,0 +1,8 @@ +FreeBSD port of OpenJDK 23 + +This version of the port passes basic smoke testing. It has been successfully +built on some combinations of FreeBSD 13 and 14 for the aarch64 and amd64 +architectures. + +Although these are untested, it may also build on other recent FreeBSD releases +for the x86 and powerpc64 architectures. diff --git a/java/openjdk23/pkg-message b/java/openjdk23/pkg-message new file mode 100644 index 000000000000..2ea3d87d89c8 --- /dev/null +++ b/java/openjdk23/pkg-message @@ -0,0 +1,18 @@ +[ +{ type: install + message: <