git: 9c0054517dd7 - main - java/openjdk{25,26}: Don't req xorg for headless

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

URL: https://cgit.FreeBSD.org/ports/commit/?id=9c0054517dd7d300ae4950a7d3004c70f02976c9

commit 9c0054517dd7d300ae4950a7d3004c70f02976c9
Author:     Raivo Hool <raivo@lehma.com>
AuthorDate: 2026-08-25 08:45:31 +0000
Commit:     Harald Eilertsen <haraldei@FreeBSD.org>
CommitDate: 2026-09-01 08:07:34 +0000

    java/openjdk{25,26}: Don't req xorg for headless
    
    We no longer need the xorg libs to build OpenJDK headless variants for
    OpenJDK 25 and 26.
    
    Relevant upstream JBS issues:
    - OpenJDK 25.0.4: https://bugs.openjdk.org/browse/JDK-8381011
    - OpenJDK 26.0.2: https://bugs.openjdk.org/browse/JDK-8378158
    
    PR:             294358
    Reported by:    raivo@lehma.com
    Reviewed by:    haraldei, jrm
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D59167
---
 java/openjdk25/Makefile | 9 ++++++++-
 java/openjdk26/Makefile | 9 ++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/java/openjdk25/Makefile b/java/openjdk25/Makefile
index 172fc63d4106..ba7d985f6ecf 100644
--- a/java/openjdk25/Makefile
+++ b/java/openjdk25/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	openjdk
 DISTVERSIONPREFIX=	jdk-
 DISTVERSION=	${JDK_FULL_VERSION:S/.0.0//}
+PORTREVISION=	1
 CATEGORIES=	java devel
 PKGNAMESUFFIX?=	${JDK_MAJOR_VERSION}
 MASTER_SITES=	LOCAL/openjdk:boot
@@ -51,14 +52,20 @@ RUN_DEPENDS=	javavm:java/javavmwrapper
 RUN_DEPENDS+=	xorg-fonts-truetype>0:x11-fonts/xorg-fonts-truetype
 .endif
 
+.if ${FLAVOR:M*headless} == ""
 USES=		autoreconf:build compiler:features cpe gmake iconv jpeg pkgconfig xorg
+.else
+USES=		autoreconf:build compiler:features cpe gmake iconv jpeg pkgconfig
+.endif
 
 CPE_VENDOR=	oracle
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	freebsd
 
-USE_XORG=	x11 xext xi xrandr xrender xt xtst
+.if ${FLAVOR:M*headless} == ""
+USE_XORG=       x11 xext xi xrandr xrender xt xtst
+.endif
 
 GNU_CONFIGURE=		yes
 CONFIGURE_ARGS=		--disable-ccache \
diff --git a/java/openjdk26/Makefile b/java/openjdk26/Makefile
index 014c27995f54..6767a58efc58 100644
--- a/java/openjdk26/Makefile
+++ b/java/openjdk26/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	openjdk
 DISTVERSIONPREFIX=	jdk-
 DISTVERSION=	${JDK_FULL_VERSION:S/.0.0//}
+PORTREVISION=	1
 CATEGORIES=	java devel
 PKGNAMESUFFIX?=	${JDK_MAJOR_VERSION}
 MASTER_SITES=	LOCAL/openjdk:boot
@@ -51,14 +52,20 @@ RUN_DEPENDS=	javavm:java/javavmwrapper
 RUN_DEPENDS+=	xorg-fonts-truetype>0:x11-fonts/xorg-fonts-truetype
 .endif
 
+.if ${FLAVOR:M*headless} == ""
 USES=		autoreconf:build compiler:features cpe gmake iconv jpeg pkgconfig xorg
+.else
+USES=		autoreconf:build compiler:features cpe gmake iconv jpeg pkgconfig
+.endif
 
 CPE_VENDOR=	oracle
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	freebsd
 
-USE_XORG=	x11 xext xi xrandr xrender xt xtst
+.if ${FLAVOR:M*headless} == ""
+USE_XORG=       x11 xext xi xrandr xrender xt xtst
+.endif
 
 GNU_CONFIGURE=		yes
 CONFIGURE_ARGS=		--disable-ccache \