git: 35b87f5972e2 - main - math/vtk9: Fix build with OSMESA and JAVA option

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Thu, 22 Feb 2024 09:38:51 UTC
The branch main has been updated by yuri:

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

commit 35b87f5972e2a55f4dd6704665eca9de71011ef3
Author:     Hiroo Ono <hiroo.ono+freebsd@gmail.com>
AuthorDate: 2024-02-22 09:24:21 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2024-02-22 09:38:42 +0000

    math/vtk9: Fix build with OSMESA and JAVA option
    
    PR:             277216
---
 math/vtk9/Makefile                                           |  6 +++---
 math/vtk9/files/patch-ThirdParty_glew_vtkglew_src_glew.c     | 10 ++++++++++
 math/vtk9/files/patch-ThirdParty_glew_vtkglew_src_glewinfo.c | 10 ++++++++++
 3 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/math/vtk9/Makefile b/math/vtk9/Makefile
index 69729940f2ee..dd192c6800fc 100644
--- a/math/vtk9/Makefile
+++ b/math/vtk9/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	vtk
 DISTVERSION=	9.2.6
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	math graphics
 MASTER_SITES=	https://vtk.org/files/release/${VTK_SHORT_VER}/
 PKGNAMESUFFIX=	9
@@ -22,7 +22,7 @@ LIB_DEPENDS=	\
 		libpng.so:graphics/png \
 		libtiff.so:graphics/tiff
 
-USES=		alias cmake compiler:c++11-lang gl jpeg localbase xorg
+USES=		alias cmake compiler:c++11-lang jpeg localbase xorg
 USE_LDCONFIG=	${PREFIX}/lib/vtk-${VTK_SHORT_VER}
 USE_XORG=	ice x11 xt xext sm xcursor xfixes xrender
 
@@ -104,7 +104,7 @@ JAVA_VARS=		USE_JAVA=yes
 JAVA_CMAKE_BOOL=	VTK_WRAP_JAVA
 JAVA_CMAKE_ON=		-DJAVA_INCLUDE_PATH:PATH=${JAVA_HOME}/include \
 			-DJAVA_AWT_LIBRARY:PATH=${JAVA_HOME}/jre/lib/${ARCH}/libjawt.so \
-			-DJAVA_JVM_LIBRARY:PATH=${JAVA_HOME}/jre/lib/${ATCH}/libjava.so
+			-DJAVA_JVM_LIBRARY:PATH=${JAVA_HOME}/jre/lib/${ARCH}/libjava.so
 
 TCLTK_USES=		tk
 TCLTK_CMAKE_ON=		-DVTK_GROUP_ENABLE_Tk:STRING=YES \
diff --git a/math/vtk9/files/patch-ThirdParty_glew_vtkglew_src_glew.c b/math/vtk9/files/patch-ThirdParty_glew_vtkglew_src_glew.c
new file mode 100644
index 000000000000..65889826bdd6
--- /dev/null
+++ b/math/vtk9/files/patch-ThirdParty_glew_vtkglew_src_glew.c
@@ -0,0 +1,10 @@
+--- ThirdParty/glew/vtkglew/src/glew.c.orig	2024-02-21 22:29:42 UTC
++++ ThirdParty/glew/vtkglew/src/glew.c
+@@ -38,6 +38,7 @@
+ 
+ #if defined(GLEW_OSMESA)
+ #  define GLAPI extern
++#  define APIENTRY __stdcall
+ #  include <GL/osmesa.h>
+ #elif defined(GLEW_EGL)
+ #  include <GL/eglew.h>
diff --git a/math/vtk9/files/patch-ThirdParty_glew_vtkglew_src_glewinfo.c b/math/vtk9/files/patch-ThirdParty_glew_vtkglew_src_glewinfo.c
new file mode 100644
index 000000000000..0ea9659d6ec5
--- /dev/null
+++ b/math/vtk9/files/patch-ThirdParty_glew_vtkglew_src_glewinfo.c
@@ -0,0 +1,10 @@
+--- ThirdParty/glew/vtkglew/src/glewinfo.c.orig	2024-02-21 22:29:54 UTC
++++ ThirdParty/glew/vtkglew/src/glewinfo.c
+@@ -38,6 +38,7 @@
+ #include <GL/eglew.h>
+ #elif defined(GLEW_OSMESA)
+ #define GLAPI extern
++#define APIENTRY __stdcall
+ #include <GL/osmesa.h>
+ #elif defined(_WIN32)
+ #include <GL/wglew.h>