git: 94a68738ff31 - main - java/openjdk{25,26}: portclippy and cleanup

From: Harald Eilertsen <haraldei_at_FreeBSD.org>
Date: Tue, 08 Sep 2026 17:10:06 UTC
The branch main has been updated by haraldei:

URL: https://cgit.FreeBSD.org/ports/commit/?id=94a68738ff3170f7c12c7b7ee206f45499e5c71f

commit 94a68738ff3170f7c12c7b7ee206f45499e5c71f
Author:     Harald Eilertsen <haraldei@FreeBSD.org>
AuthorDate: 2026-09-01 13:21:08 +0000
Commit:     Harald Eilertsen <haraldei@FreeBSD.org>
CommitDate: 2026-09-08 17:09:36 +0000

    java/openjdk{25,26}: portclippy and cleanup
    
    Just a cleanup commit sorting the Makefile according to the order
    outlined in the Porters Handbook, and reducing the number of times we
    check for a headless build, as suggested by vsasjason_gmail.com.
    
    This commit does not increase the PORTREVISION as it does not introduce
    any changes to functionality or dependencies.
    
    Reviewed by:    jrm
    Sponsored by:   The FreeBSD Foundation
---
 java/openjdk25/Makefile | 37 ++++++++++++++++---------------------
 java/openjdk26/Makefile | 37 ++++++++++++++++---------------------
 2 files changed, 32 insertions(+), 42 deletions(-)

