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

dweber at macports.org dweber at macports.org
Fri May 8 15:45:39 PDT 2009


Revision: 50760
          http://trac.macports.org/changeset/50760
Author:   dweber at macports.org
Date:     2009-05-08 15:45:39 -0700 (Fri, 08 May 2009)
Log Message:
-----------
revision 1; numerous changes; everything 'appears' to work, but nothing has been extensively tested

Revision Links:
--------------
    http://trac.macports.org/changeset/1

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

Modified: trunk/dports/graphics/vtk-devel/Portfile
===================================================================
--- trunk/dports/graphics/vtk-devel/Portfile	2009-05-08 22:29:45 UTC (rev 50759)
+++ trunk/dports/graphics/vtk-devel/Portfile	2009-05-08 22:45:39 UTC (rev 50760)
@@ -5,8 +5,7 @@
 
 name            vtk-devel
 version         5.4.0
-revision        0
-
+revision        1
 set branch	    [join [lrange [split ${version} .] 0 1] .]
 
 categories      graphics math science devel 
@@ -16,50 +15,34 @@
 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. \
-default_variants: +examples +testing +tclSys
+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} \
+                http://www.vtk.org/doc/release/${branch}
 
 distname        vtk-${branch}
-distfiles       vtk-${version}.tar.gz \
-                vtkdata-${version}.tar.gz \
-                vtkDocHtml-${version}.tar.gz
+distfiles       vtk-${version}.tar.gz
 
 checksums       vtk-${version}.tar.gz \
                     md5  3e7c6d5c37602c935674d580a8dd43c0 \
                     sha1 a227caf932315d944cf72008d75df90dd4c554e7 \
-                    rmd160 e2140fc35ed974f5fde6b418089554904e197c21 \
-                vtkdata-${version}.tar.gz \
-                    md5  283d40f3e499b3a6102d86855d2ca20b \
-                    sha1 a710227e7f7f25f481a36d2fa14bda49756bd39d \
-                    rmd160 160129a0580bd7b70b40d3f7fa61bbd78b586ad8 \
-                vtkDocHtml-${version}.tar.gz \
-                    md5 eb8fcaa5fa8bc8f463084f071b2b978b \
-                    sha1 1a8f8ff20b18bc7ac707846a8ba056b04c827392 \
-                    rmd160 c657f9ce0850eca1bb0a0d7537f0bcf631132f30
+                    rmd160 e2140fc35ed974f5fde6b418089554904e197c21
 
 platforms       darwin
 
-depends_build   port:cmake 
-depends_lib     port:readline
+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 macport variables (using 'port -d fetch vtk-devel')
-#fetch { system "echo ${workbuildpath} && echo ${worksrcpath} && echo ${destroot}" }
+#fetch { system "echo ${distfiles} && echo ${checksums}" }
 
 post-extract {
     move ${workpath}/VTK     ${workpath}/${distname}
-    move ${workpath}/VTKData ${workpath}/${distname}-data
-    move ${workpath}/html    ${workpath}/${distname}-html
 }
 
 configure {
@@ -67,12 +50,11 @@
     system "cd ${build.dir} && cmake ${configure.args} ${worksrcpath}"
 }
 
-
 # To double-check all the cmake variable settings after the configure
-#cd ${workbuildpath}
+#cd ${build.dir}
 #sudo cmake -LAH ../vtk-${branch} > ~/cmake_vars.txt
 # Similarly, for an interactive configuration with ccmake, try:
-#cd ${workbuildpath}
+#cd ${build.dir}
 #sudo ccmake ../vtk-${branch}
 
 configure.args \
@@ -88,10 +70,10 @@
     -DBUILD_TESTING:BOOL=OFF \
     -DBUILD_SHARED_LIBS:BOOL=OFF \
     -DVTK_DEBUG_LEAKS:BOOL=ON \
-    -DVTK_USE_HYBRID: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 \
@@ -99,16 +81,11 @@
     -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_WRAP_PYTHON:BOOL=OFF \
+    -DVTK_WRAP_TCL: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
@@ -118,13 +95,12 @@
 # 8 for 10.4 Tiger, or
 # 9 for 10.5 Leopard.
 
-#VTK_REQUIRED_OBJCXX_FLAGS "-fobjc-gc"
 # 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 \
-        VTK_REQUIRED_OBJCXX_FLAGS="-fobjc-gc"
+        -DVTK_REQUIRED_OBJCXX_FLAGS="-fobjc-gc"
 }
 
 
