cad/opencascade: switch to vtk9

- switches opencascade to vtk9 to enable upcoming import of
  cad/py-ocp
- cad/freecad has to switch vtk8 -> vtk9, too
  - this requires upstream commit 0cfea3fee3e7848bbf043d2b1a19f6405d7ebe25
    "Make smesh compile with vtk9"
  - while touching this, fixes vtk module detection
  - clean up VTK_DIR usage: that variable does not exist in FreeCAD's
    build system anymore (for quite some time, actually)

Obtained from:	opencascade upstream: Kirill Gavrilov
Obtained from:	freecad upstream: committed by github/wwmayer
Differential Revision:	D30934
Reported by:	thierry@
Submitted by:	thierry@
This commit is contained in:
Christoph Moench-Tegeder 2021-07-07 09:54:41 +02:00
parent 53c01d6598
commit f3c231d641
12 changed files with 107 additions and 32 deletions

View file

@ -1,11 +1,14 @@
PORTNAME= FreeCAD PORTNAME= FreeCAD
DISTVERSION= 0.19.2 DISTVERSION= 0.19.2
PORTREVISION= 2 PORTREVISION= 3
# use these for bugfixes/snapshots # use these for bugfixes/snapshots
# DISTVERSION= 0.18-16093 # git rev-list --count # DISTVERSION= 0.18-16093 # git rev-list --count
# DISTVERSIONSUFFIX= -g690774c0e # DISTVERSIONSUFFIX= -g690774c0e
CATEGORIES= cad CATEGORIES= cad
PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
PATCHFILES= 0cfea3fee3e7848bbf043d2b1a19f6405d7ebe25.patch:-p1
MAINTAINER= cmt@FreeBSD.org MAINTAINER= cmt@FreeBSD.org
COMMENT= General purpose 3D CAD modeller COMMENT= General purpose 3D CAD modeller
@ -22,7 +25,7 @@ LIB_DEPENDS= libexpat.so:textproc/expat2 \
libCoin.so:graphics/Coin \ libCoin.so:graphics/Coin \
libpng.so:graphics/png \ libpng.so:graphics/png \
libtiff.so:graphics/tiff \ libtiff.so:graphics/tiff \
libvtkFiltersTexture-8.2.so:math/vtk8 \ libvtksys-${VTK_VER}.so:math/vtk${VTK_VER:R} \
libTKernel.so:cad/opencascade \ libTKernel.so:cad/opencascade \
libxerces-c.so:textproc/xerces-c3 \ libxerces-c.so:textproc/xerces-c3 \
libboost_thread.so:devel/boost-libs \ libboost_thread.so:devel/boost-libs \
@ -43,6 +46,8 @@ USE_QT= buildtools concurrent core gui network opengl printsupport \
qmake_build svg webkit widgets xml xmlpatterns qmake_build svg webkit widgets xml xmlpatterns
USE_LDCONFIG= yes USE_LDCONFIG= yes
VTK_VER= 9.0
DOS2UNIX_GLOB= *.txt *.h *.cpp *.py *.qss *.csv *.pov *.stp *.ui *.wrl *.WRL DOS2UNIX_GLOB= *.txt *.h *.cpp *.py *.qss *.csv *.pov *.stp *.ui *.wrl *.WRL
CMAKE_ARGS+= -DOCC_INCLUDE_DIR="${LOCALBASE}/include/OpenCASCADE" \ CMAKE_ARGS+= -DOCC_INCLUDE_DIR="${LOCALBASE}/include/OpenCASCADE" \
@ -55,7 +60,6 @@ CMAKE_ARGS+= -DOCC_INCLUDE_DIR="${LOCALBASE}/include/OpenCASCADE" \
-DBUILD_ASSEMBLY="OFF" -DBUILD_FLAT_MESH="ON" \ -DBUILD_ASSEMBLY="OFF" -DBUILD_FLAT_MESH="ON" \
-DPYSIDE2RCCBINARY="${RCC}" \ -DPYSIDE2RCCBINARY="${RCC}" \
-DPYSIDE2UICBINARY="${UIC}" \ -DPYSIDE2UICBINARY="${UIC}" \
-DVTK_DIR:PATH=${LOCALBASE}/lib/vtk-8.2/cmake/vtk-8.2 \
-DBUILD_ENABLE_CXX_STD=C++17 -DBUILD_ENABLE_CXX_STD=C++17
CMAKE_INSTALL_PREFIX= ${PREFIX}/${PORTNAME} CMAKE_INSTALL_PREFIX= ${PREFIX}/${PORTNAME}

