[50417] trunk/dports/graphics/vtk-devel/Portfile

dweber at macports.org dweber at macports.org
Thu Apr 30 11:59:44 PDT 2009


Revision: 50417
          http://trac.macports.org/changeset/50417
Author:   dweber at macports.org
Date:     2009-04-30 11:59:44 -0700 (Thu, 30 Apr 2009)
Log Message:
-----------
Many modifications; All the core variants are working, incl. data, doc, examples, shared libs, testing; the data, doc, examples, testing files are installed to /opt/local/share/vtk-/ and install_name_tool is used to map the binary rapths for examples and testing to the correct library location such that /opt/local/share/vtk-/*/bin/ contains executables that run the examples and tests

Modified Paths:
--------------
    trunk/dports/graphics/vtk-devel/Portfile

Modified: trunk/dports/graphics/vtk-devel/Portfile
===================================================================
--- trunk/dports/graphics/vtk-devel/Portfile	2009-04-30 18:41:47 UTC (rev 50416)
+++ trunk/dports/graphics/vtk-devel/Portfile	2009-04-30 18:59:44 UTC (rev 50417)
@@ -1,19 +1,19 @@
 # -*- 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$
 
-PortSystem  1.0
+PortSystem      1.0
 
-name        vtk-devel
-version     5.4.0
-revision    0
+name            vtk-devel
+version         5.4.0
+revision        0
 
-set branch	[join [lrange [split ${version} .] 0 1] .]
+set branch	    [join [lrange [split ${version} .] 0 1] .]
 
-categories  graphics math science devel 
+categories      graphics math science devel 
 
-maintainers dweber openmaintainer
+maintainers     dweber openmaintainer
 
-description 3D visualization toolkit (www.vtk.org)
+description     3D visualization toolkit (www.vtk.org)
 
 long_description \
 An open source, freely available software system for computer graphics, \
@@ -23,11 +23,13 @@
 default_variants: +examples +testing +tclSys
 
 homepage        http://www.vtk.org/
-master_sites    http://www.vtk.org/files/release/${branch}
+master_sites    http://www.vtk.org/files/release/${branch} \
+                http://www.vtk.org/doc/release/${branch} \
 
 distname        vtk-${branch}
 distfiles       vtk-${version}.tar.gz \
-                vtkdata-${version}.tar.gz
+                vtkdata-${version}.tar.gz \
+                vtkDocHtml-${version}.tar.gz
 
 checksums       vtk-${version}.tar.gz \
                     md5  3e7c6d5c37602c935674d580a8dd43c0 \
@@ -36,41 +38,35 @@
                 vtkdata-${version}.tar.gz \
                     md5  283d40f3e499b3a6102d86855d2ca20b \
                     sha1 a710227e7f7f25f481a36d2fa14bda49756bd39d \
-                    ripemd160 160129a0580bd7b70b40d3f7fa61bbd78b586ad8
+                    rmd160 160129a0580bd7b70b40d3f7fa61bbd78b586ad8 \
+                vtkDocHtml-${version}.tar.gz \
+                    md5 eb8fcaa5fa8bc8f463084f071b2b978b \
+                    sha1 1a8f8ff20b18bc7ac707846a8ba056b04c827392 \
+                    rmd160 c657f9ce0850eca1bb0a0d7537f0bcf631132f30
 
 platforms       darwin
 
-depends_build   port:cmake \
-                port:gmake
+depends_build   port:cmake 
 depends_lib     port:readline
 
+# Use gmake and build in a separate directory from the source
+build.type      gnu
+build.dir       ${workpath}/${distname}-build
+
 # Using this dummy stage to inspect macport variables (using 'port -d fetch vtk-devel')
 #fetch { system "echo ${workbuildpath} && echo ${worksrcpath} && echo ${destroot}" }
 
-
-# Build in a separate directory from the source
-set workbuildpath   ${workpath}/${distname}-build
 post-extract {
-    system "cd ${workpath}; mv VTK ${distname}; mv VTKData ${distname}-data;"
-    system "mkdir ${workbuildpath}"
+    move ${workpath}/VTK     ${workpath}/${distname}
+    move ${workpath}/VTKData ${workpath}/${distname}-data
+    move ${workpath}/html    ${workpath}/${distname}-html
 }
+
 configure {
-    system "cd ${workbuildpath} && ${configure.env} && cmake ${configure.args} ${worksrcpath}"
+    xinstall -d -o root -g admin -m 0755 ${build.dir}
+    system "cd ${build.dir} && cmake ${configure.args} ${worksrcpath}"
 }
-build {
-    system "cd ${workbuildpath} && gmake"
-}
-destroot {
-    system "cd ${workbuildpath} && gmake install DESTDIR=${destroot}"
-}
 
-# Set the equivalent of ${configure.ldflags} ${configure.cppflags}
-# cmake also has variables called:
-# CMAKE_LIBRARY_PATH_FLAG => specify -L compiler options
-# CMAKE_LINK_LIBRARY_FLAG => specify -l compiler options
-configure.env \
-    LDFLAGS=-L${prefix}/lib \
-    CXXFLAGS=-I${prefix}/include
 
 # To double-check all the cmake variable settings after the configure
 #cd ${workbuildpath}
@@ -80,20 +76,20 @@
 #sudo ccmake ../vtk-${branch}
 
 configure.args \
-    -DBUILD_DOCUMENTATION:BOOL=OFF \
-    -DBUILD_EXAMPLES:BOOL=OFF \
-    -DBUILD_TESTING:BOOL=OFF \
-    -DBUILD_SHARED_LIBS:BOOL=OFF \
+    -DCMAKE_OSX_SYSROOT=${universal_sysroot} \
     -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
     -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
     -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
     -DCMAKE_INCLUDE_PATH:PATH=${prefix}/include \
     -DCMAKE_LIBRARY_PATH:PATH=${prefix}/lib \
     -DCMAKE_INSTALL_NAME_DIR:STRING=${prefix}/lib/${distname} \
-    -DVTK_DATA_ROOT:PATH=${prefix}/share/${distname}-data \
+    -DBUILD_DOCUMENTATION:BOOL=OFF \
+    -DBUILD_EXAMPLES:BOOL=OFF \
+    -DBUILD_TESTING:BOOL=OFF \
+    -DBUILD_SHARED_LIBS:BOOL=OFF \
     -DVTK_DEBUG_LEAKS:BOOL=ON \
     -DVTK_USE_HYBRID:BOOL=ON \
-    -DVTK_USE_COCOA:BOOL=ON \
+    -DVTK_USE_COCOA:BOOL=OFF \
     -DVTK_USE_CARBON:BOOL=OFF \
     -DVTK_USE_X:BOOL=OFF \
     -DVTK_USE_GUISUPPORT:BOOL=ON \
@@ -101,16 +97,19 @@
     -DVTK_USE_PARALLEL:BOOL=ON \
     -DVTK_USE_RENDERING:BOOL=ON \
     -DVTK_USE_VIEWS:BOOL=ON \
+    -DVTK_USE_GL2PS:BOOL=ON \
+    -DVTK_USE_N_WAY_ARRAYS:BOOL=ON \
     -DVTK_WRAP_TCL:BOOL=OFF \
     -DVTK_WRAP_JAVA:BOOL=OFF \
     -DVTK_WRAP_PYTHON:BOOL=OFF
 
-    #-DVTK_USE_RPATH:BOOL=OFF \
+    #-DVTK_USE_RPATH:BOOL=OFF
     #-DVTK_REQUIRED_EXE_LINKER_FLAGS:STRING=-rpath ${prefix}/lib \
     #-DCMAKE_EXE_LINKER_FLAGS:STRING=-rpath ${prefix}/lib \
 
 
 
+# -----------------------------------------------------------------------------
 # PLATFORMS: platform darwin <version>
 # Can be used to handle different tasks depending
 # on the version of Mac OS X.  The version can be:
@@ -119,198 +118,314 @@
 # 8 for 10.4 Tiger, or
 # 9 for 10.5 Leopard.
 
-platform darwin 8 {
-    # I have not tested this [dweber]
-    depends_build-append \
-        port:gcc40
-    configure.env-append \
-        CC=/usr/bin/gcc-4.0 \
-        CXX=/usr/bin/cpp-4.0 \
-        MACOSX_DEPLOYMENT_TARGET=10.4
-}
-
 #VTK_REQUIRED_OBJCXX_FLAGS "-fobjc-gc"
-# When building VTK with Cocoa, in 10.5, Cocoa supports two memory models:
-# reference counting and garbage collection. This compiler flag lets it work with both.
+# When building VTK with Cocoa, in OSX >= 10.5.x, Cocoa supports two memory
+# models: reference counting and garbage collection. This compiler flag lets
+# it work with both.
 platform darwin 9 {
-    configure.env-append \
-        MACOSX_DEPLOYMENT_TARGET=10.5
     configure.args-append \
         VTK_REQUIRED_OBJCXX_FLAGS="-fobjc-gc"
 }
 
 
-# ------------------------------------------------------------------
+# -----------------------------------------------------------------------------
 # VARIANTS
-#
 # variant name [requires variant] [conflicts variant] [description description]
 
 default_variants \
-    +cocoa \
     +data \
+    +doc \
     +examples \
-    +shared
+    +shared \
+    +testing
 
-variant data description {install example data [default ${prefix}/share/vtk-*-data/]} {
+if { ![variant_isset carbon] && ![variant_isset x11] } {
+    default_variants-append +cocoa
 }
 
 
-variant doc description {build and install doxygen documentation [default]} {
-    depends_build-append \
-        port:doxygen
-    configure.args-append \
-        -DBUILD_DOCUMENTATION:BOOL=ON
-}
+# --- "Core" variants for VTK: data, doc, examples, shared libs, testing
 
 
-variant examples description {build and install VTK examples [default]} {
-    configure.args-delete \
-        -DBUILD_EXAMPLES:BOOL=OFF
+variant data description {install example data [default: ${prefix}/share/${distname}/data]} {
+    set vtkDataPath ${prefix}/share/${distname}/data
     configure.args-append \
-        -DBUILD_EXAMPLES:BOOL=ON
+        -DVTK_DATA_ROOT:PATH=${vtkDataPath}
+    post-destroot {
+        set vtkDataFile ${distpath}/vtkdata-${version}.tar.gz
+        set vtkDataPath ${prefix}/share/${distname}/data
+        xinstall -d -o root -g admin -m 0755 ${destroot}/${vtkDataPath}
+        system "tar --strip-components 1 -C ${destroot}/${vtkDataPath} -zxvf ${vtkDataFile}"
+    }
 }
 
 
-variant testing description {build and install VTK tests} {
-    configure.args-delete \
-        -DBUILD_TESTING:BOOL=OFF
-    configure.args-append \
-        -DBUILD_TESTING:BOOL=ON
+variant doc description {provide doxygen documentation [default: ${prefix}/share/${distname}/doc]} {
+    post-destroot {
+        set vtkDocFile ${distpath}/vtkDocHtml-${version}.tar.gz
+        set vtkDocPathMain ${prefix}/share/${distname}/doc
+        set vtkDocPathLink ${prefix}/share/doc/${distname}
+        xinstall -d -o root -g admin -m 0755 ${destroot}/${vtkDocPathMain}
+        xinstall -d -o root -g admin -m 0755 ${destroot}/${vtkDocPathLink}
+        # Create a symlink to the $prefix path (not the destroot path); use the
+        # system to do this because the $prefix path doesn't exist yet and the
+        # tcl ln command fails whereas the system command will allow it.
+        system "ln -Fhs ${vtkDocPathMain} ${destroot}/${vtkDocPathLink}"
+        # Add basic documentation
+        file copy ${worksrcpath}/README.html   ${destroot}/${vtkDocPathMain}
+        file copy ${worksrcpath}/Copyright.txt ${destroot}/${vtkDocPathMain}
+        file copy ${worksrcpath}/Testing.txt   ${destroot}/${vtkDocPathMain}
+        # Add the doxygen documentation 
+        system "tar -C ${destroot}/${vtkDocPathMain} -zxvf ${vtkDocFile}"
+    }
+    # The doxygen dependency fails to build (as of May 2009).
+    #depends_build-append \
+        port:doxygen
+    #configure.args-append \
+        -DBUILD_DOCUMENTATION:BOOL=ON
 }
 
 
-variant tclSys conflicts tclMacPorts description {tcl wrapper (system tcl/tk)} {
+variant examples description {provide VTK examples [default: ${prefix}/share/${distname}/examples]} {
     configure.args-delete \
-        -DVTK_WRAP_TCL:BOOL=OFF
+        -DBUILD_EXAMPLES:BOOL=OFF
     configure.args-append \
-        -DVTK_WRAP_TCL:BOOL=ON \
-        -DTCL_TCLSH:FILEPATH=/usr/bin/tclsh \
-        -DTCL_INCLUDE_PATH:PATH=/System/Library/Frameworks/Tcl.framework/Headers \
-        -DTCL_LIBRARY:FILEPATH=/System/Library/Frameworks/tcl.framework \
-        -DTK_INCLUDE_PATH:PATH=/System/Library/Frameworks/Tk.framework/Headers \
-        -DTK_LIBRARY:FILEPATH=/System/Library/Frameworks/tk.framework
+        -DBUILD_EXAMPLES:BOOL=ON
+    post-destroot {
+        set vtkExamplePath ${prefix}/share/${distname}/examples
+        xinstall -d -o root -g admin -m 0755 ${destroot}${vtkExamplePath}/bin
+        system "cp -r ${worksrcpath}/Examples/* ${destroot}${vtkExamplePath}"
+        # Installations for the example binaries are in ${build.dir}/bin/.
+        # All the rpath settings for these binaries point to the build.dir, so
+        # they are reset using install_name_tool.
+        system "
+            cd ${build.dir};
+            find bin \! -name '*.dylib' | grep -e '\[^(bin)\]\$' > find.txt;
+            for f in `cat find.txt`; do
+                cp -Rf \${f} ${destroot}${vtkExamplePath}/bin/; 
+            done;
+            find ${destroot}${vtkExamplePath}/bin | grep -e '\[^(bin)\]\$' > find.txt;
+            for f in `cat find.txt`; do
+                if \[ -f \${f} \] && \[ -x \${f} \]; then
+                    echo install_name_tool changing link libs for \${f};
+                    otool -L \${f} | grep 'libvtk' > otool_libs.txt;
+                    for lib in `cat otool_libs.txt`; do
+                        newlib=`echo \${lib} | sed s#${build.dir}/bin#${prefix}/lib/${distname}#`;
+                        install_name_tool -change \${lib} \${newlib} \${f};
+                    done;
+                    rm otool_libs.txt;
+                fi;
+            done;
+            rm find.txt;
+            "
+    }
 }
 
-# This provides a tcl variant that uses the macports tcl installation. (It seems
-# vtk 5.2 does not work with tcl8.5 - macports has 8.5, as of Sep 2008).
-variant tclMacPorts conflicts tclSys description {tcl wrapper (MacPorts tcl/tk)} {
-    depends_lib-append \
-        port:tcl \
-        port:tk
-    configure.args-delete \
-        -DVTK_WRAP_TCL:BOOL=OFF
-    configure.args-append \
-        -DVTK_WRAP_TCL:BOOL=ON \
-        -DTCL_TCLSH:FILEPATH=${prefix}/bin/tclsh \
-        -DTCL_INCLUDE_PATH:PATH=${prefix}/include \
-        -DTCL_LIBRARY:FILEPATH=${prefix}/lib \
-        -DTK_INCLUDE_PATH:PATH=${prefix}/include \
-        -DTK_LIBRARY:FILEPATH=${prefix}/lib
-}
-# /opt/local/lib/tclConfig.sh
-# /opt/local/lib/tkConfig.sh
 
+# Notes on RPATH settings for the shared dylib build and install:
+#
+# CMake book, Appendix A, p 234: "CMAKE_SKIP_BUILD_RPATH: Do not include RPATHs
+# in the build tree.  Normally CMake uses the build tree for the RPATH when
+# building executables etc. on systems that use RPATH.  When the software is
+# installed the executables etc.  are relinked by CMake to have the install
+# RPATH.  If this variable is set to true then the software is always built with
+# no RPATH."
+#
+# CMake book, Appendix B, p. 301: "... SKIP_BUILD_RPATH is a boolean specifying
+# whether to skip automatic generation of an rpath allowing the target to run
+# from the build tree.  BUILD_WITH_INSTALL_RPATH is a boolean specifying whether
+# to link the target in the build tree with the INSTALL_RPATH.  This takes
+# precedence over SKIP_BUILD_RPATH and avoids the need for relinking before
+# installation."
+#
+# Using CMAKE_SKIP_BUILD_RPATH:BOOL=OFF, we get all the executables and dylibs
+# built with the $build.dir in the rpath.  For this to work, we must also have
+# CMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF.  After the build, at the destroot
+# phase, all the installation candidates (which excludes the examples and
+# testing binaries) have their rpath settings reset to the INSTALL_RPATH (which
+# should point to $prefix..., not the $destroot location).  VTK_USE_RPATH
+# is required to ensure that rpath is set for all the installed executables and
+# dylibs.
 
-variant java description {java wrapper} {
-    configure.args-append \
-        -DVTK_WRAP_JAVA:BOOL=ON
-}
-
-
-variant python requires shared description {python wrapper} {
-   depends_build-append \
-       port:python26
-   configure.args-delete \
-       -DVTK_WRAP_PYTHON:BOOL=OFF \
-   configure.args-append \
-       -DVTK_WRAP_PYTHON:BOOL=ON \
-       -DVTK_NO_PYTHON_THREADS:BOOL=OFF \
-       -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/include/python2.6 \
-       -DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/libpython2.6.dylib \
-       -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/lib/libpython2.6.dylib \
-       -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/python2.6 \
-       -DVTK_PYTHON_SETUP_ARGS:STRING="--prefix=${prefix} --root=${destdir}"
-}
-
-
 variant shared description {build shared libraries [default]} {
     configure.args-delete \
         -DBUILD_SHARED_LIBS:BOOL=OFF
     configure.args-append \
         -DBUILD_SHARED_LIBS:BOOL=ON \
-        -DCMAKE_SKIP_BUILD_RPATH:BOOL=ON \
-        -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON \
+        -DCMAKE_SKIP_BUILD_RPATH:BOOL=OFF \
+        -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF \
         -DCMAKE_INSTALL_RPATH:STRING=${prefix}/lib/${distname} \
         -DVTK_USE_RPATH:BOOL=ON
 }
 
-# CMAKE_EXE_LINKER_FLAGS:STRING=
 
-#  -DVTK_INSTALL_LIB_DIR:STRING=${prefix}/lib/vtk-5.2
+variant testing requires data description {provide VTK tests [default: ${prefix}/share/${distname}/testing]} {
+    configure.args-delete \
+        -DBUILD_TESTING:BOOL=OFF
+    configure.args-append \
+        -DBUILD_TESTING:BOOL=ON
+    post-destroot {
+        set vtkTestingPath ${prefix}/share/${distname}/testing
+        xinstall -d -o root -g admin -m 0755 ${destroot}${vtkTestingPath}/bin
+        # Most of the Testing source code is in ${build.dir}/*/Testing/.
+        # Installations for the test binaries are in ${build.dir}/bin/.
+        # All the rpath settings for these binaries point to the build.dir, so
+        # they are reset using install_name_tool.
+        system "
+            cd ${build.dir};
+            find . -type d -name 'Testing' > find.txt;
+            for d in `cat find.txt`; do
+                nd=`echo \${d} | sed s#^\.#${destroot}${vtkTestingPath}#`;
+                mkdir -p \${nd};
+                cp -Rf \${d}/ \${nd}; 
+            done;
+            find bin -name '*Test*' > find.txt;
+            for f in `cat find.txt`; do
+                cp -Rf \${f} ${destroot}${vtkTestingPath}/bin/;
+            done;
+            find ${destroot}${vtkTestingPath}/bin | grep -e '\[^(bin)\]\$' > find.txt;
+            for f in `cat find.txt`; do
+                if \[ -f \${f} \] && \[ -x \${f} \]; then
+                    echo install_name_tool changing link libs for \${f};
+                    otool -L \${f} | grep 'libvtk' > otool_libs.txt;
+                    for lib in `cat otool_libs.txt`; do
+                        newlib=`echo \${lib} | sed s#${build.dir}/bin#${prefix}/lib/${distname}#`;
+                        install_name_tool -change \${lib} \${newlib} \${f};
+                    done;
+                    rm otool_libs.txt;
+                fi;
+            done;
+            rm find.txt;
+            "
+    }
+}
 
 
+# --- Graphics subsystem variants: carbon, cocoa, x11
+
+
 variant carbon conflicts cocoa x11 description {build with Carbon} {
     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
 }
 
 
 variant cocoa conflicts carbon x11 description {build with Cocoa [default]} {
+    configure.args-delete   \
+        -DVTK_USE_COCOA:BOOL=OFF
+    configure.args-append   \
+        -DVTK_USE_COCOA:BOOL=ON
 }
 
 
 variant x11 conflicts cocoa carbon description {build with X11} {
-    #depends_build-append    \
+    depends_lib-append    \
         port:xorg-libs \
-        port:xorg-proto
+        port:xorg-proto \
+        port:mesa
     configure.args-delete   \
-        -DVTK_USE_COCOA:BOOL=ON \
         -DVTK_USE_X:BOOL=OFF
     configure.args-append   \
-        -DVTK_USE_COCOA:BOOL=OFF \
         -DVTK_USE_X:BOOL=ON \
-        -DOPENGL_gl_LIBRARY:FILEPATH=${x11prefix}/lib/libGL.dylib \
-        -DOPENGL_glu_LIBRARY:FILEPATH=${x11prefix}/lib/libGLU.dylib \
-        -DOPENGL_INCLUDE_DIR:PATH=${x11prefix}/include \
-        -DVTK_GLEXT_FILE:FILEPATH=${x11prefix}/include/GL/glext.h \
-        -DVTK_GLXEXT_FILE:FILEPATH=${x11prefix}/include/GL/glxext.h
-        -DVTK_OPENGL_HAS_OSMESA:BOOL=OFF
+        -DOPENGL_gl_LIBRARY:FILEPATH=${prefix}/lib/libGL.dylib \
+        -DOPENGL_glu_LIBRARY:FILEPATH=${prefix}/lib/libGLU.dylib \
+        -DOPENGL_INCLUDE_DIR:PATH=${prefix}/include \
+        -DVTK_GLEXT_FILE:FILEPATH=${prefix}/include/GL/glext.h \
+        -DVTK_GLXEXT_FILE:FILEPATH=${prefix}/include/GL/glxext.h \
+        -DVTK_OPENGL_HAS_OSMESA:BOOL=ON
+        #-DVTK_USE_MANGLED_MESA:BOOL=OFF
 }
 
 