@@ -148,9 +124,17 @@
 
 
 variant data description {install example data [default: ${prefix}/share/${distname}/data]} {
+    distfiles-append vtkdata-${version}.tar.gz
+    checksums-append vtkdata-${version}.tar.gz \
+                        md5  283d40f3e499b3a6102d86855d2ca20b \
+                        sha1 a710227e7f7f25f481a36d2fa14bda49756bd39d \
+                        rmd160 160129a0580bd7b70b40d3f7fa61bbd78b586ad8
     set vtkDataPath ${prefix}/share/${distname}/data
     configure.args-append \
         -DVTK_DATA_ROOT:PATH=${vtkDataPath}
+    post-extract {
+        move ${workpath}/VTKData ${workpath}/${distname}-data
+    }
     post-destroot {
         set vtkDataFile ${distpath}/vtkdata-${version}.tar.gz
         set vtkDataPath ${prefix}/share/${distname}/data
@@ -161,24 +145,33 @@
 
 
 variant doc description {provide doxygen documentation [default: ${prefix}/share/${distname}/doc]} {
+    distfiles-append vtkDocHtml-${version}.tar.gz
+    checksums-append vtkDocHtml-${version}.tar.gz \
+                        md5 eb8fcaa5fa8bc8f463084f071b2b978b \
+                        sha1 1a8f8ff20b18bc7ac707846a8ba056b04c827392 \
+                        rmd160 c657f9ce0850eca1bb0a0d7537f0bcf631132f30
+    post-extract {
+        move ${workpath}/html    ${workpath}/${distname}-html
+    }
     post-destroot {
-        set vtkDocFile ${distpath}/vtkDocHtml-${version}.tar.gz
+        set vtkDocDistFile ${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 the doxygen documentation 
+        system "tar -C ${destroot}/${vtkDocPathMain} -zxf ${vtkDocDistFile}"
         # 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}"
+        # 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 ${vtkDocPathMain} ${destroot}/${vtkDocPathLink}"
     }
-    # The doxygen dependency fails to build (as of May 2009).
+    # 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 \
@@ -193,31 +186,34 @@
         -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}"
+        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.
-        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;
-            "
+        set vtkLibPath ${prefix}/lib/${distname}
+        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}"
+                    }
+                }
+            }
+        }
     }
 }
 
@@ -256,6 +252,9 @@
         -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 \
 }
 
 
@@ -266,37 +265,40 @@
         -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/.
+        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.
-        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;
-            "
+        set vtkLibPath ${prefix}/lib/${distname}
+        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}"
+                    }
+                }
+            }
+        }
     }
 }
 
@@ -341,50 +343,143 @@
 
 
 # --- Language wrappers: java, python, tcl
+#
+# VTK has it's 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,
+# ie: depends_build-append port:byacc port:flex
 
 
 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
 }
 
 
