git: 4747e1050974 - main - net/tigervnc-viewer-java: add port

From: Koichiro Iwao <meta_at_FreeBSD.org>
Date: Tue, 07 Feb 2023 15:13:00 UTC
The branch main has been updated by meta:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4747e1050974d56bb33b987fac3f32ddcec19372

commit 4747e1050974d56bb33b987fac3f32ddcec19372
Author:     Koichiro Iwao <meta@FreeBSD.org>
AuthorDate: 2023-02-07 15:05:31 +0000
Commit:     Koichiro Iwao <meta@FreeBSD.org>
CommitDate: 2023-02-07 15:08:05 +0000

    net/tigervnc-viewer-java: add port
---
 net/Makefile                                     |  1 +
 net/tigervnc-viewer-java/Makefile                | 41 ++++++++++++++++++++++++
 net/tigervnc-viewer-java/files/vncviewer-java.in | 14 ++++++++
 net/tigervnc-viewer-java/pkg-descr               |  5 +++
 4 files changed, 61 insertions(+)

diff --git a/net/Makefile b/net/Makefile
index 0796d9303cc7..469e6b90bae3 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -1510,6 +1510,7 @@
     SUBDIR += throttled
     SUBDIR += tigervnc-server
     SUBDIR += tigervnc-viewer
+    SUBDIR += tigervnc-viewer-java
     SUBDIR += tightvnc
     SUBDIR += timed
     SUBDIR += tintin++
diff --git a/net/tigervnc-viewer-java/Makefile b/net/tigervnc-viewer-java/Makefile
new file mode 100644
index 000000000000..7d52fa24519b
--- /dev/null
+++ b/net/tigervnc-viewer-java/Makefile
@@ -0,0 +1,41 @@
+PKGNAMESUFFIX=	-viewer-java
+CATEGORIES=	net java
+
+COMMENT=	TigerVNC Viewer
+WWW=		https://tigervnc.org/
+
+USES+=		jpeg xorg
+USE_XORG+=	pixman
+USE_JAVA=	yes
+JAVA_VERSION=	8+
+
+CMAKE_ARGS+=	-DBUILD_JAVA:BOOL=true \
+		-DBUILD_VIEWER:BOOL=false \
+		-DENABLE_NLS:BOOL=false
+
+DESKTOP_ENTRIES=	"TigerVNC viewer (Java version)" "Connect to VNC server and display remote desktop" \
+				"${PORTNAME}" "vncviewer-java" "Network;" false
+
+DESCR=		${.CURDIR}/pkg-descr
+FILESDIR=	${.CURDIR}/files
+
+JARFILES=	VncViewer.jar
+PLIST_FILES=	${JARFILES:S,^,${JAVAJARDIR}/,} \
+		bin/vncviewer-java
+SUB_LIST=	JAVAJARDIR="${JAVAJARDIR}"
+SUB_FILES=	vncviewer-java
+
+post-patch:
+	# do not build server components and tests
+	@${REINPLACE_CMD} \
+		-e 's|add_subdirectory(unix)||' \
+		-e 's|add_subdirectory(tests)||' \
+		${WRKSRC}/CMakeLists.txt
+
+do-install:
+	 ${INSTALL_DATA} ${WRKSRC}/java/VncViewer.jar ${STAGEDIR}${JAVAJARDIR}/
+	 ${INSTALL_SCRIPT} ${WRKDIR}/vncviewer-java ${STAGEDIR}${PREFIX}/bin/
+
+MASTERDIR=	${.CURDIR}/../tigervnc-server
+
+.include "${MASTERDIR}/Makefile.common.mk"
diff --git a/net/tigervnc-viewer-java/files/vncviewer-java.in b/net/tigervnc-viewer-java/files/vncviewer-java.in
new file mode 100644
index 000000000000..2efeec3e045d
--- /dev/null
+++ b/net/tigervnc-viewer-java/files/vncviewer-java.in
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# Inspired by devel/apache-rat/files/apache-rat.sh.in
+#
+JAVACMD="${JAVACMD:-"%%LOCALBASE%%/bin/java"}"
+
+if [ ! -x "${JAVACMD}" ]; then
+	echo "Error: ${JAVACMD} is not present on your system" >&2
+	echo "       Please specify the path to an existing java executable with the" >&2
+	echo "       JAVACMD environment variable when running rat." >&2
+	exit 1
+fi
+
+exec "${JAVACMD}" -jar %%JAVAJARDIR%%/VncViewer.jar "$@"
diff --git a/net/tigervnc-viewer-java/pkg-descr b/net/tigervnc-viewer-java/pkg-descr
new file mode 100644
index 000000000000..7338f4760639
--- /dev/null
+++ b/net/tigervnc-viewer-java/pkg-descr
@@ -0,0 +1,5 @@
+This port provides Java version client(viewer) compornents of TigerVNC.
+
+TigerVNC is a high-performance, platform-neutral implementation of VNC,
+a client/server application that allows users to launch and interact with
+graphical applications on remote machines.