diff options
author | Sam James <sam@gentoo.org> | 2024-11-25 02:39:51 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2024-11-25 02:39:51 +0000 |
commit | a7b9d39fa7b80783e7b7e47bf7ec67a296765a5d (patch) | |
tree | 635c298ce8c69f8815ebc017ed5e33c9eba4b5f8 /media-gfx/netgen | |
parent | media-libs/libgpod: fix modern C issue (diff) | |
download | gentoo-a7b9d39fa7b80783e7b7e47bf7ec67a296765a5d.tar.gz gentoo-a7b9d39fa7b80783e7b7e47bf7ec67a296765a5d.tar.bz2 gentoo-a7b9d39fa7b80783e7b7e47bf7ec67a296765a5d.zip |
media-gfx/netgen: fix opencascade-7.8.0 compat
Closes: https://bugs.gentoo.org/930171
Thanks-to: Michael Tulupov
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-gfx/netgen')
-rw-r--r-- | media-gfx/netgen/files/netgen-6.2.2302-opencascade-7.8.0.patch | 147 | ||||
-rw-r--r-- | media-gfx/netgen/netgen-6.2.2302.ebuild | 1 |
2 files changed, 148 insertions, 0 deletions
diff --git a/media-gfx/netgen/files/netgen-6.2.2302-opencascade-7.8.0.patch b/media-gfx/netgen/files/netgen-6.2.2302-opencascade-7.8.0.patch new file mode 100644 index 000000000000..0c5664edd6bb --- /dev/null +++ b/media-gfx/netgen/files/netgen-6.2.2302-opencascade-7.8.0.patch @@ -0,0 +1,147 @@ +https://bugs.gentoo.org/930171 +https://github.com/NGSolve/netgen/issues/170 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -372,25 +372,20 @@ if (USE_OCC) + TKGeomAlgo + TKGeomBase + TKHLR +- TKIGES + TKLCAF + TKMath + TKMesh + TKOffset + TKPrim +- TKSTEP +- TKSTEP209 +- TKSTEPAttr +- TKSTEPBase +- TKSTL ++ TKDESTL + TKService + TKShHealing + TKTopAlgo + TKV3d + TKVCAF + TKXCAF +- TKXDEIGES +- TKXDESTEP ++ TKDEIGES ++ TKDESTEP + TKXSBase + TKernel + ) +--- a/libsrc/occ/Partition_Loop3d.hxx ++++ b/libsrc/occ/Partition_Loop3d.hxx +@@ -10,27 +10,16 @@ + #ifndef _Partition_Loop3d_HeaderFile + #define _Partition_Loop3d_HeaderFile + +-#ifndef _TopTools_ListOfShape_HeaderFile +-#include <TopTools_ListOfShape.hxx> +-#endif +-#ifndef _TopTools_IndexedDataMapOfShapeListOfShape_HeaderFile +-#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx> +-#endif +-#ifndef _Standard_Boolean_HeaderFile ++#include <Standard_Version.hxx> + #include <Standard_Boolean.hxx> +-#endif +-#ifndef _Standard_Real_HeaderFile + #include <Standard_Real.hxx> +-#endif +-#ifndef _Standard_Version_HeaderFile +-#include <Standard_Version.hxx> +-#endif ++#include <TopTools_ListOfShape.hxx> ++#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx> + +-#if OCC_VERSION_HEX < 0x070000 ++#if OCC_VERSION_HEX < 0x070000 || OCC_VERSION_HEX > 0x070799 + #else + #include <TopTools_ShapeMapHasher.hxx> + #include <TopTools_OrientedShapeMapHasher.hxx> +- #include <TopTools_MapOfOrientedShape.hxx> + #endif + + class TopoDS_Shape; +@@ -38,6 +27,8 @@ class TopoDS_Shape; + #if OCC_VERSION_HEX < 0x070000 + class TopTools_ListOfShape; + class TopTools_MapOfOrientedShape; ++#else ++#include <TopTools_MapOfOrientedShape.hxx> + #endif + + class TopoDS_Edge; +--- a/libsrc/occ/occ_edge.cpp ++++ b/libsrc/occ/occ_edge.cpp +@@ -55,7 +55,11 @@ namespace netgen + + size_t OCCEdge::GetHash() const + { ++#if OCC_VERSION_HEX < 0x070800 + return edge.HashCode(std::numeric_limits<Standard_Integer>::max()); ++#else ++ return std::hash<TopoDS_Shape>{}(edge); ++#endif + } + + void OCCEdge::ProjectPoint(Point<3>& p, EdgePointGeomInfo* gi) const +--- a/libsrc/occ/occ_face.cpp ++++ b/libsrc/occ/occ_face.cpp +@@ -32,7 +32,11 @@ namespace netgen + + size_t OCCFace::GetHash() const + { ++#if OCC_VERSION_HEX < 0x070800 + return face.HashCode(std::numeric_limits<Standard_Integer>::max()); ++#else ++ return std::hash<TopoDS_Shape>{}(face); ++#endif + } + + Point<3> OCCFace::GetCenter() const +--- a/libsrc/occ/occ_solid.hpp ++++ b/libsrc/occ/occ_solid.hpp +@@ -16,8 +16,11 @@ namespace netgen + OCCSolid(TopoDS_Shape dshape) + : solid(TopoDS::Solid(dshape)) + { } +- ++#if OCC_VERSION_HEX < 0x070800 + size_t GetHash() const override { return solid.HashCode(std::numeric_limits<Standard_Integer>::max()); } ++#else ++ size_t GetHash() const override { return std::hash<TopoDS_Solid>{}(solid); } ++#endif + }; + } + +--- a/libsrc/occ/occ_vertex.cpp ++++ b/libsrc/occ/occ_vertex.cpp +@@ -19,6 +19,10 @@ namespace netgen + + size_t OCCVertex::GetHash() const + { ++#if OCC_VERSION_HEX < 0x070800 + return vertex.HashCode(std::numeric_limits<Standard_Integer>::max()); ++#else ++ return std::hash<TopoDS_Shape>{}(vertex); ++#endif + } + } +--- a/libsrc/occ/occgeom.cpp ++++ b/libsrc/occ/occgeom.cpp +@@ -1625,8 +1625,12 @@ +
+ // enumerate shapes and archive only integers
+ auto my_hash = [](const TopoDS_Shape & key) {
++#if OCC_VERSION_HEX < 0x070800
+ auto occ_hash = key.HashCode(1<<31UL);
+ return std::hash<decltype(occ_hash)>()(occ_hash);
++#else
++ return std::hash<TopoDS_Shape>{}(key);
++#endif
+ };
+ TopTools_IndexedMapOfShape shape_map;
+ Array<TopoDS_Shape> shape_list;
diff --git a/media-gfx/netgen/netgen-6.2.2302.ebuild b/media-gfx/netgen/netgen-6.2.2302.ebuild index 5a86024f6f64..5b3aa9d3d837 100644 --- a/media-gfx/netgen/netgen-6.2.2302.ebuild +++ b/media-gfx/netgen/netgen-6.2.2302.ebuild @@ -74,6 +74,7 @@ PATCHES=( "${FILESDIR}/${PN}-6.2.2204-disable-python-tests.patch" "${FILESDIR}/${PN}-6.2.2301-find-libjpeg-turbo-library.patch" "${FILESDIR}/${PN}-6.2.2301-fix-nullptr-deref-in-archive.patch" + "${FILESDIR}/${PN}-6.2.2302-opencascade-7.8.0.patch" ) pkg_setup() { |