-variant python25 requires shared description {python 2.5 wrapper} {
-    set pyver python2.5
-    depends_build-append \
-        port:python25
+# 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 no easy way to short-circuit it with a dependency on a prior binary
+# install of vtk.  If there are seperate 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
+
+variant py25 conflicts py26 requires shared description {python 2.5 wrapper} {
+    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:${pyport}
     configure.args-delete \
-        -DVTK_WRAP_PYTHON:BOOL=OFF \
+        -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}"
+        -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 {
+        # Redefine all the python variables in this clause (they are not carried
+        # through from the definitions above in the variant).
+        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}
+        # Reset the name of the vtkpython binary
+        move ${destroot}${prefix}/bin/vtkpython ${destroot}${prefix}/bin/vtk-${branch}-${pyport}
+        # Is it possible to change the python site-package name and have it all work OK?
+        # from:  /opt/local/lib/python2.6/site-packages/vtk
+        # to:    /opt/local/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 vtkPythonPackage ${destroot}${prefix}/lib/${python}/site-packages/vtk
+        foreach f [glob ${vtkPythonPackage}/*.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 python26 requires shared description {python 2.6 wrapper} {
-    set pyver python2.6
-    depends_build-append \
-        port:python26
+variant py26 conflicts py25 requires shared description {python 2.6 wrapper} {
+    set pyver        2.6
+    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:${pyport}
     configure.args-delete \
-        -DVTK_WRAP_PYTHON:BOOL=OFF \
+        -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}"
+        -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/Library/Frameworks/Python.framework/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=${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 {
+        # Redefine all the python variables in this clause (they are not carried
+        # through from the definitions above in the variant).
+        set pyver        2.6
+        set python       python${pyver}
+        set pyport       [join [lrange [split ${python} .] 0 1] ""]
+        set pyframe      ${prefix}/Library/Frameworks/Python.framework/Versions/${pyver}
+        # Reset the name of the vtkpython binary
+        move ${destroot}${prefix}/bin/vtkpython ${destroot}${prefix}/bin/vtk-${branch}-${pyport}
+        # Is it possible to change the python site-package name and have it all work OK?
+        # from:  /opt/local/lib/python2.6/site-packages/vtk
+        # to:    /opt/local/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 vtkPythonPackage ${destroot}${pyframe}/lib/${python}/site-packages/vtk
+        foreach f [glob ${vtkPythonPackage}/*.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}"
+                }
+            }
+        }
+    }
 }
 
+# Note: VTK_TCL_TK_STATIC is not specified here, it's OFF by default
 
-# 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:tcl \
@@ -395,15 +490,16 @@
         -DVTK_WRAP_TCL:BOOL=ON \
         -DTCL_TCLSH:FILEPATH=${prefix}/bin/tclsh \
         -DTCL_INCLUDE_PATH:PATH=${prefix}/include \
-        -DTCL_LIBRARY:FILEPATH=${prefix}/lib \
+        -DTCL_LIBRARY:FILEPATH=${prefix}/lib/libtcl.dylib \
         -DTK_INCLUDE_PATH:PATH=${prefix}/include \
-        -DTK_LIBRARY:FILEPATH=${prefix}/lib
+        -DTK_LIBRARY:FILEPATH=${prefix}/lib/libtk.dylib
+    post-destroot {
+        # Reset the name of the vtk tcl binary
+        move ${destroot}${prefix}/bin/vtk ${destroot}${prefix}/bin/vtk-${branch}-tcl
+    }
 }
-# /opt/local/lib/tclConfig.sh
-# /opt/local/lib/tkConfig.sh
 
-
-variant tcl_apple conflicts tcl description {tcl wrapper (apple system tcl/tk)} {
+variant tcl_apple conflicts tcl description {tcl wrapper (apple tcl/tk framework)} {
     configure.args-delete \
         -DVTK_WRAP_TCL:BOOL=OFF
     configure.args-append \
@@ -413,40 +509,44 @@
         -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
+        move ${destroot}${prefix}/bin/vtk ${destroot}${prefix}/bin/vtk-${branch}-tcl
+    }
 }
 
 
 # --- Database variants
 
+#
+#variant mysql description {build the MySQL driver for vtkSQLDatabase} {
+#    depends_lib-append \
+#        port:mysql5
+#    configure.args-append \
+#        -DVTK_USE_MYSQL:BOOL=ON
+#        #MYSQL_INCLUDE_DIRECTORIES
+#        #MYSQL_LIBRARY
+#}
+#
+#
+#variant pgsql description {build the PostgreSQL driver for vtkSQLDatabase} {
+#    depends_lib-append \
+#        port:libpqxx
+#    configure.args-append \
+#        -DVTK_USE_POSTGRES:BOOL=ON
+#        #POSTGRES_INCLUDE_DIRECTORIES
+#        #POSTGRES_LIBRARIES
+#}
+#
+#
+#variant odbc description {build the ODBC database interface} {
+#    depends_lib-append \
+#        port:unixODBC
+#    configure.args-append \
+#        -DVTK_USE_ODBC:BOOL=ON
+#}
 
-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
-}
 
-
-variant pgsql description {build the PostgreSQL driver for vtkSQLDatabase} {
-    depends_build-append \
-        port:libpqxx
-    configure.args-append \
-        -DVTK_USE_POSTGRES:BOOL=ON
-        #POSTGRES_INCLUDE_DIRECTORIES
-        #POSTGRES_LIBRARIES
-}
-
-
-variant odbc description {build the ODBC database interface} {
-    depends_build-append \
-        port:unixODBC
-    configure.args-append \
-        -DVTK_USE_ODBC:BOOL=ON
-}
-
-
 # --- Miscellaneous variants
 
 
@@ -480,6 +580,18 @@
 #    depends_build-append \
 #        port:cg_toolkit
 #    configure.args-append \
-#        VTK_USE_CG_SHADERS:BOOL=ON
+#        -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
+#}
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090508/afd5482c/attachment-0001.html>


More information about the macports-changes mailing list