View file

@ -1,3 +1,5 @@
TIMESTAMP = 1619964737 TIMESTAMP = 1619964737
SHA256 (FreeCAD-FreeCAD-0.19.2_GH0.tar.gz) = 47e39e3d6fcafe6e0c68923fb1b86acda16986268e5e6011694057b940139fba SHA256 (FreeCAD-FreeCAD-0.19.2_GH0.tar.gz) = 47e39e3d6fcafe6e0c68923fb1b86acda16986268e5e6011694057b940139fba
SIZE (FreeCAD-FreeCAD-0.19.2_GH0.tar.gz) = 296987961 SIZE (FreeCAD-FreeCAD-0.19.2_GH0.tar.gz) = 296987961
SHA256 (0cfea3fee3e7848bbf043d2b1a19f6405d7ebe25.patch) = 71a2ad3bc210281d151add9e73beab78eaa1cc6d94bf97db865b4171f8d56d4d
SIZE (0cfea3fee3e7848bbf043d2b1a19f6405d7ebe25.patch) = 34604

View file

@ -0,0 +1,40 @@
--- cMake/FreeCAD_Helpers/SetupSalomeSMESH.cmake.orig 2021-04-15 09:17:08 UTC
+++ cMake/FreeCAD_Helpers/SetupSalomeSMESH.cmake
@@ -12,24 +12,24 @@ macro(SetupSalomeSMESH)
#if we use smesh we definitely also need vtk, no matter of external or internal smesh
set (VTK_COMPONENTS
- vtkCommonCore
- vtkCommonDataModel
- vtkFiltersVerdict
- vtkIOXML
- vtkFiltersCore
- vtkFiltersGeneral
- vtkIOLegacy
- vtkFiltersExtraction
- vtkFiltersSources
- vtkFiltersGeometry
+ CommonCore
+ tkCommonDataModel
+ tkFiltersVerdict
+ tkIOXML
+ tkFiltersCore
+ tkFiltersGeneral
+ tkIOLegacy
+ tkFiltersExtraction
+ tkFiltersSources
+ tkFiltersGeometry
)
# check which modules are available
if(UNIX OR WIN32)
- find_package(VTK COMPONENTS vtkCommonCore REQUIRED NO_MODULE)
- list(APPEND VTK_COMPONENTS vtkIOMPIParallel vtkParallelMPI vtkhdf5 vtkFiltersParallelDIY2 vtkRenderingCore vtkInteractionStyle vtkRenderingFreeType vtkRenderingOpenGL2)
+ find_package(VTK COMPONENTS CommonCore REQUIRED NO_MODULE)
+ list(APPEND VTK_COMPONENTS IOMPIParallel ParallelMPI hdf5 FiltersParallelDIY2 RenderingCore InteractionStyle RenderingFreeType RenderingOpenGL2)
foreach(_module ${VTK_COMPONENTS})
- list (FIND VTK_MODULES_ENABLED ${_module} _index)
+ list (FIND VTK_AVAILABLE_COMPONENTS ${_module} _index)
if (${_index} GREATER -1)
list(APPEND AVAILABLE_VTK_COMPONENTS ${_module})
endif()

View file

