Date: Tue, 29 Jun 2021 10:21:27 GMT From: Thierry Thomas <thierry@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: e67606b6b191 - main - math/vtk9: do not pollute namespace with Xutil.h Message-ID: <202106291021.15TALRxq007232@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by thierry: URL: https://cgit.FreeBSD.org/ports/commit/?id=e67606b6b191a590ef2e373ab5e3f0e32aedae05 commit e67606b6b191a590ef2e373ab5e3f0e32aedae05 Author: Thierry Thomas <thierry@FreeBSD.org> AuthorDate: 2021-06-20 20:06:41 +0000 Commit: Thierry Thomas <thierry@FreeBSD.org> CommitDate: 2021-06-29 10:20:38 +0000 math/vtk9: do not pollute namespace with Xutil.h Add the patch b3b088e8 from upstream, in order to permit cad/opencascade to switch to VTK-9. PR: 256876 Approved by: yuri (maintainer) --- math/vtk9/Makefile | 2 +- ...ch-Rendering_OpenGL2_vtkXOpenGLRenderWindow.cxx | 44 ++++++++++++++++++++++ ...atch-Rendering_OpenGL2_vtkXOpenGLRenderWindow.h | 24 ++++++++++++ 3 files changed, 69 insertions(+), 1 deletion(-) diff --git a/math/vtk9/Makefile b/math/vtk9/Makefile index 13dba74c3eaf..7268fab0eb9c 100644 --- a/math/vtk9/Makefile +++ b/math/vtk9/Makefile @@ -1,6 +1,6 @@ PORTNAME= vtk DISTVERSION= 9.0.1 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= math graphics MASTER_SITES= https://vtk.org/files/release/${VTK_SHORT_VER}/ PKGNAMESUFFIX= 9 diff --git a/math/vtk9/files/patch-Rendering_OpenGL2_vtkXOpenGLRenderWindow.cxx b/math/vtk9/files/patch-Rendering_OpenGL2_vtkXOpenGLRenderWindow.cxx new file mode 100644 index 000000000000..b3870218a2f8 --- /dev/null +++ b/math/vtk9/files/patch-Rendering_OpenGL2_vtkXOpenGLRenderWindow.cxx @@ -0,0 +1,44 @@ +--- Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx.orig 2020-06-26 13:24:40 UTC ++++ Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx +@@ -61,10 +61,22 @@ typedef ptrdiff_t GLsizeiptr; + + #include <sstream> + ++// Patch from upstream b3b088e8 ++#include <X11/Xatom.h> ++#include <X11/cursorfont.h> ++ + #include <X11/Xlib.h> + #include <X11/Xutil.h> +-#include <X11/cursorfont.h> + ++/* ++ * Work-around to get forward declarations of C typedef of anonymous ++ * structs working. We do not want to include XUtil.h in the header as ++ * it populates the global namespace. ++ */ ++struct vtkXVisualInfo : public XVisualInfo ++{ ++}; ++ + #define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 + #define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 + typedef GLXContext (*glXCreateContextAttribsARBProc)( +@@ -224,7 +236,7 @@ int XEventTypeEquals(Display*, XEvent* event, XPointer + return event->type == EventType; + } + +-XVisualInfo* vtkXOpenGLRenderWindow::GetDesiredVisualInfo() ++vtkXVisualInfo* vtkXOpenGLRenderWindow::GetDesiredVisualInfo() + { + XVisualInfo* v = nullptr; + +@@ -258,7 +270,7 @@ XVisualInfo* vtkXOpenGLRenderWindow::GetDesiredVisualI + vtkErrorMacro(<< "Could not find a decent visual\n"); + } + } +- return (v); ++ return reinterpret_cast<vtkXVisualInfo*>(v); + } + + vtkXOpenGLRenderWindow::vtkXOpenGLRenderWindow() diff --git a/math/vtk9/files/patch-Rendering_OpenGL2_vtkXOpenGLRenderWindow.h b/math/vtk9/files/patch-Rendering_OpenGL2_vtkXOpenGLRenderWindow.h new file mode 100644 index 000000000000..59457634d2ba --- /dev/null +++ b/math/vtk9/files/patch-Rendering_OpenGL2_vtkXOpenGLRenderWindow.h @@ -0,0 +1,24 @@ +--- Rendering/OpenGL2/vtkXOpenGLRenderWindow.h.orig 2020-06-26 13:24:40 UTC ++++ Rendering/OpenGL2/vtkXOpenGLRenderWindow.h +@@ -28,11 +28,11 @@ + #include "vtkOpenGLRenderWindow.h" + #include "vtkRenderingOpenGL2Module.h" // For export macro + #include <X11/Xlib.h> // Needed for X types used in the public interface +-#include <X11/Xutil.h> // Needed for X types used in the public interface + #include <stack> // for ivar + + class vtkIdList; + class vtkXOpenGLRenderWindowInternal; ++struct vtkXVisualInfo; + + class VTKRENDERINGOPENGL2_EXPORT vtkXOpenGLRenderWindow : public vtkOpenGLRenderWindow + { +@@ -112,7 +112,7 @@ class VTKRENDERINGOPENGL2_EXPORT vtkXOpenGLRenderWindo + */ + virtual Colormap GetDesiredColormap(); + virtual Visual* GetDesiredVisual(); +- virtual XVisualInfo* GetDesiredVisualInfo(); ++ virtual vtkXVisualInfo* GetDesiredVisualInfo(); + virtual int GetDesiredDepth(); + //@} +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202106291021.15TALRxq007232>