SHA256
1
0
forked from pool/vtk

- Update to version 9.3.1, see:

https://gitlab.kitware.com/vtk/vtk/-/blob/master/Documentation/release/9.3.md
- Add patches:
  * 0001-ioss-update-fmt-includes.patch
- Drop upstream patches:
  * fix_rendering_core_linkage
- New features and bugfixes:
  * The vendored `fmt` library has been updated to 10.1.1.
  * Fix SIGSEGV on `vtkCompositeDataProbeFilter`.
  * Add `ComponentName` in `vtkImageAlgorithm` and subclasses.
  * Fix UT record support in `vtkDICOMParser`
  * Fix for reading binary XML files > 2Gb on Windows.
  * Fix `ResampleWithDataSet` with an HTG source using MPI.
  * Fix `HyperTree` iterator in `ExtractElements` method.
  * Fix `vtkOpenGLRenderWindow::GetZBufferData` in OpenGL ES 3.
  * Fix GPU Ray Cast Volume Rendering with `ModelTransformMatrix`.
  * Fix Off-axis stereo image separation issue.
  * Fix Display Attribute Inheritance `vtkOpenGLGlyph3DMapper`.

OBS-URL: https://build.opensuse.org/package/show/science/vtk?expand=0&rev=193
This commit is contained in:
Atri Bhattacharya 2024-10-08 23:44:04 +00:00 committed by Git OBS Bridge
commit c97ea51671
18 changed files with 2321 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View File

