# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 PortSystem 1.0 PortGroup cmake 1.1 PortGroup compiler_blacklist_versions 1.0 PortGroup mpi 1.0 PortGroup muniversal 1.0 # Require C++11 compiler.cxx_standard 2011 # some older Clang say they support C++11 when they don't # this is the same blacklisting as for jsoncpp, on which vtk depends. compiler.blacklist-append {clang < 900} name vtk version 9.3.1 revision 1 categories graphics devel license BSD set branch [join [lrange [split ${version} .] 0 1] .] maintainers {stromnov @stromnov} \ {@Dave-Allured noaa.gov:dave.allured} \ openmaintainer description Visualization Toolkit (VTK) long_description Visualization Toolkit (VTK) is an open-source, freely \ available software system for 3D computer graphics, \ image processing and visualization. homepage https://www.vtk.org master_sites ${homepage}/files/release/${branch} distname VTK-${version} checksums rmd160 98a2dbf4db1fb92b974f8476490b913718bfd36f \ sha256 8354ec084ea0d2dc3d23dbe4243823c4bfc270382d0ce8d658939fd50061cab8 \ size 99964158 mpi.setup depends_lib-append \ port:double-conversion \ path:share/pkgconfig/eigen3.pc:eigen3 \ port:expat \ port:freetype \ port:gl2ps \ port:glew \ port:hdf5 \ path:include/turbojpeg.h:libjpeg-turbo \ port:jsoncpp \ port:libharu \ port:libogg \ port:libtheora \ port:lz4 \ port:netcdf-cxx \ port:pugixml \ port:tiff \ port:zlib mpi.enforce_variant hdf5 # Re restoring support for legacy macOS, see: # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/11171 # https://gitlab.kitware.com/vtk/vtk/-/issues/19352 patchfiles-append patch-MACH_TASK_BASIC_INFO.diff configure.pre_args-delete \ -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON configure.args-append \ ../${distname}/ \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=ON \ -DVTK_BUILD_EXAMPLES:BOOL=OFF \ -DVTK_WRAP_PYTHON:BOOL=OFF \ -DVTK_WRAP_JAVA:BOOL=OFF \ -DVTK_USE_COCOA:BOOL=ON # Support for Cocoa of 10.6 has been dropped in # https://github.com/Kitware/VTK/commit/f2e249c0a6a93f12808822cc5e5dddda35a09a35 # However it is an optional module. Instead of breaking the port, # just disable what is broken. Notice, it may also be possible # to build with SDL2 backend (VTK_USE_SDL2) or X-less Mesa. if {${os.platform} eq "darwin" && ${os.major} < 11} { # Avoid hardcoded failure: patchfiles-append patch-vtkApple.cmake.diff # Fix for pthreads, only relevant for < 10.7: patchfiles-append patch-pthread_threadid_np.diff # Ensure Cocoa does not get picked and fix GL linking: patchfiles-append patch-use-x11.diff # Fix 32-bit builds with gcc: if {[string match *gcc* ${configure.compiler}] \ && ${configure.build_arch} in [list arm i386 ppc]} { patchfiles-append \ patch-DataModel.diff } depends_lib-append port:mesa \ port:xorg-libX11 \ port:xorg-libXcursor configure.args-append \ -DVTK_USE_X:BOOL=ON configure.args-replace \ -DVTK_USE_COCOA:BOOL=ON -DVTK_USE_COCOA:BOOL=OFF # As proposed at #46890 configure.args-append \ -DIOKit:FILEPATH=/System/Library/Frameworks/IOKit.framework } # loguru.cpp:576:90: error: invalid conversion from 'long unsigned int' # to 'size_t*' {aka 'long unsigned int*'} [-fpermissive] # loguru.cpp:580:68: error: invalid conversion from 'const char*' # to 'char*' [-fpermissive]. Perhaps specific to older SDKs, # but gcc is not used by default elsewhere anyway. if {[string match *gcc* ${configure.compiler}]} { configure.cxxflags-append \ -fpermissive } variant ffmpeg description {Add support for ffmpeg} { depends_lib-append path:lib/libavcodec.dylib:ffmpeg configure.args-append \ -DModule_vtkIOFFMPEG:BOOL=ON } variant qt5 description {Add Qt5 support.} { PortGroup qt5 1.0 configure.args-append \ -DQT_QMAKE_EXECUTABLE:PATH=${qt_qmake_cmd} \ -DQMLPLUGINDUMP_EXECUTABLE:PATH=${qt_bins_dir}/qmlplugindump \ -DVTK_QT_VERSION=5 \ -DVTK_GROUP_ENABLE_Qt:STRING=YES \ -DVTK_MODULE_ENABLE_VTK_GUISupportQt=YES \ -DVTK_MODULE_ENABLE_VTK_RenderingQt=YES \ -DVTK_MODULE_ENABLE_VTK_ViewsQt=YES } # Supported pythons set python_versions {39 310 311 312} foreach pyver ${python_versions} { # Conflicting python versions set other_python_versions {} foreach other_pyver ${python_versions} { if {${other_pyver} ne ${pyver}} { if {${other_pyver} ni ${other_python_versions}} { lappend other_python_versions python${other_pyver} } } } # Get python branch set python_branch "[string index ${pyver} 0].[string range ${pyver} 1 end]" set python_major_ver "[string index ${pyver} 0]" variant python${pyver} conflicts {*}${other_python_versions} description "Add Python ${python_branch} support" " depends_lib-append port:python${pyver} configure.args-delete \ -DVTK_WRAP_PYTHON:BOOL=OFF configure.args-append \ -DVTK_WRAP_PYTHON:BOOL=ON \ -DPython${python_major_ver}_EXECUTABLE:STRING=${prefix}/bin/python${python_branch} \ -DPython${python_major_ver}_INCLUDE_DIR=${frameworks_dir}/Python.framework/Versions/${python_branch}/Headers/ \ -DPython${python_major_ver}_LIBRARY=${frameworks_dir}/Python.framework/Versions/${python_branch}/lib/libpython${python_branch}.dylib \ -DVTK_PYTHON_SITE_PACKAGES_SUFFIX=Library/Frameworks/Python.framework/Versions/${python_branch}/lib/python${python_branch}/site-packages \ if {[mpi_variant_isset]} { depends_lib-append port:py${pyver}-mpi4py configure.args-append \ -DVTK_USE_SYSTEM_MPI4PY:BOOL=ON } post-destroot { # generate setup.py and other necessary files to create .dist-info folder system -W ${workpath}/build \"cmake -DVTK_WHEEL_BUILD:BOOL=ON -DVTK_VERSION_SUFFIX= ${worksrcpath}\" set site_pack_dir Library/Frameworks/Python.framework/Versions/${python_branch}/lib/python${python_branch}/site-packages delete -force ${workpath}/build/vtkmodules copy ${workpath}/build/\${site_pack_dir}/vtkmodules ${workpath}/build # create the .dist-info folder and contents system -W ${workpath}/build \"${prefix}/bin/python${python_branch} setup.py dist_info\" copy ${workpath}/build/${name}-${version}.dist-info ${destroot}${prefix}/\${site_pack_dir} } " } variant xdmf description {Add XDMF readers} { depends_lib-append port:boost \ port:xdmf configure.args-append \ -DVTK_USE_SYSTEM_XDMF2:BOOL=OFF \ -DNETCDF_DIR=${prefix} \ -DBOOST_ROOT=${prefix} \ -DModule_vtkIOXdmf2:BOOL=ON \ -DModule_vtkxdmf2:BOOL=ON \ -DModule_vtkxdmf3:BOOL=ON \ -DModule_vtkIOXdmf3:BOOL=ON } if {[mpi_variant_isset]} { configure.args-append \ -DVTK_Group_MPI:BOOL=ON } livecheck.type regex livecheck.url http://www.vtk.org/VTK/resources/software.html livecheck.regex {[vV][tT][kK]-(\d+(?:\.\d+)*)\.[tz]}