diff --git a/cad/freecad/Makefile b/cad/freecad/Makefile index bb3b90350984..c78d05bd7378 100644 --- a/cad/freecad/Makefile +++ b/cad/freecad/Makefile @@ -1,137 +1,138 @@ PORTNAME= FreeCAD DISTVERSION= 1.1.0 +PORTREVISION= 1 CATEGORIES= cad MAINTAINER= cmt@FreeBSD.org COMMENT= General purpose 3D CAD modeller WWW= https://www.freecadweb.org/ LICENSE= LGPL20+ LICENSE_FILE= ${WRKSRC}/LICENSE CONFLICTS_INSTALL= freecad-devel # bin/FreeCAD BUILD_DEPENDS= doxygen:devel/doxygen \ pybind11-config:devel/py-pybind11@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pyside6-tools>0:devel/pyside6-tools@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pivy>0:graphics/py-pivy@${PY_FLAVOR} \ ${PYTHON_SITELIBDIR}/matplotlib/__init__.py:math/py-matplotlib@${PY_FLAVOR} \ microsoft-gsl>0:devel/microsoft-gsl \ googletest>0:devel/googletest \ swig:devel/swig # the ffmpeg4 dependency is inherited via cad/opencascade LIB_DEPENDS= libexpat.so:textproc/expat2 \ libyaml-cpp.so:devel/yaml-cpp \ libfreetype.so:print/freetype2 \ libtbb.so:devel/onetbb \ ${PY_BOOST} \ libpyside6.abi3.so:devel/pyside6@${PY_FLAVOR} \ libCoin.so:graphics/Coin \ libfmt.so:devel/libfmt \ libpng.so:graphics/png \ libtiff.so:graphics/tiff \ libvtksys-${VTK_VER}.so:math/vtk${VTK_VER:R} \ libTKernel.so:cad/opencascade \ libxerces-c.so:textproc/xerces-c3 \ libboost_thread.so:devel/boost-libs \ libfontconfig.so:x11-fonts/fontconfig \ libfreeimage.so:graphics/freeimage \ libavutil.so.60:multimedia/ffmpeg \ libavformat.so.58:multimedia/ffmpeg4 \ libmed.so:french/med \ libshiboken6.abi3.so:devel/shiboken6@${PY_FLAVOR} \ libhdf5.so:science/hdf5 \ libspnav.so:misc/libspnav RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pivy>0:graphics/py-pivy@${PY_FLAVOR} \ ${PYTHON_SITELIBDIR}/matplotlib/__init__.py:math/py-matplotlib@${PY_FLAVOR} PORTSCOUT= limit:^[0-9\.]*$$ USES= dos2unix compiler:c++20-lang cmake cpe gl eigen:3 fortran gmake jpeg \ localbase:ldflags mpi:openmpi pkgconfig python localbase qt:6 xorg \ desktop-file-utils shared-mime-info shebangfix USE_GITHUB= yes GH_ACCOUNT= FreeCAD:ondselsolver \ FreeCAD:addonmgr GH_PROJECT= OndselSolver:ondselsolver \ AddonManager:addonmgr GH_TAGNAME= 30e9b64e8bf881d438d4b88834f9ba3674865418:ondselsolver \ 937b6877239dc78ef59eeefe8099e5f14243eda1:addonmgr GH_SUBDIR= src/3rdParty/OndselSolver:ondselsolver \ src/Mod/AddonManager:addonmgr USE_XORG= ice sm x11 xext xt USE_GL= gl glu USE_QT= base declarative svg tools USE_LDCONFIG= yes CPE_VENDOR= freecad_project DOS2UNIX_GLOB= *.txt *.h *.cpp *.py *.qss *.csv *.pov *.stp *.ui *.wrl *.WRL SHEBANG_FILES= src/Tools/freecad-thumbnailer.in # our HDF5/CMake integration is messy, so workarounds are required below CMAKE_ARGS+= -DOCC_INCLUDE_DIR="${LOCALBASE}/include/OpenCASCADE" \ -DOPENMPI_INCLUDE_DIRS="${LOCALBASE}/mpi/openmpi/include" \ -DFREECAD_QT_VERSION="6" \ -DPYTHON_LIBRARY="${PYTHONBASE}/lib/libpython${PYTHON_VER}${PYTHON_ABIVER}.so" \ -DPYTHON_INCLUDE_DIR="${PYTHON_INCLUDEDIR}" \ -DPYTHON_PACKAGES_PATH="${PYTHON_SITELIBDIR}" \ -DPYTHON_EXECUTABLE="${PYTHON_CMD}" \ -DBUILD_ASSEMBLY="ON" \ -DBUILD_DESIGNER_PLUGIN="ON" \ -DBUILD_FLAT_MESH="ON" \ -DBUILD_TEST="OFF" \ -DENABLE_DEVELOPER_TESTS="OFF" \ -DBUILD_VR="OFF" \ -DFREECAD_LIBPACK_USE="OFF" \ -DFREECAD_USE_EXTERNAL_FMT="ON" \ -DFREECAD_CREATE_MAC_APP="OFF" \ -DFREECAD_FREECAD_LIBPACK_USE="OFF" \ -DFREECAD_USE_EXTERNAL_KDL="OFF" \ -DFREECAD_USE_EXTERNAL_SMESH="OFF" \ -DFREECAD_USE_FREETYPE="ON" \ -DFREECAD_USE_PYBIND11="ON" \ -DUSE_CUDA="OFF" \ -DUSE_OPENCV="OFF" \ -Dpybind11_DIR="${PYTHON_SITELIBDIR}/pybind11/share/cmake/pybind11" \ -DHDF5_CFLAGS="-I${LOCALBASE}/include" \ -DHDF5_FOUND=TRUE \ -DHDF5_VERSION="1.12.2" \ -DHDF5_INCLUDE_DIRS="${LOCALBASE}/include/hdf5" \ -DHDF5_LIBRARIES="-L${LOCALBASE}/lib -lhdf5" \ -DHDF5_LIBRARY_DIRS="${LOCALBASE}/lib" \ -DBUILD_ENABLE_CXX_STD=C++20 \ -DXDG_DATADIR="${PREFIX}/share" CMAKE_INSTALL_PREFIX= ${PREFIX}/${PORTNAME} OPTIONS_DEFINE= COLLADA COLLADA_DESC= Install pycollada for Collada files import COLLADA_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pycollada>0:graphics/py-pycollada@${PY_FLAVOR} .include .if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH} == i386 PLIST_SUB= WEBENGINE="" USE_QT+= webengine .else CMAKE_ARGS+= -DBUILD_WEB:BOOL=OFF PLIST_SUB= WEBENGINE="@comment " .endif pre-configure: @${REINPLACE_CMD} -e '/self\.rev/s/Unknown/${DISTVERSION:C/.*-//}/' \ ${WRKSRC}/src/Tools/SubWCRev.py # Install XDG icons and files to the standard path @${REINPLACE_CMD} -e 's/CMAKE_INSTALL_DATAROOTDIR/XDG_DATADIR/g' \ ${WRKSRC}/src/XDGData/CMakeLists.txt \ ${WRKSRC}/src/Gui/CMakeLists.txt post-install: ${LN} -s ../${PORTNAME}/bin/FreeCAD ${STAGEDIR}${LOCALBASE}/bin/FreeCAD ${LN} -s ../${PORTNAME}/bin/FreeCADCmd ${STAGEDIR}${LOCALBASE}/bin/FreeCADCmd .include <../../math/vtk9/Makefile.version> .include diff --git a/cad/freecad/files/patch-compat-coin408 b/cad/freecad/files/patch-compat-coin408 new file mode 100644 index 000000000000..4c091d5e7bd5 --- /dev/null +++ b/cad/freecad/files/patch-compat-coin408 @@ -0,0 +1,153 @@ +commit dd3e6b65b537161abfb62188254d60dba5984f2c +Author: Captain <87000456+captain0xff@users.noreply.github.com> +Date: Sat Mar 21 05:52:51 2026 +0530 + + Gui: update CoinPtr to not use boost::intrusive_ptr (#28427) + +diff --git src/Gui/View3DInventor.cpp src/Gui/View3DInventor.cpp +index 807432fb68..037380390b 100644 +--- src/Gui/View3DInventor.cpp ++++ src/Gui/View3DInventor.cpp +@@ -597,7 +597,7 @@ bool View3DInventor::setCamera(const char* pCamera) + } + + // this is to make sure to reliably delete the node +- CoinPtr camPtr(Cam, true); ++ CoinPtr camPtr {Cam}; + + // toggle between perspective and orthographic camera + if (Cam->getTypeId() != CamViewer->getTypeId()) { +diff --git src/Gui/ViewProvider.h src/Gui/ViewProvider.h +index 2c4600cc80..7680d46f9f 100644 +--- src/Gui/ViewProvider.h ++++ src/Gui/ViewProvider.h +@@ -86,26 +86,102 @@ enum ViewStatus + }; + + ++/** Convenience smart pointer to manage the lifetime of coin nodes. ++ * ++ * This class is copied from Inventor/misc/SoRefPtr.h and can be removed when the ++ * minimum supported coin version provides this header. ++ */ ++template ++class SoRefPtr ++{ ++public: ++ SoRefPtr(void) noexcept ++ : ptr(NULL) ++ {} ++ ++ explicit SoRefPtr(T* p) ++ : ptr(p) ++ { ++ if (this->ptr) { ++ this->ptr->ref(); ++ } ++ } ++ ++ SoRefPtr(const SoRefPtr& other) ++ : ptr(other.ptr) ++ { ++ if (this->ptr) { ++ this->ptr->ref(); ++ } ++ } ++ ++ SoRefPtr(SoRefPtr&& other) noexcept ++ : ptr(other.ptr) ++ { ++ other.ptr = NULL; ++ } ++ ++ ~SoRefPtr(void) ++ { ++ if (this->ptr) { ++ this->ptr->unref(); ++ } ++ } ++ ++ SoRefPtr& operator=(SoRefPtr other) noexcept ++ { ++ this->swap(other); ++ return *this; ++ } ++ ++ void reset(T* p = NULL) ++ { ++ SoRefPtr tmp(p); ++ this->swap(tmp); ++ } ++ ++ T* get(void) const noexcept ++ { ++ return this->ptr; ++ } ++ T& operator*(void) const ++ { ++ return *this->ptr; ++ } ++ T* operator->(void) const noexcept ++ { ++ return this->ptr; ++ } ++ explicit operator bool(void) const noexcept ++ { ++ return this->ptr != NULL; ++ } ++ ++ void swap(SoRefPtr& other) noexcept ++ { ++ using std::swap; ++ swap(this->ptr, other.ptr); ++ } ++ ++private: ++ T* ptr; ++}; ++ + /** Convenience smart pointer to wrap coin node. + * +- * It is basically boost::intrusive plus implicit pointer conversion to save the +- * trouble of typing get() all the time. ++ * This class isn't merged with SoRefPtr because it can be removed in the future + */ + template +-class CoinPtr: public boost::intrusive_ptr ++class CoinPtr: public SoRefPtr + { + public: +- // Too bad, VC2013 does not support constructor inheritance +- // using boost::intrusive_ptr::intrusive_ptr; +- using inherited = boost::intrusive_ptr; +- CoinPtr() = default; +- CoinPtr(T* p, bool add_ref = true) +- : inherited(p, add_ref) +- {} +- template +- CoinPtr(CoinPtr const& r) +- : inherited(r) +- {} ++ using SoRefPtr::SoRefPtr; ++ ++ CoinPtr& operator=(T* ptr) ++ { ++ SoRefPtr::reset(ptr); ++ return *this; ++ } + + operator T*() const + { +diff --git src/Gui/ViewProviderLink.cpp src/Gui/ViewProviderLink.cpp +index 269c21dd9a..398e7ff921 100644 +--- src/Gui/ViewProviderLink.cpp ++++ src/Gui/ViewProviderLink.cpp +@@ -1644,7 +1644,7 @@ void LinkView::updateLink() + bool LinkView::linkGetElementPicked(const SoPickedPoint* pp, std::string& subname) const + { + std::ostringstream ss; +- CoinPtr path = pp->getPath(); ++ CoinPtr path {pp->getPath()}; + if (!nodeArray.empty()) { + auto idx = path->findNode(pcLinkRoot); + if (idx < 0 || idx + 2 >= path->getLength()) {