-# This mesaOpenGL variant may not require the x11 variant, but the
-# assumption here is that it's more likely to work with it than without it.
 
-variant mesaOpenGL requires x11 description {use mesa OpenGL} {
+# --- Language wrappers: java, python, tcl
+
+
+variant java description {java wrapper} {
+    configure.args-append \
+        -DVTK_WRAP_JAVA:BOOL=ON
+}
+
+
+variant python25 requires shared description {python 2.5 wrapper} {
+    set pyver python2.5
     depends_build-append \
-        port:mesa
+        port:python25
+    configure.args-delete \
+        -DVTK_WRAP_PYTHON:BOOL=OFF \
     configure.args-append \
-        -DOPENGL_INCLUDE_DIR:PATH=${prefix}/include \
-        -DOPENGL_gl_LIBRARY:FILEPATH=${prefix}/lib/libGL.dylib \
-        -DOPENGL_glu_LIBRARY:FILEPATH=${prefix}/lib/libGLU.dylib \
-        -DVTK_GLEXT_FILE:FILEPATH=${prefix}/include/GL/glext.h \
-        -DVTK_GLXEXT_FILE:FILEPATH=${prefix}/include/GL/glxext.h \
-        -DVTK_OPENGL_HAS_OSMESA:BOOL=ON
+        -DVTK_WRAP_PYTHON:BOOL=ON \
+        -DVTK_NO_PYTHON_THREADS:BOOL=OFF \
+        -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/include/${pyver} \
+        -DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/lib${pyver}.dylib \
+        -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/lib/lib${pyver}.dylib \
+        -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/${pyver} \
+        -DVTK_PYTHON_SETUP_ARGS:STRING="--prefix=${prefix} --root=${destdir}"
 }
 
 
-variant mpi description {use message passing interface (MPI) for parallel support} {
+variant python26 requires shared description {python 2.6 wrapper} {
+    set pyver python2.6
+    depends_build-append \
+        port:python26
+    configure.args-delete \
+        -DVTK_WRAP_PYTHON:BOOL=OFF \
+    configure.args-append \
+        -DVTK_WRAP_PYTHON:BOOL=ON \
+        -DVTK_NO_PYTHON_THREADS:BOOL=OFF \
+        -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/include/${pyver} \
+        -DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/lib${pyver}.dylib \
+        -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/lib/lib${pyver}.dylib \
+        -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/${pyver} \
+        -DVTK_PYTHON_SETUP_ARGS:STRING="--prefix=${prefix} --root=${destdir}"
+}
+
+
+# This provides a tcl variant that uses the macports tcl installation. (It seems
+# vtk 5.2 does not work with tcl8.5 - macports has 8.5, as of Sep 2008).
+variant tcl conflicts tcl_apple description {tcl wrapper (MacPorts tcl/tk)} {
     depends_lib-append \
-        port:mpich2
+        port:tcl \
+        port:tk
+    configure.args-delete \
+        -DVTK_WRAP_TCL:BOOL=OFF
     configure.args-append \
-        -DVTK_USE_MPI:BOOL=ON
+        -DVTK_WRAP_TCL:BOOL=ON \
+        -DTCL_TCLSH:FILEPATH=${prefix}/bin/tclsh \
+        -DTCL_INCLUDE_PATH:PATH=${prefix}/include \
+        -DTCL_LIBRARY:FILEPATH=${prefix}/lib \
+        -DTK_INCLUDE_PATH:PATH=${prefix}/include \
+        -DTK_LIBRARY:FILEPATH=${prefix}/lib
 }
+# /opt/local/lib/tclConfig.sh
+# /opt/local/lib/tkConfig.sh
 
 
+variant tcl_apple conflicts tcl description {tcl wrapper (apple system tcl/tk)} {
+    configure.args-delete \
+        -DVTK_WRAP_TCL:BOOL=OFF
+    configure.args-append \
+        -DVTK_WRAP_TCL:BOOL=ON \
+        -DTCL_TCLSH:FILEPATH=/usr/bin/tclsh \
+        -DTCL_INCLUDE_PATH:PATH=/System/Library/Frameworks/Tcl.framework/Headers \
+        -DTCL_LIBRARY:FILEPATH=/System/Library/Frameworks/tcl.framework \
+        -DTK_INCLUDE_PATH:PATH=/System/Library/Frameworks/Tk.framework/Headers \
+        -DTK_LIBRARY:FILEPATH=/System/Library/Frameworks/tk.framework
+}
+
+
+# --- Database variants
+
+
 variant mysql description {build the MySQL driver for vtkSQLDatabase} {
     depends_build-append \
         port:mysql5
     configure.args-append \
         -DVTK_USE_MYSQL:BOOL=ON
+        #MYSQL_INCLUDE_DIRECTORIES
+        #MYSQL_LIBRARY
 }
 
 
@@ -319,6 +434,8 @@
         port:libpqxx
     configure.args-append \
         -DVTK_USE_POSTGRES:BOOL=ON
+        #POSTGRES_INCLUDE_DIRECTORIES
+        #POSTGRES_LIBRARIES
 }
 
 
@@ -330,58 +447,39 @@
 }
 
 