@ -2,7 +2,7 @@
PORTNAME= opencascade PORTNAME= opencascade
PORTVERSION= 7.5.0 PORTVERSION= 7.5.0
PORTREVISION= 2 PORTREVISION= 3
CATEGORIES= cad science CATEGORIES= cad science
MASTER_SITES= LOCAL/thierry MASTER_SITES= LOCAL/thierry
@ -18,8 +18,8 @@ BUILD_DEPENDS= rapidjson>0:devel/rapidjson \
${LOCALBASE}/lib/qt5/bin/qmake:devel/qt5-qmake \ ${LOCALBASE}/lib/qt5/bin/qmake:devel/qt5-qmake \
${LOCALBASE}/lib/qt5/bin/moc:devel/qt5-buildtools ${LOCALBASE}/lib/qt5/bin/moc:devel/qt5-buildtools
LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \ LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \
libvtksys-${VTKVER}.so:math/vtk8 \ libfreetype.so:print/freetype2 \
libfreetype.so:print/freetype2 libvtksys-${VTKVER}.so:math/vtk${VTKVER:R}
RUN_DEPENDS= bash:shells/bash RUN_DEPENDS= bash:shells/bash
# Check ${WRKSRC}/dox/overview/overview.md # Check ${WRKSRC}/dox/overview/overview.md
@ -27,7 +27,7 @@ RUN_DEPENDS= bash:shells/bash
USES= alias:10 cmake compiler:c++14-lang dos2unix \ USES= alias:10 cmake compiler:c++14-lang dos2unix \
gl python qt:5 shebangfix tk tar:tgz xorg gl python qt:5 shebangfix tk tar:tgz xorg
USE_XORG= ice sm x11 xext xi xmu xt USE_XORG= ice sm x11 xext xi xmu xt
USE_GL= gl glu USE_GL= egl gl glesv2 glu
DOS2UNIX_FILES= adm/templates/* DOS2UNIX_FILES= adm/templates/*
SHEBANG_FILES= adm/templates/*.sh \ SHEBANG_FILES= adm/templates/*.sh \
@ -38,7 +38,7 @@ SHEBANG_FILES= adm/templates/*.sh \
gendoc gendoc
ENVSH= adm/templates/env.sh ENVSH= adm/templates/env.sh
VTKVER= 8.2 VTKVER= 9.0
OPTIONS_DEFINE= DOCS DOXYGEN FFMPEG VIS OPTIONS_DEFINE= DOCS DOXYGEN FFMPEG VIS
VIS_DESC= Build Visualizazion module (requires OpenGL, freetype, ftgl) VIS_DESC= Build Visualizazion module (requires OpenGL, freetype, ftgl)
@ -59,7 +59,7 @@ CMAKE_ARGS+= -DINSTALL_DIR=${OCCROOT} \
-DUSE_TBB:BOOL=OFF \ -DUSE_TBB:BOOL=OFF \
-DUSE_RAPIDJSON:BOOL=ON \ -DUSE_RAPIDJSON:BOOL=ON \
-DUSE_VTK:BOOL=ON \ -DUSE_VTK:BOOL=ON \
-DVTK_DIR:PATH=${LOCALBASE}/lib/vtk-${VTKVER}/cmake/vtk-${VTKVER} -D3RDPARTY_VTK_INCLUDE_DIR:PATH=${LOCALBASE}/include/vtk-${VTKVER}
# TODO: TBB to be replaced by onetbb later # TODO: TBB to be replaced by onetbb later
#CMAKE_ARGS+= -DUSE_EIGEN:BOOL=ON -DUSE_TBB:BOOL=ON #CMAKE_ARGS+= -DUSE_EIGEN:BOOL=ON -DUSE_TBB:BOOL=ON

View file

@ -1,9 +1,10 @@
--- adm/cmake/occt_csf.cmake.orig 2018-05-25 19:13:23 UTC --- adm/cmake/occt_csf.cmake.orig 2020-11-03 14:49:43 UTC
+++ adm/cmake/occt_csf.cmake +++ adm/cmake/occt_csf.cmake
@@ -116,6 +116,5 @@ if (WIN32) @@ -124,7 +124,6 @@ else()
set (CSF_OpenGlLibs "GL") set (CSF_OpenGlLibs "GL")
endif() endif()
set (CSF_XwLibs "X11 Xext Xmu Xi") set (CSF_XwLibs "X11 Xext Xmu Xi")
- set (CSF_dl "dl") - set (CSF_dl "dl")
set (CSF_fontconfig "fontconfig")
endif() endif()
endif() endif()

View file

@ -1,6 +1,6 @@
--- adm/cmake/occt_macros.cmake.orig 2018-05-25 19:13:23 UTC --- adm/cmake/occt_macros.cmake.orig 2020-11-03 14:49:43 UTC
+++ adm/cmake/occt_macros.cmake +++ adm/cmake/occt_macros.cmake
@@ -53,7 +53,7 @@ macro (OCCT_MAKE_OS_WITH_BITNESS) @@ -47,7 +47,7 @@ macro (OCCT_MAKE_OS_WITH_BITNESS)
elseif(APPLE) elseif(APPLE)
set (OS_WITH_BIT "mac${COMPILER_BITNESS}") set (OS_WITH_BIT "mac${COMPILER_BITNESS}")
else() else()
@ -9,7 +9,7 @@
endif() endif()
endmacro() endmacro()
@@ -337,7 +337,7 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_F @@ -336,7 +336,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) configure_file ("${TEMPLATE_HEADER_PATH}" "${ROOT_TARGET_OCCT_DIR}/${OCCT_INSTALL_DIR_PREFIX}/${HEADER_FILE_NAME}" @ONLY)
endforeach() endforeach()

View file

@ -1,6 +1,6 @@
--- adm/templates/OpenCASCADEConfig.cmake.in.orig 2017-12-27 14:54:08 UTC --- adm/templates/OpenCASCADEConfig.cmake.in.orig 2021-06-26 15:04:30 UTC
+++ adm/templates/OpenCASCADEConfig.cmake.in +++ adm/templates/OpenCASCADEConfig.cmake.in
@@ -31,11 +31,11 @@ if (OpenCASCADE_INSTALL_PREFIX MATCHES " @@ -36,11 +36,11 @@ if (OpenCASCADE_INSTALL_PREFIX MATCHES "/libs/${CMAKE_
endif() endif()
# Set OpenCASCADE paths to headers, binaries, libraries, resources, tests, samples, data # Set OpenCASCADE paths to headers, binaries, libraries, resources, tests, samples, data

View file

@ -1,6 +1,6 @@
--- adm/templates/custom.install.sh.in.orig 2017-12-27 14:54:08 UTC --- adm/templates/custom.install.sh.in.orig 2021-06-26 15:04:30 UTC
+++ adm/templates/custom.install.sh.in +++ adm/templates/custom.install.sh.in
@@ -21,14 +21,14 @@ if [ "$1" == "@BIN_LETTER@" ]; then @@ -20,14 +20,14 @@ if [ "$1" == "@BIN_LETTER@" ]; then
export TCL_VERSION_WITH_DOT="@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@" export TCL_VERSION_WITH_DOT="@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
export TK_VERSION_WITH_DOT="@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@" export TK_VERSION_WITH_DOT="@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"

View file

@ -1,6 +1,6 @@
--- src/DrawResources/CheckCommands.tcl.orig 2018-05-25 19:13:38 UTC --- src/DrawResources/CheckCommands.tcl.orig 2020-11-03 14:49:56 UTC
+++ src/DrawResources/CheckCommands.tcl +++ src/DrawResources/CheckCommands.tcl
@@ -1036,6 +1036,7 @@ help checkplatform { @@ -1053,6 +1053,7 @@ help checkplatform {
-windows : return 1 if current platform is 'Windows', overwise return 0 -windows : return 1 if current platform is 'Windows', overwise return 0
-linux : return 1 if current platform is 'Linux', overwise return 0 -linux : return 1 if current platform is 'Linux', overwise return 0
-osx : return 1 if current platform is 'MacOS X', overwise return 0 -osx : return 1 if current platform is 'MacOS X', overwise return 0
@ -8,7 +8,7 @@
Only one option can be used at once. Only one option can be used at once.
If no option is given, procedure will return the name of current platform. If no option is given, procedure will return the name of current platform.
@@ -1044,9 +1045,11 @@ proc checkplatform {args} { @@ -1061,9 +1062,11 @@ proc checkplatform {args} {
set check_for_windows false set check_for_windows false
set check_for_linux false set check_for_linux false
set check_for_macosx false set check_for_macosx false
@ -20,7 +20,7 @@
{"-osx" check_for_macosx 0}} {"-osx" check_for_macosx 0}}
_check_args ${args} ${options} "checkplatform" _check_args ${args} ${options} "checkplatform"
@@ -1055,17 +1058,19 @@ proc checkplatform {args} { @@ -1072,17 +1075,19 @@ proc checkplatform {args} {
set current_platform Windows set current_platform Windows
} elseif { $::tcl_platform(os) == "Linux" } { } elseif { $::tcl_platform(os) == "Linux" } {
set current_platform Linux set current_platform Linux
@ -42,21 +42,18 @@
error "Error: wrong usage of command checkplatform, only single option can be used at once" error "Error: wrong usage of command checkplatform, only single option can be used at once"
} }
@@ -1074,11 +1079,16 @@ proc checkplatform {args} { @@ -1091,8 +1096,13 @@ proc checkplatform {args} {
return 1 return 1
} }
- # checking for Mac OS X platforms - # checking for Mac OS X platforms
+ # checking for Linux platforms + # checking for Linux platforms
if { ${check_for_linux} && ${current_platform} == "Linux" } { if { ${check_for_linux} && ${current_platform} == "Linux" } {
return 1
}
+ # checking for FreeBSD platforms
+ if { ${check_for_freebsd} && ${current_platform} == "FreeBSD" } {
+ return 1 + return 1
+ } + }
+ +
# checking for Mac OS X platforms + # checking for FreeBSD platforms
if { ${check_for_macosx} && ${current_platform} == "MacOS" } { + if { ${check_for_freebsd} && ${current_platform} == "FreeBSD" } {
return 1 return 1
}

View file

@ -0,0 +1,15 @@
--- src/IVtkDraw/IVtkDraw.cxx.orig 2020-11-03 14:50:01 UTC
+++ src/IVtkDraw/IVtkDraw.cxx
@@ -36,6 +36,12 @@
#include <V3d_TypeOfOrientation.hxx>
#include <Aspect_DisplayConnection.hxx>
+// Preventing naming collisions between
+// GLX and VTK versions 9.0 and above
+#ifdef AllValues
+#undef AllValues
+#endif
+
#include <IVtk_Types.hxx>
#include <IVtkVTK_ShapeData.hxx>
#include <IVtkOCC_Shape.hxx>

View file

@ -0,0 +1,16 @@
--- src/IVtkDraw/IVtkDraw_Interactor.cxx.orig 2020-11-03 14:50:01 UTC
+++ src/IVtkDraw/IVtkDraw_Interactor.cxx
@@ -20,6 +20,13 @@
#include <vtkWin32OpenGLRenderWindow.h>
#else
#include <GL/glx.h>
+
+// Preventing naming collisions between
+// GLX and VTK versions 9.0 and above
+#ifdef AllValues
+#undef AllValues
+#endif
+
#include <vtkXRenderWindowInteractor.h>
#include <vtkXOpenGLRenderWindow.h>
#endif

View file

@ -1,6 +1,6 @@
--- src/Standard/Standard_CString.cxx.orig 2017-08-30 13:28:31 UTC --- src/Standard/Standard_CString.cxx.orig 2020-11-03 14:50:08 UTC
+++ src/Standard/Standard_CString.cxx +++ src/Standard/Standard_CString.cxx
@@ -81,7 +81,7 @@ Standard_Integer HashCodes (const Standa @@ -83,7 +83,7 @@ Standard_Integer HashCodes (const Standard_CString the
// strtod, strtol, strtoll functions. For other system with locale-depended // strtod, strtol, strtoll functions. For other system with locale-depended
// implementations problems may appear if "C" locale is not set explicitly. // implementations problems may appear if "C" locale is not set explicitly.
#if !defined(__ANDROID__) && !defined(__QNX__) && !defined(__MINGW32__) #if !defined(__ANDROID__) && !defined(__QNX__) && !defined(__MINGW32__)