From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 532AF1382C5 for ; Thu, 24 Jun 2021 10:06:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 57F96E0870; Thu, 24 Jun 2021 10:06:28 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 296BBE0870 for ; Thu, 24 Jun 2021 10:06:28 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9A2BE341FBB for ; Thu, 24 Jun 2021 10:06:26 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 931797A1 for ; Thu, 24 Jun 2021 10:06:24 +0000 (UTC) From: "Alexey Shvetsov" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Alexey Shvetsov" Message-ID: <1624529173.0f7a957b96c79b35bd8cbb7c712bb7358188853e.alexxy@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/opencascade/files/, sci-libs/opencascade/ X-VCS-Repository: repo/gentoo X-VCS-Files: sci-libs/opencascade/files/opencascade-7.5.1-fix-AllValues-name-collision-with-vtk-9.0.patch sci-libs/opencascade/opencascade-7.5.1-r1.ebuild X-VCS-Directories: sci-libs/opencascade/ sci-libs/opencascade/files/ X-VCS-Committer: alexxy X-VCS-Committer-Name: Alexey Shvetsov X-VCS-Revision: 0f7a957b96c79b35bd8cbb7c712bb7358188853e X-VCS-Branch: master Date: Thu, 24 Jun 2021 10:06:24 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 531d57ea-c009-4fdf-848c-eebca48a95dc X-Archives-Hash: f0b331528e0886737ff55ffb198da516 commit: 0f7a957b96c79b35bd8cbb7c712bb7358188853e Author: Roman Beranek prusa3d com> AuthorDate: Thu Jun 3 14:09:09 2021 +0000 Commit: Alexey Shvetsov gentoo org> CommitDate: Thu Jun 24 10:06:13 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f7a957b sci-libs/opencascade[vtk]: prevent name collision VTK-9.0 declares in their headers 'struct AllValues' which collides with a macro defined by GLX. This has been only partially fixed in the upstream: https://git.dev.opencascade.org/gitweb/?p=occt.git;a=commit;h=2c276f91da0 It was necessary to put `#undef`s in a few other places. Closes: https://bugs.gentoo.org/794031 Signed-off-by: Roman Beranek prusa3d.com> Closes: https://github.com/gentoo/gentoo/pull/21105 Signed-off-by: Alexey Shvetsov gentoo.org> ...fix-AllValues-name-collision-with-vtk-9.0.patch | 172 +++++++++++++++++++++ sci-libs/opencascade/opencascade-7.5.1-r1.ebuild | 1 + 2 files changed, 173 insertions(+) diff --git a/sci-libs/opencascade/files/opencascade-7.5.1-fix-AllValues-name-collision-with-vtk-9.0.patch b/sci-libs/opencascade/files/opencascade-7.5.1-fix-AllValues-name-collision-with-vtk-9.0.patch new file mode 100644 index 00000000000..e2725ebb2c6 --- /dev/null +++ b/sci-libs/opencascade/files/opencascade-7.5.1-fix-AllValues-name-collision-with-vtk-9.0.patch @@ -0,0 +1,172 @@ +From f624c55d7b75ccbe3fdfef0db141fdbe1f6b383a Mon Sep 17 00:00:00 2001 +From: anv +Date: Tue, 27 Apr 2021 21:33:54 +0300 +Subject: [PATCH 1/2] 0032331: Visualization - Exception when trying to display + some surfaces using iVtk with VTK 9 + +Updated memory allocation for vtkPolyData to use more suited method for VTK versions after 9.0 +--- + src/IVtkDraw/IVtkDraw_Interactor.cxx | 7 +++ + src/IVtkTools/IVtkTools_SubPolyDataFilter.cxx | 50 ++++++++++++++++++- + 2 files changed, 56 insertions(+), 1 deletion(-) + +diff --git a/src/IVtkDraw/IVtkDraw_Interactor.cxx b/src/IVtkDraw/IVtkDraw_Interactor.cxx +index f9f68c37b6..1b68c959f5 100644 +--- a/src/IVtkDraw/IVtkDraw_Interactor.cxx ++++ b/src/IVtkDraw/IVtkDraw_Interactor.cxx +@@ -20,6 +20,13 @@ + #include + #else + #include ++ ++// Preventing naming collisions between ++// GLX and VTK versions 9.0 and above ++#ifdef AllValues ++#undef AllValues ++#endif ++ + #include + #include + #endif +diff --git a/src/IVtkTools/IVtkTools_SubPolyDataFilter.cxx b/src/IVtkTools/IVtkTools_SubPolyDataFilter.cxx +index 26ded68af5..bd289d2b51 100644 +--- a/src/IVtkTools/IVtkTools_SubPolyDataFilter.cxx ++++ b/src/IVtkTools/IVtkTools_SubPolyDataFilter.cxx +@@ -87,6 +87,11 @@ int IVtkTools_SubPolyDataFilter::RequestData (vtkInformation *vtkNotUsed(theRequ + + // Prepare the list of ids from the set of ids. + // Iterate on input cells. ++#if (VTK_MAJOR_VERSION >= 9) ++ // Count number of different cells. ++ int aNbVerts = 0, aNbLines = 0, aNbPolys = 0, aNbStrips = 0; ++ int aNbVertPts = 0, aNbLinePts = 0, aNbPolyPts = 0, aNbStripPts = 0; ++#endif + if (!myIdsSet.IsEmpty()) + { + for (vtkIdType anI = 0; anI < aSize; anI++) +@@ -95,13 +100,56 @@ int IVtkTools_SubPolyDataFilter::RequestData (vtkInformation *vtkNotUsed(theRequ + { + // Add a cell id to output if it's value is in the set. + anIdList->InsertNextId (anI); ++#if (VTK_MAJOR_VERSION >= 9) ++ switch (anInput->GetCellType(anI)) ++ { ++ case VTK_VERTEX: ++ aNbVerts++; ++ aNbVertPts++; ++ break; ++ case VTK_POLY_VERTEX: ++ aNbVerts++; ++ aNbVertPts += anInput->GetCell(anI)->GetNumberOfPoints(); ++ break; ++ case VTK_LINE: ++ aNbLines++; ++ aNbLinePts += 2; ++ break; ++ case VTK_POLY_LINE: ++ aNbLines++; ++ aNbLinePts += anInput->GetCell(anI)->GetNumberOfPoints(); ++ break; ++ case VTK_TRIANGLE: ++ aNbPolys++; ++ aNbPolyPts += 3; ++ break; ++ case VTK_QUAD: ++ aNbPolys++; ++ aNbPolyPts += 4; ++ break; ++ case VTK_POLYGON: ++ aNbPolys++; ++ aNbPolyPts += anInput->GetCell(anI)->GetNumberOfPoints(); ++ break; ++ case VTK_TRIANGLE_STRIP: ++ aNbStrips++; ++ aNbStripPts += anInput->GetCell(anI)->GetNumberOfPoints(); ++ break; ++ } ++#endif + } + } + } + + // Copy cells with their points according to the prepared list of cell ids. + anOutput->GetCellData()->AllocateArrays(anInput->GetCellData()->GetNumberOfArrays()); +- anOutput->Allocate(anInput, anIdList->GetNumberOfIds()); // Allocate output cells ++ // Allocate output cells ++#if (VTK_MAJOR_VERSION >= 9) ++ anOutput->AllocateExact (aNbVerts, aNbVertPts, aNbLines, aNbLinePts, aNbPolys, aNbPolyPts, aNbStrips, aNbStripPts); ++#else ++ anOutput->Allocate (anInput, anIdList->GetNumberOfIds()); ++#endif ++ + // Pass data arrays. + // Create new arrays for output data + vtkSmartPointer anInData = anInput->GetCellData(); +-- +2.31.1 + + +From 3a0d59614378af258b285c7a3cab66c4bb7cecd3 Mon Sep 17 00:00:00 2001 +From: Roman Beranek +Date: Thu, 3 Jun 2021 15:41:45 +0200 +Subject: [PATCH 2/2] undef AllValues after inclusion of GL/glx.h + +Replicate the measure from 0032331 also for IVtkDraw.cxx and InterfaceGraphic.hxx +--- + src/IVtkDraw/IVtkDraw.cxx | 17 +++++++++++------ + src/InterfaceGraphic/InterfaceGraphic.hxx | 4 +++- + 2 files changed, 14 insertions(+), 7 deletions(-) + +diff --git a/src/IVtkDraw/IVtkDraw.cxx b/src/IVtkDraw/IVtkDraw.cxx +index 93d4a2fd1a..84bacdc55a 100644 +--- a/src/IVtkDraw/IVtkDraw.cxx ++++ b/src/IVtkDraw/IVtkDraw.cxx +@@ -52,6 +52,17 @@ + + // prevent disabling some MSVC warning messages by VTK headers + #include ++#ifndef _WIN32 ++ #include ++ #include ++ #include ++ #include ++ #include ++ #include ++ #ifdef AllValues ++ #undef AllValues ++ #endif ++#endif + #include + #include + #include +@@ -75,12 +86,6 @@ + #include + #include + #ifndef _WIN32 +- #include +- #include +- #include +- #include +- #include +- #include + #include + #include + #include +diff --git a/src/InterfaceGraphic/InterfaceGraphic.hxx b/src/InterfaceGraphic/InterfaceGraphic.hxx +index c533f68cd5..bf02b3f397 100644 +--- a/src/InterfaceGraphic/InterfaceGraphic.hxx ++++ b/src/InterfaceGraphic/InterfaceGraphic.hxx +@@ -39,7 +39,9 @@ + #include + #include + #include +- ++#ifdef AllValues ++#undef AllValues ++#endif + #endif + + #endif // __INTERFACE_GRAPHIC_HXX +-- +2.31.1 + diff --git a/sci-libs/opencascade/opencascade-7.5.1-r1.ebuild b/sci-libs/opencascade/opencascade-7.5.1-r1.ebuild index ffa4d80678e..666120a0cd9 100644 --- a/sci-libs/opencascade/opencascade-7.5.1-r1.ebuild +++ b/sci-libs/opencascade/opencascade-7.5.1-r1.ebuild @@ -68,6 +68,7 @@ PATCHES=( "${FILESDIR}"/${P}-0004-fix-installation-of-cmake-config-files.patch "${FILESDIR}"/${P}-0005-fix-write-permissions-on-scripts.patch "${FILESDIR}"/${P}-0006-fix-creation-of-custom.sh-script.patch + "${FILESDIR}"/${P}-fix-AllValues-name-collision-with-vtk-9.0.patch ) src_prepare() {