diff --git a/java/openjdk25/Makefile b/java/openjdk25/Makefile
index ba7d985f6ecf..57b371499a57 100644
--- a/java/openjdk25/Makefile
+++ b/java/openjdk25/Makefile
@@ -3,8 +3,8 @@ DISTVERSIONPREFIX=	jdk-
 DISTVERSION=	${JDK_FULL_VERSION:S/.0.0//}
 PORTREVISION=	1
 CATEGORIES=	java devel
-PKGNAMESUFFIX?=	${JDK_MAJOR_VERSION}
 MASTER_SITES=	LOCAL/openjdk:boot
+PKGNAMESUFFIX?=	${JDK_MAJOR_VERSION}
 DISTFILES=	${BOOTSTRAPJDKFILE}:boot
 
 MAINTAINER=	java@FreeBSD.org
@@ -20,20 +20,6 @@ LICENSE=	GPLv2
 
 ONLY_FOR_ARCHS=	aarch64 amd64 powerpc64 powerpc64le
 
-# This port supports the following flavors:
-#
-# - jdk (default)	Full OpenJDK including dev tools and x11 support
-# - headless		Full OpenJDK including dev tools, but without x11 support
-# - jre			Java Runtime Environment including x11 support
-# - jre_headless	Jave Runtime Environment without x11 support
-FLAVORS=	jdk jre headless jre_headless
-
-headless_PKGNAMESUFFIX=	${JDK_MAJOR_VERSION}-headless
-jre_PKGNAMESUFFIX=	${JDK_MAJOR_VERSION}-jre
-jre_headless_PKGNAMESUFFIX=	${JDK_MAJOR_VERSION}-jre-headless
-
-FLAVOR?=	${BUILD_JRE:?jre:${FLAVORS:[1]}}
-
 BUILD_DEPENDS=	${LOCALBASE}/include/cups/cups.h:print/cups \
 		bash:shells/bash \
 		gsed:textproc/gsed \
@@ -48,11 +34,22 @@ LIB_DEPENDS=	libasound.so:audio/alsa-lib \
 		libpng.so:graphics/png
 
 RUN_DEPENDS=	javavm:java/javavmwrapper
-.if ${FLAVOR:M*headless} == ""
-RUN_DEPENDS+=	xorg-fonts-truetype>0:x11-fonts/xorg-fonts-truetype
-.endif
+
+# This port supports the following flavors:
+#
+# - jdk (default)	Full OpenJDK including dev tools and x11 support
+# - headless		Full OpenJDK including dev tools, but without x11 support
+# - jre			Java Runtime Environment including x11 support
+# - jre_headless	Java Runtime Environment without x11 support
+FLAVORS=	jdk jre headless jre_headless
+FLAVOR?=	${BUILD_JRE:?jre:${FLAVORS:[1]}}
+
+headless_PKGNAMESUFFIX=	${JDK_MAJOR_VERSION}-headless
+jre_PKGNAMESUFFIX=	${JDK_MAJOR_VERSION}-jre
+jre_headless_PKGNAMESUFFIX=	${JDK_MAJOR_VERSION}-jre-headless
 
 .if ${FLAVOR:M*headless} == ""
+RUN_DEPENDS+=	xorg-fonts-truetype>0:x11-fonts/xorg-fonts-truetype
 USES=		autoreconf:build compiler:features cpe gmake iconv jpeg pkgconfig xorg
 .else
 USES=		autoreconf:build compiler:features cpe gmake iconv jpeg pkgconfig
@@ -63,9 +60,7 @@ CPE_VENDOR=	oracle
 USE_GITHUB=	yes
 GH_ACCOUNT=	freebsd
 
-.if ${FLAVOR:M*headless} == ""
-USE_XORG=       x11 xext xi xrandr xrender xt xtst
-.endif
+USE_XORG=	x11 xext xi xrandr xrender xt xtst
 
 GNU_CONFIGURE=		yes
 CONFIGURE_ARGS=		--disable-ccache \
diff --git a/java/openjdk26/Makefile b/java/openjdk26/Makefile
index 6767a58efc58..7fabef5f25bf 100644
--- a/java/openjdk26/Makefile
+++ b/java/openjdk26/Makefile
@@ -3,8 +3,8 @@ DISTVERSIONPREFIX=	jdk-
 DISTVERSION=	${JDK_FULL_VERSION:S/.0.0//}
 PORTREVISION=	1
 CATEGORIES=	java devel
-PKGNAMESUFFIX?=	${JDK_MAJOR_VERSION}
 MASTER_SITES=	LOCAL/openjdk:boot
+PKGNAMESUFFIX?=	${JDK_MAJOR_VERSION}
 DISTFILES=	${BOOTSTRAPJDKFILE}:boot
 
 MAINTAINER=	java@FreeBSD.org
@@ -20,20 +20,6 @@ LICENSE=	GPLv2
 
 ONLY_FOR_ARCHS=	aarch64 amd64 powerpc64 powerpc64le
 
-# This port supports the following flavors:
-#
-# - jdk (default)	Full OpenJDK including dev tools and x11 support
-# - headless		Full OpenJDK including dev tools, but without x11 support
-# - jre			Java Runtime Environment including x11 support
-# - jre_headless	Jave Runtime Environment without x11 support
-FLAVORS=	jdk jre headless jre_headless
-
-headless_PKGNAMESUFFIX=	${JDK_MAJOR_VERSION}-headless
-jre_PKGNAMESUFFIX=	${JDK_MAJOR_VERSION}-jre
-jre_headless_PKGNAMESUFFIX=	${JDK_MAJOR_VERSION}-jre-headless
-
-FLAVOR?=	${BUILD_JRE:?jre:${FLAVORS:[1]}}
-
 BUILD_DEPENDS=	${LOCALBASE}/include/cups/cups.h:print/cups \
 		bash:shells/bash \
 		gsed:textproc/gsed \
@@ -48,11 +34,22 @@ LIB_DEPENDS=	libasound.so:audio/alsa-lib \
 		libpng.so:graphics/png
 
 RUN_DEPENDS=	javavm:java/javavmwrapper
-.if ${FLAVOR:M*headless} == ""
-RUN_DEPENDS+=	xorg-fonts-truetype>0:x11-fonts/xorg-fonts-truetype
-.endif
+
+# This port supports the following flavors:
+#
+# - jdk (default)	Full OpenJDK including dev tools and x11 support
+# - headless		Full OpenJDK including dev tools, but without x11 support
+# - jre			Java Runtime Environment including x11 support
+# - jre_headless	Java Runtime Environment without x11 support
+FLAVORS=	jdk jre headless jre_headless
+FLAVOR?=	${BUILD_JRE:?jre:${FLAVORS:[1]}}
+
+headless_PKGNAMESUFFIX=	${JDK_MAJOR_VERSION}-headless
+jre_PKGNAMESUFFIX=	${JDK_MAJOR_VERSION}-jre
+jre_headless_PKGNAMESUFFIX=	${JDK_MAJOR_VERSION}-jre-headless
 
 .if ${FLAVOR:M*headless} == ""
+RUN_DEPENDS+=	xorg-fonts-truetype>0:x11-fonts/xorg-fonts-truetype
 USES=		autoreconf:build compiler:features cpe gmake iconv jpeg pkgconfig xorg
 .else
 USES=		autoreconf:build compiler:features cpe gmake iconv jpeg pkgconfig
@@ -63,9 +60,7 @@ CPE_VENDOR=	oracle
 USE_GITHUB=	yes
 GH_ACCOUNT=	freebsd
 
-.if ${FLAVOR:M*headless} == ""
-USE_XORG=       x11 xext xi xrandr xrender xt xtst
-.endif
+USE_XORG=	x11 xext xi xrandr xrender xt xtst
 
 GNU_CONFIGURE=		yes
 CONFIGURE_ARGS=		--disable-ccache \