SHA256
1
0
forked from pool/vtk

Accepting request 810514 from home:badshah400:branches:science

* Fix build failures against Qt 5.15 (see current staging:adi:100) with upstream patch
* Get around %cmake's RPATH weirdness for Leap to make builds successful again.
* Disbale pegtl module when pegtl >= 2.0 is unavailable (Leap 15.1).
* Disable java bindings for Leap 15.1 due to inavailability of javah.

OBS-URL: https://build.opensuse.org/request/show/810514
OBS-URL: https://build.opensuse.org/package/show/science/vtk?expand=0&rev=157
This commit is contained in:
Dirk Stoecker 2020-06-03 15:39:23 +00:00 committed by Git OBS Bridge
parent be13127c36
commit 713745e6cb
3 changed files with 107 additions and 29 deletions

View File

@ -0,0 +1,36 @@
From 797f28697d5ba50c1fa2bc5596af626a3c277826 Mon Sep 17 00:00:00 2001
From: "Andrew J. P. Maclean" <andrew.amaclean@gmail.com>
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 <QImage>
#include <QMap>
#include <QPainter>
+#include <QPainterPath>
#include <QPair>
#include <QPixmap>
#include <QTextDocument>
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 <QFontMetrics>
#include <QImage>
#include <QPainter>
+#include <QPainterPath>
#include <QPixmap>
#include <QString>
#include <QTextDocument>
--
2.26.2

View File

@ -1,3 +1,21 @@
-------------------------------------------------------------------
Sun May 31 20:28:03 UTC 2020 - Atri Bhattacharya <badshah400@gmail.com>
- Add vtk-qt-5.15-include-QPainterPath.patch: Include QPainterPath
to fix build failures against Qt 5.15; patch taken from
upstream, see
<https://gitlab.kitware.com/vtk/vtk/-/merge_requests/6943>.
- The %%cmake macro sets CMAKE_SKIP_RPATH=ON for Leap 15.x which
causes build failures; set it to OFF and set
CMAKE_SKIP_INSTALL_RPATH=ON for openSUSE <= 1500. See
<https://discourse.vtk.org/t/building-fails-generating-wrap-hierarchy-for-vtk-commoncore-unable-to-open-libvtkwrappingtools-so-1>.
- Build without pegtl for distributions where pegtl > 2.0 is
unavailable (Leap 15.1).
- Disable java bindings for Leap 15.1 only where cmake still
searches for the javah binary (and setting it to %{_bindir}/true
seems to no longer work).
- Run ld post scripts for vtk-qt.
------------------------------------------------------------------- -------------------------------------------------------------------
Fri May 8 13:33:26 UTC 2020 - Atri Bhattacharya <badshah400@gmail.com> Fri May 8 13:33:26 UTC 2020 - Atri Bhattacharya <badshah400@gmail.com>

View File

