ports/math/cgal/Makefile
Dimitry Andric 54b05f1c1e math/cgal: fix headers for use with clang 19
Clang 19 has become more strict about errors in member functions, which
results in errors building ports that use headers from math/cgal, such
as cad/csxcad:

  In file included from /wrkdirs/usr/ports/cad/csxcad/work/CSXCAD-0.6.3/src/CSPrimPolyhedron.cpp:25:
  In file included from /wrkdirs/usr/ports/cad/csxcad/work/CSXCAD-0.6.3/src/CSPrimPolyhedron_p.h:6:
  In file included from /usr/local/include/CGAL/Polyhedron_3.h:25:
  In file included from /usr/local/include/CGAL/HalfedgeDS_default.h:23:
  In file included from /usr/local/include/CGAL/boost/graph/graph_traits_HalfedgeDS_default.h:15:
  In file included from /usr/local/include/CGAL/boost/graph/graph_traits_HalfedgeDS.h:29:
  /usr/local/include/CGAL/boost/graph/iterator.h:224:22: error: no member named 'base' in 'Halfedge_around_source_iterator<Graph>'
    224 |     return (! (this->base() == nullptr)) ?
        |                ~~~~  ^
  /usr/local/include/CGAL/boost/graph/iterator.h:324:22: error: no member named 'base' in 'Halfedge_around_target_iterator<Graph>'
    324 |     return (! (this->base() == nullptr)) ?
        |                ~~~~  ^
  /usr/local/include/CGAL/boost/graph/iterator.h:423:22: error: no member named 'base' in 'Halfedge_around_face_iterator<Graph>'
    423 |     return (! (this->base() == nullptr)) ?
        |                ~~~~  ^

The problem is that the `base()` member function is only available when
an iterator is derived from `boost::iterator_adaptor`, but the three
iterators mentioned above, `Halfedge_around_source_iterator`,
`Halfedge_around_target_iterator` and `Halfedge_around_face_iterator`
are not.

Upstream CGAL has done a bit more refactoring in this particular area,
but is enough to cherry-pick the changes that remove the `operator
bool_type() const` member functions, which reference the non-existing
`base()` member function.

Bump PORTREVISION to ensure dependent ports build against the fixed
headers.

PR:		281880
Approved by:	maintainer timeout (2 weeks)
MFH:		2024Q4
2024-10-20 11:57:11 +02:00

48 lines
1.1 KiB
Makefile

PORTNAME= cgal
PORTVERSION= 5.5.1
PORTREVISION= 4
CATEGORIES= math
MASTER_SITES= https://github.com/${PORTNAME:tu}/${PORTNAME}/releases/download/v${PORTVERSION}/
DISTNAME= ${PORTNAME:tu}-${PORTVERSION}
MAINTAINER= wen@FreeBSD.org
COMMENT= Computational geometry library
WWW= https://www.cgal.org/
LICENSE= GPLv3 LGPL3
LICENSE_COMB= multi
BUILD_DEPENDS= ${LOCALBASE}/lib/libntl.a:math/ntl
LIB_DEPENDS= libboost_system.so:devel/boost-libs \
libmpfr.so:math/mpfr \
libgmp.so:math/gmp
#TODO math/mpfi, math/rs, graphics/qglviewer
#Not yet in ports
USES= cmake eigen:3 shebangfix tar:xz
NO_ARCH= yes
SHEBANG_FILES= scripts/cgal_create_CMakeLists \
scripts/cgal_create_cmake_script
OPTIONS_DEFINE= VISUALIZATION QT5
VISUALIZATION_IMPLIES= QT5
OPTIONS_SUB= yes
VISUALIZATION_DESC= Visualization Required for most demos (Qt5 Geomview)
VISUALIZATION_LIB_DEPENDS= libgeomview.so:graphics/geomview
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MQT5}
USES+= gl qt:5
CMAKE_ARGS+= -DWITH_CGAL_Qt5=ON
USE_QT+= core gui opengl widgets svg buildtools:build qmake:build xml
USE_GL+= gl glu
.else
CMAKE_ARGS+= -DWITH_CGAL_Qt5=OFF
.endif
.include <bsd.port.mk>