diff --git a/0001-Add-missing-guard-required-for-GLES-to-disable-stere.patch b/0001-Add-missing-guard-required-for-GLES-to-disable-stere.patch new file mode 100644 index 0000000..218fc11 --- /dev/null +++ b/0001-Add-missing-guard-required-for-GLES-to-disable-stere.patch @@ -0,0 +1,37 @@ +From a9c31af9e6edd45ae01fb2712ad7a3c0d3e3cc37 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Sat, 4 Jul 2020 21:04:52 +0200 +Subject: [PATCH] Add missing guard required for GLES to disable stereo + rendering + +fmt.stereo() will evaluate to false for GLES, guard the whole block +so GL_BACK_* is not used. +Qt already includes the OpenGL/GLES headers, so GL_ES_VERSION_2_0 will +be defined for Qt GLES builds. +--- + GUISupport/Qt/QVTKOpenGLWindow.cxx | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/GUISupport/Qt/QVTKOpenGLWindow.cxx b/GUISupport/Qt/QVTKOpenGLWindow.cxx +index 335feb581c..b692b5490a 100644 +--- a/GUISupport/Qt/QVTKOpenGLWindow.cxx ++++ b/GUISupport/Qt/QVTKOpenGLWindow.cxx +@@ -231,6 +231,7 @@ void QVTKOpenGLWindow::paintGL() + + const QSize deviceSize = this->size() * this->devicePixelRatioF(); + const auto fmt = this->context()->format(); ++#ifndef GL_ES_VERSION_2_0 + if (fmt.stereo() && this->RenderWindow->GetStereoRender() && + this->RenderWindow->GetStereoType() == VTK_STEREO_CRYSTAL_EYES) + { +@@ -240,6 +241,7 @@ void QVTKOpenGLWindow::paintGL() + this->defaultFramebufferObject(), GL_BACK_RIGHT, QRect(QPoint(0, 0), deviceSize)); + } + else ++#endif + { + this->RenderWindowAdapter->blit( + this->defaultFramebufferObject(), GL_BACK, QRect(QPoint(0, 0), deviceSize)); +-- +2.27.0 + diff --git a/0001-Allow-compilation-on-GLES-platforms.patch b/0001-Allow-compilation-on-GLES-platforms.patch index 112a158..c7189ee 100644 --- a/0001-Allow-compilation-on-GLES-platforms.patch +++ b/0001-Allow-compilation-on-GLES-platforms.patch @@ -1,55 +1,75 @@ -From 2d5a68b91f9d638aa408285d1608bc5d70060602 Mon Sep 17 00:00:00 2001 +From 5c4e4e5832613e758b7c1389a5dbcc1d57db7c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= -Date: Fri, 1 Sep 2017 02:11:37 +0200 +Date: Tue, 9 Jun 2020 17:11:12 +0200 Subject: [PATCH] Allow compilation on GLES platforms -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit On GLES 2.0 platforms (more specifically, for Qt5 "opengl es2" builds), QOpenGLFunctions_3_2_Core does not exist. Since Qt 5.7, QOpenGlFramebufferObject has a static wrapper method for framebuffer -blitting, which in worst case is a noop. +blitting, which in worst case (i.e. no GL_EXT_framebuffer blit +extension) is a noop, but handles all GL platform differences otherwise +(3.2 Core context, GLES 3.0, or any earlier with required extensions). -Signed-off-by: Stefan Brüns +The code ignores the passed in targetId FBO handle, but relies on +the default framebuffer object of the context. As the calling code calls +QOpenGLWindow::makeCurrent() the context default FBO is the one returned +by QOpenGLWindow::defaultFramebufferObject(). --- - GUISupport/Qt/QVTKOpenGLNativeWidget.cxx | 12 ++++++++++++ - 1 file changed, 12 insertions(+) + GUISupport/Qt/QVTKRenderWindowAdapter.cxx | 21 ++++++++++++++++++++- + 1 file changed, 20 insertions(+), 1 deletion(-) -diff --git a/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx b/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx -index a1676e8..16e255f 100644 ---- a/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx -+++ b/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx -@@ -534,10 +534,15 @@ void QVTKOpenGLNativeWidget::paintGL() - - // blit from this->FBO to QOpenGLWidget's FBO. - vtkQVTKOpenGLNativeWidgetDebugMacro("paintGL::blit-to-defaultFBO"); -+#if QT_VERSION < 0x050700 - QOpenGLFunctions_3_2_Core* f = - QOpenGLContext::currentContext()->versionFunctions(); +diff --git a/GUISupport/Qt/QVTKRenderWindowAdapter.cxx b/GUISupport/Qt/QVTKRenderWindowAdapter.cxx +index 5a66e236df..e5fc5a6135 100644 +--- a/GUISupport/Qt/QVTKRenderWindowAdapter.cxx ++++ b/GUISupport/Qt/QVTKRenderWindowAdapter.cxx +@@ -334,12 +334,17 @@ public: + { + return false; + } ++#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) + QOpenGLFunctions_3_2_Core* f = this->Context->versionFunctions(); +#else -+ QOpenGLFunctions* f = QOpenGLContext::currentContext()->functions(); ++ QOpenGLFunctions* f = this->Context->functions(); +#endif - if (f) + if (!f) + { + return false; + } + ++#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) + f->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, targetId); + f->glDrawBuffer(targetAttachment); + +@@ -358,6 +363,20 @@ public: + auto sourceSize = this->FBO->size(); + f->glBlitFramebuffer(0, 0, sourceSize.width(), sourceSize.height(), targetRect.x(), + targetRect.y(), targetRect.width(), targetRect.height(), GL_COLOR_BUFFER_BIT, GL_NEAREST); ++#else ++ GLboolean scissorTest = f->glIsEnabled(GL_SCISSOR_TEST); ++ if (scissorTest == GL_TRUE) ++ { ++ f->glDisable(GL_SCISSOR_TEST); // Scissor affects glBindFramebuffer. ++ } ++ auto sourceSize = this->FBO->size(); ++ QRect sourceRect(0, 0, sourceSize.width(), sourceSize.height()); ++ unsigned int readAttachment = ++ left ? this->RenderWindow->GetFrontLeftBuffer() : this->RenderWindow->GetFrontRightBuffer(); ++ QOpenGLFramebufferObject::blitFramebuffer(nullptr, targetRect, this->FBO.get(), sourceRect, ++ GL_COLOR_BUFFER_BIT, GL_NEAREST, readAttachment, targetAttachment, ++ QOpenGLFramebufferObject::DontRestoreFramebufferBinding); ++#endif + + this->clearAlpha(targetRect); + +@@ -436,7 +455,7 @@ public: { -+#if QT_VERSION < 0x050700 - vtkOpenGLState *ostate = this->RenderWindow->GetState(); + Q_ASSERT(this->Context && this->FBO); - f->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, this->defaultFramebufferObject()); -@@ -556,6 +561,13 @@ void QVTKOpenGLNativeWidget::paintGL() - f->glBlitFramebuffer(0, 0, this->RenderWindow->GetSize()[0], this->RenderWindow->GetSize()[1], - 0, 0, this->RenderWindow->GetSize()[0], this->RenderWindow->GetSize()[1], GL_COLOR_BUFFER_BIT, - GL_NEAREST); -+#else -+ f->glDisable(GL_SCISSOR_TEST); // Scissor affects glBindFramebuffer. -+ QRect rect(0, 0, this->RenderWindow->GetSize()[0], this->RenderWindow->GetSize()[1]); -+ QOpenGLFramebufferObject::blitFramebuffer(0 /* binds to default framebuffer */, rect, -+ this->FBO, rect, GL_COLOR_BUFFER_BIT, GL_NEAREST, GL_COLOR_ATTACHMENT0, -+ GL_COLOR_ATTACHMENT0, QOpenGLFramebufferObject::DontRestoreFramebufferBinding); -+#endif - - // now clear alpha otherwise we end up blending the rendering with - // background windows in certain cases. It happens on OsX +- QOpenGLFunctions_3_2_Core* f = this->Context->versionFunctions(); ++ QOpenGLFunctions* f = this->Context->functions(); + if (f) + { + // now clear alpha otherwise we end up blending the rendering with -- -2.14.1 +2.27.0 diff --git a/0001-Correct-GL_BACK-GL_BACK_LEFT-mapping-on-GLES.patch b/0001-Correct-GL_BACK-GL_BACK_LEFT-mapping-on-GLES.patch new file mode 100644 index 0000000..54663b0 --- /dev/null +++ b/0001-Correct-GL_BACK-GL_BACK_LEFT-mapping-on-GLES.patch @@ -0,0 +1,39 @@ +From 2b930f694c2275b892772857002724b9fdcae6c5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Thu, 16 Jul 2020 03:52:23 +0200 +Subject: [PATCH 1/2] Correct GL_BACK/GL_BACK_LEFT mapping on GLES + +GLES does not have LEFT/RIGHT targets for the default framebuffer, but +just GL_BACK, so there is no need to remap it. Desktop GL may have +LEFT and RIGHT attached at the simultaneously, so one of the buffers +has to be selected when querying the attributes. +--- + Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx b/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx +index 9bbbc2ba54..4bda9330b6 100644 +--- a/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx ++++ b/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx +@@ -719,6 +719,10 @@ int vtkOpenGLRenderWindow::GetColorBufferSizes(int* rgba) + #ifdef GL_DRAW_BUFFER + glGetIntegerv(GL_DRAW_BUFFER, &attachment); + #endif ++#ifdef GL_ES_VERSION_3_0 ++ // GLES only has the GL_BACK color ++ // attachment for the default framebuffer ++#else + // GL seems odd with its handling of left/right. + // if it says we are using GL_FRONT or GL_BACK + // then convert those to GL_FRONT_LEFT and +@@ -731,6 +735,7 @@ int vtkOpenGLRenderWindow::GetColorBufferSizes(int* rgba) + { + attachment = GL_BACK_LEFT; + } ++#endif + + // make sure we clear any errors before we start + // otherwise we may get incorrect results +-- +2.27.0 + diff --git a/0001-Fix-PyVTKAddFile_-function-signature-mismatch.patch b/0001-Fix-PyVTKAddFile_-function-signature-mismatch.patch new file mode 100644 index 0000000..e993fb9 --- /dev/null +++ b/0001-Fix-PyVTKAddFile_-function-signature-mismatch.patch @@ -0,0 +1,36 @@ +From 4253aefd5b5bf5f68177b37b73588ed83d05ac7e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Thu, 2 Jul 2020 19:29:04 +0200 +Subject: [PATCH] Fix PyVTKAddFile_* function signature mismatch + +The implementation generated in vtkWrapPython.c has void return type, as +noted by GCC when using LTO, e.g.: +-- +./build/CMakeFiles/vtkRenderingOpenGL2PythonPython/vtkRenderingOpenGL2PythonInitImpl.cxx:85:24: warning: 'PyVTKAddFile_vtkPointFillPass' violates the C++ One Definition Rule [-Wodr] + 85 | extern "C" { PyObject *PyVTKAddFile_vtkPointFillPass(PyObject *dict); } + | ^ +./build/CMakeFiles/vtkRenderingOpenGL2Python/vtkPointFillPassPython.cxx:442:6: note: return value type mismatch + 442 | void PyVTKAddFile_vtkPointFillPass( + | ^ +./build/CMakeFiles/vtkRenderingOpenGL2Python/vtkPointFillPassPython.cxx:442:6: note: 'PyVTKAddFile_vtkPointFillPass' was previously declared here +-- +--- + Wrapping/Tools/vtkWrapPythonInit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Wrapping/Tools/vtkWrapPythonInit.c b/Wrapping/Tools/vtkWrapPythonInit.c +index 6b108c1aca..dcccd4cf5d 100644 +--- a/Wrapping/Tools/vtkWrapPythonInit.c ++++ b/Wrapping/Tools/vtkWrapPythonInit.c +@@ -61,7 +61,7 @@ static void CreateImplFile(const char* libName, const char* importName, int numD + + for (i = 0; i < numFiles; i++) + { +- fprintf(fout, "extern \"C\" { PyObject *PyVTKAddFile_%s(PyObject *dict); }\n", files[i]); ++ fprintf(fout, "extern \"C\" { void PyVTKAddFile_%s(PyObject *dict); }\n", files[i]); + } + + fprintf(fout, "\nstatic PyMethodDef Py%s_Methods[] = {\n", libName); +-- +2.27.0 + diff --git a/0001-GL_POINT_SPRITE-is-only-available-for-Compatibility-.patch b/0001-GL_POINT_SPRITE-is-only-available-for-Compatibility-.patch new file mode 100644 index 0000000..b833df6 --- /dev/null +++ b/0001-GL_POINT_SPRITE-is-only-available-for-Compatibility-.patch @@ -0,0 +1,46 @@ +From 6b675d1fbb130480725ae5ed3f3bdd995e9b336a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Fri, 17 Jul 2020 05:00:04 +0200 +Subject: [PATCH 1/2] GL_POINT_SPRITE is only available for Compatibility + Profiles and GLES 1.0 + +--- + Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx +index 6cd90e0306..7b834fa6e5 100644 +--- a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx ++++ b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx +@@ -1126,22 +1126,28 @@ void vtkOpenGLContextDevice2D::DrawPointSprites( + } + + // We can actually use point sprites here ++#ifdef GL_POINT_SPRITE + if (this->RenderWindow->IsPointSpriteBugPresent()) + { + glEnable(GL_POINT_SPRITE); + glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE); + } ++#endif ++#ifdef GL_POINT_SPRITE_COORD_ORIGIN + glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT); ++#endif + + glDrawArrays(GL_POINTS, 0, n); + + // free everything + cbo->ReleaseGraphicsResources(this->RenderWindow); ++#ifdef GL_POINT_SPRITE + if (this->RenderWindow->IsPointSpriteBugPresent()) + { + glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_FALSE); + glDisable(GL_POINT_SPRITE); + } ++#endif + + if (sprite) + { +-- +2.27.0 + diff --git a/0001-Guard-glPointSize-with-GL_ES_VERSION_3_0.patch b/0001-Guard-glPointSize-with-GL_ES_VERSION_3_0.patch new file mode 100644 index 0000000..f419f79 --- /dev/null +++ b/0001-Guard-glPointSize-with-GL_ES_VERSION_3_0.patch @@ -0,0 +1,43 @@ +From 5dff10d6a3c2e19eed46af4639ade2ff0ca10d98 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Sat, 18 Jul 2020 02:22:45 +0200 +Subject: [PATCH] Guard glPointSize with GL_ES_VERSION_3_0 + +glPointSize is not available in GLES, so just disable the call on GLES +like done elsewhere. +--- + Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx | 2 ++ + Rendering/ContextOpenGL2/vtkOpenGLContextDevice3D.cxx | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx +index cc376934dd..5f4eed5401 100644 +--- a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx ++++ b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx +@@ -1912,7 +1912,9 @@ void vtkOpenGLContextDevice2D::SetPointSize(float size) + { + gl2ps->SetPointSize(size); + } ++#ifndef GL_ES_VERSION_3_0 + glPointSize(size); ++#endif + } + + //----------------------------------------------------------------------------- +diff --git a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice3D.cxx b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice3D.cxx +index d24eeeda75..ab46faf8ca 100644 +--- a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice3D.cxx ++++ b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice3D.cxx +@@ -452,7 +452,9 @@ void vtkOpenGLContextDevice3D::DrawPoints( + + this->EnableDepthBuffer(); + ++#ifndef GL_ES_VERSION_3_0 + glPointSize(this->Pen->GetWidth()); ++#endif + + vtkOpenGLHelper* cbo = nullptr; + if (colors) +-- +2.27.0 + diff --git a/0001-Remove-duplicate-check-for-QOpenGLFunctions_3_2_Core.patch b/0001-Remove-duplicate-check-for-QOpenGLFunctions_3_2_Core.patch new file mode 100644 index 0000000..eb08d6c --- /dev/null +++ b/0001-Remove-duplicate-check-for-QOpenGLFunctions_3_2_Core.patch @@ -0,0 +1,96 @@ +From 6cc902225a0c4fe8567071ce6518d5861218ca6a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Tue, 9 Jun 2020 17:34:39 +0200 +Subject: [PATCH 1/3] Remove duplicate check for QOpenGLFunctions_3_2_Core* + +The return value is already checked in QVTKRenderWindowAdapter::blit(), +no need to do it twice. +--- + GUISupport/Qt/QVTKOpenGLNativeWidget.cxx | 12 +++------ + GUISupport/Qt/QVTKOpenGLWindow.cxx | 32 ++++++++++-------------- + 2 files changed, 16 insertions(+), 28 deletions(-) + +diff --git a/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx b/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx +index 9f058c7141..054079793a 100644 +--- a/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx ++++ b/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx +@@ -19,7 +19,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -237,14 +236,9 @@ void QVTKOpenGLNativeWidget::paintGL() + // before proceeding with blit-ing. + this->makeCurrent(); + +- QOpenGLFunctions_3_2_Core* f = +- QOpenGLContext::currentContext()->versionFunctions(); +- if (f) +- { +- const QSize deviceSize = this->size() * this->devicePixelRatioF(); +- this->RenderWindowAdapter->blit( +- this->defaultFramebufferObject(), GL_COLOR_ATTACHMENT0, QRect(QPoint(0, 0), deviceSize)); +- } ++ const QSize deviceSize = this->size() * this->devicePixelRatioF(); ++ this->RenderWindowAdapter->blit( ++ this->defaultFramebufferObject(), GL_COLOR_ATTACHMENT0, QRect(QPoint(0, 0), deviceSize)); + } + else + { +diff --git a/GUISupport/Qt/QVTKOpenGLWindow.cxx b/GUISupport/Qt/QVTKOpenGLWindow.cxx +index 8311ac24a8..9c97121db9 100644 +--- a/GUISupport/Qt/QVTKOpenGLWindow.cxx ++++ b/GUISupport/Qt/QVTKOpenGLWindow.cxx +@@ -19,7 +19,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -230,25 +229,20 @@ void QVTKOpenGLWindow::paintGL() + // before proceeding with blit-ing. + this->makeCurrent(); + +- QOpenGLFunctions_3_2_Core* f = +- QOpenGLContext::currentContext()->versionFunctions(); +- if (f) ++ const QSize deviceSize = this->size() * this->devicePixelRatioF(); ++ const auto fmt = this->context()->format(); ++ if (fmt.stereo() && this->RenderWindow->GetStereoRender() && ++ this->RenderWindow->GetStereoType() == VTK_STEREO_CRYSTAL_EYES) + { +- const QSize deviceSize = this->size() * this->devicePixelRatioF(); +- const auto fmt = this->context()->format(); +- if (fmt.stereo() && this->RenderWindow->GetStereoRender() && +- this->RenderWindow->GetStereoType() == VTK_STEREO_CRYSTAL_EYES) +- { +- this->RenderWindowAdapter->blitLeftEye( +- this->defaultFramebufferObject(), GL_BACK_LEFT, QRect(QPoint(0, 0), deviceSize)); +- this->RenderWindowAdapter->blitRightEye( +- this->defaultFramebufferObject(), GL_BACK_RIGHT, QRect(QPoint(0, 0), deviceSize)); +- } +- else +- { +- this->RenderWindowAdapter->blit( +- this->defaultFramebufferObject(), GL_BACK, QRect(QPoint(0, 0), deviceSize)); +- } ++ this->RenderWindowAdapter->blitLeftEye( ++ this->defaultFramebufferObject(), GL_BACK_LEFT, QRect(QPoint(0, 0), deviceSize)); ++ this->RenderWindowAdapter->blitRightEye( ++ this->defaultFramebufferObject(), GL_BACK_RIGHT, QRect(QPoint(0, 0), deviceSize)); ++ } ++ else ++ { ++ this->RenderWindowAdapter->blit( ++ this->defaultFramebufferObject(), GL_BACK, QRect(QPoint(0, 0), deviceSize)); + } + } + else +-- +2.27.0 + diff --git a/0001-Replace-invalid-GL_LINE-with-GL_LINES-for-glDrawArra.patch b/0001-Replace-invalid-GL_LINE-with-GL_LINES-for-glDrawArra.patch new file mode 100644 index 0000000..2347aff --- /dev/null +++ b/0001-Replace-invalid-GL_LINE-with-GL_LINES-for-glDrawArra.patch @@ -0,0 +1,28 @@ +From cce31fb588c24c56848cb4ec28b10f2831232374 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Sat, 18 Jul 2020 02:09:18 +0200 +Subject: [PATCH] Replace invalid GL_LINE with GL_LINES for glDrawArrays + +GL_LINE applies to glPolygonMode, but glDrawArrays uses GL_LINES. + +(cherry picked from commit bd241df6c5804875d879c4649915e3e83172ba3f) +--- + Rendering/ContextOpenGL2/vtkOpenGLContextDevice3D.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice3D.cxx b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice3D.cxx +index c55968d3b8..d24eeeda75 100644 +--- a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice3D.cxx ++++ b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice3D.cxx +@@ -431,7 +431,7 @@ void vtkOpenGLContextDevice3D::DrawLines( + this->BuildVBO(cbo, verts, n, colors, nc, nullptr); + this->SetMatrices(cbo->Program); + +- glDrawArrays(GL_LINE, 0, n); ++ glDrawArrays(GL_LINES, 0, n); + + // free everything + cbo->ReleaseGraphicsResources(this->RenderWindow); +-- +2.27.0 + diff --git a/0001-Replace-last-glDrawBuffer-call-with-glDrawBuffers-1.patch b/0001-Replace-last-glDrawBuffer-call-with-glDrawBuffers-1.patch new file mode 100644 index 0000000..f16beaa --- /dev/null +++ b/0001-Replace-last-glDrawBuffer-call-with-glDrawBuffers-1.patch @@ -0,0 +1,46 @@ +From 98857882cdd0a08a5102d663dc9510e6343adbfa Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Sun, 28 Jun 2020 22:13:32 +0200 +Subject: [PATCH 1/2] Replace last glDrawBuffer call with glDrawBuffers(1, ...) + +glDrawBuffer is only available in Desktop OpenGL, while the equivalent +glDrawBuffers is valid also for GLES. + +Just defining glDrawBuffer as an empty macro is obviously not the right +solution, as the call is also required on GLES. This also causes +a compilation failure - GL.h may be included via GLX.h on X11 platforms, +and the glDrawBuffer prototype declaration becomes malformed. +--- + Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h | 3 ++- + ThirdParty/glew/vtk_glew.h.in | 1 - + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h +index ddeeb04d38..2e1cc9cbf2 100644 +--- a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h ++++ b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h +@@ -324,7 +324,8 @@ public: + + if (this->SavedDrawBuffer != GL_BACK_LEFT) + { +- glDrawBuffer(this->SavedDrawBuffer); ++ const GLenum bufs[1] = { static_cast(this->SavedDrawBuffer) }; ++ ::glDrawBuffers(1, bufs); + } + + ostate->vtkglClearColor(this->SavedClearColor[0], this->SavedClearColor[1], +diff --git a/ThirdParty/glew/vtk_glew.h.in b/ThirdParty/glew/vtk_glew.h.in +index 009f230b19..1763e79319 100644 +--- a/ThirdParty/glew/vtk_glew.h.in ++++ b/ThirdParty/glew/vtk_glew.h.in +@@ -52,7 +52,6 @@ + + /* some fixes for both ES 2 and 3 */ + #ifdef GL_ES_VERSION_3_0 +-#define glDrawBuffer(arg) + #define GL_BACK_LEFT 0 + #define GL_BACK_RIGHT 0 + #define GL_FRONT_LEFT 0 +-- +2.27.0 + diff --git a/0001-clean-up-some-old-opengl-es-stuff.patch b/0001-clean-up-some-old-opengl-es-stuff.patch new file mode 100644 index 0000000..5b60fc3 --- /dev/null +++ b/0001-clean-up-some-old-opengl-es-stuff.patch @@ -0,0 +1,247 @@ +From 13956bf0d47391046e7bb08bb0b581d0850738a9 Mon Sep 17 00:00:00 2001 +From: Ken Martin +Date: Tue, 23 Jun 2020 14:31:15 -0400 +Subject: [PATCH] clean up some old opengl es stuff + +No longer have the version option so remove + +Partially implement 1D textures as 2D +--- + Examples/Android/ReadMe.txt | 6 +- + Rendering/OpenGL2/CMakeLists.txt | 6 +- + Rendering/OpenGL2/vtkTextureObject.cxx | 95 +++++++++++++++++++++++++- + ThirdParty/glew/vtk_glew.h.in | 45 ++++++------ + 4 files changed, 118 insertions(+), 34 deletions(-) + +diff --git a/Examples/Android/ReadMe.txt b/Examples/Android/ReadMe.txt +index 7b43476bdd..9c6f5a102d 100644 +--- a/Examples/Android/ReadMe.txt ++++ b/Examples/Android/ReadMe.txt +@@ -41,10 +41,6 @@ To build VTK and these examples follow the steps below. + * Run cmake on vtkandroid with -DVTK_ANDROID_BUILD=ON, if you use the gui add a + * boolean entry with that name prior to configuring and set it on. + +-If you want OpenGL ES 3.0 support make sure to change the setting of +-OPENGL_ES_VERSION to 3.0. Volume Rendering requires ES 3.0. Make sure to turn on +-VTK_BUILD_EXAMPLES +- + * configure and generate as usual + + * Once done run ninja or make as appropriate +@@ -60,4 +56,4 @@ cd into CMakeExternals/Build/vtk-android/Examples/Android/ExampleName/bin + + You should see some apk files in this directory. + +-You can adb install -r ExampleName-debug.apk and then run the example on your device +\ No newline at end of file ++You can adb install -r ExampleName-debug.apk and then run the example on your device +diff --git a/Rendering/OpenGL2/CMakeLists.txt b/Rendering/OpenGL2/CMakeLists.txt +index da43adb85f..0ea0ee3200 100644 +--- a/Rendering/OpenGL2/CMakeLists.txt ++++ b/Rendering/OpenGL2/CMakeLists.txt +@@ -3,6 +3,7 @@ set(classes + vtkClearRGBPass + vtkClearZPass + vtkCompositePolyDataMapper2 ++ vtkDataTransferHelper + vtkDefaultPass + vtkDepthImageProcessingPass + vtkDepthOfFieldPass +@@ -93,11 +94,6 @@ set(classes + vtkValuePass + vtkVolumetricPass) + +-if (NOT DEFINED OPENGL_ES_VERSION) +- list(APPEND classes +- vtkDataTransferHelper) +-endif() +- + set(headers + vtkCompositePolyDataMapper2Internal.h + vtkOpenGL.h + vtkStateStorage.h +diff --git a/Rendering/OpenGL2/vtkTextureObject.cxx b/Rendering/OpenGL2/vtkTextureObject.cxx +index 6afef26d97..b491c62e89 100644 +--- a/Rendering/OpenGL2/vtkTextureObject.cxx ++++ b/Rendering/OpenGL2/vtkTextureObject.cxx +@@ -1030,6 +1030,99 @@ bool vtkTextureObject::CreateTextureBuffer( + + #else + ++// Emulate 1D textures as 2D. Note that the any shader code will likely ++// have to be modified as well for this to work. ++ ++//------------------------------------------------------------------------------ ++bool vtkTextureObject::Create1D( ++ int numComps, vtkPixelBufferObject* pbo, bool shaderSupportsTextureInt) ++{ ++ assert(this->Context); ++ assert(pbo->GetContext() == this->Context.GetPointer()); ++ ++ GLenum target = GL_TEXTURE_2D; ++ ++ // Now, determine texture parameters using the information from the pbo. ++ ++ // * internalFormat depends on number of components and the data type. ++ GLenum internalFormat = ++ this->GetInternalFormat(pbo->GetType(), numComps, shaderSupportsTextureInt); ++ ++ // * format depends on the number of components. ++ GLenum format = this->GetFormat(pbo->GetType(), numComps, shaderSupportsTextureInt); ++ ++ // * type if the data type in the pbo ++ GLenum type = this->GetDefaultDataType(pbo->GetType()); ++ ++ if (!internalFormat || !format || !type) ++ { ++ vtkErrorMacro("Failed to determine texture parameters."); ++ return false; ++ } ++ ++ this->Target = target; ++ this->Context->ActivateTexture(this); ++ this->CreateTexture(); ++ this->Bind(); ++ ++ pbo->Bind(vtkPixelBufferObject::UNPACKED_BUFFER); ++ ++ // Source texture data from the PBO. ++ glPixelStorei(GL_UNPACK_ALIGNMENT, 1); ++ glTexImage2D(target, 0, static_cast(internalFormat), ++ static_cast(pbo->GetSize() / static_cast(numComps)), 1, 0, format, type, ++ BUFFER_OFFSET(0)); ++ vtkOpenGLCheckErrorMacro("failed at glTexImage1D"); ++ pbo->UnBind(); ++ this->Deactivate(); ++ ++ this->Target = target; ++ this->Format = format; ++ this->Type = type; ++ this->Components = numComps; ++ this->Width = pbo->GetSize(); ++ this->Height = 1; ++ this->Depth = 1; ++ this->NumberOfDimensions = 1; ++ return true; ++} ++ ++//------------------------------------------------------------------------------ ++bool vtkTextureObject::Create1DFromRaw(unsigned int width, int numComps, int dataType, void* data) ++{ ++ assert(this->Context); ++ ++ // Now determine the texture parameters using the arguments. ++ this->GetDataType(dataType); ++ this->GetInternalFormat(dataType, numComps, false); ++ this->GetFormat(dataType, numComps, false); ++ ++ if (!this->InternalFormat || !this->Format || !this->Type) ++ { ++ vtkErrorMacro("Failed to determine texture parameters."); ++ return false; ++ } ++ ++ GLenum target = GL_TEXTURE_2D; ++ this->Target = target; ++ this->Components = numComps; ++ this->Width = width; ++ this->Height = 1; ++ this->Depth = 1; ++ this->NumberOfDimensions = 1; ++ this->Context->ActivateTexture(this); ++ this->CreateTexture(); ++ this->Bind(); ++ ++ glTexImage2D(this->Target, 0, this->InternalFormat, static_cast(this->Width), 1, 0, ++ this->Format, this->Type, static_cast(data)); ++ ++ vtkOpenGLCheckErrorMacro("failed at glTexImage1D"); ++ ++ this->Deactivate(); ++ return true; ++} ++ + // Description: + // Create a texture buffer basically a 1D texture that can be + // very large for passing data into the fragment shader +@@ -1037,7 +1130,7 @@ bool vtkTextureObject::CreateTextureBuffer( + unsigned int numValues, int numComps, int dataType, vtkOpenGLBufferObject* bo) + { + assert(this->Context); +- vtkErrorMacro("TextureBuffers not supported in OPenGL ES"); ++ vtkErrorMacro("TextureBuffers not supported in OpenGL ES"); + // TODO: implement 1D and Texture buffers using 2D textures + return false; + } +diff --git a/ThirdParty/glew/vtk_glew.h.in b/ThirdParty/glew/vtk_glew.h.in +index 6aa8c2ee9e..009f230b19 100644 +--- a/ThirdParty/glew/vtk_glew.h.in ++++ b/ThirdParty/glew/vtk_glew.h.in +@@ -35,42 +35,41 @@ + #endif + + #if VTK_MODULE_vtkglew_GLES3 +-# include ++#include + #elif TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR +-# include ++#include + #elif VTK_MODULE_USE_EXTERNAL_vtkglew +-# include +-# ifdef _WIN32 +-# include +-# endif ++#include ++#ifdef _WIN32 ++#include ++#endif + #else +-# include +-# ifdef _WIN32 +-# include +-# endif ++#include ++#ifdef _WIN32 ++#include ++#endif + #endif + + /* some fixes for both ES 2 and 3 */ + #ifdef GL_ES_VERSION_3_0 +-# define glDrawBuffer(arg) +-# define GL_BACK_LEFT 0 +-# define GL_BACK_RIGHT 0 +-# define GL_FRONT_LEFT 0 +-# define GL_FRONT_RIGHT 0 ++#define glDrawBuffer(arg) ++#define GL_BACK_LEFT 0 ++#define GL_BACK_RIGHT 0 ++#define GL_FRONT_LEFT 0 ++#define GL_FRONT_RIGHT 0 + + /* this sends all the data each time as opposed to allowing a subset */ +-# define glMultiDrawElements(mode, counts, type, indicies, primcount) \ +- for (size_t eCount = 0; eCount < primcount; ++eCount) \ +- { \ +- glDrawElements(mode, *(counts + eCount), \ +- type, (GLvoid *)(indicies[eCount])); \ +- } ++#define glMultiDrawElements(mode, counts, type, indicies, primcount) \ ++ for (size_t eCount = 0; eCount < primcount; ++eCount) \ ++ { \ ++ glDrawElements(mode, *(counts + eCount), type, (GLvoid*)(indicies[eCount])); \ ++ } + #endif + + /*** deal with some GLES 3.0 specific issues ***/ + #ifdef GL_ES_VERSION_3_0 +-# define GLEW_ARB_vertex_array_object 1 +-# define GLEW_ARB_instanced_arrays 1 ++#define GLEW_ARB_vertex_array_object 1 ++#define GLEW_ARB_instanced_arrays 1 + #endif + + #endif +-- +2.27.0 + diff --git a/0001-expose-1d-texture-options.patch b/0001-expose-1d-texture-options.patch new file mode 100644 index 0000000..c0a1c42 --- /dev/null +++ b/0001-expose-1d-texture-options.patch @@ -0,0 +1,35 @@ +From 18b9e99bcc2550515e2f725f1b0c70904068c945 Mon Sep 17 00:00:00 2001 +From: Ken Martin +Date: Mon, 6 Jul 2020 10:48:40 -0400 +Subject: [PATCH] expose 1d texture options + +They are partially implemented as 2d textures +--- + Rendering/OpenGL2/vtkTextureObject.h | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/Rendering/OpenGL2/vtkTextureObject.h b/Rendering/OpenGL2/vtkTextureObject.h +index b6dcdf6ba7..fe018c75f9 100644 +--- a/Rendering/OpenGL2/vtkTextureObject.h ++++ b/Rendering/OpenGL2/vtkTextureObject.h +@@ -226,9 +226,6 @@ public: + bool CreateCubeFromRaw( + unsigned int width, unsigned int height, int numComps, int dataType, void* data[6]); + +-// 1D textures are not supported in ES 2.0 or 3.0 +-#ifndef GL_ES_VERSION_3_0 +- + /** + * Create a 1D texture using the PBO. + * Eventually we may start supporting creating a texture from subset of data +@@ -245,7 +242,6 @@ public: + * Create 1D texture from client memory + */ + bool Create1DFromRaw(unsigned int width, int numComps, int dataType, void* data); +-#endif + + /** + * Create a 2D texture using the PBO. +-- +2.27.0 + diff --git a/0002-Guard-GL_LINE_SMOOTH-for-GLES.patch b/0002-Guard-GL_LINE_SMOOTH-for-GLES.patch new file mode 100644 index 0000000..35980ba --- /dev/null +++ b/0002-Guard-GL_LINE_SMOOTH-for-GLES.patch @@ -0,0 +1,42 @@ +From f03ed2c663c30baac698d5b76a8ba4ea63776ce2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Fri, 17 Jul 2020 05:05:55 +0200 +Subject: [PATCH 2/2] Guard GL_LINE_SMOOTH for GLES + +--- + Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx +index 7b834fa6e5..cc376934dd 100644 +--- a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx ++++ b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx +@@ -332,10 +332,12 @@ void vtkOpenGLContextDevice2D::Begin(vtkViewport* viewport) + this->RenderWindow->GetShaderCache()->ReleaseCurrentShader(); + + // Enable simple line smoothing if multisampling is on. ++#ifdef GL_LINE_SMOOTH + if (this->Renderer->GetRenderWindow()->GetMultiSamples()) + { + glEnable(GL_LINE_SMOOTH); + } ++#endif + + this->InRender = true; + vtkOpenGLCheckErrorMacro("failed after Begin"); +@@ -359,10 +361,12 @@ void vtkOpenGLContextDevice2D::End() + this->Storage->RestoreGLState(ostate); + + // Disable simple line smoothing if multisampling is on. ++#ifdef GL_LINE_SMOOTH + if (this->Renderer->GetRenderWindow()->GetMultiSamples()) + { + glDisable(GL_LINE_SMOOTH); + } ++#endif + + this->PolyDataImpl->HandleEndFrame(); + +-- +2.27.0 + diff --git a/0002-Use-GL_DRAW_BUFFER0-instead-of-GL_DRAW_BUFFER-for-GL.patch b/0002-Use-GL_DRAW_BUFFER0-instead-of-GL_DRAW_BUFFER-for-GL.patch new file mode 100644 index 0000000..37252c1 --- /dev/null +++ b/0002-Use-GL_DRAW_BUFFER0-instead-of-GL_DRAW_BUFFER-for-GL.patch @@ -0,0 +1,150 @@ +From 651b3bae914b9f3c69031c97a366e5cf53ead389 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Thu, 16 Jul 2020 19:54:38 +0200 +Subject: [PATCH 2/2] Use GL_DRAW_BUFFER0 instead of GL_DRAW_BUFFER for GLES + compatibility + +ARB_draw_buffers is part of GL 2.0, so GL_DRAW_BUFFERS0 so it is always +available, and contrary to GL_DRAW_BUFFER it is also valid for GLES +(part of GLES 3 or as EXT_draw_buffers). + +This also matches the universal use of glDrawBuffers instead of +glDrawBuffer. + +At least with MESA, GL_DRAW_BUFFER and GL_DRAW_BUFFER0 always return the +same value. GL_DRAW_BUFFERn is also used in several places already. +--- + .../ContextOpenGL2/vtkOpenGLContextBufferId.cxx | 2 +- + .../vtkOpenGLContextDevice2DPrivate.h | 2 +- + .../External/vtkExternalOpenGLRenderWindow.cxx | 2 +- + Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx | 12 ++++++------ + Rendering/OpenGL2/vtkOpenGLState.cxx | 16 ++++++++-------- + 5 files changed, 17 insertions(+), 17 deletions(-) + +diff --git a/Rendering/ContextOpenGL2/vtkOpenGLContextBufferId.cxx b/Rendering/ContextOpenGL2/vtkOpenGLContextBufferId.cxx +index 06abb5e7e6..0d39638869 100644 +--- a/Rendering/ContextOpenGL2/vtkOpenGLContextBufferId.cxx ++++ b/Rendering/ContextOpenGL2/vtkOpenGLContextBufferId.cxx +@@ -139,7 +139,7 @@ vtkIdType vtkOpenGLContextBufferId::GetPickedItem(int x, int y) + // Render texture to current write buffer. Texel x,y is rendered at + // pixel x,y (instead of pixel 0,0 to work around pixel ownership test). + GLint savedDrawBuffer; +- glGetIntegerv(GL_DRAW_BUFFER, &savedDrawBuffer); ++ glGetIntegerv(GL_DRAW_BUFFER0, &savedDrawBuffer); + + vtkOpenGLState::ScopedglEnableDisable dsaver(ostate, GL_DEPTH_TEST); + vtkOpenGLState::ScopedglEnableDisable ssaver(ostate, GL_STENCIL_TEST); +diff --git a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h +index 5632547459..17e2f182ef 100644 +--- a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h ++++ b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h +@@ -309,7 +309,7 @@ public: + this->SavedStencilTest = ostate->GetEnumState(GL_STENCIL_TEST); + this->SavedBlend = ostate->GetEnumState(GL_BLEND); + ostate->vtkglGetFloatv(GL_COLOR_CLEAR_VALUE, this->SavedClearColor); +- ostate->vtkglGetIntegerv(GL_DRAW_BUFFER, &this->SavedDrawBuffer); ++ ostate->vtkglGetIntegerv(GL_DRAW_BUFFER0, &this->SavedDrawBuffer); + } + } + +diff --git a/Rendering/External/vtkExternalOpenGLRenderWindow.cxx b/Rendering/External/vtkExternalOpenGLRenderWindow.cxx +index c95b50ac64..291c4e1e61 100644 +--- a/Rendering/External/vtkExternalOpenGLRenderWindow.cxx ++++ b/Rendering/External/vtkExternalOpenGLRenderWindow.cxx +@@ -60,7 +60,7 @@ void vtkExternalOpenGLRenderWindow::Start(void) + + // For stereo, render the correct eye based on the OpenGL buffer mode + GLint bufferType; +- ostate->vtkglGetIntegerv(GL_DRAW_BUFFER, &bufferType); ++ ostate->vtkglGetIntegerv(GL_DRAW_BUFFER0, &bufferType); + vtkCollectionSimpleIterator sit; + vtkRenderer* renderer; + for (this->GetRenderers()->InitTraversal(sit); +diff --git a/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx b/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx +index 4bda9330b6..14cd43711f 100644 +--- a/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx ++++ b/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx +@@ -533,8 +533,8 @@ bool vtkOpenGLRenderWindow::InitializeFromCurrentContext() + { + this->DefaultFrameBufferId = frameBufferBinding; + GLint attachment = GL_COLOR_ATTACHMENT0; +-#ifdef GL_DRAW_BUFFER +- glGetIntegerv(GL_DRAW_BUFFER, &attachment); ++#ifdef GL_DRAW_BUFFER0 ++ glGetIntegerv(GL_DRAW_BUFFER0, &attachment); + #endif + this->BackLeftBuffer = static_cast(attachment); + this->FrontLeftBuffer = static_cast(attachment); +@@ -660,8 +660,8 @@ bool vtkOpenGLRenderWindow::GetUsingSRGBColorSpace() + this->MakeCurrent(); + + GLint attachment = GL_BACK_LEFT; +-#ifdef GL_DRAW_BUFFER +- glGetIntegerv(GL_DRAW_BUFFER, &attachment); ++#ifdef GL_DRAW_BUFFER0 ++ glGetIntegerv(GL_DRAW_BUFFER0, &attachment); + #endif + // GL seems odd with its handling of left/right. + // if it says we are using GL_FRONT or GL_BACK +@@ -716,8 +716,8 @@ int vtkOpenGLRenderWindow::GetColorBufferSizes(int* rgba) + { + this->MakeCurrent(); + GLint attachment = GL_BACK_LEFT; +-#ifdef GL_DRAW_BUFFER +- glGetIntegerv(GL_DRAW_BUFFER, &attachment); ++#ifdef GL_DRAW_BUFFER0 ++ glGetIntegerv(GL_DRAW_BUFFER0, &attachment); + #endif + #ifdef GL_ES_VERSION_3_0 + // GLES only has the GL_BACK color +diff --git a/Rendering/OpenGL2/vtkOpenGLState.cxx b/Rendering/OpenGL2/vtkOpenGLState.cxx +index 3822fe7bd0..dbec8329dd 100644 +--- a/Rendering/OpenGL2/vtkOpenGLState.cxx ++++ b/Rendering/OpenGL2/vtkOpenGLState.cxx +@@ -205,8 +205,8 @@ void vtkOpenGLState::CheckState() + error = true; + } + unsigned int sval; +-#ifdef GL_DRAW_BUFFER +- ::glGetIntegerv(GL_DRAW_BUFFER, iparams); ++#ifdef GL_DRAW_BUFFER0 ++ ::glGetIntegerv(GL_DRAW_BUFFER0, iparams); + sval = this->CurrentState.DrawBinding.GetDrawBuffer(0); + if (sval == GL_BACK_LEFT) + { +@@ -518,8 +518,8 @@ void vtkOpenGLState::vtkglBindFramebuffer(unsigned int target, unsigned int val) + this->CurrentState.DrawBinding.Binding = val; + this->CurrentState.DrawBinding.Framebuffer = nullptr; + ::glBindFramebuffer(GL_DRAW_FRAMEBUFFER, val); +-#ifdef GL_DRAW_BUFFER +- ::glGetIntegerv(GL_DRAW_BUFFER, (int*)&this->CurrentState.DrawBinding.DrawBuffers[0]); ++#ifdef GL_DRAW_BUFFER0 ++ ::glGetIntegerv(GL_DRAW_BUFFER0, (int*)&this->CurrentState.DrawBinding.DrawBuffers[0]); + #endif + } + } +@@ -1222,8 +1222,8 @@ void vtkOpenGLState::Initialize(vtkOpenGLRenderWindow*) + unsigned int vals[1]; + vals[0] = this->CurrentState.DrawBinding.GetDrawBuffer(0); + ::glDrawBuffers(1, vals); +-#ifdef GL_DRAW_BUFFER +- ::glGetIntegerv(GL_DRAW_BUFFER, (int*)&this->CurrentState.DrawBinding.DrawBuffers[0]); ++#ifdef GL_DRAW_BUFFER0 ++ ::glGetIntegerv(GL_DRAW_BUFFER0, (int*)&this->CurrentState.DrawBinding.DrawBuffers[0]); + #endif + ::glReadBuffer(this->CurrentState.ReadBinding.GetReadBuffer()); + ::glGetIntegerv(GL_READ_BUFFER, (int*)&this->CurrentState.ReadBinding.ReadBuffer); +@@ -1232,8 +1232,8 @@ void vtkOpenGLState::Initialize(vtkOpenGLRenderWindow*) + void vtkOpenGLState::ResetFramebufferBindings() + { + ::glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, (int*)&this->CurrentState.DrawBinding.Binding); +-#ifdef GL_DRAW_BUFFER +- ::glGetIntegerv(GL_DRAW_BUFFER, (int*)&this->CurrentState.DrawBinding.DrawBuffers[0]); ++#ifdef GL_DRAW_BUFFER0 ++ ::glGetIntegerv(GL_DRAW_BUFFER0, (int*)&this->CurrentState.DrawBinding.DrawBuffers[0]); + #endif + + ::glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, (int*)&this->CurrentState.ReadBinding.Binding); +-- +2.27.0 + diff --git a/VTK-9.0.0.tar.gz b/VTK-9.0.0.tar.gz deleted file mode 100644 index 964a908..0000000 --- a/VTK-9.0.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:15def4e6f84d72f82386617fe595ec124dda3cbd13ea19a0dcd91583197d8715 -size 33535036 diff --git a/VTK-9.0.1.tar.gz b/VTK-9.0.1.tar.gz new file mode 100644 index 0000000..e52462f --- /dev/null +++ b/VTK-9.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b39a5e191c282861e7af4101eaa8585969a2de05f5646c9199a161213a622c7 +size 34687900 diff --git a/bundled_exodusii_add_missing_libpthread.patch b/bundled_exodusii_add_missing_libpthread.patch deleted file mode 100644 index 0dab21a..0000000 --- a/bundled_exodusii_add_missing_libpthread.patch +++ /dev/null @@ -1,63 +0,0 @@ -From ca02bcc844e4d268ac5060f56f10467e2579fb43 Mon Sep 17 00:00:00 2001 -From: Ben Boeckel -Date: Thu, 7 May 2020 11:36:50 -0400 -Subject: [PATCH 1/3] exodusII: also link to hdf5 directly - ---- - ThirdParty/exodusII/vtk.module | 1 + - 1 file changed, 1 insertion(+) - -Index: VTK-9.0.0/ThirdParty/exodusII/vtk.module -=================================================================== ---- VTK-9.0.0.orig/ThirdParty/exodusII/vtk.module -+++ VTK-9.0.0/ThirdParty/exodusII/vtk.module -@@ -3,5 +3,6 @@ NAME - LIBRARY_NAME - vtkexodusII - DEPENDS -+ VTK::hdf5 - VTK::netcdf - THIRD_PARTY - -From a98772f6d5f6b62c0f3ac360702b585c09bc5557 Mon Sep 17 00:00:00 2001 -From: Seacas Upstream -Date: Thu, 7 May 2020 12:22:01 -0400 -Subject: [PATCH 3/3] exodusII 2020-05-07 (2c24a120) - -Code extracted from: - - https://gitlab.kitware.com/third-party/seacas.git - -at commit 2c24a120deb77a8a2ea05462d0a60e7f9d90e58e (for/vtk-20200507-7.24f-v2019-12-18). ---- - ThirdParty/exodusII/vtkexodusII/CMakeLists.txt | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/ThirdParty/exodusII/vtkexodusII/CMakeLists.txt b/ThirdParty/exodusII/vtkexodusII/CMakeLists.txt -index 025abc43e0..d931004997 100644 ---- a/ThirdParty/exodusII/vtkexodusII/CMakeLists.txt -+++ b/ThirdParty/exodusII/vtkexodusII/CMakeLists.txt -@@ -297,14 +297,19 @@ set(headers - "${CMAKE_CURRENT_BINARY_DIR}/include/exodusII_cfg.h" - "${CMAKE_CURRENT_BINARY_DIR}/include/exodus_config.h") - -+vtk_module_find_package(PACKAGE Threads) -+ - vtk_module_add_module(VTK::exodusII - SOURCES ${sources} - HEADERS ${headers} - HEADERS_SUBDIR "vtkexodusII/include") --target_compile_definitions(exodusII -+vtk_module_definitions(VTK::exodusII - PRIVATE - exoIIc_EXPORTS) --target_include_directories(exodusII -+vtk_module_include(VTK::exodusII - PUBLIC - "$" - "$") -+vtk_module_link(VTK::exodusII -+ PRIVATE -+ Threads::Threads) --- -2.26.2 diff --git a/vtk-parallelgeometry-dependency.patch b/vtk-parallelgeometry-dependency.patch deleted file mode 100644 index 255c817..0000000 --- a/vtk-parallelgeometry-dependency.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: VTK-9.0.0/Filters/ParallelGeometry/vtk.module -=================================================================== ---- VTK-9.0.0.orig/Filters/ParallelGeometry/vtk.module -+++ VTK-9.0.0/Filters/ParallelGeometry/vtk.module -@@ -12,6 +12,7 @@ DEPENDS - VTK::CommonCore - VTK::CommonSystem - VTK::CommonExecutionModel -+ VTK::FiltersCore - VTK::FiltersGeometry - VTK::FiltersParallel - VTK::ParallelMPI diff --git a/vtk-qt-5.15-include-QPainterPath.patch b/vtk-qt-5.15-include-QPainterPath.patch deleted file mode 100644 index a50085b..0000000 --- a/vtk-qt-5.15-include-QPainterPath.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 797f28697d5ba50c1fa2bc5596af626a3c277826 Mon Sep 17 00:00:00 2001 -From: "Andrew J. P. Maclean" -Date: Wed, 27 May 2020 15:27:15 +1000 -Subject: [PATCH] Qt 5.15 needs the include file QPainterPath - ---- - Rendering/Qt/vtkQtLabelRenderStrategy.cxx | 1 + - Rendering/Qt/vtkQtStringToImage.cxx | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/Rendering/Qt/vtkQtLabelRenderStrategy.cxx b/Rendering/Qt/vtkQtLabelRenderStrategy.cxx -index afda585cca..eca65c64cd 100644 ---- a/Rendering/Qt/vtkQtLabelRenderStrategy.cxx -+++ b/Rendering/Qt/vtkQtLabelRenderStrategy.cxx -@@ -41,6 +41,7 @@ - #include - #include - #include -+#include - #include - #include - #include -diff --git a/Rendering/Qt/vtkQtStringToImage.cxx b/Rendering/Qt/vtkQtStringToImage.cxx -index 659c71570e..fbb9b78f05 100644 ---- a/Rendering/Qt/vtkQtStringToImage.cxx -+++ b/Rendering/Qt/vtkQtStringToImage.cxx -@@ -30,6 +30,7 @@ - #include - #include - #include -+#include - #include - #include - #include --- -2.26.2 diff --git a/vtk.changes b/vtk.changes index afc2bd4..b0f7651 100644 --- a/vtk.changes +++ b/vtk.changes @@ -1,3 +1,36 @@ +------------------------------------------------------------------- +Thu Jul 16 16:55:31 UTC 2020 - Stefan Brüns + +- Update to version 9.0.1: + * Drop obsolete patches: + + bundled_exodusii_add_missing_libpthread.patch + + vtk-parallelgeometry-dependency.patch + + vtk-qt-5.15-include-QPainterPath.patch +- Explicitly enable module RenderingContextOpenGL2 required for PCL +- Conditionally add pugixml-devel Requires in devel package +- Make devel package installable even when built without Java +- Remove CAPITALIZATION from comments +- Drop obsolete TK build dependency +- Drop unused wget build dependency +- Wrap devel-doc generation in bcond (keep defaulted to off), and + drop the essentially empty package when disabled. +- Fix build on ARM/Qt GLES (boo#1172723): + * set VTK_OPENGL_USE_GLES + * Add 0001-clean-up-some-old-opengl-es-stuff.patch + * Add 0001-expose-1d-texture-options.patch + * Add 0001-Remove-duplicate-check-for-QOpenGLFunctions_3_2_Core.patch + * Rebase 0001-Allow-compilation-on-GLES-platforms.patch + * Add 0001-Replace-last-glDrawBuffer-call-with-glDrawBuffers-1.patch + * Add 0001-Use-2D-textures-for-1D-texture-emulation-on-GLES.patch + * Add 0001-Add-missing-guard-required-for-GLES-to-disable-stere.patch + * Add 0001-Correct-GL_BACK-GL_BACK_LEFT-mapping-on-GLES.patch + * Add 0002-Use-GL_DRAW_BUFFER0-instead-of-GL_DRAW_BUFFER-for-GL.patch + * Add 0001-GL_POINT_SPRITE-is-only-available-for-Compatibility-.patch + * Add 0002-Guard-GL_LINE_SMOOTH-for-GLES.patch + * Add 0001-Guard-glPointSize-with-GL_ES_VERSION_3_0.patch +- Add 0001-Fix-PyVTKAddFile_-function-signature-mismatch.patch +- Add 0001-Replace-invalid-GL_LINE-with-GL_LINES-for-glDrawArra.patch + ------------------------------------------------------------------- Mon Jun 15 14:47:31 UTC 2020 - Andreas Schwab diff --git a/vtk.spec b/vtk.spec index 9bbea70..a9a0aed 100644 --- a/vtk.spec +++ b/vtk.spec @@ -19,6 +19,7 @@ %global flavor @BUILD_FLAVOR@%{nil} %bcond_with examples +%bcond_with documentation %if 0%{?sle_version} >= 150200 %define DisOMPI1 ExclusiveArch: do_not_build @@ -27,9 +28,15 @@ %define DisOMPI3 ExclusiveArch: do_not_build %endif +%ifarch %arm aarch64 +%bcond_without gles +%else +%bcond_with gles +%endif + %define pkgname vtk -# PUGIXML, GL2PS IN LEAPS ARE TOO OLD +# pugixml and gl2ps in Leap 15.x are too old %if 0%{?suse_version} <= 1500 %bcond_with pugixml %bcond_with gl2ps @@ -38,9 +45,9 @@ %bcond_without gl2ps %endif -# PEGTL IN LEAP 15.1 IS TOO OLD (< 2.0.0) -# cmake STILL CHECKS FOR JAVAH (AND CHEATING WITH {_bindir}/true NO LONGER WORKS) -%if 0%{?suse_version} == 1500 && 0%{?sle_version} == 150100 +# pegtl in Leap 15.1 is too old (< 2.0.0) +# JAVA bindings fail to build +%if 0%{?sle_version} == 150100 %bcond_with java %bcond_with pegtl %else @@ -99,13 +106,13 @@ %define shlib %{vtklib} Name: vtk%{?my_suffix} -Version: 9.0.0 +Version: 9.0.1 Release: 0 %define series 9.0 +Summary: The Visualization Toolkit - A high level 3D visualization library # This is a variant BSD license, a cross between BSD and ZLIB. # For all intents, it has the same rights and restrictions as BSD. # http://fedoraproject.org/wiki/Licensing/BSD#VTKBSDVariant -Summary: The Visualization Toolkit - A high level 3D visualization library License: BSD-3-Clause Group: Productivity/Scientific/Other URL: https://vtk.org/ @@ -113,28 +120,40 @@ Source: https://www.vtk.org/files/release/%{series}/VTK-%{version}.tar.g # FIXME See if packaging can be tweaked to accommodate python-vtk's devel files in a devel package later # We need to use the compat conditionals here to avoid Factory's source validator from tripping up Source99: vtk-rpmlintrc -# PATCH-NEEDS-REBASE -%if 0 -# PATCH-FIX-OPENSUSE 0001-Allow-compilation-on-GLES-platforms.patch VTK issue #17113 stefan.bruens@rwth-aachen.de -- Fix building with Qt GLES builds -Patch2: 0001-Allow-compilation-on-GLES-platforms.patch -%endif # PATCH-FIX-OPENSUSE bundled_libharu_add_missing_libm.patch stefan.bruens@rwth-aachen.de -- Add missing libm for linking (gh#libharu/libharu#213) -Patch3: bundled_libharu_add_missing_libm.patch -# PATCH-FIX-UPSTREAM bundled_exodusii_add_missing_libpthread.patch stefan.bruens@rwth-aachen.de -- Add missing libm for linking (updated to upstream patch by badshah400, see https://gitlab.kitware.com/vtk/vtk/-/merge_requests/6865) -Patch4: bundled_exodusii_add_missing_libpthread.patch -# PATCH-FIX-UPSTREAM vtk-parallelgeometry-dependency.patch badshah400@gmail.com -- Fix a mistake in the dependencies for ParallelGeometry causing build failures for MPI builds -Patch5: vtk-parallelgeometry-dependency.patch -# PATCH-FIX-UPSTREAM vtk-qt-5.15-include-QPainterPath.patch badshah400@gmail.com -- Include QPainterPath to fix build failures against Qt 5.15; patch taken from upstream, see https://gitlab.kitware.com/vtk/vtk/-/merge_requests/6943 -Patch6: vtk-qt-5.15-include-QPainterPath.patch +Patch1: bundled_libharu_add_missing_libm.patch +# PATCH-FIX-UPSTREAM +Patch2: 0001-clean-up-some-old-opengl-es-stuff.patch +# PATCH-FIX-UPSTREAM +Patch3: 0001-expose-1d-texture-options.patch +# PATCH-FIX-UPSTREAM -- prep for GLES patch, VTK issue #17113 stefan.bruens@rwth-aachen.de +Patch4: 0001-Remove-duplicate-check-for-QOpenGLFunctions_3_2_Core.patch +# PATCH-FIX-UPSTREAM 0001-Allow-compilation-on-GLES-platforms.patch VTK issue #17113 stefan.bruens@rwth-aachen.de -- Fix building with Qt GLES builds +Patch5: 0001-Allow-compilation-on-GLES-platforms.patch +# PATCH-FIX-UPSTREAM -- Fix building with Qt GLES builds +Patch6: 0001-Replace-last-glDrawBuffer-call-with-glDrawBuffers-1.patch +# PATCH-FIX-OPENSUSE -- Fix building with Qt GLES builds +Patch7: 0001-Add-missing-guard-required-for-GLES-to-disable-stere.patch +# PATCH-FIX-UPSTREAM -- Fix building with Qt GLES builds +Patch8: 0001-Correct-GL_BACK-GL_BACK_LEFT-mapping-on-GLES.patch +# PATCH-FIX-UPSTREAM -- Fix building with Qt GLES builds +Patch9: 0002-Use-GL_DRAW_BUFFER0-instead-of-GL_DRAW_BUFFER-for-GL.patch +# PATCH-FIX-UPSTREAM +Patch10: 0001-GL_POINT_SPRITE-is-only-available-for-Compatibility-.patch +# PATCH-FIX-OPENSUSE -- GLES - Does no longer apply to upstream code +Patch11: 0002-Guard-GL_LINE_SMOOTH-for-GLES.patch +# PATCH-FIX-UPSTREAM +Patch12: 0001-Guard-glPointSize-with-GL_ES_VERSION_3_0.patch +# PATCH-FIX-UPSTREAM -- https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7098 +Patch13: 0001-Fix-PyVTKAddFile_-function-signature-mismatch.patch +# PATCH-FIX-UPSTREAM -- https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7115 +Patch14: 0001-Replace-invalid-GL_LINE-with-GL_LINES-for-glDrawArra.patch BuildRequires: R-base-devel BuildRequires: chrpath BuildRequires: cmake >= 3.4 BuildRequires: double-conversion-devel -BuildRequires: doxygen BuildRequires: fdupes BuildRequires: gcc-c++ -BuildRequires: gnuplot -BuildRequires: graphviz BuildRequires: hdf5-devel BuildRequires: libboost_graph-devel BuildRequires: libboost_graph_parallel-devel @@ -146,7 +165,6 @@ BuildRequires: python3-devel BuildRequires: python3-numpy-devel BuildRequires: python3-qt5-devel BuildRequires: utfcpp-devel -BuildRequires: wget BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5OpenGL) BuildRequires: pkgconfig(Qt5OpenGLExtensions) @@ -172,10 +190,13 @@ BuildRequires: pkgconfig(netcdf) BuildRequires: pkgconfig(proj) >= 5.0.0 BuildRequires: pkgconfig(sqlite3) BuildRequires: pkgconfig(theora) -# Still required with 8.2.x for PythonTkInter -BuildRequires: pkgconfig(tk) BuildRequires: pkgconfig(xt) BuildRequires: pkgconfig(zlib) +%if %{with documentation} +BuildRequires: doxygen +BuildRequires: gnuplot +BuildRequires: graphviz +%endif %if %{with gl2ps} BuildRequires: gl2ps-devel > 1.4.0 %endif @@ -223,9 +244,10 @@ This package provides the shared libraries for VTK. %package devel Summary: VTK header files for building C++ code -Group: Development/Libraries/C and C++ # not strictly necessary, but required by VTKs cmake files -Requires: %{name}-java = %{version} +Group: Development/Libraries/C and C++ +%{?with_java:Requires: %{name}-java = %{version}} +Requires: %{name}-qt = %{version} Requires: %{shlib} = %{version} Requires: R-core-devel Requires: cmake >= 3.4 @@ -239,7 +261,6 @@ Requires: libmysqlclient-devel Requires: libnetcdf_c++-devel Requires: libtiff-devel Requires: python3-%{name} = %{version} -Requires: python3-%{name} = %{version} Requires: utfcpp-devel %{?with_mpi:Requires: %{mpi_flavor}} %{?with_mpi:Requires: %{mpi_flavor}-devel} @@ -268,6 +289,9 @@ Requires: pkgconfig(zlib) %if %{with pegtl} Requires: pegtl-devel %endif +%if %{with pugixml} +Requires: pugixml-devel +%endif Conflicts: vtk-compat_gl-devel %description devel @@ -363,7 +387,23 @@ languages. %endif %prep -%autosetup -p1 -n VTK-%{version} +%setup -n VTK-%{version} +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%if %{with gles} +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%endif +%patch13 -p1 +%patch14 -p1 # Replace relative path ../../../../VTKData with %%{_datadir}/vtkdata # otherwise it will break on symlinks. @@ -382,8 +422,9 @@ export CXX=g++ export CFLAGS="%{optflags}" export CXXFLAGS="%{optflags}" -# THE %%cmake MACRO SETS CMAKE_SKIP_RPATH=ON FOR LEAP 15.x WHICH CAUSES BUILD FAILURES +# The %%cmake macro sets CMAKE_SKIP_RPATH=ON for Leap 15.x which causes build failures # https://discourse.vtk.org/t/building-fails-generating-wrap-hierarchy-for-vtk-commoncore-unable-to-open-libvtkwrappingtools-so-1 +# -DOpenGL_GL_PREFERENCE:STRING='LEGACY' - see https://gitlab.kitware.com/vtk/vtk/-/merge_requests/6946#note_767329 %cmake \ -DCMAKE_INSTALL_PREFIX:PATH=%{my_prefix} \ -DCMAKE_INSTALL_LIBDIR:PATH=%{_lib} \ @@ -392,6 +433,8 @@ export CXXFLAGS="%{optflags}" -DVTK_INSTALL_PACKAGE_DIR:PATH=%{_lib}/cmake/%{pkgname} \ -DVTK_PYTHON_OPTIONAL_LINK:BOOL=OFF \ -DVTK_BUILD_TESTING:BOOL=ON \ + -DVTK_BUILD_EXAMPLES:BOOL=%{?with_examples:ON}%{!?with_examples:OFF} \ + -DVTK_BUILD_DOCUMENTATION:BOOL=%{?with_documentation:ON}%{!?with_documentation:OFF} \ -DCMAKE_NO_BUILTIN_CHRPATH:BOOL=ON \ %if 0%{?suse_version} <= 1500 -DCMAKE_SKIP_RPATH:BOOL=OFF \ @@ -399,7 +442,8 @@ export CXXFLAGS="%{optflags}" %endif -DVTK_MODULE_ENABLE_VTK_TestingCore=WANT \ -DVTK_MODULE_ENABLE_VTK_TestingRendering=WANT \ - -DOpenGL_GL_PREFERENCE:STRING='GLVND' \ + -DVTK_MODULE_ENABLE_VTK_RenderingContextOpenGL2=YES \ + -DVTK_MODULE_ENABLE_VTK_RenderingFreeTypeFontConfig=YES \ -DVTK_CUSTOM_LIBRARY_SUFFIX="" \ -DVTK_GROUP_ENABLE_Imaging=WANT \ %if %{with mpi} @@ -414,14 +458,16 @@ export CXXFLAGS="%{optflags}" -DVTK_GROUP_ENABLE_Views=WANT \ -DVTK_PYTHON_VERSION=3 \ -DVTK_USE_OGGTHEORA_ENCODER:BOOL=ON \ + -DJava_JAVAH_EXECUTABLE=%{_bindir}/true \ -DVTK_WRAP_JAVA:BOOL=%{?with_java:ON}%{!?with_java:OFF} \ -DVTK_WRAP_PYTHON:BOOL=ON \ -DVTK_USE_EXTERNAL:BOOL=ON \ + -DOpenGL_GL_PREFERENCE:STRING='GLVND' \ + -DVTK_OPENGL_USE_GLES:BOOL=%{?with_gles:ON}%{!?with_gles:OFF} \ -DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps=%{?with_gl2ps:ON}%{!?with_gl2ps:OFF} \ -DVTK_MODULE_USE_EXTERNAL_VTK_libharu=%{?with_haru:ON}%{!?with_haru:OFF} \ -DVTK_MODULE_USE_EXTERNAL_VTK_pugixml=%{?with_pugixml:ON}%{!?with_pugixml:OFF} \ - -DVTK_MODULE_ENABLE_VTK_pegtl=%{?with_pegtl:YES}%{!?with_pegtl:NO} \ - -DVTK_INSTALL_DOC_DIR:PATH=%{_docdir}/%{name}-%{series} + -DVTK_MODULE_ENABLE_VTK_pegtl=%{?with_pegtl:YES}%{!?with_pegtl:NO} #-DVTK_EXTERNAL_LIBHARU_IS_SHARED:BOOL=OFF \ @@ -487,9 +533,9 @@ perl -pi -e's,^,%{my_bindir}/,' examples.list %endif -# MOVE LICENSES TO PROPER DOCDIR INSTEAD OF %%{my_datadir}/licenses -mkdir -p %{buildroot}%{_datadir}/licenses/%{name} -mv %{buildroot}%{my_datadir}/licenses/VTK/* %{buildroot}%{_datadir}/licenses/%{name}/ +# Move licenses to licensedir instead of %%{my_datadir}/licenses +mkdir -p %{buildroot}%{_licensedir} +mv %{buildroot}%{my_datadir}/licenses/VTK %{buildroot}%{_licensedir}/%{name} %fdupes -s %{buildroot} @@ -526,7 +572,9 @@ find %{buildroot} . -name vtk.cpython-3*.pyc -delete # drop unreproducible time- %files devel %license Copyright.txt %license %{_datadir}/licenses/%{name}/ +%if %{without gles} %{my_bindir}/vtkProbeOpenGLVersion +%endif %{my_bindir}/%{pkgname}ParseJava %{my_bindir}/%{pkgname}WrapHierarchy %{my_bindir}/%{pkgname}WrapJava @@ -542,9 +590,11 @@ find %{buildroot} . -name vtk.cpython-3*.pyc -delete # drop unreproducible time- %exclude %{my_libdir}/libvtk*Python*.so %exclude %{my_libdir}/libvtk*Qt*.so +%if %{with documentation} %files devel-doc %license Copyright.txt %{_docdir}/%{name}-%{series} +%endif %if %{with java} %files java