[51562] users/dweber

dweber at macports.org dweber at macports.org
Wed May 27 15:49:47 PDT 2009


Revision: 51562
          http://trac.macports.org/changeset/51562
Author:   dweber at macports.org
Date:     2009-05-27 15:49:47 -0700 (Wed, 27 May 2009)
Log Message:
-----------


Added Paths:
-----------
    users/dweber/graphics/
    users/dweber/graphics/InsightToolkit/
    users/dweber/graphics/InsightToolkit/Portfile
    users/dweber/graphics/paraview/
    users/dweber/graphics/paraview/Portfile
    users/dweber/graphics/vtk-devel/
    users/dweber/graphics/vtk-devel/Portfile

Added: users/dweber/graphics/InsightToolkit/Portfile
===================================================================
--- users/dweber/graphics/InsightToolkit/Portfile	                        (rev 0)
+++ users/dweber/graphics/InsightToolkit/Portfile	2009-05-27 22:49:47 UTC (rev 51562)
@@ -0,0 +1,699 @@
+# -*- 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
+
+# Note: don't change this name, only change the distname, as there are numerous
+# default build assumptions in both cmake and ITK that use this specific name,
+# and many post-destroot hacks in this port that depend on this name.
+name            InsightToolkit
+version         3.12.0
+revision        3
+set branch      [join [lrange [split ${version} .] 0 1] .]
+
+categories      graphics math science devel
+
+maintainers     dweber openmaintainer
+
+description     Insight Segmentation and Registration Toolkit (ITK)
+
+long_description \
+ITK is an open-source software toolkit for performing registration and segmentation. Segmentation is the process of identifying and classifying data found in a digitally sampled representation. Typically the sampled representation is an image acquired from such medical instrumentation as CT or MRI scanners. Registration is the task of aligning or developing correspondences between data. For example, in the medical environment, a CT scan may be aligned with a MRI scan in order to combine the information contained in both.
+
+homepage        http://www.itk.org/
+master_sites    sourceforge:itk
+
+distname        InsightToolkit-${branch}
+distfiles       InsightToolkit-${version}.tar.gz \
+                CableSwig-ITK-${version}.tar.gz
+
+checksums       InsightToolkit-${version}.tar.gz \
+                    md5  0bdf73a88f0d6936496addf036b07215 \
+                    sha1 7db0e20c8cbfe1c12a3ad86428cb6eefd8169f58 \
+                    rmd160 0adcab3705b96db08dbf5110d9a09cc265821a9d \
+                CableSwig-ITK-${version}.tar.gz \
+                    md5  04a8610e3724e7fef9207a90fd4bfde3 \
+                    sha1 04ab4f03a8e08267b9e78aafea055ef2a5058798 \
+                    rmd160 5758c7ee205a53a205a8a72a721aafeff7c8b194
+
+extract.only    InsightToolkit-${version}.tar.gz \
+                CableSwig-ITK-${version}.tar.gz
+
+platforms       darwin
+
+depends_build   port:cmake \
+                port:gmake \
+                port:gawk \
+                port:bison
+
+depends_lib     port:xorg-libs \
+                port:ossp-uuid
+
+# Use gmake and build in a separate directory from the source
+build.type      gnu
+build.dir       ${workpath}/${distname}-build
+
+# The parallel build would be nice, but it's not reliable.
+#use_parallel_build  yes
+
+# Global variables, used in variants, where a destroot prefix is appended, when necessary.
+set itkBuildBin     ${build.dir}/bin
+set itkIncPath      ${prefix}/include/${distname}
+set itkLibPath      ${prefix}/lib/${distname}
+set itkSharePath    ${prefix}/share/${distname}
+set itkDocFile      DoxygenInsightToolkit-${version}.tar.gz
+set itkDocPath      ${itkSharePath}/doc
+set itkDataPath     ${itkSharePath}/data
+set itkExamplePath  ${itkSharePath}/examples
+set itkTestingPath  ${itkSharePath}/testing
+set itkExampleBin   ${itkExamplePath}/bin
+set itkTestingBin   ${itkTestingPath}/bin
+set itkExampleSrc   ${worksrcpath}/Examples
+set itkTestingSrc   ${worksrcpath}/Testing
+set itkWrapLibPath  ${itkLibPath}/WrapITK/lib
+
+# Using this dummy stage to inspect MacPorts variables
+# (using 'port -d fetch InsightToolkit')
+#fetch { system "echo ${itkLibPath}" }
+
+post-extract {
+    move ${workpath}/InsightToolkit-${version} ${worksrcpath}
+    move ${workpath}/CableSwig-ITK-${version}  ${worksrcpath}/Utilities/CableSwig
+}
+
+configure {
+    xinstall -d -m 0755 ${build.dir}
+    system "cd ${build.dir} && cmake ${configure.args} ${worksrcpath}"
+}
+
+# To double-check all the cmake variable settings after the configure
+#cd ${build.dir}
+#sudo cmake -LAH ../itk-${branch} > ~/cmake_vars.txt
+# Similarly, for an interactive configuration with ccmake, try:
+#cd ${build.dir}
+#sudo ccmake ../itk-${branch}
+
+# Get the size of RAM in Gigabits
+set gigabits [expr [exec sysctl -n hw.memsize] / pow(1024,3)]
+
+configure.args-append \
+    -DBUILD_DOXYGEN:BOOL=OFF \
+    -DBUILD_EXAMPLES:BOOL=OFF \
+    -DBUILD_TESTING:BOOL=OFF \
+    -DBUILD_SHARED_LIBS:BOOL=OFF \
+    -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
+    -DCMAKE_INCLUDE_PATH:PATH=${prefix}/include \
+    -DCMAKE_LIBRARY_PATH:PATH=${prefix}/lib \
+    -DCMAKE_INSTALL_NAME_DIR:STRING=${prefix}/lib/${distname} \
+    -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
+    -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
+    -DITK_COMPUTER_MEMORY_SIZE:STRING=${gigabits} \
+    -DUUID_INCLUDE_DIR:PATH=${prefix}/include/uuid \
+    -DUUID_LIBRARY:FILEPATH=${prefix}/lib/libuuid.dylib
+
+
+post-destroot {
+    # For some reason, cmake does not install into the CMAKE_INSTALL_NAME_DIR
+    move ${destroot}${prefix}/lib/${name}       ${destroot}${itkLibPath}
+    move ${destroot}${prefix}/include/${name}   ${destroot}${itkIncPath}
+    # Create a symlink from the generic lib and include for InsightToolkit to this version
+    ln -sf ${distname} ${destroot}${prefix}/lib/${name}
+    ln -sf ${distname} ${destroot}${prefix}/include/${name}
+    # copy FindITK.cmake to a version specific file, which might persist even
+    # when cmake is updated, deactivated, etc.
+    set findITK [glob ${prefix}/share/cmake-*/Modules/FindITK.cmake]
+    set findITKbranch [strsed ${findITK} #FindITK#FindITK-${branch}#]
+    copy ${findITK} ${destroot}${findITKbranch}
+    # Change the content of $findITKbranch so it will find this $distname lib
+    reinplace "s|lib/${name}|lib/${distname}|g" ${destroot}${findITKbranch}
+    # Change the content of *.cmake config files
+    reinplace "s|${name}|${distname}|g" ${destroot}${itkLibPath}/ITKConfig.cmake
+    copy ${destroot}${itkLibPath}/ITKConfig.cmake ${destroot}${itkLibPath}/itk-${branch}-config.cmake
+}
+
+
+# -----------------------------------------------------------------------------
+# VARIANTS
+# variant name [requires variant] [conflicts variant] [description description]
+
+default_variants \
+    +doc \
+    +py25
+
+variant doc description "provide doxygen documentation in ${itkDocPath}" {
+    distfiles-append    ${itkDocFile}
+    checksums-append    ${itkDocFile} \
+                        md5  99dcad9f8e7a3d0acb9da62efdf5fd13 \
+                        sha1 e6800094f493e6ef2b1484ce2da578a19a978c40 \
+                        rmd160 a20167892a6e91e6f530313c3c057e4d08999d62
+    post-destroot {
+        set itkDocPathLink ${prefix}/share/doc/${distname}
+        xinstall -d -o root -g admin -m 0755 ${destroot}/${itkDocPath}
+        xinstall -d -o root -g admin -m 0755 ${destroot}/${itkDocPathLink}
+        # Add the doxygen documentation 
+        system "tar --strip-components 1 -C ${destroot}/${itkDocPath} -zxf ${distpath}/${itkDocFile}"
+        # Add basic documentation
+        file copy ${worksrcpath}/Copyright     ${destroot}/${itkDocPath}/
+        file copy ${worksrcpath}/Copyright.txt ${destroot}/${itkDocPath}/
+        file copy ${worksrcpath}/README.html   ${destroot}/${itkDocPath}/
+        # 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 this system command will allow it.
+        system "ln -Fns ${itkDocPath} ${destroot}/${itkDocPathLink}"
+    }
+}
+
+# --- Data variants
+
+# Change this to the itkDataPath and use post-destroot to relocate all this data
+#-DITK_DATA_ROOT:PATH=${worksrcpath}/Testing/Data
+
+##// Directory with data taken from http://public.kitware.com/pub/itk/Data/BrainWeb/
+##ITK_BRAINWEB_DATA_ROOT:PATH=ITK_BRAINWEB_DATA_ROOT-NOTFOUND
+variant brainweb description "provide ITK BrainWeb data in ${itkDataPath}" {
+    master_sites-append \
+        http://public.kitware.com/pub/itk/Data/BrainWeb:brainweb
+    distfiles-append \
+        BrainPart1.tgz:brainweb \
+        BrainPart1Rotated10Translated15.tgz:brainweb \
+        BrainPart1Rotated20Translated20.tgz:brainweb \
+        BrainPart2.tgz:brainweb \
+        BrainPart2Rotated10Translated15.tgz:brainweb \
+        BrainPart2Rotated20Translated20.tgz:brainweb \
+        BrainPart3.tgz:brainweb \
+        BrainPart3Rotated10Translated15.tgz:brainweb \
+        BrainPart3Rotated20Translated20.tgz:brainweb
+    checksums-append \
+        BrainPart1.tgz \
+            md5  e722d697f9d0b51023652b3fe7348658 \
+            sha1 e91f5c4928c880b944e1559eee015170c1badc4b \
+            rmd160 b5cbb557df0b019afe3f411deea72ef464626ace \
+        BrainPart1Rotated10Translated15.tgz \
+            md5  9d052710929477b1ddb5095575a5d7f9 \
+            sha1 effc10374f1e70ded967fb55237cd600b6ef51ca \
+            rmd160 3e1f19dbe48b7912f46f255459330fde50f96b62 \
+        BrainPart1Rotated20Translated20.tgz \
+            md5  36af81caf9ea7ce9b72987ff6d08ddf3 \
+            sha1 4c10b5ab612282361f344d1432664067bc94c736 \
+            rmd160 d6d23117fbf8803b0488b4fd5bddb739576d983f \
+        BrainPart2.tgz \
+            md5  458b0903a2fb52a1cae616eddf817142 \
+            sha1 21659b5ee37a9ed0958c79a1943dd5ebafbe27ec \
+            rmd160 dc85b393c8dfbf04ba2aa0690237acfb185ada4e \
+        BrainPart2Rotated10Translated15.tgz \
+            md5  8c978a660e442e4ed06e77bc4f769af2 \
+            sha1 58c1b5a6d9e8a965f3e73febca012747b0246702 \
+            rmd160 3867b0d006fa8b5af084a78fa812aff69c2ad0c1 \
+        BrainPart2Rotated20Translated20.tgz \
+            md5  5f53d805ab4346b933ce52c7b34e67b2 \
+            sha1 f29740e4760ffc602e9a6b2aa2b96efabcff1aa6 \
+            rmd160 2441747f0c98e9f2fa24a1c7ca9294bed729dcc0 \
+        BrainPart3.tgz \
+            md5  c6f5edccbb2c0ba418e4666fe989eb15 \
+            sha1 20cdee786c710aed0df6943bcbaa9c62bb82e773 \
+            rmd160 3f730bf426a6509c73c58902220b64cb3324b136 \
+        BrainPart3Rotated10Translated15.tgz \
+            md5  61893ca3df13d24530275758de702fef \
+            sha1 4f6ba74d68a7e477fd43237213d4d4e4ce839503 \
+            rmd160 ba408d2ff6297af7f76af82ae24e9afe519bb80c \
+        BrainPart3Rotated20Translated20.tgz \
+            md5  db63c7567d1c021860d59812eb41dfa9 \
+            sha1 2e14b66beef00acc8cd17942d9bf0c155841a934 \
+            rmd160 42d403505116e8b9885d00964376cee909711bd0
+    configure.args-append \
+        -DITK_BRAINWEB_DATA_ROOT:PATH=${itkDataPath}
+    post-destroot {
+        xinstall -d -o root -g admin -m 0755 ${destroot}/${itkDataPath}
+        foreach tgz [exec find ${distpath} -name "BrainPart*.tgz"] {
+            system "tar -C ${destroot}/${itkDataPath} -zxf ${tgz}"
+        }
+    }
+}
+
+
+##// Directory with data taken from http://public.kitware.com/pub/itk/Data/HealthyVolunteersMRIDatabase/
+##ITK_MRI_UNC_DATABASE_DATA_ROOT:PATH=ITK_MRI_UNC_DATABASE_DATA_ROOT-NOTFOUND
+#http://public.kitware.com/pub/itk/Data/HealthyVolunteersMRIDatabase/Brain_MRA_From_UNC_Collection.zip
+#http://public.kitware.com/pub/itk/Data/HealthyVolunteersMRIDatabase/LICENSE.txt
+# During install, use a message to echo the LICENSE.txt file
+
+
+##// Directory with data taken from http://www.osirix-viewer.com/Downloads.html
+##ITK_OSIRIX_DATA_ROOT:PATH=ITK_OSIRIX_DATA_ROOT-NOTFOUND
+# sourceforge downloads:
+#http://prdownloads.sourceforge.net/osirix/CardiacCT.zip?download
+#http://prdownloads.sourceforge.net/osirix/PET-CT.zip?download
+# More datasets available from:
+#http://pubimage.hcuge.ch:8080/
+
+
+# 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).
+
+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_RPATH:BOOL=OFF \
+        -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF \
+        -DCMAKE_INSTALL_RPATH:STRING=${itkLibPath}
+}
+
+
+proc resetLibLinks { inputPath } {
+    # The example and testing binaries are built, but they are not "installed".
+    # All their rpath settings point to the build.dir, so they must be
+    # reset using install_name_tool for the destroot install.
+    global itkBuildBin itkLibPath
+    foreach f [glob ${inputPath}/*] {
+        if [string equal [file extension ${f}] ".app"] {
+            set exeName [file rootname [lindex [file split ${f}] end]]
+            set f [format "%s/Contents/MacOS/%s" ${f} ${exeName}]
+        }
+        if [expr [file isfile ${f}] && [file executable ${f}]] {
+            foreach dep [exec otool -L ${f}] {
+                if [string match -nocase "*/libitk*.dylib" ${dep}] {
+                    set newdep [strsed ${dep} #${itkBuildBin}#${itkLibPath}#]
+                    system "install_name_tool -change ${dep} ${newdep} ${f}"
+                }
+            }
+        }
+    }
+}
+
+
+variant examples description "provide ITK examples in ${itkExamplePath}" {
+    configure.args-delete \
+        -DBUILD_EXAMPLES:BOOL=OFF
+    configure.args-append \
+        -DBUILD_EXAMPLES:BOOL=ON
+    post-destroot {
+        xinstall -d -o root -g admin -m 0755 ${destroot}/${itkExampleBin}
+        foreach f [glob ${itkExampleSrc}/*] {
+            file copy ${f} ${destroot}/${itkExamplePath}/
+        }
+        # Find all the example executables by parsing all the
+        # CMakeLists.txt files within the src Examples path
+        set exe {}
+        foreach f [exec find ${itkExampleSrc} -name "CMakeLists.txt"] {
+            catch {exec grep -e "ADD_EXECUTABLE" ${f}} results
+            if [expr ![string match "*child process*" ${results}]] {
+                # Remove the string "ADD_EXECUTABLE(", with or without whitespace
+                regsub -all "\[ \t\]*ADD_EXECUTABLE\[(\]\[ \t\]*" ${results} "" results
+                # Remove the string ".cxx)", with or without whitespace
+                regsub -all ".cxx\[ \t\]*\[)\]" ${results} "" results
+                set exe [concat ${exe} ${results}]
+            }
+        }
+        set exe [lsort -unique ${exe}]
+        # Installations for the example binaries are in ${itkBuildBin}.
+        # Copy them into the destroot example bin.
+        foreach f $exe {
+            set f ${itkBuildBin}/${f}
+            if [expr [file isfile ${f}] && [file executable ${f}]] {
+                file copy ${f} ${destroot}/${itkExampleBin}
+            }
+        }
+        # Only do this if the shared variant is selected?
+        resetLibLinks ${destroot}/${itkExampleBin}
+    }
+}
+
+
+variant testing description "provide ITK testing in ${itkTestingPath}" {
+    configure.args-delete \
+        -DBUILD_TESTING:BOOL=OFF
+    configure.args-append \
+        -DBUILD_TESTING:BOOL=ON
+    post-destroot {
+        xinstall -d -o root -g admin -m 0755 ${destroot}/${itkTestingBin}
+        foreach f [glob ${itkTestingSrc}/*] {
+            file copy ${f} ${destroot}/${itkTestingPath}/
+        }
+        # Find all the testing executables by parsing all the
+        # CMakeLists.txt files within the itkTestingSrc path
+        set exe {}
+        foreach f [exec find ${itkTestingSrc} -name "CMakeLists.txt"] {
+            catch {exec grep -e "ADD_EXECUTABLE" ${f}} results
+            if [expr ![string match "*child process*" ${results}]] {
+                # Remove the string "ADD_EXECUTABLE(", with or without whitespace
+                regsub -all "\[ \t\]*ADD_EXECUTABLE\[(\]\[ \t\]*" ${results} "" results
+                # Remove the string ".cxx)", with or without whitespace
+                regsub -all ".cxx\[ \t\]*\[)\]" ${results} "" results
+                set exe [concat ${exe} ${results}]
+            }
+        }
+        set exe [lsort -unique ${exe}]
+        # Installations for the testing binaries are in ${itkBuildBin}.
+        # Copy them into the destroot testing bin.
+        foreach f $exe {
+            set f ${itkBuildBin}/${f}
+            if [expr [file isfile ${f}] && [file executable ${f}]] {
+                file copy ${f} ${destroot}/${itkTestingBin}
+            }
+        }
+        # Only do this if the shared variant is selected?
+        resetLibLinks ${destroot}/${itkTestingBin}
+    }
+}
+
+
+# --- external languages support
+
+
+# Some of the wrapper libs are built, but they are not "installed".
+# All their rpath settings point to the build.dir, so they must be
+# reset using install_name_tool after the destroot phase.
+proc resetWrapLibs { filepattern } {
+    global itkBuildBin itkLibPath itkWrapLibPath 
+    foreach f [glob ${filepattern}] {
+        foreach dep [exec otool -L ${f}] {
+            if [string match -nocase "*libSwigRuntime*" ${dep}] {
+                set newdep [strsed ${dep} #${itkBuildBin}#${itkWrapLibPath}#]
+                system "install_name_tool -change ${dep} ${newdep} ${f}"
+            } elseif [string match -nocase "${itkBuildBin}*" ${dep}] {
+                set newdep [strsed ${dep} #${itkBuildBin}#${itkLibPath}#]
+                system "install_name_tool -change ${dep} ${newdep} ${f}"
+            }
+        }
+    }
+}
+
+
+variant wrap requires shared description "USE_WRAP_ITK for external language support (includes shared)" {
+    depends_lib-append \
+        port:guile \
+        port:tcl
+    # The WrapITK install path assumes a prefix of ${prefix}, but without this
+    # variable setting, it will default to "lib/${name}/WrapITK" without the
+    # version specific ${distname}
+    set itkWrapInstallPath /lib/${distname}/WrapITK
+    configure.args-append \
+        -DUSE_WRAP_ITK:BOOL=ON \
+        -DITK_USE_REVIEW:BOOL=ON \
+        -DWRAP_ITK_JAVA:BOOL=ON \
+        -DWRAP_ITK_TCL:BOOL=ON \
+        -DCMAKE_CXX_FLAGS:STRING=-fpermissive \
+        -DGUILE_EXECUTABLE:FILEPATH=${prefix}/bin/guile \
+        -DGUILE_LIBRARY:FILEPATH=${prefix}/lib/libguile.dylib \
+        -DGUILE_INCLUDE_PATH:PATH=${prefix}/include/guile \
+        -DTCL_TCLSH:FILEPATH=${prefix}/bin/tclsh \
+        -DTCL_INCLUDE_PATH:PATH=${prefix}/include \
+        -DTCL_LIBRARY:FILEPATH=${prefix}/lib/libtcl.dylib \
+        -DTK_INCLUDE_PATH:PATH=${prefix}/include \
+        -DTK_LIBRARY:FILEPATH=${prefix}/lib/libtk.dylib
+        # The following config option seems more trouble than useful:
+        #-DWRAP_ITK_INSTALL_PREFIX:PATH=${itkWrapInstallPath} \
+        # Could enable this if the example variant is selected:
+        #-DSWIG_BUILD_EXAMPLES:BOOL=ON
+    post-destroot {
+        # Fix executable permissions and move tclwish to version specific file
+        set itkwishSh ${destroot}/${prefix}/bin/itkwish-${branch}
+        move ${destroot}/${prefix}/bin/itkwish ${itkwishSh}
+        file attributes ${itkwishSh} -permissions 0755
+        ln -s itkwish-${branch} ${destroot}/${prefix}/bin/itkwish
+        # Change the content of itkwish
+        reinplace "s|${name}|${distname}|g" ${itkwishSh}
+        reinplace "s|//|/|g" ${itkwishSh}
+        # Reset dynamic library dependency paths for itkwish binary
+        set itkwishBin ${destroot}/${itkLibPath}/WrapITK/bin/itkwish
+        foreach dep [exec otool -L ${itkwishBin}] {
+            if [string match "*Tcl.dylib" ${dep}] {
+                set newdep [strsed ${dep} #${itkLibPath}#${itkWrapLibPath}#]
+                system "install_name_tool -change ${dep} ${newdep} ${itkwishBin}"
+            }
+        }
+        # Reset dynamic library dependency paths (see proc above)
+        resetWrapLibs ${destroot}/${itkLibPath}/WrapITK/lib/*.dylib
+        resetWrapLibs ${destroot}/${itkLibPath}/WrapITK/lib/*.jnilib
+    }
+}
+
+# The following were possiblilities identified by ccmake
+
+#-DPERL_EXECUTABLE                 /opt/local/bin/perl
+#-DPERL_INCLUDE_PATH               PERL_INCLUDE_PATH-NOTFOUND
+#-DPERL_LIBRARY                    PERL_LIBRARY-NOTFOUND
+
+#-DPHP4_EXECUTABLE                 /opt/local/bin/php
+#-DPHP4_FOUND_INCLUDE_PATH         PHP4_FOUND_INCLUDE_PATH-NOTFOUND
+
+#-DPIKE_EXECUTABLE                 PIKE_EXECUTABLE-NOTFOUND
+#-DPIKE_INCLUDE_PATH               PIKE_INCLUDE_PATH-NOTFOUND
+
+#-DRUBY_EXECUTABLE                 RUBY_EXECUTABLE-NOTFOUND
+#-DRUBY_INCLUDE_PATH               /System/Library/Frameworks/Ruby.framework/Headers
+#-DRUBY_LIBRARY                    RUBY_LIBRARY-NOTFOUND
+
+# Note for Ruby include path:
+# exec ruby -r rbconfig -e {puts Config::CONFIG["archdir"]}
+
+# Some default WrapITK settings:
+
+ #WRAP_BinaryMorphology            ON
+ #WRAP_Calculators                 ON
+ #WRAP_Compose                     ON
+ #WRAP_DeformableTransforms        ON
+ #WRAP_Denoising                   ON
+ #WRAP_DistanceMap                 ON
+ #WRAP_EdgesAndContours            ON
+ #WRAP_FFT                         ON
+ #WRAP_FFTW                        OFF
+ #WRAP_Filtering                   ON
+ #WRAP_IO                          ON
+ #WRAP_ITK_DIMS                    2;3
+ #WRAP_ITK_INSTALL_PREFIX          /lib/InsightToolkit/WrapITK
+ #WRAP_ITK_JAVA                    ON
+ #WRAP_ITK_PYTHON                  ON
+ #WRAP_ITK_TCL                     ON
+ #WRAP_IntensityFilters            ON
+ #WRAP_Interpolators               ON
+ #WRAP_Iterators                   OFF
+ #WRAP_LevelSet                    ON
+ #WRAP_Morphology                  ON
+ #WRAP_PixelMath                   ON
+ #WRAP_Registration                ON
+ #WRAP_Resize                      ON
+ #WRAP_Review                      ON
+ #WRAP_SegmentationAndThreshold    ON
+ #WRAP_SegmentationValidation      ON
+ #WRAP_SimpleFilters               ON
+ #WRAP_UnaryPixelMath              ON
+ #WRAP_complex_double              OFF
+ #WRAP_complex_float               ON
+ #WRAP_covariant_vector_double     OFF
+ #WRAP_covariant_vector_float      ON
+ #WRAP_double                      OFF
+ #WRAP_float                       ON
+ #WRAP_rgb_unsigned_char           OFF
+ #WRAP_rgb_unsigned_short          ON
+ #WRAP_rgba_unsigned_char          OFF
+ #WRAP_rgba_unsigned_short         ON
+ #WRAP_signed_char                 OFF
+ #WRAP_signed_long                 OFF
+ #WRAP_signed_short                OFF
+ #WRAP_unsigned_char               OFF
+ #WRAP_unsigned_long               OFF
+ #WRAP_unsigned_short              ON
+ #WRAP_vector_double               OFF
+ #WRAP_vector_float                ON
+
+
+
+
+
+
+# -----------------------------------------------------------------------------
+# The USE_WRAP_ITK will configure a default tcl and java wrapping.  Only enable
+# and modify the variants below to provide version specific language
+# wrappers.  Each of these variants should require the wrap variant.
+
+
+proc setPython { {major 2} {minor 6} } {
+    global pyVer python pyPort pyBin pyLib pyInc pyFrame pySite
+    set pyVer       ${major}.${minor}
+    set python      python${pyVer}
+    set pyPort      python${major}${minor}
+    set pyFrame     Library/Frameworks/Python.framework/Versions/${pyVer}
+    set pyLib       ${pyFrame}/Python
+    #set pyLib       lib/${python}
+    set pyBin       bin/${python}
+    set pyInc       include/${python}
+    set pySite      lib/${python}/site-packages
+    if [string match "2.6" ${pyVer}] {
+        # python2.6 is a true framework installation; whereas installs for 2.4
+        # and 2.5 contain symlinks in the framework path to the prefix path; and
+        # those symlinks can break the file_map stage of port activation.
+        set pyBin   ${pyFrame}/bin/${python}
+        set pyInc   ${pyFrame}/include/${python}
+        set pySite  ${pyFrame}/lib/${python}/site-packages
+    }
+}
+setPython
+
+
+variant py24 requires wrap conflicts py25 description "python 2.4 wrapper (includes wrap)" {
+    setPython 2 4
+    # Hereafter py24 and py25 are the same, but how to abstract this?  Maybe
+    # a general pyXY variant that is required by py24 and py25, but not clear on
+    # how the require precedence works with regard to the setPython proc.
+    depends_lib-append \
+        port:${pyPort}
+    configure.args-append \
+        -DWRAP_ITK_PYTHON:BOOL=ON \
+        -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/${pyBin} \
+        -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/${pyInc} \
+        -DPYTHON_LIBRARY:FILEPATH=${prefix}/${pyLib} \
+        -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/${pyLib} \
+        -DPY_SITE_PACKAGES_PATH:PATH=${prefix}/${pySite}
+    post-destroot {
+        # Change the content of WrapITK.pth (for any python version)
+        reinplace "s|${name}|${distname}|g" ${destroot}/${prefix}/${pySite}/WrapITK.pth
+        reinplace "s|//|/|g" ${destroot}/${prefix}/${pySite}/WrapITK.pth
+        # Change the content of FindWrapITK.cmake (for any python version)
+        set findWrapITK [glob ${destroot}/${prefix}/share/cmake-*/Modules/FindWrapITK.cmake]
+        reinplace "s|${name}|${distname}|g" ${findWrapITK}
+        reinplace "s|//|/|g" ${findWrapITK}
+        # Reset dynamic library dependency paths (see proc above)
+        resetWrapLibs ${destroot}/${itkLibPath}/WrapITK/lib/*.so
+    }
+}
+
+variant py25 requires wrap conflicts py24 description "python 2.5 wrapper (includes wrap)" {
+    setPython 2 5
+    depends_lib-append \
+        port:${pyPort}
+    configure.args-append \
+        -DWRAP_ITK_PYTHON:BOOL=ON \
+        -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/${pyBin} \
+        -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/${pyInc} \
+        -DPYTHON_LIBRARY:FILEPATH=${prefix}/${pyLib} \
+        -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/${pyLib} \
+        -DPY_SITE_PACKAGES_PATH:PATH=${prefix}/${pySite}
+    post-destroot {
+        # Change the content of WrapITK.pth (for any python version)
+        reinplace "s|${name}|${distname}|g" ${destroot}/${prefix}/${pySite}/WrapITK.pth
+        reinplace "s|//|/|g" ${destroot}/${prefix}/${pySite}/WrapITK.pth
+        # Change the content of FindWrapITK.cmake (for any python version)
+        set findWrapITK [glob ${destroot}/${prefix}/share/cmake-*/Modules/FindWrapITK.cmake]
+        reinplace "s|${name}|${distname}|g" ${findWrapITK}
+        reinplace "s|//|/|g" ${findWrapITK}
+        # Reset dynamic library dependency paths (see proc above)
+        resetWrapLibs ${destroot}/${itkLibPath}/WrapITK/lib/*.so
+    }
+}
+
+
+# Regardless of the pyLib setting for py26, cmake or the wrap config sets
+# the string "-framework Python", but this "-framework Python" setting actually
+# gets resolved by the link process into the Apple system /Framework path rather
+# than macports!  I'm not clear about how to control this, so the py26 variant
+# must be disabled for now.  If it's enabled, add the py26 variant to the
+# conflicts of py24 and py25.
+#variant py26 requires wrap conflicts py24 py25 description "python 2.6 wrapper (includes wrap)" {
+#    setPython 2 6
+#    depends_lib-append \
+#        port:${pyPort}
+#    configure.args-append \
+#        -DWRAP_ITK_PYTHON:BOOL=ON \
+#        -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/${pyBin} \
+#        -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/${pyInc} \
+#        -DPYTHON_LIBRARY:FILEPATH=${prefix}/${pyLib} \
+#        -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/${pyLib} \
+#        -DPY_SITE_PACKAGES_PATH:PATH=${prefix}/${pySite}
+#    post-destroot {
+#        # Change the content of WrapITK.pth (for any python version)
+#        reinplace "s|${name}|${distname}|g" ${destroot}/${prefix}/${pySite}/WrapITK.pth
+#        # Reset dynamic library dependency paths (see proc above)
+#        resetWrapLibs ${destroot}/${itkLibPath}/WrapITK/lib/*.so
+#    }
+#}
+
+
+#variant java requires wrap description "provide java wrapper" {
+#    configure.args-append \
+#        # The following variables are defined automatically by cmake:
+#        #-DJAVACOMMAND                     /usr/bin/java
+#        #-DJAVA_ARCHIVE                    /usr/bin/jar
+#        #-DJAVA_AWT_INCLUDE_PATH           /System/Library/Frameworks/JavaVM.framework/Headers
+#        #-DJAVA_AWT_LIBRARY                -framework
+#        #-DJAVA_COMPILE                    /usr/bin/javac
+#        #-DJAVA_INCLUDE_PATH               /System/Library/Frameworks/JavaVM.framework/Headers
+#        #-DJAVA_INCLUDE_PATH2              /System/Library/Frameworks/JavaVM.framework/Headers
+#        #-DJAVA_JVM_LIBRARY                -framework
+#        #-DJAVA_RUNTIME                    /usr/bin/java
+#}
+
+
+#variant tcl requires wrap description "tcl wrapper (MacPorts tcl/tk)" {
+#    depends_lib-append \
+#        port:tcl \
+#        port:tk
+#    configure.args-append \
+#        -DTCL_TCLSH:FILEPATH=${prefix}/bin/tclsh \
+#        -DTCL_INCLUDE_PATH:PATH=${prefix}/include \
+#        -DTCL_LIBRARY:FILEPATH=${prefix}/lib/libtcl.dylib \
+#        -DTK_INCLUDE_PATH:PATH=${prefix}/include \
+#        -DTK_LIBRARY:FILEPATH=${prefix}/lib/libtk.dylib
+#}
+
+
+
+
+# -----------------------------------------------------------------------------
+# Additional possibilities for variants, not yet evaluated.
+
+#ITK_USE_LIBXML2
+#ITK_USE_MINC2
+
+#VNL_CONFIG_*
+
+#VXL_UPDATE_CONFIGURATION
+
+#variant kwstyle description {provide Kitware Style checking} {
+#    depends_lib-append \
+#        port:kwstyle
+#    configure.args-append \
+#        -DITK_USE_KWSTYLE:BOOL=ON
+#}
+
+#// Use an outside build of GDCM.
+#ITK_USE_SYSTEM_GDCM:BOOL=OFF
+#// Use the system's libxml2 library.
+#ITK_USE_SYSTEM_LIBXML2:BOOL=OFF
+#// Use the system's png library.
+#ITK_USE_SYSTEM_PNG:BOOL=OFF
+#// Use the system's tiff library.
+#ITK_USE_SYSTEM_TIFF:BOOL=OFF
+#// Use an outside build of VXL.
+#ITK_USE_SYSTEM_VXL:BOOL=OFF
+#// Use the system's zlib library.
+#ITK_USE_SYSTEM_ZLIB:BOOL=OFF
+
+
+
+# -----------------------------------------------------------------------------
+#livecheck.check     sourceforge
+#livecheck.regex     <title>itk InsightToolkit-(.*) released.*</title>
+


Property changes on: users/dweber/graphics/InsightToolkit/Portfile
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: users/dweber/graphics/paraview/Portfile
===================================================================
--- users/dweber/graphics/paraview/Portfile	                        (rev 0)
+++ users/dweber/graphics/paraview/Portfile	2009-05-27 22:49:47 UTC (rev 51562)
@@ -0,0 +1,321 @@
+# -*- 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
+
+name            paraview
+version         3.4.0
+revision        0
+set branch      [join [lrange [split ${version} .] 0 1] .]
+
+categories      graphics math science devel
+
+maintainers     dweber openmaintainer
+
+description     ParaView: data visualization on distributed computing platforms
+
+long_description \
+ParaView is an open-source, multi-platform data analysis and visualization application. ParaView users can quickly build visualizations to analyze their data using qualitative and quantitative techniques. The data exploration can be done interactively in 3D or programmatically using ParaView's batch processing capabilities.  ParaView was developed to analyze extremely large datasets using distributed memory computing resources. It can be run on supercomputers to analyze datasets of terascale as well as on laptops for smaller data.
+
+homepage        http://www.paraview.org
+master_sites    ${homepage}/files/v${branch}
+
+distname        paraview-${branch}
+distfiles       paraview-${version}.tar.gz \
+
+checksums       paraview-${version}.tar.gz \
+                    md5  a12067913e08ea7a465ca41509dbfde1 \
+                    sha1 08aca4cac9e557b763206ba6a5496487e335bcbc \
+                    rmd160 992c90712c057e1802fb55817ca2d7d49e526afb
+
+extract.only    paraview-${version}.tar.gz \
+
+platforms       darwin
+
+depends_build   port:cmake \
+                port:gmake
+
+depends_lib     port:xorg-libs \
+                port:qt4-mac
+
+# Use gmake and build in a separate directory from the source
+build.type      gnu
+build.dir       ${workpath}/${distname}-build
+
+
+# Global variables, used in variants, where a destroot prefix is appended, when necessary.
+set pvLibPath      ${prefix}/lib/${distname}
+set pvIncPath      ${prefix}/include/${distname}
+set pvSharePath    ${prefix}/share/${distname}
+#set pvDocFile      Doxygenparaview-${version}.tar.gz
+set pvDocPath      ${pvSharePath}/doc
+set pvDataPath     ${pvSharePath}/data
+set pvExamplePath  ${pvSharePath}/examples
+set pvTestingPath  ${pvSharePath}/testing
+set pvBuildBin     ${build.dir}/bin
+set pvExampleBin   ${pvExamplePath}/bin
+set pvTestingBin   ${pvTestingPath}/bin
+set pvExampleSrc   ${worksrcpath}/Examples
+set pvTestingSrc   ${worksrcpath}/Testing
+
+# Using this dummy stage to inspect MacPorts variables
+# (using 'port -d fetch paraview')
+#fetch { system "echo ${pvLibPath}" }
+
+post-extract {
+    move ${workpath}/paraview-${version} ${worksrcpath}
+}
+
+configure {
+    xinstall -d -m 0755 ${build.dir}
+    system "cd ${build.dir} && cmake ${configure.args} ${worksrcpath}"
+}
+
+# To double-check all the cmake variable settings after the configure
+#cd ${build.dir}
+#sudo cmake -LAH ../pv-${branch} > ~/cmake_vars.txt
+# Similarly, for an interactive configuration with ccmake, try:
+#cd ${build.dir}
+#sudo ccmake ../pv-${branch}
+
+configure.args-append \
+    -DBUILD_SHARED_LIBS:BOOL=OFF \
+    -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
+    -DCMAKE_INCLUDE_PATH:PATH=${prefix}/include \
+    -DCMAKE_LIBRARY_PATH:PATH=${prefix}/lib \
+    -DCMAKE_INSTALL_NAME_DIR:STRING=${prefix}/lib/${distname} \
+    -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
+    -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
+    -DDESIRED_QT_VERSION:STRING=4 \
+    -DPARAVIEW_BUILD_QT_GUI:BOOL=ON \
+    -DQT_QMAKE_EXECUTABLE:FILEPATH=${prefix}/bin/qmake-mac \
+    -DVTK_USE_QVTK:BOOL=ON \
+    -DPARAVIEW_ENABLE_PYTHON:BOOL=OFF \
+    -DPARAVIEW_USE_MPI:BOOL=OFF
+
+# Qt 4.3.0 or greater not found.  Please check the QT_QMAKE_EXECUTABLE
+
+#post-destroot {
+#    move ${destroot}${prefix}/lib/paraview     ${destroot}/${pvLibPath}
+#    move ${destroot}${prefix}/include/paraview ${destroot}/${pvIncPath}
+#}
+
+
+# -----------------------------------------------------------------------------
+# VARIANTS
+# variant name [requires variant] [conflicts variant] [description description]
+
+default_variants \
+    +data \
+    +shared
+
+#variant doc description "provide doxygen documentation in ${pvDocPath}" {
+#    distfiles-append    ${pvDocFile}
+#    checksums-append    ${pvDocFile} \
+#                        md5  99dcad9f8e7a3d0acb9da62efdf5fd13 \
+#                        sha1 e6800094f493e6ef2b1484ce2da578a19a978c40 \
+#                        rmd160 a20167892a6e91e6f530313c3c057e4d08999d62
+#    post-destroot {
+#        set pvDocPathLink ${prefix}/share/doc/${distname}
+#        xinstall -d -o root -g admin -m 755 ${destroot}/${pvDocPath}
+#        xinstall -d -o root -g admin -m 755 ${destroot}/${pvDocPathLink}
+#        # Add the doxygen documentation 
+#        system "tar --strip-components 1 -C ${destroot}/${pvDocPath} -zxf ${distpath}/${pvDocFile}"
+#        # Add basic documentation
+#        file copy ${worksrcpath}/Copyright     ${destroot}/${pvDocPath}/
+#        file copy ${worksrcpath}/Copyright.txt ${destroot}/${pvDocPath}/
+#        file copy ${worksrcpath}/README.html   ${destroot}/${pvDocPath}/
+#        # 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 this system command will allow it.
+#        system "ln -Fns ${pvDocPath} ${destroot}/${pvDocPathLink}"
+#    }
+#}
+
+# --- Data variants
+
+variant data description "provide data in ${pvDataPath}" {
+    distfiles-append \
+        ParaViewData${branch}.zip
+    checksums-append \
+        ParaViewData${branch}.zip \
+            md5  93cf1bfb4a64c9fee5254c9dd126027d \
+            sha1 af2ed1b2b809c0fe7228ee22dd058074c662667f \
+            rmd160 8bdd50bbf22de7e0f8316aed22cd64138b1ba2a5
+    configure.args-append \
+        -DPARAVIEW_DATA_ROOT:PATH=${pvDataPath}
+    #post-destroot {
+    #    xinstall -d -o root -g admin -m 755 ${destroot}/${pvDataPath}
+    #    foreach tgz [exec find ${distpath} -name "BrainPart*.tgz"] {
+    #        system "tar -C ${destroot}/${pvDataPath} -zxf ${tgz}"
+    #    }
+    #}
+}
+
+
+# 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).
+
+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_RPATH:BOOL=OFF \
+        -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF \
+        -DCMAKE_INSTALL_RPATH:STRING=${pvLibPath}
+}
+
+
+proc resetLibLinks { inputPath } {
+    # The example and testing binaries are built, but they are not "installed".
+    # All their rpath settings point to the build.dir, so they must be
+    # reset using install_name_tool for the destroot install.
+    global pvBuildBin pvLibPath
+    foreach f [glob ${inputPath}/*] {
+        if [string equal [file extension ${f}] ".app"] {
+            set exeName [file rootname [lindex [file split ${f}] end]]
+            set f [format "%s/Contents/MacOS/%s" ${f} ${exeName}]
+        }
+        if [expr [file isfile ${f}] && [file executable ${f}]] {
+            foreach dep [exec otool -L ${f}] {
+                if [string match -nocase "*/libpv*.dylib" ${dep}] {
+                    set newdep [strsed ${dep} #${pvBuildBin}#${pvLibPath}#]
+                    system "install_name_tool -change ${dep} ${newdep} ${f}"
+                }
+            }
+        }
+    }
+}
+
+
+variant examples description "provide examples in ${pvExamplePath}" {
+    configure.args-delete \
+        -DBUILD_EXAMPLES:BOOL=OFF
+    configure.args-append \
+        -DBUILD_EXAMPLES:BOOL=ON
+    #post-destroot {
+    #    xinstall -d -o root -g admin -m 755 ${destroot}/${pvExampleBin}
+    #    foreach f [glob ${pvExampleSrc}/*] {
+    #        file copy ${f} ${destroot}/${pvExamplePath}/
+    #    }
+    #    # Find all the example executables by parsing all the
+    #    # CMakeLists.txt files within the src Examples path
+    #    set exe {}
+    #    foreach f [exec find ${pvExampleSrc} -name "CMakeLists.txt"] {
+    #        catch {exec grep -e "ADD_EXECUTABLE" ${f}} results
+    #        if [expr ![string match "*child process*" ${results}]] {
+    #            # Remove the string "ADD_EXECUTABLE(", with or without whitespace
+    #            regsub -all "\[ \t\]*ADD_EXECUTABLE\[(\]\[ \t\]*" ${results} "" results
+    #            # Remove the string ".cxx)", with or without whitespace
+    #            regsub -all ".cxx\[ \t\]*\[)\]" ${results} "" results
+    #            set exe [concat ${exe} ${results}]
+    #        }
+    #    }
+    #    set exe [lsort -unique ${exe}]
+    #    # Installations for the example binaries are in ${pvBuildBin}.
+    #    # Copy them into the destroot example bin.
+    #    foreach f $exe {
+    #        set f ${pvBuildBin}/${f}
+    #        if [expr [file isfile ${f}] && [file executable ${f}]] {
+    #            file copy ${f} ${destroot}/${pvExampleBin}
+    #        }
+    #    }
+    #    resetLibLinks ${destroot}/${pvExampleBin}
+    #}
+}
+
+
+variant testing description "provide testing in ${pvTestingPath}" {
+    configure.args-delete \
+        -DBUILD_TESTING:BOOL=OFF
+    configure.args-append \
+        -DBUILD_TESTING:BOOL=ON
+    #post-destroot {
+    #    xinstall -d -o root -g admin -m 755 ${destroot}/${pvTestingBin}
+    #    foreach f [glob ${pvTestingSrc}/*] {
+    #        file copy ${f} ${destroot}/${pvTestingPath}/
+    #    }
+    #    # Find all the testing executables by parsing all the
+    #    # CMakeLists.txt files within the pvTestingSrc path
+    #    set exe {}
+    #    foreach f [exec find ${pvTestingSrc} -name "CMakeLists.txt"] {
+    #        catch {exec grep -e "ADD_EXECUTABLE" ${f}} results
+    #        if [expr ![string match "*child process*" ${results}]] {
+    #            # Remove the string "ADD_EXECUTABLE(", with or without whitespace
+    #            regsub -all "\[ \t\]*ADD_EXECUTABLE\[(\]\[ \t\]*" ${results} "" results
+    #            # Remove the string ".cxx)", with or without whitespace
+    #            regsub -all ".cxx\[ \t\]*\[)\]" ${results} "" results
+    #            set exe [concat ${exe} ${results}]
+    #        }
+    #    }
+    #    set exe [lsort -unique ${exe}]
+    #    # Installations for the testing binaries are in ${pvBuildBin}.
+    #    # Copy them into the destroot testing bin.
+    #    foreach f $exe {
+    #        set f ${pvBuildBin}/${f}
+    #        if [expr [file isfile ${f}] && [file executable ${f}]] {
+    #            file copy ${f} ${destroot}/${pvTestingBin}
+    #        }
+    #    }
+    #    resetLibLinks ${destroot}/${pvTestingBin}
+    #}
+}
+
+
+# --- external languages support
+
+#variant wrap requires shared description "USE_WRAP_ITK for external language support" {
+#    set pyver        2.5
+#    set python       python${pyver}
+#    set pyport       [join [lrange [split ${python} .] 0 1] ""]
+#    set pyframe      ${prefix}/Library/Frameworks/Python.framework/Versions/${pyver}
+#    depends_lib-append \
+#        port:guile
+#    configure.args-append \
+#        -DUSE_WRAP_ITK:BOOL=ON \
+#        -DITK_USE_REVIEW:BOOL=ON \
+#        -DCMAKE_CXX_FLAGS:STRING=-fpermissive \
+#        -DGUILE_EXECUTABLE:FILEPATH=${prefix}/bin/guile \
+#        -DGUILE_LIBRARY:FILEPATH=${prefix}/lib/libguile.dylib \
+#        -DGUILE_INCLUDE_PATH:PATH=${prefix}/include/guile \
+#        -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/${python} \
+#        -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/include/${python} \
+#        -DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/lib${python}.dylib \
+#        -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/lib/lib${python}.dylib \
+#        -DTCL_TCLSH:FILEPATH=${prefix}/bin/tclsh \
+#        -DTCL_INCLUDE_PATH:PATH=${prefix}/include \
+#        -DTCL_LIBRARY:FILEPATH=${prefix}/lib/libtcl.dylib \
+#        -DTK_INCLUDE_PATH:PATH=${prefix}/include \
+#        -DTK_LIBRARY:FILEPATH=${prefix}/lib/libtk.dylib
+#
+#        #-DSWIG_BUILD_EXAMPLES:BOOL=ON
+#
+#}
+
+
+#-DPARAVIEW_ENABLE_PYTHON:BOOL=ON
+
+
+
+#-DPARAVIEW_USE_MPI:BOOL=ON


