git: efef6dc621a5 - main - x11/virtualgl: Update to 3.0

From: Ka Ho Ng <khng_at_FreeBSD.org>
Date: Mon, 06 Dec 2021 00:28:42 UTC
The branch main has been updated by khng (src committer):

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

commit efef6dc621a53adfd34b72ec3040ee741cc12a10
Author:     Ka Ho Ng <khng@FreeBSD.org>
AuthorDate: 2021-12-06 00:24:40 +0000
Commit:     Ka Ho Ng <khng@FreeBSD.org>
CommitDate: 2021-12-06 00:28:01 +0000

    x11/virtualgl: Update to 3.0
    
    The most significant update is the addition of EGL backend. To use the
    backend with the default GPU, specify VGL_DISPLAY=EGL in the environment
    variables.
    
    PR:             260244
    Sponsored by:   The FreeBSD Foundation
    Approved by:    ygy
    Differential Revision:  https://reviews.freebsd.org/D33281
---
 x11/virtualgl/Makefile                            | 31 +++++++++++------------
 x11/virtualgl/distinfo                            |  6 ++---
 x11/virtualgl/files/patch-server__fakerconfig.cpp | 11 --------
 x11/virtualgl/files/patch-server_faker-glx.cpp    | 24 ------------------
 x11/virtualgl/files/patch-server_faker-sym.h      | 11 --------
 x11/virtualgl/pkg-plist                           | 28 ++++++++++----------
 6 files changed, 33 insertions(+), 78 deletions(-)

diff --git a/x11/virtualgl/Makefile b/x11/virtualgl/Makefile
index 17fa5eb28d28..ca10cdb2c827 100644
--- a/x11/virtualgl/Makefile
+++ b/x11/virtualgl/Makefile
@@ -1,35 +1,38 @@
 # Created by: David Mackay <davidjx8p@gmail.com>
 
 PORTNAME=	virtualgl
-PORTVERSION=	2.6.3
-PORTREVISION=	2
+DISTVERSION=	3.0
 CATEGORIES=	x11 graphics
-MASTER_SITES=	SF/${PORTNAME}/${PORTVERSION}
-DISTNAME=	VirtualGL-${PORTVERSION}
 
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Redirects commands from an OpenGL app to another X server
 
+ONLY_FOR_ARCHS=	aarch64 amd64 armv7 i386 powerpc powerpc64 powerpc64le
+
 LIB_DEPENDS=	libfltk.so:x11-toolkits/fltk \
 		libturbojpeg.so:graphics/libjpeg-turbo \
 		libxcb-keysyms.so:x11/xcb-util-keysyms
 
-ONLY_FOR_ARCHS=	amd64 armv7 i386 powerpc powerpc64 powerpc64le
-
-CMAKE_INSTALL_PREFIX=	${LOCALBASE}/VirtualGL
-DOCSDIR=	${LOCALBASE}/VirtualGL/doc
-
 USES=		cmake compiler:c++11-lang gl xorg
-USE_GL=		gl glu
+USE_GL=		egl gl glu
 USE_XORG=	x11 xcb xext xtst
+USE_LDCONFIG=	${PREFIX}/VirtualGL/lib
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	VirtualGL
+
 CMAKE_ARGS=	-DTJPEG_INCLUDE_DIR=${LOCALBASE}/include \
 		-DTJPEG_LIBRARY=${LOCALBASE}/lib/libturbojpeg.so \
 		-DVGL_FAKEXCB=on -DVGL_SYSTEMFLTK=on \
 		-DCMAKE_INSTALL_DOCDIR=${DOCSDIR}
-USE_LDCONFIG=	${PREFIX}/VirtualGL/lib
+CFLAGS+=	-I${LOCALBASE}/include
+CXXFLAGS+=	-I${LOCALBASE}/include
 LDFLAGS+=	-L${LOCALBASE}/lib
+CMAKE_INSTALL_PREFIX=	${LOCALBASE}/VirtualGL
 
