Skip to content

Commit

Permalink
cad/opencascade: upgrade to 7.8.0
Browse files Browse the repository at this point in the history
Release notes at
	<https://dev.opencascade.org/content/open-cascade-technology-780-released>

It includes a patch from ichesnok <ichesnok@opencascade.com> to fix the problem
reported at
<https://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff;h=0f6f5b64d321a988399567f6b901bef385cc8d41>

PR:		277294
  • Loading branch information
thierry-FreeBSD committed Mar 21, 2024
1 parent 3f70a54 commit 70f1baf
Show file tree
Hide file tree
Showing 15 changed files with 1,864 additions and 1,586 deletions.
63 changes: 34 additions & 29 deletions cad/opencascade/Makefile
@@ -1,8 +1,7 @@
PORTNAME= opencascade
DISTVERSION= 7.7.0
PORTREVISION= 10
DISTVERSIONPREFIX= V
DISTVERSION= 7_8_0
CATEGORIES= cad science
MASTER_SITES= LOCAL/thierry

MAINTAINER= thierry@FreeBSD.org
COMMENT= Open CASCADE Technology, 3D modeling & numerical simulation
Expand All @@ -18,6 +17,7 @@ BUILD_DEPENDS= rapidjson>0:devel/rapidjson \
${LOCALBASE}/lib/qt5/bin/moc:devel/qt5-buildtools
LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \
libfreetype.so:print/freetype2 \
libtbbmalloc.so:devel/onetbb \
libexpat.so:textproc/expat2 \
libdraco.so:archivers/draco \
libpng16.so:graphics/png \
Expand All @@ -26,13 +26,17 @@ RUN_DEPENDS= bash:shells/bash

# Check ${WRKSRC}/dox/overview/overview.md
# and ${WRKSRC}/dox/dev_guides/building
USES= alias:10 cmake compiler:c++14-lang dos2unix gettext-runtime \
gl gnome localbase python qt:5 shebangfix tk tar:tgz xorg
USES= alias:10 cmake compiler:c++14-lang eigen:3 gettext-runtime \
gl gnome localbase python qt:5 shebangfix tk xorg
USE_XORG= ice sm x11 xau xcb xdmcp xext xft xi xmu xrender xscrnsaver xt
USE_GL= egl gl glesv2 glu
USE_GNOME= libxml2
USE_QT= core declarative gui network quick3d linguisttools widgets xml

USE_GITHUB= yes
GH_ACCOUNT= Open-Cascade-SAS
GH_PROJECT= OCCT

