diff --git a/vtk-opensuse-python-metadata.patch b/vtk-opensuse-python-metadata.patch new file mode 100644 index 0000000..b536c2f --- /dev/null +++ b/vtk-opensuse-python-metadata.patch @@ -0,0 +1,45 @@ +Index: VTK-9.0.1/CMakeLists.txt +=================================================================== +--- VTK-9.0.1.orig/CMakeLists.txt ++++ VTK-9.0.1/CMakeLists.txt +@@ -48,6 +48,8 @@ include(vtkCMakeBackports) + + if (VTK_WHEEL_BUILD) + include(vtkWheelPreparation) ++elseif(VTK_OPENSUSE_PYTHON_BUILD) ++ include(vtkPythonMetadataPrepare) + endif () + + include(vtkCompilerChecks) +@@ -474,7 +476,7 @@ install( + + # TODO: HeaderTest exclusions for memcheck. + +-if (VTK_WHEEL_BUILD) ++if (VTK_WHEEL_BUILD OR VTK_OPENSUSE_PYTHON_BUILD) + include(vtkWheelFinalization) + endif () + +Index: VTK-9.0.1/CMake/vtkPythonMetadataPrepare.cmake +=================================================================== +--- /dev/null ++++ VTK-9.0.1/CMake/vtkPythonMetadataPrepare.cmake +@@ -0,0 +1,18 @@ ++# copied from vtkWheelPrepare, but without forcing wheel specific options ++ ++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/vtk-rpmlintrc b/vtk-rpmlintrc index 84e8490..aebdb43 100644 --- a/vtk-rpmlintrc +++ b/vtk-rpmlintrc @@ -1,12 +1,3 @@ -# FIXME: See if packaging can be tweaked to avoid these warnings later -# python-vtk needs these devel files to work -addFilter("python3-vtk.* shlib-policy-name-error") -addFilter("python3-vtk.* shlib-policy-missing-suffix") -addFilter("python3-vtk.* devel-file-in-non-devel-package") -addFilter("python3-vtk-openmpi.* shlib-policy-name-error") -addFilter("python3-vtk-openmpi.* shlib-policy-missing-suffix") -addFilter("python3-vtk-openmpi.* devel-file-in-non-devel-package") - # Upstream does not supply manuals for any binary, suppress warnings addFilter(".* no-manual-page-for-binary") diff --git a/vtk-std_numeric_limits.patch b/vtk-std_numeric_limits.patch new file mode 100644 index 0000000..5cc0721 --- /dev/null +++ b/vtk-std_numeric_limits.patch @@ -0,0 +1,70 @@ +From c7d6a8d81367a4ed92163c059aa3181386eabc24 Mon Sep 17 00:00:00 2001 +From: Ben Boeckel +Date: Mon, 3 May 2021 11:55:27 -0400 +Subject: [PATCH] vtkDataArrayPrivate: include for std::numeric_limits + +See: #18194 +--- + Common/Core/vtkDataArrayPrivate.txx | 1 + + 1 file changed, 1 insertion(+) + +Index: VTK-9.0.1/Common/Core/vtkDataArrayPrivate.txx +=================================================================== +--- VTK-9.0.1.orig/Common/Core/vtkDataArrayPrivate.txx ++++ VTK-9.0.1/Common/Core/vtkDataArrayPrivate.txx +@@ -24,6 +24,7 @@ + #include + #include + #include // for assert() ++#include + #include + + namespace vtkDataArrayPrivate +Index: VTK-9.0.1/Common/Core/vtkGenericDataArrayLookupHelper.h +=================================================================== +--- VTK-9.0.1.orig/Common/Core/vtkGenericDataArrayLookupHelper.h ++++ VTK-9.0.1/Common/Core/vtkGenericDataArrayLookupHelper.h +@@ -25,6 +25,7 @@ + #include "vtkIdList.h" + #include + #include ++#include + #include + #include + +Index: VTK-9.0.1/Common/DataModel/vtkPiecewiseFunction.cxx +=================================================================== +--- VTK-9.0.1.orig/Common/DataModel/vtkPiecewiseFunction.cxx ++++ VTK-9.0.1/Common/DataModel/vtkPiecewiseFunction.cxx +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + #include + #include + +Index: VTK-9.0.1/Filters/HyperTree/vtkHyperTreeGridThreshold.cxx +=================================================================== +--- VTK-9.0.1.orig/Filters/HyperTree/vtkHyperTreeGridThreshold.cxx ++++ VTK-9.0.1/Filters/HyperTree/vtkHyperTreeGridThreshold.cxx +@@ -28,6 +28,7 @@ + #include "vtkHyperTreeGridNonOrientedCursor.h" + + #include ++#include + + vtkStandardNewMacro(vtkHyperTreeGridThreshold); + +Index: VTK-9.0.1/Rendering/Core/vtkColorTransferFunction.cxx +=================================================================== +--- VTK-9.0.1.orig/Rendering/Core/vtkColorTransferFunction.cxx ++++ VTK-9.0.1/Rendering/Core/vtkColorTransferFunction.cxx +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + #include + diff --git a/vtk.changes b/vtk.changes index cfa24ad..cd22ad5 100644 --- a/vtk.changes +++ b/vtk.changes @@ -1,3 +1,33 @@ +------------------------------------------------------------------- +Sat Jun 19 21:04:19 UTC 2021 - Ben Greiner + +- Add vtk-opensuse-python-metadata.patch: + Installing without VTK_BUILD_WHEEL lacks the dist-info/egg-info + metadata. When a user installs python packages which depend + on vtk through pip (into the user home or into a virtualenv), + pip does not recognize the files installed into site-packages + without the metadata and pulls in a big manylinux wheel from + PyPI. We introduce the necessary egg-info metadata in order to + avoid this. +- python3-vtk: Don't own the arch site-packages (%python3_sitearch) + and the toplevel __pycache__ dir, only our own python files. +- Move qt and python .so devel files to main devel package, adjust + rpmlintrc: The devel files are not required by the + python bindings (anymore?). + +------------------------------------------------------------------- +Wed Jun 9 17:21:57 UTC 2021 - Ben Greiner + +- Add vtk-std_numeric_limits.patch in order to fix gcc 11.1 build + https://gitlab.kitware.com/vtk/vtk/-/issues/18194 +- Require %{name}-qt in python3-%{name}: The Python bindings link + to libvtkRenderingQt.so.1, but zypper fails to resolve the + requirement to the correct (non-)mpi flavor -- boo#1187161 +- Change description: The vtk-qt subpackage provides some Qt + libraries, not a designer plugin. +- Support for QtWebkit was removed with vtk 9.0.0: Remove the build + requirement. + ------------------------------------------------------------------- Tue Oct 20 14:06:35 UTC 2020 - Ismail Dönmez diff --git a/vtk.spec b/vtk.spec index c9a55d7..dbed3c2 100644 --- a/vtk.spec +++ b/vtk.spec @@ -1,7 +1,7 @@ # -# spec file for package vtk +# spec file # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -150,6 +150,10 @@ Patch13: 0001-Fix-PyVTKAddFile_-function-signature-mismatch.patch Patch14: 0001-Replace-invalid-GL_LINE-with-GL_LINES-for-glDrawArra.patch # PATCH-FIX-UPSTREAM -- https://gitlab.kitware.com/vtk/vtk/-/issues/18033 Patch15: vtk-freetype-2.10.3-replace-FT_CALLBACK_DEF.patch +# PATCH-FIX-UPSTREAM -- https://gitlab.kitware.com/vtk/vtk/-/issues/18194 +Patch16: vtk-std_numeric_limits.patch +# PATCH-FIX-OPENSUSE -- create python package metadata (egg-info) despite not building a wheel +Patch17: vtk-opensuse-python-metadata.patch BuildRequires: R-base-devel BuildRequires: chrpath BuildRequires: cmake >= 3.4 @@ -166,12 +170,12 @@ BuildRequires: libtiff-devel BuildRequires: python3-devel BuildRequires: python3-numpy-devel BuildRequires: python3-qt5-devel +BuildRequires: python3-setuptools BuildRequires: utfcpp-devel BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5OpenGL) BuildRequires: pkgconfig(Qt5OpenGLExtensions) BuildRequires: pkgconfig(Qt5Sql) -BuildRequires: pkgconfig(Qt5WebKitWidgets) BuildRequires: pkgconfig(Qt5Widgets) BuildRequires: pkgconfig(eigen3) >= 2.91.0 BuildRequires: pkgconfig(expat) @@ -270,7 +274,6 @@ Requires: pkgconfig(Qt5Core) Requires: pkgconfig(Qt5OpenGL) Requires: pkgconfig(Qt5OpenGLExtensions) Requires: pkgconfig(Qt5Sql) -Requires: pkgconfig(Qt5WebKitWidgets) Requires: pkgconfig(Qt5Widgets) Requires: pkgconfig(expat) Requires: pkgconfig(freetype2) @@ -338,6 +341,10 @@ 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 @@ -354,7 +361,7 @@ LOD control). This package provides python 3.x bindings for VTK. %package qt -Summary: Qt Designer plugin for QVTKWidget +Summary: Qt libraries for VTK Group: Development/Libraries/C and C++ Requires: %{shlib} = %{version} Conflicts: vtk-compat_gl-qt @@ -366,7 +373,7 @@ rendering and visualization. VTK includes many advanced algorithms rendering techniques (e.g. hardware-accelerated volume rendering, LOD control). -This package provides a Qt Designer plugin for the QVTKWidget. +This package provides the Qt libraries for VTK. # The examples work with any VTK flavor, just package these once %if "%{flavor}" == "" @@ -407,6 +414,8 @@ languages. %patch13 -p1 %patch14 -p1 %patch15 -p1 +%patch16 -p1 +%patch17 -p1 # Replace relative path ../../../../VTKData with %%{_datadir}/vtkdata # otherwise it will break on symlinks. @@ -460,6 +469,7 @@ export CXXFLAGS="%{optflags}" -DVTK_GROUP_ENABLE_StandAlone=WANT \ -DVTK_GROUP_ENABLE_Views=WANT \ -DVTK_PYTHON_VERSION=3 \ + -DVTK_OPENSUSE_PYTHON_BUILD:BOOL=ON \ -DVTK_USE_OGGTHEORA_ENCODER:BOOL=ON \ -DJava_JAVAH_EXECUTABLE=%{_bindir}/true \ -DVTK_WRAP_JAVA:BOOL=%{?with_java:ON}%{!?with_java:OFF} \ @@ -540,6 +550,16 @@ perl -pi -e's,^,%{my_bindir}/,' examples.list mkdir -p %{buildroot}%{_licensedir} mv %{buildroot}%{my_datadir}/licenses/VTK %{buildroot}%{_licensedir}/%{name} +%if ! %{with mpi} +# install python distribution metadata despite not building a wheel +buildsitearch=%{python3_sitearch} +buildsitearch=${buildsitearch/\/usr/build} +cp build/{setup.py,README.md,MANIFEST.in,requirements.txt,vtk_features.py} ${buildsitearch}/ +pushd ${buildsitearch} +python3 setup.py install_egg_info -d %{buildroot}%{python3_sitearch} +popd +%endif + %fdupes -s %{buildroot} %check @@ -588,10 +608,8 @@ find %{buildroot} . -name vtk.cpython-3*.pyc -delete # drop unreproducible time- %{?with_mpi: %dir %{my_libdir}/cmake/} %{my_libdir}/cmake/%{pkgname}-%{series}/ %{my_incdir}/%{pkgname}-%{series}/ -# VTK JNI, PythonTkinter, QtGUI +# VTK JNI %exclude %{my_libdir}/libvtk*Java.so -%exclude %{my_libdir}/libvtk*Python*.so -%exclude %{my_libdir}/libvtk*Qt*.so %if %{with documentation} %files devel-doc @@ -614,15 +632,15 @@ find %{buildroot} . -name vtk.cpython-3*.pyc -delete # drop unreproducible time- %{my_bindir}/p%{pkgname}python %{my_libdir}/py* %else -%{python3_sitearch}/ +%{python3_sitearch}/vtk.py +%{python3_sitearch}/vtk-%{version}*-info +%{python3_sitearch}/vtkmodules %endif %{my_libdir}/libvtk*Python*.so.1 -%{my_libdir}/libvtk*Python*.so %files qt %license Copyright.txt %{my_libdir}/libvtk*Qt*.so.* -%{my_libdir}/libvtk*Qt*.so %if %{with examples} %if "%{flavor}" == ""