-OPTIONS_DEFINE=	OPENCL OPENSSL XVIDEO
+DOCSDIR=	${LOCALBASE}/VirtualGL/doc
+
+OPTIONS_DEFINE=	OPENCL OPENSSL XVIDEO DOCS
 OPTIONS_DEFAULT=	OPENCL
 OPTIONS_SUB=	yes
 
@@ -54,8 +57,4 @@ PLIST_SUB+=	I386="@comment "
 PLIST_SUB+=	AMD64=""
 .endif
 
-post-patch:
-	@${REINPLACE_CMD} -e '/^#define CHECKGL/s,m);, &,' \
-		${WRKSRC}/server/VirtualDrawable.cpp
-
 .include <bsd.port.post.mk>
diff --git a/x11/virtualgl/distinfo b/x11/virtualgl/distinfo
index 53401c2cefa3..b47124a5e2db 100644
--- a/x11/virtualgl/distinfo
+++ b/x11/virtualgl/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1586837136
-SHA256 (VirtualGL-2.6.3.tar.gz) = 9be36c540c512068c8fc26a28722e604e0d2c305f7295229f1e1c8283193cb5e
-SIZE (VirtualGL-2.6.3.tar.gz) = 1197037
+TIMESTAMP = 1638599825
+SHA256 (VirtualGL-virtualgl-3.0_GH0.tar.gz) = d6e00a8d0596cafa67955d6211e0dab6c8aa8239bd718f7eca6eb0b032711f9b
+SIZE (VirtualGL-virtualgl-3.0_GH0.tar.gz) = 1244021
diff --git a/x11/virtualgl/files/patch-server__fakerconfig.cpp b/x11/virtualgl/files/patch-server__fakerconfig.cpp
deleted file mode 100644
index e5dd516d404f..000000000000
--- a/x11/virtualgl/files/patch-server__fakerconfig.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
---- server/fakerconfig.cpp.orig	2019-10-20 21:29:00 UTC
-+++ server/fakerconfig.cpp
-@@ -97,7 +97,7 @@ FakerConfig *fconfig_getinstance(void)
- 			if((addr = shmat(fconfig_shmid, 0, 0)) == (void *)-1) THROW_UNIX();
- 			if(!addr)
- 				THROW("Could not attach to config structure in shared memory");
--			#ifdef linux
-+			#if defined(linux) || defined(__FreeBSD__)
- 			shmctl(fconfig_shmid, IPC_RMID, 0);
- 			#endif
- 			char *env = NULL;
diff --git a/x11/virtualgl/files/patch-server_faker-glx.cpp b/x11/virtualgl/files/patch-server_faker-glx.cpp
deleted file mode 100644
index 6fb9d381ce39..000000000000
--- a/x11/virtualgl/files/patch-server_faker-glx.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
---- server/faker-glx.cpp.orig	2019-10-20 21:29:00 UTC
-+++ server/faker-glx.cpp
-@@ -2192,11 +2192,10 @@ void glXQueryDrawable(Display *dpy, GLXDrawable draw, 
- 	CATCH();
- }
- 
--int glXQueryGLXPbufferSGIX(Display *dpy, GLXPbuffer pbuf, int attribute,
-+void glXQueryGLXPbufferSGIX(Display *dpy, GLXPbuffer pbuf, int attribute,
- 	unsigned int *value)
- {
- 	glXQueryDrawable(dpy, pbuf, attribute, value);
--	return 0;
- }
- 
- 
-@@ -2359,7 +2358,7 @@ void glXSwapBuffers(Display *dpy, GLXDrawable drawable
- // Returns the transparent index from the overlay visual on the 2D X server
- 
- int glXGetTransparentIndexSUN(Display *dpy, Window overlay, Window underlay,
--	long *transparentIndex)
-+	unsigned long *transparentIndex)
- {
- 	int retval = False;
- 	XWindowAttributes xwa;
diff --git a/x11/virtualgl/files/patch-server_faker-sym.h b/x11/virtualgl/files/patch-server_faker-sym.h
deleted file mode 100644
index 985d6bdea41e..000000000000
--- a/x11/virtualgl/files/patch-server_faker-sym.h
+++ /dev/null
@@ -1,11 +0,0 @@
---- server/faker-sym.h.orig	2019-10-20 21:29:00 UTC
-+++ server/faker-sym.h
-@@ -536,7 +536,7 @@ FUNCDEF2(GLXFBConfigSGIX, glXGetFBConfigFromVisualSGIX
- // GLX_SUN_get_transparent_index
- 
- FUNCDEF4(int, glXGetTransparentIndexSUN, Display *, dpy, Window, overlay,
--	Window, underlay, long *, transparentIndex, glXGetTransparentIndexSUN);
-+	Window, underlay, unsigned long *, transparentIndex, glXGetTransparentIndexSUN);
- 
- 
- // GL functions
diff --git a/x11/virtualgl/pkg-plist b/x11/virtualgl/pkg-plist
index e8ad86b52d28..efdedc2c15f4 100644
--- a/x11/virtualgl/pkg-plist
+++ b/x11/virtualgl/pkg-plist
@@ -1,5 +1,6 @@
 %%AMD64%%VirtualGL/bin/.vglrun.vars64
 %%I386%%VirtualGL/bin/.vglrun.vars32
+VirtualGL/bin/eglinfo
 VirtualGL/bin/glreadtest
 VirtualGL/bin/glxinfo
 %%AMD64%%VirtualGL/bin/glxspheres64
@@ -13,19 +14,19 @@ VirtualGL/bin/vglgenkey
 VirtualGL/bin/vgllogin
 VirtualGL/bin/vglrun
 VirtualGL/bin/vglserver_config
-%%DOCSDIR%%/ChangeLog.md
-%%DOCSDIR%%/LGPL.txt
-%%DOCSDIR%%/LICENSE-FLTK.txt
-%%DOCSDIR%%/LICENSE.txt
-%%DOCSDIR%%/configdialog.gif
-%%DOCSDIR%%/index.html
-%%DOCSDIR%%/somerights20.png
-%%DOCSDIR%%/sshtunnel.png
-%%DOCSDIR%%/subsampling.gif
-%%DOCSDIR%%/vgltransport.png
-%%DOCSDIR%%/vgltransportservernetwork.png
-%%DOCSDIR%%/virtualgl.css
-%%DOCSDIR%%/x11transport.png
+%%PORTDOCS%%%%DOCSDIR%%/ChangeLog.md
+%%PORTDOCS%%%%DOCSDIR%%/LGPL.txt
+%%PORTDOCS%%%%DOCSDIR%%/LICENSE-FLTK.txt
+%%PORTDOCS%%%%DOCSDIR%%/LICENSE.txt
+%%PORTDOCS%%%%DOCSDIR%%/configdialog.gif
+%%PORTDOCS%%%%DOCSDIR%%/index.html
+%%PORTDOCS%%%%DOCSDIR%%/somerights20.png
+%%PORTDOCS%%%%DOCSDIR%%/sshtunnel.png
+%%PORTDOCS%%%%DOCSDIR%%/subsampling.gif
+%%PORTDOCS%%%%DOCSDIR%%/vgltransport.png
+%%PORTDOCS%%%%DOCSDIR%%/vgltransportservernetwork.png
+%%PORTDOCS%%%%DOCSDIR%%/virtualgl.css
+%%PORTDOCS%%%%DOCSDIR%%/x11transport.png
 VirtualGL/include/rr.h
 VirtualGL/include/rrtransport.h
 VirtualGL/lib/libdlfaker.so
@@ -33,3 +34,4 @@ VirtualGL/lib/libgefaker.so
 VirtualGL/lib/libvglfaker-nodl.so
 %%OPENCL%%VirtualGL/lib/libvglfaker-opencl.so
 VirtualGL/lib/libvglfaker.so
+libdata/ldconfig/virtualgl