Property changes on: users/dweber/graphics/paraview/Portfile
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: users/dweber/graphics/vtk-devel/Portfile
===================================================================
--- users/dweber/graphics/vtk-devel/Portfile	                        (rev 0)
+++ users/dweber/graphics/vtk-devel/Portfile	2009-05-27 22:49:47 UTC (rev 51562)
@@ -0,0 +1,669 @@
+# -*- 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
+
+name            vtk-devel
+version         5.4.0
+revision        3
+set branch      [join [lrange [split ${version} .] 0 1] .]
+
+categories      graphics math science devel
+
+maintainers     dweber openmaintainer
+
+description     3D visualization toolkit (www.vtk.org)
+
+long_description \
+An open source, freely available software system for 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} \
+                http://www.vtk.org/doc/release/${branch}
+
+distname        vtk-${branch}
+distfiles       vtk-${version}.tar.gz
+
+checksums       vtk-${version}.tar.gz \
+                    md5  3e7c6d5c37602c935674d580a8dd43c0 \
+                    sha1 a227caf932315d944cf72008d75df90dd4c554e7 \
+                    rmd160 e2140fc35ed974f5fde6b418089554904e197c21
+
+eval extract.only   vtk-${version}.tar.gz
+
+# See variants for details on handling these files.
+# Update the checksums in the variants.
+set vtkDataFile     vtkdata-${version}.tar.gz
+set vtkDataPath     ${prefix}/share/${distname}/data
+set vtkDocFile      vtkDocHtml-${version}.tar.gz
+set vtkDocPath      ${prefix}/share/${distname}/doc
+set vtkExamplePath  ${prefix}/share/${distname}/examples
+set vtkTestingPath  ${prefix}/share/${distname}/testing
+set vtkLibPath      ${prefix}/lib/${distname}
+
+
+platforms       darwin
+
+depends_build   port:cmake  \
+                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 MacPorts variables (using 'port -d fetch vtk-devel')
+#fetch { system "echo ${configure.args} " }
+
+post-extract {
+    move ${workpath}/VTK ${worksrcpath}
+}
+
+configure {
+    xinstall -d -m 0755 ${build.dir}
+    system "cd ${build.dir} && cmake ${configure.args} ${worksrcpath}"
+}
+
+# To double-check all the cmake variable settings after the configure
+#cd ${build.dir}
+#sudo cmake -LAH ../vtk-${branch} > ~/cmake_vars.txt
+# Similarly, for an interactive configuration with ccmake, try:
+#cd ${build.dir}
+#sudo ccmake ../vtk-${branch}
+
+configure.args \
+    -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} \
+    -DBUILD_DOCUMENTATION:BOOL=OFF \
+    -DBUILD_EXAMPLES:BOOL=OFF \
+    -DBUILD_TESTING:BOOL=OFF \
+    -DBUILD_SHARED_LIBS:BOOL=OFF \
+    -DVTK_DEBUG_LEAKS:BOOL=ON \
+    -DVTK_USE_COCOA:BOOL=OFF \
+    -DVTK_USE_CARBON:BOOL=OFF \
+    -DVTK_USE_X:BOOL=OFF \
+    -DVTK_USE_HYBRID:BOOL=ON \
+    -DVTK_USE_GUISUPPORT:BOOL=ON \
+    -DVTK_USE_INFOVIS:BOOL=ON \
+    -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_JAVA:BOOL=OFF \
+    -DVTK_WRAP_PYTHON:BOOL=OFF \
+    -DVTK_WRAP_TCL:BOOL=OFF
+
+
+# -----------------------------------------------------------------------------
+# PLATFORMS: platform darwin <version>
+# Can be used to handle different tasks depending
+# on the version of Mac OS X.  The version can be:
+# 6 for 10.2 Jaguar,
+# 7 for 10.3 Panther,
+# 8 for 10.4 Tiger, or
+# 9 for 10.5 Leopard.
+
+# 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.args-append \
+        -DVTK_REQUIRED_OBJCXX_FLAGS="-fobjc-gc"
+}
+
+
+# -----------------------------------------------------------------------------
+# VARIANTS
+# variant name [requires variant] [conflicts variant] [description description]
+
+default_variants \
+    +data \
+    +doc \
+    +examples \
+    +shared \
+    +testing
+
+if { ![variant_isset carbon] && ![variant_isset x11] } {
+    default_variants-append +cocoa
+}
+
+
+variant huge \
+    requires cocoa data doc examples shared testing wrap database mpi boost \
+    description "provide cocoa data doc examples shared testing wrap database mpi boost" {}
+
+
+# --- "Core" variants for VTK: data, doc, examples, shared libs, testing
+
+
+variant data description "provide example data in: ${vtkDataPath}" {
+    distfiles-append    ${vtkDataFile}
+    checksums-append    ${vtkDataFile} \
+                            md5  283d40f3e499b3a6102d86855d2ca20b \
+                            sha1 a710227e7f7f25f481a36d2fa14bda49756bd39d \
+                            rmd160 160129a0580bd7b70b40d3f7fa61bbd78b586ad8
+    configure.args-append \
+        -DVTK_DATA_ROOT:PATH=${vtkDataPath}
+    post-destroot {
+        xinstall -d -o root -g admin -m 0755 ${destroot}/${vtkDataPath}
+        system "tar --strip-components 1 -C ${destroot}/${vtkDataPath} -zxvf ${distpath}/${vtkDataFile}"
+    }
+}
+
+
+variant doc description "provide doxygen documentation in: ${vtkDocPath}" {
+    distfiles-append    ${vtkDocFile}
+    checksums-append    ${vtkDocFile} \
+                            md5 eb8fcaa5fa8bc8f463084f071b2b978b \
+                            sha1 1a8f8ff20b18bc7ac707846a8ba056b04c827392 \
+                            rmd160 c657f9ce0850eca1bb0a0d7537f0bcf631132f30
+    post-destroot {
+        set vtkDocPathLink ${prefix}/share/doc/${distname}
+        xinstall -d -o root -g admin -m 0755 ${destroot}/${vtkDocPath}
+        xinstall -d -o root -g admin -m 0755 ${destroot}/${vtkDocPathLink}
+        # Add the doxygen documentation
+        system "tar -C ${destroot}/${vtkDocPath} -zxf ${distpath}/${vtkDocFile}"
+        # Add basic documentation
+        file copy ${worksrcpath}/README.html   ${destroot}/${vtkDocPath}
+        file copy ${worksrcpath}/Copyright.txt ${destroot}/${vtkDocPath}
+        file copy ${worksrcpath}/Testing.txt   ${destroot}/${vtkDocPath}
+        # 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 this system command will allow it.
+        system "ln -Fhs ${vtkDocPath} ${destroot}/${vtkDocPathLink}"
+    }
+    # A doxygen dependency would add a lot of complexity to vtk, so
+    # just use a download instead of building the docs. Otherwise:
+    #depends_build-append \
+        port:doxygen
+    #configure.args-append \
+        -DBUILD_DOCUMENTATION:BOOL=ON
+}
+
+
+variant examples description "provide VTK examples in: ${vtkExamplePath}" {
+    configure.args-delete \
+        -DBUILD_EXAMPLES:BOOL=OFF
+    configure.args-append \
+        -DBUILD_EXAMPLES:BOOL=ON
+    post-destroot {
+        xinstall -d -o root -g admin -m 0755 ${destroot}/${vtkExamplePath}/bin
+        foreach f [glob ${worksrcpath}/Examples/*] {
+            file copy ${f} ${destroot}/${vtkExamplePath}/
+        }
+        # Installations for the example binaries are in ${build.dir}/bin/.
+        set buildBinPath ${build.dir}/bin
+        foreach f [glob ${buildBinPath}/*] {
+            if {![string match {*.dylib} ${f}]} {
+              file copy ${f} ${destroot}/${vtkExamplePath}/bin/
+            }
+        }
+        # All the rpath settings for these binaries point to the build.dir, so
+        # they are reset using install_name_tool.
+        foreach f [glob ${destroot}/${vtkExamplePath}/bin/*] {
+            if [string equal [file extension ${f}] ".app"] {
+                set exeName [file rootname [lindex [file split ${f}] end]]
+                set f [format "%s/Contents/MacOS/%s" ${f} ${exeName}]
+            }
+            if [expr [file isfile ${f}] && [file executable ${f}]] {
+                foreach dep [exec otool -L ${f}] {
+                    if [string match "*/libvtk*.dylib" ${dep}] {
+                        set newdep [strsed ${dep} #${buildBinPath}#${vtkLibPath}#]
+                        system "install_name_tool -change ${dep} ${newdep} ${f}"
+                    }
+                }
+            }
+        }
+    }
+}
+
+
+# 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 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=OFF \
+        -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF \
+        -DCMAKE_INSTALL_RPATH:STRING=${prefix}/lib/${distname} \
+        -DVTK_USE_RPATH:BOOL=ON
+    # Additional options not required here:
+    #-DCMAKE_EXE_LINKER_FLAGS:STRING=-rpath ${prefix}/lib \
+    #-DVTK_REQUIRED_EXE_LINKER_FLAGS:STRING=-rpath ${prefix}/lib
+}
+
+
+variant testing requires data description "provide VTK tests in: ${vtkTestingPath}" {
+    configure.args-delete \
+        -DBUILD_TESTING:BOOL=OFF
+    configure.args-append \
+        -DBUILD_TESTING:BOOL=ON
+    post-destroot {
+        xinstall -d -o root -g admin -m 0755 ${destroot}/${vtkTestingPath}/bin
+        # Copy the testing source tree
+        foreach d [exec find ${worksrcpath} -type d -name Testing] {
+            regsub ${worksrcpath} ${d} ${destroot}${vtkTestingPath} testpath;
+            regsub Testing ${testpath} "" testpath;
+            if {![string match *Examples* ${d}]} {
+                xinstall -d -o root -g admin -m 0755 ${testpath}
+                file copy ${d} ${testpath}
+            }
+        }
+        # Installations for the test binaries are in ${build.dir}/bin/.
+        set buildBinPath ${build.dir}/bin
+        foreach f [glob ${buildBinPath}/*Test*] {
+            if {![string match {*.dylib} ${f}]} {
+              file copy ${f} ${destroot}/${vtkTestingPath}/bin/
+            }
+        }
+        # All the rpath settings for these binaries point to the build.dir, so
+        # they are reset using install_name_tool.
+        foreach f [glob ${destroot}/${vtkTestingPath}/bin/*] {
+            if [string equal [file extension ${f}] ".app"] {
+                set exeName [file rootname [lindex [file split ${f}] end]]
+                set f [format "%s/Contents/MacOS/%s" ${f} ${exeName}]
+            }
+            if [expr [file isfile ${f}] && [file executable ${f}]] {
+                foreach dep [exec otool -L ${f}] {
+                    if [string match "*/libvtk*.dylib" ${dep}] {
+                        set newdep [strsed ${dep} #${buildBinPath}#${vtkLibPath}#]
+                        system "install_name_tool -change ${dep} ${newdep} ${f}"
+                    }
+                }
+            }
+        }
+    }
+}
+
+
+# --- Graphics subsystem variants: carbon, cocoa, x11
+
+
+variant carbon conflicts cocoa x11 description "build with Carbon" {
+    configure.args-delete   \
+        -DVTK_USE_CARBON:BOOL=OFF
+    configure.args-append   \
+        -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_lib-append    \
+        port:xorg-libs \
+        port:xorg-proto \
+        port:mesa
+    configure.args-delete   \
+        -DVTK_USE_X:BOOL=OFF
+    configure.args-append   \
+        -DVTK_USE_X:BOOL=ON \
+        -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
+}
+
+
+
+# --- Language wrappers: java, python, tcl
+#
+# VTK has its own language parser, it doesn't depend on swig or cableswig (as
+# of May 2009).  Since the VTK CVS repository and source distributions include
+# the output of byacc and flex, there is no need for a dependency on these
+# to build VTK.  If that were to change at some point, use byacc and not bison,
+# i.e.: depends_build-append port:byacc port:flex
+
+
+variant wrap requires java py26 tcl description "provide java, py26, & tcl" {}
+
+
+variant java description "java wrapper" {
+    configure.args-delete \
+        -DVTK_WRAP_JAVA:BOOL=OFF
+    configure.args-append \
+        -DVTK_WRAP_JAVA:BOOL=ON
+    #
+    # All of the following were detected automatically by cmake.  They use the
+    # system java framework.  To replace them with a MacPorts java, reset
+    # these variables and add the required dependencies.
+    #
+    #JAVA_ARCHIVE:FILEPATH=/usr/bin/jar
+    #JAVA_AWT_INCLUDE_PATH:FILEPATH=/System/Library/Frameworks/JavaVM.framework/Headers
+    #JAVA_AWT_LIBRARY:FILEPATH=-framework JavaVM
+    #JAVA_COMPILE:FILEPATH=/usr/bin/javac
+    #JAVA_INCLUDE_PATH:PATH=/System/Library/Frameworks/JavaVM.framework/Headers
+    #JAVA_INCLUDE_PATH2:PATH=/System/Library/Frameworks/JavaVM.framework/Headers
+    #JAVA_JVM_LIBRARY:FILEPATH=-framework JavaVM
+    #JAVA_RUNTIME:FILEPATH=/usr/bin/java
+}
+
+
+# It might be possible to install vtk for both python25 and python26 (etc.), but
+# that may require separate ports because the build and install process for vtk
+# can only work with one at a time.  The build is a lengthy process and there
+# may be, as yet, no easy way to run a post-build wrapper with a dependency on a
+# prior install of vtk.  At present, if there are separate ports of vtk for
+# different versions of python, each port will incur a lengthy build process.
+# Moreover, it's not clear that the install process can be specifically selected
+# for python only, without also installing all of vtk.  For that reason,
+# it may be best to avoid separate ports of vtk for each python version.  The
+# preference should be to install vtk for the latest compatible version of
+# python.
+#
+# Hence, these variants for py25 and py26 must conflict.  At some point, the
+# py25 variant could disappear.  Likewise py26 could disappear if vtk works in
+# python 3.x
+
+# Note: currently vtkpython depends on libutil and finds it in:
+# // Utility library needed for vtkpython
+# PYTHON_UTIL_LIBRARY:FILEPATH=/usr/lib/libutil.dylib
+# I don't see a port for libutil.  If one arises, it should become a
+# dependency for any python variant.
+#
+#// Extra libraries to link when linking to python (such as "z" for zlib).
+#// Separate multiple libraries with semicolons.
+#PYTHON_EXTRA_LIBS:STRING=
+#
+
+# A procedure to set or reset python variables (defaults to python26).
+# This is called from within pyXY variants like this: setPython X Y
+proc setPython { {major 2} {minor 6} } {
+    global pyver python pyport pyframe
+    set pyver        ${major}.${minor}
+    set python       python${pyver}
+    set pyport       python${major}${minor}
+    set pyframe      Library/Frameworks/Python.framework/Versions/${pyver}
+}
+# Initialize the global variables for python26
+setPython
+
+
+variant py25 conflicts py26 requires shared description "python 2.5 wrapper" {
+    # Note that python25 is NOT installed as a framework (May 2009)
+    setPython 2 5
+    depends_lib-append \
+        port:${pyport}
+    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/${python} \
+        -DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/lib${python}.dylib \
+        -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/lib/lib${python}.dylib \
+        -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/${python} \
+        -DVTK_PYTHON_SETUP_ARGS:STRING='--prefix=${prefix} --root=${destroot}'
+        # The VTK_PYTHON_SETUP_ARGS *MUST* be in single quotes
+    post-destroot {
+        setPython 2 5
+        # Reset the name of the vtkpython binary (create a symlink to the
+        # version specific installation, in case other apps look for vtkpython)
+        move ${destroot}${prefix}/bin/vtkpython ${destroot}${prefix}/bin/vtk-${branch}-${pyport}
+        ln -f -s ${destroot}${prefix}/bin/vtk-${branch}-${pyport} ${destroot}${prefix}/bin/vtkpython 
+        # Is it possible to change the python site-package name and have it all work OK?
+        # from:  .../lib/python2.5/site-packages/vtk
+        # to:    .../lib/python2.5/site-packages/vtk-5.4
+        # Reset the RPATH for all the python .so files
+        set buildBinPath ${build.dir}/bin
+        set vtkLibPath ${prefix}/lib/${distname}
+        set vtkSitePackage ${destroot}/${prefix}/lib/${python}/site-packages/vtk
+        foreach f [glob ${vtkSitePackage}/*.so] {
+            foreach dep [exec otool -L ${f}] {
+                if [string match "*libvtk*.dylib" ${dep}] {
+                    set newdep [strsed ${dep} #${buildBinPath}#${vtkLibPath}#]
+                    system "install_name_tool -change ${dep} ${newdep} ${f}"
+                }
+            }
+        }
+    }
+}
+
+variant py26 conflicts py25 requires shared description "python 2.6 wrapper" {
+    # Note that python26 is installed as a framework (May 2009)
+    setPython 2 6
+    depends_lib-append \
+        port:${pyport}
+    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}/${pyframe}/Headers \
+        -DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/lib${python}.dylib \
+        -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/lib/lib${python}.dylib \
+        -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/${python} \
+        -DVTK_PYTHON_SETUP_ARGS:STRING='--prefix=${prefix}/${pyframe} --root=${destroot}'
+        # For 2.6, it needs to be installed into ${pyframe}/lib/${python}/site-packages
+        # The VTK_PYTHON_SETUP_ARGS *MUST* be in single quotes
+    post-destroot {
+        setPython 2 6
+        # Reset the name of the vtkpython binary (create a symlink to the
+        # version specific installation, in case other apps look for vtkpython)
+        move ${destroot}${prefix}/bin/vtkpython ${destroot}${prefix}/bin/vtk-${branch}-${pyport}
+        ln -f -s ${destroot}${prefix}/bin/vtk-${branch}-${pyport} ${destroot}${prefix}/bin/vtkpython 
+        # Is it possible to change the python site-package name and have it all work OK?
+        # from:  .../lib/python2.6/site-packages/vtk
+        # to:    .../lib/python2.6/site-packages/vtk-5.4
+        # Reset the RPATH for all the python .so files
+        set buildBinPath ${build.dir}/bin
+        set vtkLibPath ${prefix}/lib/${distname}
+        set vtkSitePackage ${destroot}/${prefix}/${pyframe}/lib/${python}/site-packages/vtk
+        foreach f [glob ${vtkSitePackage}/*.so] {
+            foreach dep [exec otool -L ${f}] {
+                if [string match "*libvtk*.dylib" ${dep}] {
+                    set newdep [strsed ${dep} #${buildBinPath}#${vtkLibPath}#]
+                    system "install_name_tool -change ${dep} ${newdep} ${f}"
+                }
+            }
+        }
+    }
+}
+
+
+variant tcl conflicts tcl_apple 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/libtcl.dylib \
+        -DTK_INCLUDE_PATH:PATH=${prefix}/include \
+        -DTK_LIBRARY:FILEPATH=${prefix}/lib/libtk.dylib
+        # VTK_TCL_TK_STATIC is not specified here, it's OFF by default.
+    post-destroot {
+        # Reset the name of the vtk tcl binary (create a symlink to the
+        # version specific installation, in case other apps look for vtk)
+        move ${destroot}${prefix}/bin/vtk ${destroot}${prefix}/bin/vtk-${branch}-tcl
+        ln -f -s ${destroot}${prefix}/bin/vtk-${branch}-tcl ${destroot}${prefix}/bin/vtk
+    }
+}
+
+variant tcl_apple conflicts tcl description "tcl wrapper (apple tcl/tk framework)" {
+    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
+    post-destroot {
+        # Reset the name of the vtk tcl binary (create a symlink to the
+        # version specific installation, in case other apps look for vtk)
+        move ${destroot}${prefix}/bin/vtk ${destroot}${prefix}/bin/vtk-${branch}-tcl
+        ln -f -s ${destroot}${prefix}/bin/vtk-${branch}-tcl ${destroot}${prefix}/bin/vtk
+    }
+}
+
+
+# --- Database variants
+
+variant database requires mysql5 pgsql83 odbc description "provide all database variants" {}
+
+
+variant mysql5 description "build the MySQL driver for vtkSQLDatabase" {
+    depends_lib-append \
+        path:bin/mysql_config5:mysql5 \
+        port:zlib
+    pre-configure {
+        # Find the directory containing mysql.h
+        set includePath [exec ${prefix}/bin/mysql_config5 --include]
+        set includePath [string trim ${includePath} -I ]
+        #if [ exec find $includePath -name "mysql.h" ]
+        set libs [exec ${prefix}/bin/mysql_config5 --libs]
+        set libIdx [lsearch -regex $libs "${prefix}/lib/mysql"]
+        set libPath [lindex $libs $libIdx]
+        set libPath [string trim ${libPath} -L ]
+        set libFile [exec find ${libPath} -name "libmysqlclient.dylib"]
+        configure.args-append \
+            -DVTK_USE_MYSQL:BOOL=ON \
+            -DMYSQL_INCLUDE_DIRECTORIES:PATH=${includePath} \
+            -DMYSQL_LIBRARY:FILEPATH=${libFile} \
+            -DMYSQL_EXTRA_LIBRARIES:FILEPATH=${prefix}/lib/libz.dylib
+            # A URL for a MySQL server of the form
+            # mysql://[[username[:password]@]hostname[:port]]/[dbname]
+            #VTK_MYSQL_TEST_URL:STRING=
+    }
+}
+
+
+variant pgsql83 description "build the PostgreSQL 8.3 driver for vtkSQLDatabase" {
+    depends_lib-append \
+        path:lib/postgresql83/bin/pg_config:postgresql83
+    pre-configure {
+        set pgconf [exec ${prefix}/lib/postgresql83/bin/pg_config ]
+        set includeIdx [lsearch -regex ${pgconf} "^INCLUDEDIR"]
+        set includePath [lindex ${pgconf} [expr ${includeIdx} + 2]]
+        set libIdx [lsearch -regex $pgconf "^LIBDIR"]
+        set libPath [lindex $pgconf [expr $libIdx + 2]]
+        set libFile [exec find ${libPath} -name "libpq.dylib"]
+        configure.args-append \
+            -DVTK_USE_POSTGRES:BOOL=ON \
+            -DPOSTGRES_INCLUDE_DIRECTORIES:PATH=${includePath} \
+            -DPOSTGRES_LIBRARIES:FILEPATH=${libFile}
+            #// A URL for a PostgreSQL server of the form
+            #// psql://[[username[:password]@]hostname[:port]]/[dbname]
+            #VTK_PSQL_TEST_URL:STRING=
+    }
+}
+
+
+variant odbc description "build the ODBC database interface" {
+    depends_lib-append \
+        port:unixODBC
+    configure.args-append \
+        -DVTK_USE_ODBC:BOOL=ON \
+        -DODBC_INCLUDE_DIRECTORIES:PATH=${prefix}/include \
+        -DODBC_LIBRARY:FILEPATH=${prefix}/lib/libodbc.dylib
+        #// A data source name (DSN) for an ODBC database connection to use for testing.
+        #-DVTK_ODBC_TEST_DSN:STRING=
+}
+
+
+# --- Miscellaneous variants
+
+
+variant mpi description "use message passing interface (mpich2) for parallel support" {
+    set nCPU [expr [exec sysctl -n hw.logicalcpu_max]]
+    depends_lib-append \
+        port:mpich2
+    configure.args-append \
+        -DVTK_USE_MPI:BOOL=ON \
+        -DMPI_COMPILER:FILEPATH=${prefix}/bin/mpicxx \
+        -DMPIEXEC:FILEPATH=${prefix}/bin/mpiexec \
+        -DMPIEXEC_MAX_NUMPROCS:STRING=${nCPU}
+        # If the MPI_LIBRARY and-or MPI_INCLUDE_PATH are set, then the
+        # FindMPI module will not determine all the cmake variables
+        # automatically (don't set them). It should be sufficient to set the
+        # MPI_COMPILER and leave the rest to the FindMPI module, see:
+        # /opt/local/share/cmake-2.6/Modules/FindMPI.cmake
+}
+
+
+variant boost description "use Boost libraries - www.boost.org" {
+    depends_lib-append \
+        port:boost
+    configure.args-append \
+        -DVTK_USE_BOOST:BOOL=ON
+        # All determined automatically:
+        #Boost_INCLUDE_DIR:PATH=/opt/local/include
+        #Boost_LIBRARY_DIRS:FILEPATH=/opt/local/lib
+        #Boost_USE_MULTITHREADED:BOOL=ON
+}
+
+
+
+
+#variant qvtk "build QVTK widget and plugin for Qt" {
+#    # Dependencies?
+#    configure.args-append \
+#        -DVTK_USE_QVTK:BOOL=ON
+#}
+
+
+#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 \
+#        -DVTK_USE_CG_SHADERS:BOOL=ON
+#}
+
+#variant system_libs description "build with various system libs" {
+#    configure.args-append \
+#        -DVTK_USE_SYSTEM_EXPAT:BOOL=ON \
+#        -DVTK_USE_SYSTEM_FREETYPE:BOOL=ON \
+#        -DVTK_USE_SYSTEM_JPEG:BOOL=ON \
+#        -DVTK_USE_SYSTEM_LIBPROJ4:BOOL=ON \
+#        -DVTK_USE_SYSTEM_LIBXML2:BOOL=ON \
+#        -DVTK_USE_SYSTEM_PNG:BOOL=ON \
+#        -DVTK_USE_SYSTEM_TIFF:BOOL=ON \
+#        -DVTK_USE_SYSTEM_ZLIB:BOOL=ON
+#}
+


Property changes on: users/dweber/graphics/vtk-devel/Portfile
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090527/af0b48f2/attachment-0001.html>


More information about the macports-changes mailing list