-# ------------------------------------------------------------------
-# POST DESTROOT
+# --- Miscellaneous variants
 
-set vtkDocPath  ${destroot}${prefix}/share/doc/${distname}
-set vtkDataPath ${destroot}${prefix}/share/${distname}-data
 
-post-destroot {
+variant mpi description {use message passing interface (MPI) for parallel support} {
+    depends_lib-append \
+        port:mpich2
+    configure.args-append \
+        -DVTK_USE_MPI:BOOL=ON
+}
 
-    # Provide data files
-    xinstall -d -m 0755 ${vtkDataPath}
-    system "tar -C ${vtkDataPath} -zxvf ${distpath}/vtkdata-${version}.tar.gz"
-    system "mv ${vtkDataPath}/VTKData/* ${vtkDataPath}/"
-    system "rm -rf ${vtkDataPath}/VTKData"
 
-    # Add basic documentation
-    xinstall -d -m 0755 ${vtkDocPath}
-    file copy ${worksrcpath}/README.html   ${vtkDocPath}
-    file copy ${worksrcpath}/Copyright.txt ${vtkDocPath}
-    file copy ${worksrcpath}/Testing.txt   ${vtkDocPath}
+variant boost description {use Boost libraries for graph algorithms - www.boost.org} {
+    depends_lib-append \
+        port:boost
+    configure.args-append \
+        VTK_USE_BOOST:BOOL=ON
+        #Boost_INCLUDE_DIR
+}
 
-    # Copy examples to the documentation path
-    if {[variant_isset examples]} {
-        file copy ${worksrcpath}/Examples ${vtkDocPath}
-    }
 
-    # Provide some tests in the documentation path
-    if {[variant_isset testing]} {
-        foreach x { \
-            CommonCxxTests \
-            FilteringCxxTests \
-            GenericFilteringCxxTests \
-            GraphicsCxxTests \
-            IOCxxTests \
-            ImagingCxxTests \
-            RenderingCxxTests \
-            TestCxxFeatures \
-            TestInstantiator \
-            VTKBenchMark \
-            VolumeRenderingCxxTests \
-            WidgetsCxxTests } \
-        {
-            file copy ${worksrcpath}/bin/$x ${vtkDocPath}/Examples 
-        }
-    }
-    
-}
+#variant qvtk {build QVTK widget and plugin for Qt} {
+#    # Dependencies?
+#    configure.args-append \
+#        -DVTK_USE_QVTK:BOOL=ON
+#}
 
-# This may be useful to uninstall the port:
-# for f in `cat install_manifest.txt`; do echo $f; sudo rm $f; done
-#
-# The installation is going into:
-# /opt/local/include/vtk-5.2/
-# /opt/local/lib/vtk-5.2/
-# /opt/local/bin/vtk*
 
+#variant cg description {build pixel and vertex shader support for Cg} {
+#    # Require a new port for cg_toolkit, see downloads at
+#    # http://developer.download.nvidia.com/cg/Cg_2.2/Cg-2.2_April2009.dmg
+#    depends_build-append \
+#        port:cg_toolkit
+#    configure.args-append \
+#        VTK_USE_CG_SHADERS:BOOL=ON
+#}
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090430/817ff183/attachment-0001.html>


More information about the macports-changes mailing list