@ -0,0 +1,85 @@
From b035ea7f784a842dda0c3b0dc437514879a873c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sat, 4 Jul 2020 21:04:52 +0200
Subject: [PATCH] Add missing guard required for GLES to disable stereo
rendering
fmt.stereo()/StereoRender will evaluate to false for GLES, guard the whole
block so GL_*_RIGHT is not used.
Change the GL_*_LEFT defines for GLES so it actually refers to a front/
back buffer, otherwise on GLES the invalid constant 0 will be used to
select the front (0x404) and back buffer (0x405). Remove GL_*_RIGHT
defines to avoid any accidental, unguarded use.
---
GUISupport/Qt/QVTKOpenGLWindow.cxx | 5 +++++
Rendering/External/vtkExternalOpenGLRenderWindow.cxx | 2 ++
Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx | 2 ++
ThirdParty/glew/vtk_glew.h.in | 6 ++----
4 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/GUISupport/Qt/QVTKOpenGLWindow.cxx b/GUISupport/Qt/QVTKOpenGLWindow.cxx
index 067e27cf6e..79bd714f58 100644
--- a/GUISupport/Qt/QVTKOpenGLWindow.cxx
+++ b/GUISupport/Qt/QVTKOpenGLWindow.cxx
@@ -259,6 +259,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)
{
@@ -272,6 +273,10 @@ void QVTKOpenGLWindow::paintGL()
this->RenderWindowAdapter->blit(
this->defaultFramebufferObject(), GL_BACK_LEFT, QRect(QPoint(0, 0), deviceSize));
}
+#else
+ this->RenderWindowAdapter->blit(
+ this->defaultFramebufferObject(), GL_BACK, QRect(QPoint(0, 0), deviceSize));
+#endif
ostate->Pop();
}
else
diff --git a/Rendering/External/vtkExternalOpenGLRenderWindow.cxx b/Rendering/External/vtkExternalOpenGLRenderWindow.cxx
index 445bfce802..d870568f99 100644
--- a/Rendering/External/vtkExternalOpenGLRenderWindow.cxx
+++ b/Rendering/External/vtkExternalOpenGLRenderWindow.cxx
@@ -64,12 +64,14 @@ void vtkExternalOpenGLRenderWindow::Start()
for (this->GetRenderers()->InitTraversal(sit);
(renderer = this->GetRenderers()->GetNextRenderer(sit));)
{
+#ifndef GL_ES_VERSION_3_0
if (bufferType == GL_BACK_RIGHT || bufferType == GL_RIGHT || bufferType == GL_FRONT_RIGHT)
{
this->StereoRenderOn();
this->SetStereoTypeToRight();
}
else
+#endif
{
this->SetStereoTypeToLeft();
}
diff --git a/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx b/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx
index 46064d3360..f5b7f6f0c3 100644
--- a/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx
+++ b/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx
@@ -1156,6 +1156,7 @@ void vtkOpenGLRenderWindow::BlitDisplayFramebuffersToHardware()
ostate->vtkglBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+#ifndef GL_ES_VERSION_3_0
if (this->StereoRender && this->StereoType == VTK_STEREO_CRYSTAL_EYES)
{
// bind the read buffer to detach the display framebuffer to be safe
@@ -1168,6 +1169,7 @@ void vtkOpenGLRenderWindow::BlitDisplayFramebuffersToHardware()
ostate->vtkglBlitFramebuffer(0, 0, this->Size[0], this->Size[1], 0, 0, this->Size[0],
this->Size[1], GL_COLOR_BUFFER_BIT, GL_NEAREST);
}
+#endif
ostate->vtkglDrawBuffer(this->DoubleBuffer ? GL_BACK_LEFT : GL_FRONT_LEFT);
// bind the read buffer to detach the display framebuffer to be safe
--
2.33.1

View File

@ -0,0 +1,95 @@
From a08e2a67c1e6694ba2eb2631c7e8e371bd055b46 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sat, 20 Nov 2021 23:26:05 +0100
Subject: [PATCH] Always generate Python Metadata when WRAP_PYTHON is active
Python Metadata in accordance with PEP 314 is not only used by wheels
(PEP 427/PEP 491), but can also used for `python setup.py
install_egg_info`.
The latter can be used to make a system wide VTK installation available
for other python packages (e.g. installed via pip) which require VTK.
Without the metadata, pip will not find it and always try to download the
wheel.
---
CMake/vtkPythonMetadata.cmake | 17 +++++++++++++++++
CMake/vtkWheelPreparation.cmake | 18 -----------------
CMakeLists.txt | 3 ++-
3 files changed, 19 insertions(+), 19 deletions(-)
create mode 100644 CMake/vtkPythonMetadata.cmake
diff --git a/CMake/vtkPythonMetadata.cmake b/CMake/vtkPythonMetadata.cmake
new file mode 100644
index 0000000000..44fb591321
--- /dev/null
+++ b/CMake/vtkPythonMetadata.cmake
@@ -0,0 +1,17 @@
+configure_file(
+ "${CMAKE_CURRENT_LIST_DIR}/setup.py.in"
+ "${CMAKE_BINARY_DIR}/setup.py"
+ @ONLY)
+configure_file(
+ "${CMAKE_CURRENT_LIST_DIR}/MANIFEST.in.in"
+ "${CMAKE_BINARY_DIR}/MANIFEST.in"
+ @ONLY)
+configure_file(
+ "${CMAKE_SOURCE_DIR}/Copyright.txt"
+ "${CMAKE_BINARY_DIR}/LICENSE"
+ COPYONLY)
+configure_file(
+ "${CMAKE_SOURCE_DIR}/README.md"
+ "${CMAKE_BINARY_DIR}/README.md"
+ COPYONLY)
+
diff --git a/CMake/vtkWheelPreparation.cmake b/CMake/vtkWheelPreparation.cmake
index 0a4c4786d0..df56a3d98c 100644
--- a/CMake/vtkWheelPreparation.cmake
+++ b/CMake/vtkWheelPreparation.cmake
@@ -84,22 +84,4 @@ elseif (UNIX)
endif ()
set(VTK_PYTHON_OPTIONAL_LINK ON)
-configure_file(
- "${CMAKE_CURRENT_LIST_DIR}/setup.py.in"
- "${CMAKE_BINARY_DIR}/setup.py"
- @ONLY)
-configure_file(
- "${CMAKE_CURRENT_LIST_DIR}/MANIFEST.in.in"
- "${CMAKE_BINARY_DIR}/MANIFEST.in"
- @ONLY)
-configure_file(
- "${CMAKE_SOURCE_DIR}/Copyright.txt"
- "${CMAKE_BINARY_DIR}/LICENSE"
- COPYONLY)
-configure_file(
- "${CMAKE_SOURCE_DIR}/README.md"
- "${CMAKE_BINARY_DIR}/README.md"
- COPYONLY)
-
-unset(license_file)
unset(wheel_data_dir)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 371ffd61a6..ccd4409251 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -447,6 +447,8 @@ if (VTK_WRAP_PYTHON)
TARGET_SPECIFIC_COMPONENTS "${VTK_TARGET_SPECIFIC_COMPONENTS}"
TARGET VTK::vtkpythonmodules)
+ include(vtkPythonMetadata)
+
if (APPLE AND VTK_WHEEL_BUILD)
list(REMOVE_ITEM CMAKE_INSTALL_RPATH
"@loader_path/.dylibs")
@@ -547,7 +549,7 @@ install(
# TODO: HeaderTest exclusions for memcheck.
-if (VTK_WHEEL_BUILD)
+if (VTK_WRAP_PYTHON)
include(vtkWheelFinalization)
endif ()
--
2.33.1

View File

@ -0,0 +1,77 @@
From 0cf33c4bf04596e368978e663aa4a2ea42289651 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sun, 21 Nov 2021 19:14:37 +0100
Subject: [PATCH] Consider VTK_PYTHON_SITE_PACKAGES_SUFFIX for Python Metadata
files
When building wheels, VTK_PYTHON_SITE_PACKAGES_SUFFIX is ".", so in this
case nothing is changed. For all other builds, e.g. setup.py should be
located in the same directory as e.g. vtk.py, otherwise setup.py fails.
---
CMake/vtkPythonMetadata.cmake | 8 ++++----
CMake/vtkWheelFinalization.cmake | 2 +-
CMakeLists.txt | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/CMake/vtkPythonMetadata.cmake b/CMake/vtkPythonMetadata.cmake
index 44fb591321..f88f9e8aaa 100644
--- a/CMake/vtkPythonMetadata.cmake
+++ b/CMake/vtkPythonMetadata.cmake
@@ -1,17 +1,17 @@
configure_file(
"${CMAKE_CURRENT_LIST_DIR}/setup.py.in"
- "${CMAKE_BINARY_DIR}/setup.py"
+ "${CMAKE_BINARY_DIR}/${VTK_PYTHON_SITE_PACKAGES_SUFFIX}/setup.py"
@ONLY)
configure_file(
"${CMAKE_CURRENT_LIST_DIR}/MANIFEST.in.in"
- "${CMAKE_BINARY_DIR}/MANIFEST.in"
+ "${CMAKE_BINARY_DIR}/${VTK_PYTHON_SITE_PACKAGES_SUFFIX}/MANIFEST.in"
@ONLY)
configure_file(
"${CMAKE_SOURCE_DIR}/Copyright.txt"
- "${CMAKE_BINARY_DIR}/LICENSE"
+ "${CMAKE_BINARY_DIR}/${VTK_PYTHON_SITE_PACKAGES_SUFFIX}/LICENSE"
COPYONLY)
configure_file(
"${CMAKE_SOURCE_DIR}/README.md"
- "${CMAKE_BINARY_DIR}/README.md"
+ "${CMAKE_BINARY_DIR}/${VTK_PYTHON_SITE_PACKAGES_SUFFIX}/README.md"
COPYONLY)
diff --git a/CMake/vtkWheelFinalization.cmake b/CMake/vtkWheelFinalization.cmake
index 23c17fd977..269b31e7d0 100644
--- a/CMake/vtkWheelFinalization.cmake
+++ b/CMake/vtkWheelFinalization.cmake
@@ -62,5 +62,5 @@ foreach (vtk_feature IN LISTS vtk_features)
string(APPEND vtk_feature_entries
" '${vtk_feature}': [],\n")
endforeach ()
-file(WRITE "${CMAKE_BINARY_DIR}/vtk_features.py"
+file(WRITE "${CMAKE_BINARY_DIR}/${VTK_PYTHON_SITE_PACKAGES_SUFFIX}/vtk_features.py"
"FEATURES = {\n${vtk_feature_entries}}\n")
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 90c90f9d46..03f5836a0f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -450,15 +450,15 @@ if (VTK_WRAP_PYTHON)
list(REMOVE_DUPLICATES vtk_required_python_modules)
endif ()
string(REPLACE ";" "\n" vtk_required_python_modules "${vtk_required_python_modules}")
- file(WRITE "${CMAKE_BINARY_DIR}/requirements.txt"
+ file(WRITE "${CMAKE_BINARY_DIR}/${VTK_PYTHON_SITE_PACKAGES_SUFFIX}/requirements.txt"
"${vtk_required_python_modules}\n")
get_property(vtk_web_python_modules GLOBAL
PROPERTY vtk_web_python_modules)
if (vtk_web_python_modules)
list(REMOVE_DUPLICATES vtk_web_python_modules)
endif ()
string(REPLACE ";" "\n" vtk_web_python_modules "${vtk_web_python_modules}")
- file(WRITE "${CMAKE_BINARY_DIR}/requirements_web.txt"
+ file(WRITE "${CMAKE_BINARY_DIR}/${VTK_PYTHON_SITE_PACKAGES_SUFFIX}/requirements_web.txt"
"${vtk_web_python_modules}\n")
get_property(vtk_soabi GLOBAL
PROPERTY _vtk_python_soabi)
--
2.33.1

View File

@ -0,0 +1,39 @@
From 2b930f694c2275b892772857002724b9fdcae6c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
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
@@ -849,6 +849,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
@@ -861,6 +865,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

View File

@ -0,0 +1,72 @@
From 4409560bfae26035cebf474b28097464b9ba4634 Mon Sep 17 00:00:00 2001
From: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
Date: Wed, 4 Sep 2024 18:22:50 -0400
Subject: [PATCH] ioss: update fmt includes
---
ThirdParty/ioss/vtkioss/Ioss_IOFactory.C | 2 ++
ThirdParty/ioss/vtkioss/Ioss_StructuredBlock.C | 2 ++
ThirdParty/ioss/vtkioss/Ioss_Utils.C | 2 ++
ThirdParty/ioss/vtkioss/Ioss_ZoneConnectivity.C | 2 ++
4 files changed, 8 insertions(+)
diff --git a/ThirdParty/ioss/vtkioss/Ioss_IOFactory.C b/ThirdParty/ioss/vtkioss/Ioss_IOFactory.C
index 440f352e0e..c9f0d422a3 100644
--- a/ThirdParty/ioss/vtkioss/Ioss_IOFactory.C
+++ b/ThirdParty/ioss/vtkioss/Ioss_IOFactory.C
@@ -11,7 +11,9 @@
#include <Ioss_Version.h>
#include <cstddef> // for nullptr
#include "vtk_fmt.h"
+#include VTK_FMT(fmt/format.h)
#include VTK_FMT(fmt/ostream.h)
+#include VTK_FMT(fmt/ranges.h)
#include <map> // for _Rb_tree_iterator, etc
#include <ostream> // for basic_ostream, etc
#include <set>
diff --git a/ThirdParty/ioss/vtkioss/Ioss_StructuredBlock.C b/ThirdParty/ioss/vtkioss/Ioss_StructuredBlock.C
index 1609c31fae..9afc17edbb 100644
--- a/ThirdParty/ioss/vtkioss/Ioss_StructuredBlock.C
+++ b/ThirdParty/ioss/vtkioss/Ioss_StructuredBlock.C
@@ -14,7 +14,9 @@
#include <Ioss_SmartAssert.h>
#include <Ioss_StructuredBlock.h>
#include "vtk_fmt.h"
+#include VTK_FMT(fmt/format.h)
#include VTK_FMT(fmt/ostream.h)
+#include VTK_FMT(fmt/ranges.h)
#include <cstddef> // for size_t
#include <numeric>
diff --git a/ThirdParty/ioss/vtkioss/Ioss_Utils.C b/ThirdParty/ioss/vtkioss/Ioss_Utils.C
index 57021abdcb..6a1e2ae243 100644
--- a/ThirdParty/ioss/vtkioss/Ioss_Utils.C
+++ b/ThirdParty/ioss/vtkioss/Ioss_Utils.C
@@ -19,8 +19,10 @@
#include <cstring>
#include "vtk_fmt.h"
#include VTK_FMT(fmt/chrono.h)
+#include VTK_FMT(fmt/core.h)
#include VTK_FMT(fmt/format.h)
#include VTK_FMT(fmt/ostream.h)
+#include VTK_FMT(fmt/ranges.h)
#include <fstream>
#include <sstream>
#include <string>
diff --git a/ThirdParty/ioss/vtkioss/Ioss_ZoneConnectivity.C b/ThirdParty/ioss/vtkioss/Ioss_ZoneConnectivity.C
index 5d324817f2..a1e047f967 100644
--- a/ThirdParty/ioss/vtkioss/Ioss_ZoneConnectivity.C
+++ b/ThirdParty/ioss/vtkioss/Ioss_ZoneConnectivity.C
@@ -8,7 +8,9 @@
#include <Ioss_ZoneConnectivity.h>
#include <cstddef> // for size_t
#include "vtk_fmt.h"
+#include VTK_FMT(fmt/format.h)
#include VTK_FMT(fmt/ostream.h)
+#include VTK_FMT(fmt/ranges.h)
#include <string> // for string
#include <vector> // for vector
--
2.35.3

View File

@ -0,0 +1,132 @@
From 068773541005f8d8f027b373a01c821788439c8b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sun, 21 Nov 2021 22:51:36 +0100
Subject: [PATCH] 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 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 +-
.../ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h | 2 +-
Rendering/External/vtkExternalOpenGLRenderWindow.cxx | 2 +-
Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx | 8 ++++----
Rendering/OpenGL2/vtkOpenGLState.cxx | 12 ++++++------
5 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/Rendering/ContextOpenGL2/vtkOpenGLContextBufferId.cxx b/Rendering/ContextOpenGL2/vtkOpenGLContextBufferId.cxx
index c0e0f8909f..dd6a93bde3 100644
--- a/Rendering/ContextOpenGL2/vtkOpenGLContextBufferId.cxx
+++ b/Rendering/ContextOpenGL2/vtkOpenGLContextBufferId.cxx
@@ -130,8 +130,8 @@ vtkIdType vtkOpenGLContextBufferId::GetPickedItem(int x, int y)
// pixel x,y (instead of pixel 0,0 to work around pixel ownership test).
GLint savedDrawBuffer = GL_BACK_LEFT;
-#ifdef GL_DRAW_BUFFER
- glGetIntegerv(GL_DRAW_BUFFER, &savedDrawBuffer);
+#ifdef GL_DRAW_BUFFER0
+ glGetIntegerv(GL_DRAW_BUFFER0, &savedDrawBuffer);
#endif
vtkOpenGLState::ScopedglEnableDisable dsaver(ostate, GL_DEPTH_TEST);
diff --git a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h
index 29e5f47671..7acb87e25f 100644
--- a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h
+++ b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h
@@ -306,8 +306,8 @@ public:
this->SavedBlend = ostate->GetEnumState(GL_BLEND);
ostate->vtkglGetFloatv(GL_COLOR_CLEAR_VALUE, this->SavedClearColor);
-#ifdef GL_DRAW_BUFFER
- ostate->vtkglGetIntegerv(GL_DRAW_BUFFER, &this->SavedDrawBuffer);
+#ifdef GL_DRAW_BUFFER0
+ ostate->vtkglGetIntegerv(GL_DRAW_BUFFER0, &this->SavedDrawBuffer);
#else
this->SavedDrawBuffer = GL_BACK_LEFT;
#endif
diff --git a/Rendering/External/vtkExternalOpenGLRenderWindow.cxx b/Rendering/External/vtkExternalOpenGLRenderWindow.cxx
index 445bfce802..5e1f2f4b24 100644
--- a/Rendering/External/vtkExternalOpenGLRenderWindow.cxx
+++ b/Rendering/External/vtkExternalOpenGLRenderWindow.cxx
@@ -58,7 +58,7 @@ void vtkExternalOpenGLRenderWindow::Start()
// 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 25b521bd0d..426aa69f08 100644
--- a/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx
+++ b/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx
@@ -794,8 +794,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
@@ -854,8 +854,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 24f23a5c44..aca4e4f247 100644
--- a/Rendering/OpenGL2/vtkOpenGLState.cxx
+++ b/Rendering/OpenGL2/vtkOpenGLState.cxx
@@ -217,8 +217,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 = cs.DrawBinding.GetDrawBuffer(0);
if (sval == GL_BACK_LEFT)
{
@@ -504,8 +504,8 @@ void vtkOpenGLState::vtkglBindFramebuffer(unsigned int target, unsigned int val)
{
cs.DrawBinding.Binding = val;
::glBindFramebuffer(GL_DRAW_FRAMEBUFFER, val);
-#ifdef GL_DRAW_BUFFER
- ::glGetIntegerv(GL_DRAW_BUFFER, (int*)&cs.DrawBinding.DrawBuffers[0]);
+#ifdef GL_DRAW_BUFFER0
+ ::glGetIntegerv(GL_DRAW_BUFFER0, (int*)&cs.DrawBinding.DrawBuffers[0]);
#endif
}
}
@@ -1626,8 +1626,8 @@ void vtkOpenGLState::ResetFramebufferBindings()
{
auto& cs = this->Stack.top();
::glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, (int*)&cs.DrawBinding.Binding);
-#ifdef GL_DRAW_BUFFER
- ::glGetIntegerv(GL_DRAW_BUFFER, (int*)&cs.DrawBinding.DrawBuffers[0]);
+#ifdef GL_DRAW_BUFFER0
+ ::glGetIntegerv(GL_DRAW_BUFFER0, (int*)&cs.DrawBinding.DrawBuffers[0]);
#endif
::glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, (int*)&cs.ReadBinding.Binding);
--
2.33.1

View File

@ -0,0 +1,16 @@
--- a/Rendering/CellGrid/vtkDGOpenGLRenderer.cxx_orig 2023-12-28 06:22:40.696501865 +0100
+++ b/Rendering/CellGrid/vtkDGOpenGLRenderer.cxx 2023-12-28 06:23:24.633470522 +0100
@@ -1046,11 +1046,13 @@
}
// III. Render draw
+#ifndef GL_ES_VERSION_3_0
if (renderer->GetUseImageBasedLighting() && renderer->GetEnvironmentTexture())
{
vtkOpenGLState* ostate = oglRenWin->GetState();
ostate->vtkglEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
}
+#endif
// a. Update shaders
state->CellBO.VAO->Bind();
// state->LastBoundBO = &state->CellBO; // We only bind the one...

3
VTK-9.3.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fdc7b9295225b34e4fdddc49cd06e66e94260cb00efee456e0f66568c9681be9
size 99932810

3
VTK-9.3.1.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8354ec084ea0d2dc3d23dbe4243823c4bfc270382d0ce8d658939fd50061cab8
size 99964158

11
_constraints Normal file
View File

@ -0,0 +1,11 @@
<constraints>
<hardware>
<physicalmemory>
<size unit="G">3</size>
</physicalmemory>
<disk>
<size unit="G">12</size>
</disk>
</hardware>
</constraints>

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>openmpi4</package>
</multibuild>

View File

@ -0,0 +1,13 @@
Index: VTK-9.0.0/ThirdParty/libharu/vtklibharu/CMakeLists.txt
===================================================================
--- VTK-9.0.0.orig/ThirdParty/libharu/vtklibharu/CMakeLists.txt
+++ VTK-9.0.0/ThirdParty/libharu/vtklibharu/CMakeLists.txt
@@ -68,6 +68,8 @@ if(PNG_FOUND)
find_library(M_LIB m)
endif ()
+link_libraries(m)
+
# =======================================================================
# configure header files, add compiler flags
# =======================================================================

View File

@ -0,0 +1,18 @@
--- a/Rendering/LICOpenGL2/vtk.module_orig 2023-12-27 17:36:03.966016939 +0100
+++ b/Rendering/LICOpenGL2/vtk.module 2023-12-27 17:36:40.199591808 +0100
@@ -14,6 +14,7 @@
VTK::CommonDataModel
VTK::CommonExecutionModel
VTK::RenderingOpenGL2
+ VTK::RenderingCore
PRIVATE_DEPENDS
VTK::CommonMath
VTK::CommonSystem
@@ -22,7 +23,6 @@
VTK::IOXML
VTK::ImagingCore
VTK::ImagingSources
- VTK::RenderingCore
VTK::glew
VTK::opengl
VTK::vtksys

11
vtk-rpmlintrc Normal file
View File

@ -0,0 +1,11 @@
# Upstream does not supply manuals for any binary, suppress warnings
addFilter(".* no-manual-page-for-binary")
# This is not a versioned shared lib, and not used by anything other than
# vtk's java bindings, simply package it with the vtk-java subpackage
addFilter("vtk-java.* shlib-policy-name-error")
addFilter("vtk-java.* shlib-policy-missing-suffix")
addFilter("vtk-java.* devel-file-in-non-devel-package")
addFilter("vtk-openmpi-java.* shlib-policy-name-error")
addFilter("vtk-openmpi-java.* shlib-policy-missing-suffix")
addFilter("vtk-openmpi-java.* devel-file-in-non-devel-package")

1049
vtk.changes Normal file

File diff suppressed because it is too large Load Diff

670
vtk.spec Normal file
View File

@ -0,0 +1,670 @@
#
# spec file
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global flavor @BUILD_FLAVOR@%{nil}
%bcond_with examples
%bcond_with documentation
%bcond_with testing
%ifarch %arm aarch64
%bcond_without gles
%else
%bcond_with gles
%endif
%define pkgname vtk
# pugixml in Leap 15.x is too old
# fmt in Leap 15.x is too old
# Need haru/hpdf version with HPDF_SHADING, i.e. >= 2.4.0
# PEGTL >= 3.0 not supported, https://gitlab.kitware.com/vtk/vtk/-/issues/18151
%if 0%{?suse_version} <= 1500
%bcond_with fast_float
%bcond_with fmt
%bcond_with haru
%if 0%{?sle_version} <= 150400
%bcond_without pegtl
%else
%bcond_with pegtl
%endif
%bcond_with pugixml
%else
%bcond_without fast_float
%bcond_without fmt
%bcond_without haru
%bcond_with pegtl
%bcond_without pugixml
%endif
%bcond_without gl2ps
%bcond_without java
%if "%{flavor}" == ""
%define my_suffix %{nil}
%define my_prefix %_prefix
%define my_bindir %_bindir
%define my_libdir %_libdir
%define my_incdir %_includedir
%define my_datadir %_datadir
%endif
%if "%{flavor}" == "openmpi4"
%{?DisOMPI4}
%define my_suffix -openmpi4
%define mpi_flavor openmpi4
%define mpiprefix %{_libdir}/mpi/gcc/%{mpi_flavor}
%endif
%if "%{flavor}" == "openmpi5"
%{?DisOMPI5}
%define my_suffix -openmpi5
%define mpi_flavor openmpi5
%define mpiprefix %{_libdir}/mpi/gcc/%{mpi_flavor}
%endif
%{?mpi_flavor:%{bcond_without mpi}}%{!?mpi_flavor:%{bcond_with mpi}}
%if %{with mpi}
%define my_prefix %{mpiprefix}
%define my_bindir %{my_prefix}/bin
%define my_libdir %{my_prefix}/%{_lib}/
%define my_incdir %{my_prefix}/include/
%define my_datadir %{my_prefix}/share/
%endif
%define vtklib lib%{pkgname}1%{?my_suffix}
%define shlib %{vtklib}
Name: vtk%{?my_suffix}
Version: 9.3.1
Release: 0
%define series 9.3
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
License: BSD-3-Clause
Group: Productivity/Scientific/Other
URL: https://vtk.org/
Source: https://www.vtk.org/files/release/%{series}/VTK-%{version}.tar.gz
# 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-FIX-OPENSUSE bundled_libharu_add_missing_libm.patch stefan.bruens@rwth-aachen.de -- Add missing libm for linking (gh#libharu/libharu#213)
Patch1: bundled_libharu_add_missing_libm.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-OPENSUSE -- Fix building with Qt GLES builds
Patch10: Do-not-request-CUBE_MAP_SEAMLESS-on-GLES.patch
# PATCH-FIX-UPSTREAM -- Always create python package metadata (egg-info)
Patch17: 0001-Always-generate-Python-Metadata-when-WRAP_PYTHON-is-.patch
# PATCH-FIX-UPSTREAM -- Copy generated metadata to the right directory
Patch18: 0001-Consider-VTK_PYTHON_SITE_PACKAGES_SUFFIX-for-Python-.patch
# PATCH-FIX-UPSTREAM -- Update fmt includes in ioss thirdparty package
Patch19: 0001-ioss-update-fmt-includes.patch
BuildRequires: cgns-devel
BuildRequires: chrpath
BuildRequires: cmake >= 3.12
BuildRequires: double-conversion-devel
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: hdf5-devel
BuildRequires: libboost_graph-devel
BuildRequires: libboost_graph_parallel-devel
BuildRequires: libboost_serialization-devel
BuildRequires: libjpeg-devel
BuildRequires: libmysqlclient-devel
BuildRequires: libtiff-devel
BuildRequires: python3-devel
BuildRequires: python3-numpy-devel
BuildRequires: python3-qt5-devel
BuildRequires: python3-setuptools
BuildRequires: utfcpp-devel
BuildRequires: cmake(Verdict)
BuildRequires: cmake(nlohmann_json)
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5OpenGL)
BuildRequires: pkgconfig(Qt5OpenGLExtensions)
BuildRequires: pkgconfig(Qt5Sql)
BuildRequires: pkgconfig(Qt5Widgets)
BuildRequires: pkgconfig(eigen3) >= 3.3.9
BuildRequires: pkgconfig(expat)
BuildRequires: pkgconfig(freetype2) >= 2.11.0
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(glew)
BuildRequires: pkgconfig(jsoncpp)
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavdevice)
BuildRequires: pkgconfig(libavformat)
BuildRequires: pkgconfig(libavutil)
BuildRequires: pkgconfig(libiodbc)
BuildRequires: pkgconfig(liblz4) >= 1.8.0
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(libswscale)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(netcdf)
BuildRequires: pkgconfig(proj) >= 5.0.0
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(theora)
BuildRequires: pkgconfig(xt)
BuildRequires: pkgconfig(zlib)
%if %{with documentation}
BuildRequires: doxygen
BuildRequires: gnuplot
BuildRequires: graphviz
%endif
%if %{with fmt}
BuildRequires: fmt-devel > 9.0
%endif
%if %{with gl2ps}
BuildRequires: gl2ps-devel > 1.4.0
%endif
%if %{with haru}
BuildRequires: libharu-devel >= 2.4.0
%endif
%if %{with java}
BuildRequires: java-devel >= 1.8
%endif
%if %{with mpi}
BuildRequires: %{mpi_flavor}-devel
BuildRequires: hdf5-%{mpi_flavor}-devel
BuildRequires: libboost_mpi-devel
BuildRequires: netcdf-%{mpi_flavor}-devel
BuildRequires: python3-mpi4py-devel
%endif
%if %{with fast_float}
BuildRequires: cmake(FastFloat)
%endif
%if %{with pugixml}
BuildRequires: pkgconfig(pugixml) >= 1.11
%endif
%if %{with pegtl}
BuildRequires: (pegtl-devel >= 2.0.0 with pegtl-devel < 3.0)
%endif
%if %{with testing}
BuildRequires: cli11-devel
BuildRequires: vtkdata = %{version}
%endif
%description
VTK is a software system for image processing, 3D graphics, volume
rendering and visualization. VTK includes many advanced algorithms
(e.g. surface reconstruction, implicit modelling, decimation) and
rendering techniques (e.g. hardware-accelerated volume rendering,
LOD control).
%package -n %{shlib}
Summary: The Visualization Toolkit - A high level 3D visualization library
Group: System/Libraries
Conflicts: libvtkcompat_gl1
Provides: %{name} = %{version}
%description -n %{shlib}
VTK is a software system for image processing, 3D graphics, volume
rendering and visualization. VTK includes many advanced algorithms
(e.g. surface reconstruction, implicit modelling, decimation) and
rendering techniques (e.g. hardware-accelerated volume rendering,
LOD control).
This package provides the shared libraries for VTK.
%package devel
Summary: VTK header files for building C++ code
Group: Development/Libraries/C and C++
Requires: %{name}-qt = %{version}
Requires: %{shlib} = %{version}
Requires: cgns-devel
Requires: cmake >= 3.4
Requires: double-conversion-devel
%{?with_fmt:Requires: fmt-devel}
Requires: gcc-c++
%{?with_gl2ps:Requires: gl2ps-devel}
Requires: hdf5-devel
%{?with_mpi:Requires: hdf5-%{mpi_flavor}-devel}
Requires: libjpeg-devel
Requires: libmysqlclient-devel
Requires: libnetcdf_c++-devel
Requires: libtiff-devel
# not strictly necessary, but required by VTKs cmake files
Requires: python3-%{name} = %{version}
Requires: utfcpp-devel
%{?with_mpi:Requires: %{mpi_flavor}}
%{?with_mpi:Requires: %{mpi_flavor}-devel}
%{?with_fast_float:Requires: cmake(FastFloat)}
Requires: cmake(Verdict)
Requires: cmake(nlohmann_json)
Requires: pkgconfig(Qt5Core)
Requires: pkgconfig(Qt5OpenGL)
Requires: pkgconfig(Qt5OpenGLExtensions)
Requires: pkgconfig(Qt5Sql)
Requires: pkgconfig(Qt5Widgets)
Requires: pkgconfig(expat)
Requires: pkgconfig(freetype2)
Requires: pkgconfig(gl)
Requires: pkgconfig(jsoncpp)
Requires: pkgconfig(libavcodec)
Requires: pkgconfig(libavdevice)
Requires: pkgconfig(libavformat)
Requires: pkgconfig(libavutil)
Requires: pkgconfig(libiodbc)
Requires: pkgconfig(liblz4) >= 1.7.3
Requires: pkgconfig(liblzma)
Requires: pkgconfig(libpng)
Requires: pkgconfig(libswscale)
Requires: pkgconfig(netcdf)
Requires: pkgconfig(theora)
Requires: pkgconfig(zlib)
%if %{with pegtl}
Requires: (pegtl-devel >= 2.0.0 with pegtl-devel < 3.0)
%endif
%if %{with pugixml}
Requires: pkgconfig(pugixml) >= 1.11
%endif
Conflicts: vtk-compat_gl-devel
%description devel
VTK is a software system for image processing, 3D graphics, volume
rendering and visualization. VTK includes many advanced algorithms
(e.g. surface reconstruction, implicit modelling, decimation) and
rendering techniques (e.g. hardware-accelerated volume rendering,
LOD control).
This provides development libraries and header files required to
compile C++ programs that use VTK to do 3D visualisation.
%package java-devel
Summary: Develoment files for VTK Java bindings
Group: Development/Libraries/C and C++
Requires: %{name}-devel = %{version}
Requires: %{name}-java = %{version}
Requires: java-devel >= 1.8
Provides: %{name}-devel:%{my_libdir}/libvtkJava.so
%description java-devel
VTK is a software system for image processing, 3D graphics, volume
rendering and visualization. VTK includes many advanced algorithms
(e.g. surface reconstruction, implicit modelling, decimation) and
rendering techniques (e.g. hardware-accelerated volume rendering,
LOD control).
This provides the Java part of the development files.
%package devel-doc
Summary: VTK API documentation
Group: Documentation/HTML
%description devel-doc
VTK is a software system for image processing, 3D graphics, volume
rendering and visualization. VTK includes many advanced algorithms
(e.g. surface reconstruction, implicit modelling, decimation) and
rendering techniques (e.g. hardware-accelerated volume rendering,
LOD control).
This provides the VTK API documentation useful for developing
programs that use VTK to do 3D visualisation.
%package java
Summary: Java bindings for VTK
Group: Development/Libraries/Java
Requires: %{shlib} = %{version}
Conflicts: vtk-compat_gl-java
%description java
VTK is a software system for image processing, 3D graphics, volume
rendering and visualization. VTK includes many advanced algorithms
(e.g. surface reconstruction, implicit modelling, decimation) and
rendering techniques (e.g. hardware-accelerated volume rendering,
LOD control).
This package provides java bindings for VTK.
%package -n python3-%{name}
Summary: Python bindings for VTK
Group: Development/Libraries/Python
# explicitly require the correct mpi flavor, because the automatic
# rpm requirements generator for shared libs fails to distinguish
# between them -- boo#1187161
Requires: %{name}-qt = %{version}
Requires: %{shlib} = %{version}
%{?with_mpi:Requires: python3-mpi4py}
Requires: python3-numpy
Requires: python3-qt5
Conflicts: python3-vtk-compat_gl
%description -n python3-%{name}
VTK is a software system for image processing, 3D graphics, volume
rendering and visualization. VTK includes many advanced algorithms
(e.g. surface reconstruction, implicit modelling, decimation) and
rendering techniques (e.g. hardware-accelerated volume rendering,
LOD control).
This package provides python 3.x bindings for VTK.
%package qt
Summary: Qt libraries for VTK
Group: Development/Libraries/C and C++
Requires: %{shlib} = %{version}
Conflicts: vtk-compat_gl-qt
%description qt
VTK is a software system for image processing, 3D graphics, volume
rendering and visualization. VTK includes many advanced algorithms
(e.g. surface reconstruction, implicit modelling, decimation) and
rendering techniques (e.g. hardware-accelerated volume rendering,
LOD control).
This package provides the Qt libraries for VTK.
# The examples work with any VTK flavor, just package these once
%if "%{flavor}" == ""
%package examples
Summary: Examples for VTK
Group: Documentation/Other
Recommends: vtkdata = %{version}
Conflicts: vtk-compat_gl-examples
%description examples
VTK is a software system for image processing, 3D graphics, volume
rendering and visualization. VTK includes many advanced algorithms
(e.g. surface reconstruction, implicit modelling, decimation) and
rendering techniques (e.g. hardware-accelerated volume rendering,
LOD control).
This package contains many examples showing how to use VTK.
Examples are available in the C++, Tcl, Python and Java programming
languages.
%endif
%prep
%setup -n VTK-%{version}
%patch -P 1 -p1
%if %{with gles}
%patch -P 7 -p1
%patch -P 8 -p1
%patch -P 9 -p1
%patch -P 10 -p1
%endif
%patch -P 17 -p1
%patch -P 18 -p1
%patch -P 19 -p1
# Replace relative path ../../../../VTKData with %%{_datadir}/vtkdata
# otherwise it will break on symlinks.
grep -rl '\.\./\.\./\.\./\.\./VTKData' . | xargs -r perl -pi -e's,\.\./\.\./\.\./\.\./VTKData,%{_datadir}/vtkdata,g'
# Fix erroneous dependency on sqlite3 binary
sed -i -e '/set(vtk_sqlite_build_binary 1)/ s/.*/#\0/' CMakeLists.txt
# Allow testing also without external downloads - https://gitlab.kitware.com/vtk/vtk/-/issues/18692
sed -i -e '/set(vtk_enable_tests "OFF")/ s/.*/#\0/' CMakeLists.txt
# Allow other versions for fast_float
sed -i -e '/VERSION .*/ d' ThirdParty/fast_float/CMakeLists.txt
%build
%if %{with mpi}
source %{mpiprefix}/bin/mpivars.sh
export CC=mpicc
export CXX=mpicxx
%else
export CC=gcc
export CXX=g++
%endif
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
# 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
# Disable ioss module for MPI flavors, fails to build with 9.1.0, see MR 8565.
%cmake \
-DCMAKE_INSTALL_PREFIX:PATH=%{my_prefix} \
-DCMAKE_INSTALL_LIBDIR:PATH=%{_lib} \
-DCMAKE_INSTALL_DOCDIR:PATH=%{_docdir}/%{name}-%{series} \
-DCMAKE_INSTALL_QMLDIR:PATH=%{my_libdir}/qt5/qml \
-DVTK_FORBID_DOWNLOADS:BOOL=ON \
-DVTK_PYTHON_OPTIONAL_LINK:BOOL=OFF \
-DVTK_BUILD_TESTING:BOOL=%{?with_testing:ON}%{!?with_testing:OFF} \
-DVTK_DATA_STORE:PATH=/usr/share/vtkdata/.ExternalData \
-DExternalData_NO_SYMLINKS: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 \
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON \
%endif
-DVTK_MODULE_ENABLE_VTK_TestingCore=WANT \
-DVTK_MODULE_ENABLE_VTK_TestingRendering=WANT \
-DVTK_MODULE_ENABLE_VTK_RenderingContextOpenGL2=YES \
-DVTK_MODULE_ENABLE_VTK_RenderingLICOpenGL2=%{?with_gles:NO}%{!?with_gles:YES} \
-DVTK_MODULE_ENABLE_VTK_RenderingFreeTypeFontConfig=YES \
-DVTK_CUSTOM_LIBRARY_SUFFIX="" \
-DVTK_GROUP_ENABLE_Imaging=WANT \
%if %{with mpi}
-DVTK_USE_MPI:BOOL=ON \
-DVTK_GROUP_ENABLE_MPI=WANT \
%else
-DVTK_USE_MPI:BOOL=OFF \
%endif
-DVTK_GROUP_ENABLE_Qt=WANT \
-DVTK_GROUP_ENABLE_Rendering=WANT \
-DVTK_GROUP_ENABLE_StandAlone=WANT \
-DVTK_GROUP_ENABLE_Views=WANT \
-DVTK_PYTHON_VERSION=3 \
-DVTK_WRAP_JAVA:BOOL=%{?with_java:ON}%{!?with_java:OFF} \
-DVTK_JAVA_SOURCE_VERSION:STRING='1.8' \
-DVTK_JAVA_TARGET_VERSION:STRING='1.8' \
-DVTK_WRAP_PYTHON:BOOL=ON \
-DOpenGL_GL_PREFERENCE:STRING='GLVND' \
-DVTK_OPENGL_USE_GLES:BOOL=%{?with_gles:ON}%{!?with_gles:OFF} \
-DVTK_USE_EXTERNAL:BOOL=ON \
-DVTK_MODULE_USE_EXTERNAL_VTK_exprtk:BOOL=OFF \
-DVTK_MODULE_USE_EXTERNAL_VTK_fast_float:BOOL=%{?with_fast_float:ON}%{!?with_fast_float:OFF} \
-DVTK_MODULE_USE_EXTERNAL_VTK_fmt:BOOL=%{?with_fmt:ON}%{!?with_fmt:OFF} \
-DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps=%{?with_gl2ps:ON}%{!?with_gl2ps:OFF} \
-DVTK_MODULE_USE_EXTERNAL_VTK_ioss:BOOL=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_ioss:BOOL=%{!?with_mpi:WANT}%{?with_mpi:NO} \
-DVTK_MODULE_ENABLE_VTK_pegtl=%{?with_pegtl:YES}%{!?with_pegtl:NO} \
-DVTK_MODULE_ENABLE_VTK_zfp:BOOL=NO \
%{nil}
%cmake_build
# Remove executable bits from sources (some of which are generated)
find . -name \*.c -o -name \*.cxx -o -name \*.h -o -name \*.hxx -o -name \*.gif -exec chmod -x "{}" "+"
%install
%cmake_install
%if %{with examples}
# List of executable examples
cat > examples.list << EOF
AmbientSpheres
Arrays
BalloonWidget
BandedContours
Cone
Cone2
Cone3
Cone4
Cone5
Cone6
Cube
Cylinder
Delaunay3D
Delaunay3DAlpha
DiffuseSpheres
DumpXMLFile
FilledContours
FixedPointVolumeRayCastMapperCT
GPURenderDemo
Generate2DAMRDataSetWithPulse
Generate3DAMRDataSetWithPulse
GenerateCubesFromLabels
GenerateModelsFromLabels
HierarchicalBoxPipeline
ImageSlicing
LabeledMesh
Medical1
Medical2
Medical3
Medical4
MultiBlock
ParticleReader
RGrid
SGrid
Slider
Slider2D
SpecularSpheres
TubesWithVaryingRadiusAndColors
finance
EOF
# Install examples
%if "%{flavor}" == ""
for file in `cat examples.list`; do
install -p build/bin/$file %{buildroot}%{my_bindir}
done
perl -pi -e's,^,%{my_bindir}/,' examples.list
%endif
%endif
# Move licenses to licensedir instead of %%{my_datadir}/licenses
mkdir -p %{buildroot}%{_licensedir}
mv %{buildroot}%{my_datadir}/licenses/VTK %{buildroot}%{_licensedir}/%{name}
%if ! %{with mpi}
# Generate and install python distribution metadata
pushd build/%{_lib}/python%{python3_version}/site-packages/
python3 setup.py install_egg_info -d %{buildroot}%{python3_sitearch}
popd
%endif
%fdupes %{buildroot}
%check
# Make sure the python library is at least importable
%if %{with mpi}
source %{mpiprefix}/bin/mpivars.sh
export _PYTHON_MPI_PREFIX=`echo %{buildroot}%{my_libdir}/py*/site-packages/`
export PYTHONPATH=$_PYTHON_MPI_PREFIX:$PYTHONPATH
%endif
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{my_libdir}
export PYTHONPATH=$PYTHONPATH:%{buildroot}%{python3_sitearch}
PYTHONDONTWRITEBYTECODE=1 python3 -c "import vtk"
find %{buildroot} . -name vtk.cpython-3*.pyc -print -delete # drop unreproducible time-based .pyc file
# Unittests
%if %{with testing}
%ctest
%endif
%post -n %{shlib} -p /sbin/ldconfig
%postun -n %{shlib} -p /sbin/ldconfig
%if %{with java}
%post java -p /sbin/ldconfig
%postun java -p /sbin/ldconfig
%endif
%post qt -p /sbin/ldconfig
%postun qt -p /sbin/ldconfig
%post -n python3-%{name} -p /sbin/ldconfig
%postun -n python3-%{name} -p /sbin/ldconfig
%files -n %{shlib}
%license Copyright.txt
%{my_libdir}/lib*.so.*
%exclude %{my_libdir}/libvtk*Qt*.so.*
%exclude %{my_libdir}/libvtk*Python*.so.*
%files devel
%license Copyright.txt
%license %{_datadir}/licenses/%{name}/
%if %{without gles}
%{my_bindir}/vtkProbeOpenGLVersion
%endif
%{my_bindir}/%{pkgname}WrapHierarchy
# Should go into java-devel, but referenced by VTK-targets*.cmake
%{my_bindir}/%{pkgname}WrapJava
%{my_bindir}/%{pkgname}ParseJava
%{my_bindir}/%{pkgname}WrapPython
%{my_bindir}/%{pkgname}WrapPythonInit
%{my_libdir}/*.so
%{my_libdir}/vtk-%{series}
%{?with_mpi: %dir %{my_libdir}/cmake/}
%{my_libdir}/cmake/%{pkgname}-%{series}/
%{my_incdir}/%{pkgname}-%{series}/
# VTK JNI
%exclude %{my_libdir}/libvtkJava.so
%exclude %{my_libdir}/cmake/%{pkgname}-%{series}/VTKJava-*.cmake
%if %{with documentation}
%files devel-doc
%license Copyright.txt
%{_docdir}/%{name}-%{series}
%endif
%if %{with java}
%files java
%license Copyright.txt
# VTK JNI
%{my_libdir}/java/
%files java-devel
%{my_libdir}/libvtkJava.so
%{my_libdir}/cmake/%{pkgname}-%{series}/VTKJava-*.cmake
%endif
%files -n python3-%{name}
%license Copyright.txt
%{my_bindir}/%{pkgname}python
%{my_libdir}/libvtk*Python*.so.*
%if %{with mpi}
%{my_bindir}/p%{pkgname}python
%{my_libdir}/py*
%else
%{python3_sitearch}/vtk.py
%{python3_sitearch}/vtk-%{version}*-info
%{python3_sitearch}/vtkmodules
%endif
%files qt
%license Copyright.txt
%{my_libdir}/libvtk*Qt*.so.*
%if %{with mpi}
%dir %{my_libdir}/qt5
%{my_libdir}/qt5/qml
%else
%{_libqt5_archdatadir}/qml
%endif
%if %{with examples}
%if "%{flavor}" == ""
%files examples -f examples.list
%license Copyright.txt
%endif
%endif
%changelog