DOS2UNIX_FILES= adm/templates/*
SHEBANG_FILES= adm/templates/*.sh \
adm/templates/*.sh.in \
adm/templates/*.sh.main \
Expand All @@ -57,11 +61,19 @@ CMAKE_ARGS+= -DINSTALL_DIR=${OCCROOT} \
-DINSTALL_DIR_SAMPLES=${OCCROOT}/samples \
-DINSTALL_DIR_TESTS=${OCCROOT}/tests \
-DINSTALL_TEST_CASES:BOOL=ON \
-DUSE_FREETYPE:BOOL=ON \
-DUSE_TBB:BOOL=OFF \
-DUSE_RAPIDJSON:BOOL=ON \
-DUSE_DRACO:BOOL=ON \
-DUSE_VTK:BOOL=ON \
-DBUILD_Inspector:BOOL=ON \
-DUSE_TCL:BOOL=ON \
-DCAN_USE_TK:BOOL=ON -DUSE_TK:BOOL=ON \
-DCAN_USE_XLIB:BOOL=ON -DUSE_XLIB:BOOL=ON \
-DCAN_USE_FREETYPE:BOOL=ON -DUSE_FREETYPE:BOOL=ON \
-DCAN_USE_VTK:BOOL=ON -DUSE_VTK:BOOL=ON \
-DCAN_USE_EIGEN:BOOL=ON -DUSE_EIGEN:BOOL=ON \
-DCAN_USE_RAPIDJSON:BOOL=ON -DUSE_RAPIDJSON:BOOL=ON \
-DCAN_USE_DRACO:BOOL=ON -DUSE_DRACO:BOOL=ON \
-DCAN_USE_TBB:BOOL=ON -DUSE_TBB:BOOL=ON \
-D3RDPARTY_QT_DIR:PATH=${QT_LIBDIR} \
-D3RDPARTY_DRACO_DIR:PATH=${LOCALBASE} \
-D3RDPARTY_DRACO_LIBRARY=libdraco.so \
-D3RDPARTY_DRACO_LIBRARY_DIR:PATH=${LOCALBASE}/lib \
-D3RDPARTY_DRACO_INCLUDE_DIR:PATH=${LOCALBASE}/include/draco \
-D3RDPARTY_VTK_INCLUDE_DIR:PATH=${LOCALBASE}/include/vtk-${VTK_VER}
Expand All @@ -72,21 +84,16 @@ CMAKE_ARGS+= -DCMAKE_MESSAGE_CONTEXT_SHOW:BOOL=ON \
-DCMAKE_MESSAGE_LOG_LEVEL:STRING=DEBUG
.endif

# TODO: TBB to be replaced by onetbb later
#CMAKE_ARGS+= -DUSE_EIGEN:BOOL=ON -DUSE_TBB:BOOL=ON
#USES+= eigen:3
#LIB_DEPENDS+= libtbb.so:devel/tbb

USE_LDCONFIG= yes

CONFLICTS_INSTALL= opencascade740 # OpenCAS/bin/DRAWEXE

LOCCROOT= OpenCAS
OCCROOT= ${PREFIX}/${LOCCROOT}
PLIST_SUB= OCCROOT="${LOCCROOT}" BITS=${BITS} CC=${CHOSEN_COMPILER_TYPE} \
VE=${PORTVERSION:R} VER=${DISTVERSION:C/-beta//}
VE=${PORTVERSION:R} VER=${PORTVERSION}

FFMPEG_CMAKE_ON= -DUSE_FFMPEG:BOOL=ON \
FFMPEG_CMAKE_ON= -DCAN_USE_FFMPEG:BOOL=ON -DUSE_FFMPEG:BOOL=ON \
-D3RDPARTY_FFMPEG_INCLUDE_DIR=${LOCALBASE}/ffmpeg4/include \
-D3RDPARTY_FFMPEG_DIR=${LOCALBASE}/ffmpeg4
FFMPEG_CMAKE_OFF= -DUSE_FFMPEG:BOOL=OFF
Expand Down Expand Up @@ -114,15 +121,17 @@ FFMPEG_LIB_DEPENDS= libavcodec.so.58:multimedia/ffmpeg4 \
libopus.so:audio/opus \
libgmp.so:math/gmp

VIS_CMAKE_ON= -DUSE_FREEIMAGE:BOOL=ON \
-DUSE_GLES2:BOOL=ON \
VIS_CMAKE_ON= -DCAN_USE_FREEIMAGE:BOOL=ON -DUSE_FREEIMAGE:BOOL=ON \
-DCAN_USE_OPENGL:BOOL=ON -DUSE_OPENGL:BOOL=ON \
-DCAN_USE_GLES2:BOOL=ON -DUSE_GLES2:BOOL=ON \
-D3RDPARTY_FREETYPE_DIR=${LOCALBASE}
VIS_CMAKE_OFF= -DUSE_FREEIMAGE:BOOL=OFF \
-DUSE_GLES2:BOOL=OFF
VIS_LIB_DEPENDS= libftgl.so:graphics/ftgl \
libfreeimageplus.so:graphics/freeimage
VIS_USE= GL=glesv2
VIS_USE= GL=glesv2,opengl

DOCS_DISTFILES= documentation.tar.xz
DOXYGEN_IMPLIES= DOCS
DOXYGEN_USES= tex
DOXYGEN_USE= TEX=latex:build
Expand All @@ -132,6 +141,8 @@ DOXYGEN_BUILD_DEPENDS= bash:shells/bash \
pdftex:print/tex-basic-engines \
inkscape:graphics/inkscape
DOXYGEN_RUN_DEPENDS= ${LOCALBASE}/www/MathJax/MathJax.js:www/mathjax
DOXYGEN_CMAKE_ON= -DBUILD_DOC_Overview:BOOL=ON \
-DINSTALL_DOC_Overview:BOOL=ON

.include <bsd.port.options.mk>

Expand Down Expand Up @@ -161,23 +172,17 @@ pre-configure:
${REINPLACE_CMD} -e 's|lin|bsd|' ${WRKSRC}/${es}
.endfor

post-build-DOXYGEN-on:
(cd ${WRKSRC} && ./gendoc -overview)

post-stage:
${MKDIR} ${STAGEDIR}${PREFIX}/lib/cmake/OpenCASCADE
${MV} ${STAGEDIR}${PREFIX}/lib/cmake/*.cmake \
${STAGEDIR}${PREFIX}/lib/cmake/OpenCASCADE

post-install:
${MV} ${STAGEDIR}${OCCROOT}/bin/DRAWEXE-${DISTVERSION:C/-beta//} ${STAGEDIR}${PREFIX}/bin/DRAWEXE
${MV} ${STAGEDIR}${OCCROOT}/bin/DRAWEXE-${PORTVERSION} ${STAGEDIR}${PREFIX}/bin/DRAWEXE
${RLN} ${STAGEDIR}${PREFIX}/bin/DRAWEXE ${STAGEDIR}${OCCROOT}/bin

post-install-DOXYGEN-on:
${MKDIR} ${STAGEDIR}${DOCSDIR}
(cd ${WRKSRC}/doc/overview && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR})
${RM} -r ${STAGEDIR}${DOCSDIR}/latex
${RM} ${STAGEDIR}${DOCSDIR}/html/build_upgrade_building_3rdparty.html.bak
${RLN} ${STAGEDIR}${OCCROOT}/${DOCSDIR_REL} ${STAGEDIR}${DOCSDIR}

.if defined(MAINTAINER_MODE)
regression-test: install
Expand Down
8 changes: 5 additions & 3 deletions cad/opencascade/distinfo
@@ -1,3 +1,5 @@
TIMESTAMP = 1668069465
SHA256 (opencascade-7.7.0.tgz) = 40e8e0e78b56dd407192b4cabf55dd0bdd1fa9c0a292d263b12f7e21733cb07e
SIZE (opencascade-7.7.0.tgz) = 247268442
TIMESTAMP = 1701808276
SHA256 (documentation.tar.xz) = 3c5cdd70de9c82d9f0be4b9400d618494cfecd28f502d110111060c9aaaf50c7
SIZE (documentation.tar.xz) = 48428333
SHA256 (Open-Cascade-SAS-OCCT-V7_8_0_GH0.tar.gz) = 3c5cdd70de9c82d9f0be4b9400d618494cfecd28f502d110111060c9aaaf50c7
SIZE (Open-Cascade-SAS-OCCT-V7_8_0_GH0.tar.gz) = 48428333
8 changes: 4 additions & 4 deletions cad/opencascade/files/patch-CMakeLists.txt
@@ -1,6 +1,6 @@
--- CMakeLists.txt.orig 2022-09-30 11:53:39 UTC
--- CMakeLists.txt.orig 2023-12-04 15:53:08 UTC
+++ CMakeLists.txt
@@ -1005,7 +1005,7 @@ if (${DRAWEXE_INDEX} GREATER -1)
@@ -1015,7 +1015,7 @@ if (${DRAWEXE_INDEX} GREATER -1)
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
else()
install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
Expand All @@ -9,7 +9,7 @@
endif()

# copy draw script to CMake binary folder
@@ -1021,7 +1021,7 @@ endif()
@@ -1031,7 +1031,7 @@ endif()
endif()

# change custom.bat/sh
Expand All @@ -18,7 +18,7 @@
file (READ "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}" CUSTOM_CONTENT)

set (CUSTOM_CONTENT "${CUSTOM_CONTENT} ${ADDITIONAL_CUSTOM_CONTENT}")
@@ -1265,7 +1265,7 @@ install (CODE "string (TOLOWER \"\${CMAKE_INSTALL_CONF
@@ -1275,7 +1275,7 @@ install (CODE "string (TOLOWER \"\${CMAKE_INSTALL_CONF
endforeach()
# install OpenCASCADE config file with compile definitions and C/C++ flags ONLY for current configuration
install (CODE "string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWER)")
Expand Down
10 changes: 10 additions & 0 deletions cad/opencascade/files/patch-adm_UDLIST
@@ -0,0 +1,10 @@
--- adm/UDLIST.orig 2023-12-04 15:53:08 UTC
+++ adm/UDLIST
@@ -32,6 +32,7 @@ r OS
n gp
n math
r OS
+n FlexLexer
t TKMath
t TKernel
n Adaptor2d
6 changes: 3 additions & 3 deletions cad/opencascade/files/patch-adm_cmake_occt__macros.cmake
@@ -1,4 +1,4 @@
--- adm/cmake/occt_macros.cmake.orig 2022-09-30 11:53:39 UTC
--- adm/cmake/occt_macros.cmake.orig 2023-12-04 15:53:08 UTC
+++ adm/cmake/occt_macros.cmake
@@ -47,7 +47,7 @@ macro (OCCT_MAKE_OS_WITH_BITNESS)
elseif(APPLE)
Expand All @@ -9,7 +9,7 @@
endif()
endmacro()

@@ -336,7 +336,7 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARG
@@ -338,7 +338,7 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARG
configure_file ("${TEMPLATE_HEADER_PATH}" "${ROOT_TARGET_OCCT_DIR}/${OCCT_INSTALL_DIR_PREFIX}/${HEADER_FILE_NAME}" @ONLY)
endforeach()

Expand All @@ -18,7 +18,7 @@

string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "Info: \(${CURRENT_TIME}\) Checking headers in inc folder...")
@@ -590,12 +590,12 @@ macro (OCCT_UPDATE_TARGET_FILE)
@@ -592,12 +592,12 @@ macro (OCCT_UPDATE_TARGET_FILE)

install (CODE
"string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWERCASE)
Expand Down
@@ -1,6 +1,6 @@
--- adm/templates/custom.install.sh.in.orig 2021-06-26 15:04:30 UTC
--- adm/templates/custom.install.sh.in.orig 2023-12-06 17:35:33 UTC
+++ adm/templates/custom.install.sh.in
@@ -20,14 +20,14 @@ if [ "$1" == "@BIN_LETTER@" ]; then
@@ -21,14 +21,14 @@ if [ "$1" == "@BIN_LETTER@" ]; then
export TCL_VERSION_WITH_DOT="@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
export TK_VERSION_WITH_DOT="@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"

Expand Down
@@ -1,6 +1,6 @@
- workaround for https://gitlab.kitware.com/vtk/vtk/-/issues/18683

--- src/IVtkDraw/IVtkDraw_Interactor.cxx.orig 2021-10-30 11:13:52 UTC
--- src/IVtkDraw/IVtkDraw_Interactor.cxx.orig 2023-12-04 15:53:08 UTC
+++ src/IVtkDraw/IVtkDraw_Interactor.cxx
@@ -26,6 +26,12 @@
#ifdef AllValues
Expand All @@ -13,5 +13,5 @@
+#undef Success
+#endif

#include <vtkXRenderWindowInteractor.h>
#include <vtkXOpenGLRenderWindow.h>
// Resolve name collisions with X11 headers
#ifdef Status
@@ -0,0 +1,10 @@
--- src/Message/Message_AttributeMeter.cxx.orig 2023-12-04 15:53:08 UTC
+++ src/Message/Message_AttributeMeter.cxx
@@ -253,6 +253,6 @@ void Message_AttributeMeter::DumpJson (Standard_OStrea
anIterator.More(); anIterator.Next())
{
OCCT_DUMP_VECTOR_CLASS (theOStream, Message::MetricToString (anIterator.Key()),
- 2, anIterator.Value(), anIterator.Value())
+ 2, anIterator.Value().first, anIterator.Value().second)
}
}
@@ -0,0 +1,39 @@
--- src/NCollection/NCollection_Array1.hxx.orig 2023-12-04 15:53:08 UTC
+++ src/NCollection/NCollection_Array1.hxx
@@ -72,26 +72,10 @@ class NCollection_Array1 (public)

using iterator = NCollection_IndexedIterator<std::random_access_iterator_tag, NCollection_Array1, value_type, false>;
using const_iterator = NCollection_IndexedIterator<std::random_access_iterator_tag, NCollection_Array1, value_type, true>;
+ using Iterator = NCollection_Iterator<NCollection_Array1<TheItemType>>;

public:

- // Iterator class
- class Iterator : public NCollection_Iterator<NCollection_Array1>
- {
- public:
- using NCollection_Iterator<NCollection_Array1>::NCollection_Iterator;
-
- const_reference Value() const
- {
- return *NCollection_Iterator<NCollection_Array1>::ValueIter();
- }
-
- reference ChangeValue()
- {
- return *NCollection_Iterator<NCollection_Array1>::ChangeValueIter();
- }
- };
-
const_iterator begin() const
{
return const_iterator(*this);
@@ -150,7 +134,7 @@ class NCollection_Array1 (public)
mySize(theUpper - theLower + 1),
myPointer(nullptr),
myIsOwner(false),
- allocator_type(theAlloc)
+ myAllocator(theAlloc)
{
if (mySize == 0)
{
@@ -0,0 +1,29 @@
--- src/NCollection/NCollection_DynamicArray.hxx.orig 2023-12-04 15:53:08 UTC
+++ src/NCollection/NCollection_DynamicArray.hxx
@@ -77,25 +77,9 @@ class NCollection_DynamicArray (public)

using iterator = NCollection_IndexedIterator<std::random_access_iterator_tag, NCollection_DynamicArray, value_type, false>;
using const_iterator = NCollection_IndexedIterator<std::random_access_iterator_tag, NCollection_DynamicArray, value_type, true>;
+ using Iterator = NCollection_Iterator<NCollection_DynamicArray<TheItemType>>;

public:
-
- // Iterator class
- class Iterator : public NCollection_Iterator<NCollection_DynamicArray>
- {
- public:
- using NCollection_Iterator<NCollection_DynamicArray>::NCollection_Iterator;
-
- const_reference Value() const
- {
- return *NCollection_Iterator<NCollection_DynamicArray>::ValueIter();
- }
-
- reference ChangeValue()
- {
- return *NCollection_Iterator<NCollection_DynamicArray>::ChangeValueIter();
- }
- };

const_iterator begin() const
{
@@ -0,0 +1,19 @@
--- src/NCollection/NCollection_Iterator.hxx.orig 2023-12-04 15:53:08 UTC
+++ src/NCollection/NCollection_Iterator.hxx
@@ -94,6 +94,16 @@ class NCollection_Iterator (public)
++(myCur);
}

+ const typename Container::const_reference Value() const
+ {
+ return *myCur;
+ }
+
+ const typename Container::reference ChangeValue()
+ {
+ return *myCur;
+ }
+
bool operator==(const NCollection_Iterator& theOther) { return myLast == theOther.myLast && myCur == theOther.myCur; }

bool operator!=(const NCollection_Iterator& theOther) { return myLast != theOther.myLast || myCur != theOther.myCur; }
@@ -0,0 +1,21 @@
--- src/STEPCAFControl/STEPCAFControl_Reader.cxx.orig 2023-12-04 15:53:08 UTC
+++ src/STEPCAFControl/STEPCAFControl_Reader.cxx
@@ -1996,7 +1996,8 @@ Handle(Poly_Triangulation) createMesh(const Handle(Ste
const Standard_Integer aNbNormals = theTriangulatedSufaceSet->NbNormals();
// Number of pairs (Point, Normal). It is possible for one point to have multiple normals. This is
// useful when the underlying surface is not C1 continuous.
- const Standard_Integer aNbPairs = aNbNormals > 1 ? theTriangulatedSufaceSet->NbPnindex() : aNodes->Length();
+ // Patch from https://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff;h=0f6f5b64d321a988399567f6b901bef385cc8d41
+ const Standard_Integer aNbPairs = aNbNormals > 1 ? theTriangulatedSufaceSet->Pnmax() : aNodes->Length();
const Standard_Boolean aHasNormals = aNbNormals > 0;

// Counting number of triangles in the triangle strips list.
@@ -2021,7 +2022,7 @@ Handle(Poly_Triangulation) createMesh(const Handle(Ste

for (Standard_Integer j = 1; j <= aNbPairs; ++j)
{
- const gp_XYZ& aPoint = aNodes->Value(aNbNormals > 1 ? theTriangulatedSufaceSet->PnindexValue(j) : j);
+ const gp_XYZ& aPoint = aNodes->Value((aNbNormals > 1 && theTriangulatedSufaceSet->NbPnindex() > 0) ? theTriangulatedSufaceSet->PnindexValue(j) : j);
aMesh->SetNode(j, theFact * aPoint);
}

@@ -1,6 +1,6 @@
--- src/Standard/Standard_CString.cxx.orig 2022-09-30 11:54:05 UTC
--- src/Standard/Standard_CString.cxx.orig 2023-12-04 15:53:08 UTC
+++ src/Standard/Standard_CString.cxx
@@ -80,7 +80,7 @@ Standard_Integer HashCodes (const Standard_CString the
@@ -50,7 +50,7 @@
// strtod, strtol, strtoll functions. For other system with locale-depended
// implementations problems may appear if "C" locale is not set explicitly.
#if !defined(__ANDROID__) && !defined(__QNX__) && !defined(__MINGW32__)
Expand Down

This file was deleted.

0 comments on commit 70f1baf

Please sign in to comment.