--- /dev/null
+diff -u -r opencascade-7.5.0.orig/src/OSD/OSD_Parallel_TBB.cxx opencascade-7.5.0/src/OSD/OSD_Parallel_TBB.cxx
+--- opencascade-7.5.0.orig/src/OSD/OSD_Parallel_TBB.cxx 2020-11-03 15:50:04.000000000 +0100
++++ opencascade-7.5.0/src/OSD/OSD_Parallel_TBB.cxx 2021-12-20 15:02:25.028915774 +0100
+@@ -25,7 +25,7 @@
+ #include <tbb/parallel_for.h>
+ #include <tbb/parallel_for_each.h>
+ #include <tbb/blocked_range.h>
+-#include <tbb/task_scheduler_init.h>
++#include <tbb/global_control.h>
+ Standard_ENABLE_DEPRECATION_WARNINGS
+
+ //=======================================================================
+@@ -38,19 +38,12 @@
+ const FunctorInterface& theFunctor,
+ Standard_Integer theNbItems)
+ {
+- try
+- {
+ const Handle(OSD_ThreadPool)& aThreadPool = OSD_ThreadPool::DefaultPool();
+ const Standard_Integer aNbThreads = theNbItems > 0 ?
+ aThreadPool->NbDefaultThreadsToLaunch() : -1;
+
+- tbb::task_scheduler_init aScheduler (aNbThreads);
++ tbb::global_control(tbb::global_control::max_allowed_parallelism, aNbThreads);
+ tbb::parallel_for_each (theBegin, theEnd, theFunctor);
+- }
+- catch (tbb::captured_exception& anException)
+- {
+- throw Standard_ProgramError (anException.what());
+- }
+ }
+
+ #endif /* HAVE_TBB */
# Source0-md5: eb62af12f173b7ce32209701cdd877ea
Patch0: %{name}-cmake.patch
Patch1: %{name}-inspector-data.patch
+Patch2: %{name}-tbb.patch
URL: https://www.opencascade.com/open-cascade-technology/
%{?with_freeimage:BuildRequires: FreeImage-devel}
BuildRequires: OpenGL-GLU-devel
BuildRequires: libtool
BuildRequires: rapidjson-devel
BuildRequires: rpmbuild(macros) >= 1.752
-%{?with_tbb:BuildRequires: tbb-devel}
+%{?with_tbb:BuildRequires: tbb-devel >= 2021.4}
BuildRequires: tcl-devel
BuildRequires: tk-devel
%{?with_vtk:BuildRequires: vtk-devel}
BuildRequires: qt5-linguist >= 5
%endif
Requires: %{name}-libs = %{version}-%{release}
+%{?with_tbb:Requires: tbb >= 2021.4}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _noautocompressdoc *.chm
%setup -q -n opencascade-%{version}
%patch0 -p1
%patch1 -p1
+%patch2 -p1
%{__sed} -i -e '/set (CMAKE_CONFIGURATION_TYPES/ { s/INTERNAL/STRING/;s/ FORCE// }' CMakeLists.txt