diff --git a/ports/cgal/PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch b/ports/cgal/PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch new file mode 100644 index 00000000000000..09e45a63f0727c --- /dev/null +++ b/ports/cgal/PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch @@ -0,0 +1,212 @@ +diff --git a/CGAL_Core/include/CGAL/CORE/ExprRep.h b/CGAL_Core/include/CGAL/CORE/ExprRep.h +index 0e721dda16a8..a325930a2ab4 100644 +--- a/CGAL_Core/include/CGAL/CORE/ExprRep.h ++++ b/CGAL_Core/include/CGAL/CORE/ExprRep.h +@@ -595,7 +595,7 @@ class CGAL_CORE_EXPORT ConstPolyRep : public ConstRep { + } + + void operator delete( void *p, size_t ){ +- MemoryPool::global_allocator().free(p); ++ (MemoryPool::global_allocator().free)(p); + } + + private: +@@ -1248,7 +1248,7 @@ void * AddSubRep::operator new( size_t size) + + template + void AddSubRep::operator delete( void *p, size_t ) +-{ MemoryPool >::global_allocator().free(p); } ++{ (MemoryPool >::global_allocator().free)(p); } + + + /// \typedef AddRep +diff --git a/CGAL_Core/include/CGAL/CORE/Impl.h b/CGAL_Core/include/CGAL/CORE/Impl.h +index 4ff8b4fa3d48..8ae4c53fe7d1 100644 +--- a/CGAL_Core/include/CGAL/CORE/Impl.h ++++ b/CGAL_Core/include/CGAL/CORE/Impl.h +@@ -58,7 +58,7 @@ + { return MemoryPool >::global_allocator().allocate(size); } \ + template \ + CGAL_INLINE_FUNCTION void C::operator delete( void *p, size_t ) \ +- { MemoryPool >::global_allocator().free(p); } ++ { (MemoryPool >::global_allocator().free)(p); } + #endif + + // include some common header files +diff --git a/CGAL_Core/include/CGAL/CORE/MemoryPool.h b/CGAL_Core/include/CGAL/CORE/MemoryPool.h +index 2db3de8736e1..d218a871bec5 100644 +--- a/CGAL_Core/include/CGAL/CORE/MemoryPool.h ++++ b/CGAL_Core/include/CGAL/CORE/MemoryPool.h +@@ -73,7 +73,7 @@ class MemoryPool { + + + void* allocate(std::size_t size); +- void free(void* p); ++ void free BOOST_PREVENT_MACRO_SUBSTITUTION (void* p); + + // Access the corresponding static global allocator. + static MemoryPool& global_allocator() { +diff --git a/CGAL_Core/include/CGAL/CORE/RealRep.h b/CGAL_Core/include/CGAL/CORE/RealRep.h +index 1c5d0f13a405..f2ec1e90cb3b 100644 +--- a/CGAL_Core/include/CGAL/CORE/RealRep.h ++++ b/CGAL_Core/include/CGAL/CORE/RealRep.h +@@ -154,7 +154,7 @@ void * Realbase_for::operator new( size_t size) + + template + void Realbase_for::operator delete( void *p, size_t ) +-{ MemoryPool >::global_allocator().free(p); } ++{ (MemoryPool >::global_allocator().free)(p); } + + typedef Realbase_for RealLong; + typedef Realbase_for RealDouble; + +diff --git a/CGAL_Core/include/CGAL/CORE/MemoryPool.h b/CGAL_Core/include/CGAL/CORE/MemoryPool.h +index d218a871bec5..1cfa96fa93d1 100644 +--- a/CGAL_Core/include/CGAL/CORE/MemoryPool.h ++++ b/CGAL_Core/include/CGAL/CORE/MemoryPool.h +@@ -116,7 +116,7 @@ void* MemoryPool< T, nObjects >::allocate(std::size_t) { + } + + template< class T, int nObjects > +-void MemoryPool< T, nObjects >::free(void* t) { ++void MemoryPool< T, nObjects >::free BOOST_PREVENT_MACRO_SUBSTITUTION (void* t) { + CGAL_assertion(t != 0); + if (t == 0) return; // for safety + if(blocks.empty()){ + +diff --git a/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h b/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h +index 53f8968f86f4..9a217389d82e 100644 +--- a/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h ++++ b/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h +@@ -116,8 +116,8 @@ void partition_dual_graph(const TriangleMesh& tm, + delete[] eptr; + delete[] eind; + +- std::free(npart); +- std::free(epart); ++ (std::free)(npart); ++ (std::free)(epart); + } + + template +diff --git a/BGL/include/CGAL/boost/graph/METIS/partition_graph.h b/BGL/include/CGAL/boost/graph/METIS/partition_graph.h +index 08926a641169..42f8c240f011 100644 +--- a/BGL/include/CGAL/boost/graph/METIS/partition_graph.h ++++ b/BGL/include/CGAL/boost/graph/METIS/partition_graph.h +@@ -151,8 +151,8 @@ void partition_graph(const TriangleMesh& tm, + delete[] eptr; + delete[] eind; + +- std::free(npart); +- std::free(epart); ++ (std::free)(npart); ++ (std::free)(epart); + } + + template +diff --git a/CGAL_Core/include/CGAL/CORE/Impl.h b/CGAL_Core/include/CGAL/CORE/Impl.h +index 8ae4c53fe7d1..2e21aab5ac0a 100644 +--- a/CGAL_Core/include/CGAL/CORE/Impl.h ++++ b/CGAL_Core/include/CGAL/CORE/Impl.h +@@ -51,7 +51,7 @@ + CGAL_INLINE_FUNCTION void *T::operator new( size_t size) \ + { return MemoryPool::global_allocator().allocate(size); } \ + CGAL_INLINE_FUNCTION void T::operator delete( void *p, size_t ) \ +- { MemoryPool::global_allocator().free(p); } ++ { (MemoryPool::global_allocator().free)(p); } + #define CORE_MEMORY_IMPL_TEMPLATE_WITH_ONE_ARG(C) \ + template \ + CGAL_INLINE_FUNCTION void *C::operator new( size_t size) \ +diff --git a/Classification/include/CGAL/Classification/Feature/Elevation.h b/Classification/include/CGAL/Classification/Feature/Elevation.h +index 175b20b6a44e..9ea9f267cc46 100644 +--- a/Classification/include/CGAL/Classification/Feature/Elevation.h ++++ b/Classification/include/CGAL/Classification/Feature/Elevation.h +@@ -130,7 +130,7 @@ class Elevation : public Feature_base + std::nth_element (z.begin(), z.begin() + (z.size() / 10), z.end()); + dtm_x(i,j) = z[z.size() / 10]; + } +- dem.free(); ++ (dem.free)(); + + if (grid.width() * grid.height() > input.size()) + values.resize (input.size(), compressed_float(0)); +@@ -162,7 +162,7 @@ class Elevation : public Feature_base + values[*it] = v; + } + } +- dtm_x.free(); ++ (dtm_x.free)(); + + } + +diff --git a/Classification/include/CGAL/Classification/Feature/Height_above.h b/Classification/include/CGAL/Classification/Feature/Height_above.h +index b59b108c1aca..3c85d27f91e2 100644 +--- a/Classification/include/CGAL/Classification/Feature/Height_above.h ++++ b/Classification/include/CGAL/Classification/Feature/Height_above.h +@@ -100,7 +100,7 @@ class Height_above : public Feature_base + std::size_t J = grid.y(i); + values[i] = float(dtm(I,J) - get (point_map, *(input.begin() + i)).z()); + } +- dtm.free(); ++ (dtm.free)(); + } + + } +diff --git a/Classification/include/CGAL/Classification/Feature/Height_below.h b/Classification/include/CGAL/Classification/Feature/Height_below.h +index 223719341555..f71195dd3489 100644 +--- a/Classification/include/CGAL/Classification/Feature/Height_below.h ++++ b/Classification/include/CGAL/Classification/Feature/Height_below.h +@@ -100,7 +100,7 @@ class Height_below : public Feature_base + std::size_t J = grid.y(i); + values[i] = float(get (point_map, *(input.begin() + i)).z() - dtm(I,J)); + } +- dtm.free(); ++ (dtm.free)(); + } + + } +diff --git a/Classification/include/CGAL/Classification/Feature/Vertical_range.h b/Classification/include/CGAL/Classification/Feature/Vertical_range.h +index 45b9c98d3ee7..a4df1591c13f 100644 +--- a/Classification/include/CGAL/Classification/Feature/Vertical_range.h ++++ b/Classification/include/CGAL/Classification/Feature/Vertical_range.h +@@ -102,7 +102,7 @@ class Vertical_range : public Feature_base + std::size_t J = grid.y(i); + values[i] = dtm(I,J); + } +- dtm.free(); ++ (dtm.free)(); + } + + } +diff --git a/Classification/include/CGAL/Classification/Image.h b/Classification/include/CGAL/Classification/Image.h +index 084e9572764a..3bd915f0b5d7 100644 +--- a/Classification/include/CGAL/Classification/Image.h ++++ b/Classification/include/CGAL/Classification/Image.h +@@ -71,7 +71,7 @@ class Image + { + } + +- void free() ++ void free BOOST_PREVENT_MACRO_SUBSTITUTION () + { + m_raw.reset(); + m_sparse.reset(); + +diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h +index bd5dafbf0171..92a4ac768f58 100644 +--- a/Installation/include/CGAL/config.h ++++ b/Installation/include/CGAL/config.h +@@ -37,6 +37,13 @@ + #endif + + #ifdef CGAL_INCLUDE_WINDOWS_DOT_H ++ ++#if defined(_MSC_VER) && defined(_DEBUG) ++// Include support for memory leak detection ++// This is only available in debug mode and when _CRTDBG_MAP_ALLOC is defined. ++// It will include which will redefine `malloc` and `free`. ++# define _CRTDBG_MAP_ALLOC 1 ++#endif + // Mimic users including this file which defines min max macros + // and other names leading to name clashes + #include diff --git a/ports/cgal/portfile.cmake b/ports/cgal/portfile.cmake index 4cc25786876e63..977a3ad1bd7071 100644 --- a/ports/cgal/portfile.cmake +++ b/ports/cgal/portfile.cmake @@ -1,19 +1,14 @@ -# Header only -vcpkg_buildpath_length_warning(37) +set(VCPKG_BUILD_TYPE release) # header-only vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO CGAL/cgal - REF v5.6.1 - SHA512 943413bf3b94da066d47051b22f1c1b66a39a43dad865dd0e4912a9ae6508d9a490bcfe4ef7d662844e9a1ba6e552748fad785b52b2cce98133c2dfdfbfe1a4d + REF v${VERSION} + SHA512 f61e608898d798b90ce07260928b682161f00e964b43b9876ef6604d10c30787a0814e13afde90f7d703efd6b83c61dd4a9d9f50d21068bd50c5c15f94b5755b HEAD_REF master + PATCHES + PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch ) - -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - FEATURES - qt WITH_CGAL_Qt5 -) - vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS @@ -26,7 +21,6 @@ vcpkg_cmake_configure( MAYBE_UNUSED_VARIABLES CGAL_BUILD_THREE_DOC CGAL_HEADER_ONLY - WITH_CGAL_Qt5 ) vcpkg_cmake_install() diff --git a/ports/cgal/vcpkg.json b/ports/cgal/vcpkg.json index ad521023d5cf4c..6698de04ae7fb2 100644 --- a/ports/cgal/vcpkg.json +++ b/ports/cgal/vcpkg.json @@ -1,7 +1,6 @@ { "name": "cgal", - "version": "5.6.1", - "port-version": 1, + "version": "6.0", "description": "The Computational Geometry Algorithms Library (CGAL) is a C++ library that aims to provide easy access to efficient and reliable algorithms in computational geometry.", "homepage": "https://github.com/CGAL/cgal", "license": "GPL-3.0-or-later AND LGPL-3.0-or-later AND BSL-1.0", @@ -67,14 +66,12 @@ "description": "Qt GUI support for CGAL", "dependencies": [ "eigen3", - "qt5-3d", { - "name": "qt5-base", + "name": "qtbase", "default-features": false }, - "qt5-script", - "qt5-svg", - "qt5-xmlpatterns" + "qtdeclarative", + "qtsvg" ] } } diff --git a/ports/cgal/x86_windows.patch b/ports/cgal/x86_windows.patch deleted file mode 100644 index fcb26a683807ca..00000000000000 --- a/ports/cgal/x86_windows.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/Number_types/include/CGAL/boost_mp.h b/Number_types/include/CGAL/boost_mp.h -index 3dcaadcad21..b98980acbc5 100644 ---- a/Number_types/include/CGAL/boost_mp.h -+++ b/Number_types/include/CGAL/boost_mp.h -@@ -20,8 +20,18 @@ - // easy solution. - // MSVC had trouble with versions <= 1.69: - // https://github.com/boostorg/multiprecision/issues/98 -+// -+// Disable also on Windows 32 bits -+// because CGAL/cpp_float.h assumes _BitScanForward64 is available -+// See https://learn.microsoft.com/en-us/cpp/intrinsics/bitscanforward-bitscanforward64 -+// -+// Disable also with PowerPC processors, with Boost<1.80 because of that bug: -+// https://github.com/boostorg/multiprecision/pull/421 -+// - #if !defined CGAL_DO_NOT_USE_BOOST_MP && \ -- (!defined _MSC_VER || BOOST_VERSION >= 107000) -+ (!defined _MSC_VER || BOOST_VERSION >= 107000) && \ -+ (!defined _WIN32 || defined _WIN64) && \ -+ (BOOST_VERSION >= 108000 || (!defined _ARCH_PPC && !defined _ARCH_PPC64)) - #define CGAL_USE_BOOST_MP 1 - - #include diff --git a/versions/baseline.json b/versions/baseline.json index f195e362d5bdbf..9f90a391d8f353 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1585,8 +1585,8 @@ "port-version": 6 }, "cgal": { - "baseline": "5.6.1", - "port-version": 1 + "baseline": "6.0", + "port-version": 0 }, "cgicc": { "baseline": "3.2.20", diff --git a/versions/c-/cgal.json b/versions/c-/cgal.json index f77fa5bec639e8..0b9eb53014a51e 100644 --- a/versions/c-/cgal.json +++ b/versions/c-/cgal.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "f1be286404a2a318493e10e1818b244e2772f2f0", + "version": "6.0", + "port-version": 0 + }, { "git-tree": "194089df2abf78f3701c7be7d51ddb25feaf108e", "version": "5.6.1",