# -*- 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 # $Id: Portfile 133629 2015-03-07 14:39:20Z michaelld@macports.org $ PortSystem 1.0 PortGroup cmake 1.0 name vtk5 version 5.10.1 revision 3 set branch [join [lrange [split ${version} .] 0 1] .] # # There was a stealth-update of vtkdata-5.10.1 that invalidated the checksums # of that file. # (see https://trac.macports.org/wiki/PortfileRecipes#stealth-updates) # Remove the 'dist_subdir' line when the next proper version of vtk5 is # released... # dist_subdir ${name}/${version}_1 categories graphics devel platforms darwin freebsd license BSD maintainers nomaintainer description 3D visualization toolkit long_description an open source, freely available software system \ for 3D computer graphics, image processing, and visualization \ used by thousands of researchers and developers around the world. \ VTK consists of a C++ class library, and several interpreted \ interface layers including Tcl/Tk, Java, and Python. homepage http://www.vtk.org/ master_sites http://www.vtk.org/files/release/${branch}/ distname VTK${version} distfiles vtk-${version}${extract.suffix} checksums vtk-${version}${extract.suffix} \ md5 264b0052e65bd6571a84727113508789 \ sha1 deb834f46b3f7fc3e122ddff45e2354d69d2adc3 \ rmd160 3b0b138bf45743e925a905fb2eccb6b3ab3dada4 depends_build-append port:readline patchfiles patch-tiff-inline.diff legacy.patch post-patch { # Xcode 5.1 breaks vtk build. A backwards compatible fix is to remove # -fobjc-gc; see http://review.source.kitware.com/#/c/14424/ reinplace -W ${worksrcpath} "s,-fobjc-gc,,g" CMakeLists.txt } configure.args-append \ -DBUILD_SHARED_LIBS:BOOL=ON \ -DVTK_USE_RPATH:BOOL=ON \ -DCMAKE_INSTALL_RPATH:STRING=${prefix}/lib/vtk-${branch} \ -DCMAKE_INSTALL_NAME_DIR:STRING=${prefix}/lib/vtk-${branch} \ -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON \ -DVTK_INSTALL_PREFIX:PATH=${prefix} \ -DVTK_USE_HYBRID:BOOL=ON \ -DVTK_USE_TK:BOOL=OFF \ -DVTK_WRAP_TCL:BOOL=OFF \ -DTK_INCLUDE_PATH=${prefix}/include \ -DTK_LIBRARY=${prefix}/lib/libtk.dylib \ -DVTK_USE_CARBON:BOOL=OFF \ -DVTK_USE_COCOA:BOOL=ON \ -DVTK_DATA_ROOT:PATH=${prefix}/share/VTKData \ -DVTK_USE_GL2PS:BOOL=ON \ -DVTK_WRAP_PYTHON:BOOL=OFF configure.cxxflags-append \ -DUSE_INTERP_ERRORLINE configure.cppflags-replace \ -I${prefix}/include -isystem${prefix}/include if {${os.major} <= 10} { configure.args-append \ -DIOKit:FILEPATH=/System/Library/Frameworks/IOKit.framework } post-configure { reinplace "s|c++|c++ -L${prefix}/lib |" \ ${worksrcpath}/Infovis/Testing/Cxx/CMakeFiles/InfovisCxxTests.dir/link.txt \ ${worksrcpath}/IO/Testing/Cxx/CMakeFiles/IOCxxTests.dir/link.txt \ ${worksrcpath}/Views/Testing/Cxx/CMakeFiles/ViewsCxxTests.dir/link.txt if {[variant_isset tcltk]} { reinplace "s|c++|c++ -L${prefix}/lib |" \ ${worksrcpath}/Wrapping/Tcl/CMakeFiles/vtk.dir/link.txt } } use_parallel_build yes build.env-append \ DYLD_LIBRARY_PATH=${worksrcpath}/bin if {![variant_isset carbon] && ![variant_isset qt4_mac]} { default_variants +x11 +tcltk } post-destroot { set vtkdest ${destroot}${prefix}/share/doc/${name} xinstall -d ${vtkdest} xinstall -m 644 -W ${worksrcpath} Copyright.txt README.html Testing.txt ${vtkdest} } variant x11 conflicts carbon qt4_mac { depends_lib-append port:mesa port:libGLU port:Xft2 port:xorg-libXScrnSaver port:xorg-libXt configure.args-delete \ -DVTK_USE_COCOA:BOOL=ON configure.args-append \ -DVTK_USE_COCOA:BOOL=OFF \ -DVTK_USE_X:BOOL=ON \ -DOPENGL_gl_LIBRARY:FILEPATH=${prefix}/lib/libGL.dylib \ -DOPENGL_glu_LIBRARY:FILEPATH=${prefix}/lib/libGLU.dylib } variant tcltk conflicts carbon description {Build with Tcl wrappers and Tk support} { depends_lib-append port:tcl port:tk configure.args-delete \ -DVTK_USE_TK:BOOL=OFF \ -DVTK_WRAP_TCL:BOOL=OFF configure.args-append \ -DVTK_USE_TK:BOOL=ON \ -DVTK_WRAP_TCL:BOOL=ON \ -DTCL_INCLUDE_PATH=${prefix}/include \ -DTCL_LIBRARY=${prefix}/lib/libtcl.dylib } variant carbon conflicts x11 tcltk description {Use Carbon. Allows embedding VTK within qt4-mac (and py*-pyqt4 when used with Python)} { supported_archs i386 ppc if {${os.platform} eq "darwin" && ${os.major} >= 12} { ui_error "${name}: 'carbon' is not supported on OS X 10.8 or greater" return -code error "incompatible OS X version" } configure.args-delete \ -DVTK_USE_COCOA:BOOL=ON \ -DVTK_USE_CARBON:BOOL=OFF configure.args-append \ -DVTK_USE_COCOA:BOOL=OFF \ -DVTK_USE_CARBON:BOOL=ON } # TODO: Remove after 2016-01-04. variant python25 requires python27 description {Legacy variant} {} variant python26 requires python27 description {Legacy variant} {} set pythons_suffixes {27} set pythons_ports {} foreach s ${pythons_suffixes} { lappend pythons_ports python${s} } foreach s ${pythons_suffixes} { set p python${s} set v [string index ${s} 0].[string index ${s} 1] set i [lsearch -exact ${pythons_ports} ${p}] set c [lreplace ${pythons_ports} ${i} ${i}] eval [subst { variant ${p} description "Build Python ${v} wrappers" conflicts ${c} { depends_lib-append port:${p} configure.args-delete \ -DVTK_WRAP_PYTHON:BOOL=OFF configure.args-append \ -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/lib/libpython${v}.dylib \ -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/python${v} \ -DPYTHON_INCLUDE_PATH:FILEPATH=${frameworks_dir}/Python.framework/Versions/${v}/Headers \ -DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/libpython${v}.dylib \ -DVTK_WRAP_PYTHON:BOOL=ON \ -DVTK_INSTALL_NO_PYTHON:BOOL=ON post-configure { system -W ${worksrcpath}/Wrapping/Python/CMakeFiles/vtkpython.dir "echo `cat link.txt` -L../../bin > link.txt" system -W ${worksrcpath}/Wrapping/Python/CMakeFiles/vtkPythonCore.dir "echo `cat link.txt` -L../../bin > link.txt" } post-destroot { file mkdir ${destroot}${prefix}/lib/python${v}/site-packages system "cd ${worksrcpath}/Wrapping/Python && ${prefix}/bin/python${v} setup.py install --prefix=${frameworks_dir}/Python.framework/Versions/${v} --root=${destroot}" } } }] } if {[variant_isset qt4_mac]} { PortGroup qt4 1.0 } variant qt4_mac conflicts x11 description {Build GUI support with Qt4 (Mac)} { depends_lib-append port:phonon configure.args-append -DVTK_USE_QT:BOOL=ON \ -DVTK_USE_GUISUPPORT:BOOL=ON \ -DQT_PHONON_INCLUDE_DIR=${prefix}/include/phonon \ ${qt_cmake_defines} post-destroot { xinstall -m 755 -d ${destroot}${qt_plugins_dir}/designer move ${destroot}${prefix}/plugins/designer/libQVTKWidgetPlugin.dylib \ ${destroot}${qt_plugins_dir}/designer/ set fixfile ${qt_plugins_dir}/designer/libQVTKWidgetPlugin.dylib system "install_name_tool -id ${fixfile} ${destroot}${fixfile}" } } variant mysql description {Build the MySQL driver for vtkSQLDatabase} { depends_build-append port:zlib \ port:mysql5 configure.args-append -DVTK_USE_MYSQL:BOOL=ON \ -DMYSQL_LIBRARY:FILEPATH=${prefix}/lib/mysql5/mysql/libmysqlclient.dylib \ -DMYSQL_INCLUDE_DIRECTORIES:FILEPATH=${prefix}/include/mysql5/mysql/ \ -DMYSQL_EXTRA_LIBRARIES:FILEPATH=${prefix}/lib/libz.dylib } variant data description {Install data and examples} { distfiles-append vtkdata-${version}${extract.suffix} checksums-append vtkdata-${version}${extract.suffix} \ md5 b6355063264cd56bcd1396c92f6ca59a \ sha1 9fb9b3324dc5960813fbffd4111562f7b717a483 \ rmd160 950f4dcc52ae077fb3b0d385fdd33d4dc18fdb1a post-destroot { set vtkdest ${destroot}${prefix}/share/doc/${name} # Provide some examples file copy ${worksrcpath}/Examples ${vtkdest} xinstall -W ${worksrcpath}/bin \ CommonCxxTests \ FilteringCxxTests \ GenericFilteringCxxTests \ GraphicsCxxTests \ IOCxxTests \ ImagingCxxTests \ RenderingCxxTests \ TestCxxFeatures \ TestInstantiator \ VTKBenchMark \ VolumeRenderingCxxTests \ WidgetsCxxTests \ ${vtkdest}/Examples # Provide data files system "tar -C ${destroot}${prefix}/share -xzvf ${distpath}/vtkdata-${version}${extract.suffix}" } }