@ -29,6 +29,7 @@
%define pkgname vtk %define pkgname vtk
# PUGIXML, GL2PS IN LEAPS ARE TOO OLD
%if 0%{?suse_version} <= 1500 %if 0%{?suse_version} <= 1500
%bcond_with pugixml %bcond_with pugixml
%bcond_with gl2ps %bcond_with gl2ps
@ -36,9 +37,19 @@
%bcond_without pugixml %bcond_without pugixml
%bcond_without gl2ps %bcond_without gl2ps
%endif %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
%bcond_with java
%bcond_with pegtl
%else
%bcond_without java
%bcond_without pegtl
%endif
# Need patched version with HPDF_SHADING # Need patched version with HPDF_SHADING
%bcond_with haru %bcond_with haru
# Need unrelased version > 1.4.0 with e.g. gl2psTextOptColorBL
%if "%{flavor}" == "" %if "%{flavor}" == ""
%define my_suffix %{nil} %define my_suffix %{nil}
@ -113,6 +124,8 @@ Patch3: bundled_libharu_add_missing_libm.patch
Patch4: bundled_exodusii_add_missing_libpthread.patch 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 # 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 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
BuildRequires: R-base-devel BuildRequires: R-base-devel
BuildRequires: chrpath BuildRequires: chrpath
BuildRequires: cmake >= 3.4 BuildRequires: cmake >= 3.4
@ -120,36 +133,16 @@ BuildRequires: double-conversion-devel
BuildRequires: doxygen BuildRequires: doxygen
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: gcc-c++ BuildRequires: gcc-c++
%if %{with gl2ps}
BuildRequires: gl2ps-devel > 1.4.0
%endif
BuildRequires: gnuplot BuildRequires: gnuplot
BuildRequires: graphviz BuildRequires: graphviz
%if %{with mpi}
BuildRequires: hdf5-%{mpi_flavor}-devel
%endif
BuildRequires: hdf5-devel BuildRequires: hdf5-devel
BuildRequires: java-devel
BuildRequires: libboost_graph-devel BuildRequires: libboost_graph-devel
BuildRequires: libboost_graph_parallel-devel BuildRequires: libboost_graph_parallel-devel
BuildRequires: libboost_serialization-devel BuildRequires: libboost_serialization-devel
%if %{with mpi}
BuildRequires: libboost_mpi-devel
%endif
%if %{with haru}
BuildRequires: libharu-devel > 2.3.0
%endif
BuildRequires: libjpeg-devel BuildRequires: libjpeg-devel
BuildRequires: libmysqlclient-devel BuildRequires: libmysqlclient-devel
BuildRequires: libtiff-devel BuildRequires: libtiff-devel
BuildRequires: pegtl-devel >= 2.0.0
%if %{with mpi}
BuildRequires: %{mpi_flavor}-devel
%endif
BuildRequires: python3-devel BuildRequires: python3-devel
%if %{with mpi}
BuildRequires: python3-mpi4py-devel
%endif
BuildRequires: python3-numpy-devel BuildRequires: python3-numpy-devel
BuildRequires: python3-qt5-devel BuildRequires: python3-qt5-devel
BuildRequires: utfcpp-devel BuildRequires: utfcpp-devel
@ -176,19 +169,35 @@ BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(libswscale) BuildRequires: pkgconfig(libswscale)
BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(netcdf) BuildRequires: pkgconfig(netcdf)
%if %{with mpi}
BuildRequires: netcdf-%{mpi_flavor}-devel
%endif
BuildRequires: pkgconfig(proj) >= 5.0.0 BuildRequires: pkgconfig(proj) >= 5.0.0
%if %{with pugixml}
BuildRequires: pkgconfig(pugixml)
%endif
BuildRequires: pkgconfig(sqlite3) BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(theora) BuildRequires: pkgconfig(theora)
# Still required with 8.2.x for PythonTkInter # Still required with 8.2.x for PythonTkInter
BuildRequires: pkgconfig(tk) BuildRequires: pkgconfig(tk)
BuildRequires: pkgconfig(xt) BuildRequires: pkgconfig(xt)
BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(zlib)
%if %{with gl2ps}
BuildRequires: gl2ps-devel > 1.4.0
%endif
%if %{with haru}
BuildRequires: libharu-devel > 2.3.0
%endif
%if %{with java}
BuildRequires: java-devel
%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 pugixml}
BuildRequires: pkgconfig(pugixml)
%endif
%if %{with pegtl}
BuildRequires: pegtl-devel >= 2.0.0
%endif
%description %description
VTK is a software system for image processing, 3D graphics, volume VTK is a software system for image processing, 3D graphics, volume
@ -229,7 +238,6 @@ Requires: libjpeg-devel
Requires: libmysqlclient-devel Requires: libmysqlclient-devel
Requires: libnetcdf_c++-devel Requires: libnetcdf_c++-devel
Requires: libtiff-devel Requires: libtiff-devel
Requires: pegtl-devel
Requires: python3-%{name} = %{version} Requires: python3-%{name} = %{version}
Requires: python3-%{name} = %{version} Requires: python3-%{name} = %{version}
Requires: utfcpp-devel Requires: utfcpp-devel
@ -257,6 +265,9 @@ Requires: pkgconfig(libswscale)
Requires: pkgconfig(netcdf) Requires: pkgconfig(netcdf)
Requires: pkgconfig(theora) Requires: pkgconfig(theora)
Requires: pkgconfig(zlib) Requires: pkgconfig(zlib)
%if %{with pegtl}
Requires: pegtl-devel
%endif
Conflicts: vtk-compat_gl-devel Conflicts: vtk-compat_gl-devel
%description devel %description devel
@ -372,6 +383,8 @@ export CXX=g++
export CFLAGS="%{optflags}" export CFLAGS="%{optflags}"
export CXXFLAGS="%{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
%cmake \ %cmake \
-DCMAKE_INSTALL_PREFIX:PATH=%{my_prefix} \ -DCMAKE_INSTALL_PREFIX:PATH=%{my_prefix} \
-DCMAKE_INSTALL_LIBDIR:PATH=%{_lib} \ -DCMAKE_INSTALL_LIBDIR:PATH=%{_lib} \
@ -381,6 +394,10 @@ export CXXFLAGS="%{optflags}"
-DVTK_PYTHON_OPTIONAL_LINK:BOOL=OFF \ -DVTK_PYTHON_OPTIONAL_LINK:BOOL=OFF \
-DVTK_BUILD_TESTING:BOOL=ON \ -DVTK_BUILD_TESTING:BOOL=ON \
-DCMAKE_NO_BUILTIN_CHRPATH:BOOL=ON \ -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_TestingCore=WANT \
-DVTK_MODULE_ENABLE_VTK_TestingRendering=WANT \ -DVTK_MODULE_ENABLE_VTK_TestingRendering=WANT \
-DOpenGL_GL_PREFERENCE:STRING='GLVND' \ -DOpenGL_GL_PREFERENCE:STRING='GLVND' \
@ -398,12 +415,13 @@ export CXXFLAGS="%{optflags}"
-DVTK_GROUP_ENABLE_Views=WANT \ -DVTK_GROUP_ENABLE_Views=WANT \
-DVTK_PYTHON_VERSION=3 \ -DVTK_PYTHON_VERSION=3 \
-DVTK_USE_OGGTHEORA_ENCODER:BOOL=ON \ -DVTK_USE_OGGTHEORA_ENCODER:BOOL=ON \
-DVTK_WRAP_JAVA:BOOL=ON \ -DVTK_WRAP_JAVA:BOOL=%{?with_java:ON}%{!?with_java:OFF} \
-DVTK_WRAP_PYTHON:BOOL=ON \ -DVTK_WRAP_PYTHON:BOOL=ON \
-DVTK_USE_EXTERNAL:BOOL=ON \ -DVTK_USE_EXTERNAL:BOOL=ON \
-DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps=%{?with_gl2ps:ON}%{!?with_gl2ps: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_libharu=%{?with_haru:ON}%{!?with_haru:OFF} \
-DVTK_MODULE_USE_EXTERNAL_VTK_pugixml=%{?with_pugixml:ON}%{!?with_pugixml: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_INSTALL_DOC_DIR:PATH=%{_docdir}/%{name}-%{series}
#-DVTK_EXTERNAL_LIBHARU_IS_SHARED:BOOL=OFF \ #-DVTK_EXTERNAL_LIBHARU_IS_SHARED:BOOL=OFF \
@ -490,8 +508,12 @@ find %{buildroot} . -name vtk.cpython-3*.pyc -delete # drop unreproducible time-
%post -n %{shlib} -p /sbin/ldconfig %post -n %{shlib} -p /sbin/ldconfig
%postun -n %{shlib} -p /sbin/ldconfig %postun -n %{shlib} -p /sbin/ldconfig
%if %{with java}
%post java -p /sbin/ldconfig %post java -p /sbin/ldconfig
%postun 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 %post -n python3-%{name} -p /sbin/ldconfig
%postun -n python3-%{name} -p /sbin/ldconfig %postun -n python3-%{name} -p /sbin/ldconfig
@ -525,11 +547,13 @@ find %{buildroot} . -name vtk.cpython-3*.pyc -delete # drop unreproducible time-
%license Copyright.txt %license Copyright.txt
%{_docdir}/%{name}-%{series} %{_docdir}/%{name}-%{series}
%if %{with java}
%files java %files java
%license Copyright.txt %license Copyright.txt
%{my_libdir}/libvtk*Java.so %{my_libdir}/libvtk*Java.so
%{my_libdir}/libvtk*Java.so.1 %{my_libdir}/libvtk*Java.so.1
%{my_libdir}/java/ %{my_libdir}/java/
%endif
%files -n python3-%{name} %files -n python3-%{name}
%license Copyright.txt %license Copyright.txt