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

dweber at macports.org dweber at macports.org
Tue Jul 7 18:09:05 PDT 2009


Revision: 53544
          http://trac.macports.org/changeset/53544
Author:   dweber at macports.org
Date:     2009-07-07 18:09:05 -0700 (Tue, 07 Jul 2009)
Log Message:
-----------
Done with testing revision 4 in user svn, time to commit back to trunk from rev53187:revHEAD of the user svn

Revision Links:
--------------
    http://trac.macports.org/changeset/4
    http://trac.macports.org/changeset/53187

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

Modified: trunk/dports/graphics/vtk-devel/Portfile
===================================================================
--- trunk/dports/graphics/vtk-devel/Portfile	2009-07-08 00:53:09 UTC (rev 53543)
+++ trunk/dports/graphics/vtk-devel/Portfile	2009-07-08 01:09:05 UTC (rev 53544)
@@ -5,7 +5,7 @@
 
 name            vtk-devel
 version         5.4.0
-revision        3
+revision        4
 set branch      [join [lrange [split ${version} .] 0 1] .]
 
 categories      graphics math science devel
@@ -31,26 +31,30 @@
 
 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
+                port:readline \
+                port:gnutar
 
+
 # Use gmake and build in a separate directory from the source
 build.type      gnu
 build.dir       ${workpath}/${distname}-build
 
+use_parallel_build  no
+
+# Global variables (used in 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}
+set vtkBuildBinPath ${build.dir}/bin
+
 # Using this dummy stage to inspect MacPorts variables (using 'port -d fetch vtk-devel')
 #fetch { system "echo ${configure.args} " }
 
@@ -63,6 +67,22 @@
     system "cd ${build.dir} && cmake ${configure.args} ${worksrcpath}"
 }
 
+
+# From vtk5 - look into how this works and whether it will replace the need to
+# call install_name_tool in many variants.  Disabled until it can be checked.
+#post-configure {
+#    reinplace "s|c++|c++ -L${prefix}/lib |" \
+#    ${worksrcpath}/Infovis/Testing/Cxx/CMakeFiles/InfovisCxxTests.dir/link.txt \
+#    ${worksrcpath}/IO/Testing/Cxx/CMakeFiles/IOCxxTests.dir/link.txt \
+#    ${worksrcpath}/Views/Testing/Cxx/CMakeFiles/ViewsCxxTests.dir/link.txt
+#
+#    if {[variant_isset tcltk]} {
+#      reinplace "s|c++|c++ -L${prefix}/lib |" \
+#      ${worksrcpath}/Wrapping/Tcl/CMakeFiles/vtk.dir/link.txt
+#    }
+#}
+
+
 # To double-check all the cmake variable settings after the configure
 #cd ${build.dir}
 #sudo cmake -LAH ../vtk-${branch} > ~/cmake_vars.txt
@@ -102,6 +122,21 @@
         -DCMAKE_OSX_SYSROOT=${universal_sysroot}
 }
 
+
+# General post-destroot, see also variant specific sections below
+post-destroot {
+    # create version specific binaries and symlinks
+    if [file exists ${destroot}${prefix}/bin/vtkEncodeString] {
+        move ${destroot}${prefix}/bin/vtkEncodeString ${destroot}${prefix}/bin/vtk-${branch}-EncodeString
+        ln -f -s vtk-${branch}-EncodeString ${destroot}${prefix}/bin/vtkEncodeString 
+    }
+    if [file exists ${destroot}${prefix}/bin/lproj] {
+        move ${destroot}${prefix}/bin/lproj ${destroot}${prefix}/bin/vtk-${branch}-lproj
+        ln -f -s vtk-${branch}-lproj ${destroot}${prefix}/bin/lproj 
+    }
+}
+
+
 # -----------------------------------------------------------------------------
 # PLATFORMS: platform darwin <version>
 # Can be used to handle different tasks depending
@@ -111,6 +146,10 @@
 # 8 for 10.4 Tiger, or
 # 9 for 10.5 Leopard.
 
+# Nothing done here, but the darwin_8 platform needs to be initialized
+# for use inside the post-destroot phase of the data variant
+platform darwin 8 {}
+
 # 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.
@@ -136,96 +175,41 @@
 }
 
 
+# --- Convenience variants
+
 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" {}
+    requires core cocoa shared wrap database mpi boost \
+    description "provide core cocoa shared wrap database mpi boost" {}
 
+variant core \
+    requires data doc examples testing \
+    description "provide data doc examples testing" {}
 
-# --- "Core" variants for VTK: data, doc, examples, shared libs, testing
+variant wrap \
+    requires java py26 tcl \
+    description "provide java, py26, & tcl" {}
 
+variant database \
+    requires mysql5 pgsql83 odbc \
+    description "provide all database variants" {}
 
-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}"
-    }
-}
 
+# --- Build variants
 
-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 debug conflicts release description "debug build" {
+    configure.args-delete \
+        -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
+    configure.args-append \
+        -DCMAKE_BUILD_TYPE:STRING=Debug
 }
 
-
-variant examples description "provide VTK examples in: ${vtkExamplePath}" {
+variant release conflicts debug description "release build" {
     configure.args-delete \
-        -DBUILD_EXAMPLES:BOOL=OFF
+        -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
     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}"
-                    }
-                }
-            }
-        }
-    }
+        -DCMAKE_BUILD_TYPE:STRING=Release
 }
 
-
 # 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
@@ -266,50 +250,20 @@
 }
 
 
-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}"
-                    }
-                }
-            }
-        }
-    }
-}
+#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
+#}
 
 
-# --- Graphics subsystem variants: carbon, cocoa, x11
+# --- Graphics build variants: carbon, cocoa, x11
 
 
 variant carbon conflicts cocoa x11 description "build with Carbon" {
@@ -344,7 +298,126 @@
 }
 
 
+# --- "Core" variants for VTK: data, doc, examples, 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 "gnutar --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 {
+        xinstall -d -o root -g admin -m 0755 ${destroot}/${vtkDocPath}
+        xinstall -d -o root -g admin -m 0755 ${destroot}/${prefix}/share/doc
+        # Add the doxygen documentation
+        system "gnutar -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 -s ${vtkDocPath} ${destroot}/${prefix}/share/doc/${distname}"
+    }
+    # 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
+}
+
+
+proc resetLibLinks { inputPath } {
+    # The example and testing binaries are built, but they are not
+    # "installed" with the correct rpath settings.  All their rpath settings
+    # point to the build.dir, so they must be reset using install_name_tool for
+    # the destroot install.
+    global vtkBuildBinPath vtkLibPath
+    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 "*/libvtk*.dylib" ${dep}] {
+                    set newdep [strsed ${dep} #${vtkBuildBinPath}#${vtkLibPath}#]
+                    system "install_name_tool -change ${dep} ${newdep} ${f}"
+                }
+            }
+        }
+    }
+}
+
+
+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/.
+        foreach f [glob ${vtkBuildBinPath}/*] {
+            if {![string match {*.dylib} ${f}]} {
+              file copy ${f} ${destroot}/${vtkExamplePath}/bin/
+            }
+        }
+        if [variant_isset shared] {
+            resetLibLinks ${destroot}/${vtkExamplePath}/bin
+        }
+    }
+}
+
+
+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/.
+        foreach f [glob ${vtkBuildBinPath}/*Test*] {
+            if {![string match {*.dylib} ${f}]} {
+              file copy ${f} ${destroot}/${vtkTestingPath}/bin/
+            }
+        }
+        if [variant_isset shared] {
+            resetLibLinks ${destroot}/${vtkTestingPath}/bin
+        }
+    }
+}
+
+
 # --- Language wrappers: java, python, tcl
 #
 # VTK has its own language parser, it doesn't depend on swig or cableswig (as
@@ -354,9 +427,6 @@
 # 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
@@ -375,6 +445,16 @@
     #JAVA_INCLUDE_PATH2:PATH=/System/Library/Frameworks/JavaVM.framework/Headers
     #JAVA_JVM_LIBRARY:FILEPATH=-framework JavaVM
     #JAVA_RUNTIME:FILEPATH=/usr/bin/java
+    post-destroot {
+        if [file exists ${destroot}${prefix}/bin/vtkWrapJava] {
+            move ${destroot}${prefix}/bin/vtkWrapJava ${destroot}${prefix}/bin/vtk-${branch}-WrapJava
+            ln -f -s vtk-${branch}-WrapJava ${destroot}${prefix}/bin/vtkWrapJava 
+        }
+        if [file exists ${destroot}${prefix}/bin/vtkParseJava] {
+            move ${destroot}${prefix}/bin/vtkParseJava ${destroot}${prefix}/bin/vtk-${branch}-ParseJava
+            ln -f -s vtk-${branch}-ParseJava ${destroot}${prefix}/bin/vtkParseJava 
+        }
+    }
 }
 
 
@@ -408,53 +488,86 @@
 # 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}
+    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 framework installation, whereas installs for 2.4
+        # and 2.5 contain symlinks in the framework path to the prefix path;
+        # 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
+    }
 }
 # Initialize the global variables for python26
 setPython
 
+proc pyPostDestroot { {major 2} {minor 6} } {
+    global pyVer python pyPort pyBin pyLib pyInc pyFrame pySite
+    global branch destroot prefix
+    global vtkBuildBinPath vtkLibPath
+    setPython $major $minor
+    # Reset the name of the vtkpython binaries; create symlinks to the
+    # version specific binaries, in case other apps look for them.
+    if [file exists ${destroot}${prefix}/bin/vtkpython] {
+        move ${destroot}${prefix}/bin/vtkpython ${destroot}${prefix}/bin/vtk-${branch}-${pyPort}
+        ln -f -s vtk-${branch}-${pyPort} ${destroot}${prefix}/bin/vtkpython 
+    }
+    if [file exists ${destroot}${prefix}/bin/pvtkpython] {
+        move ${destroot}${prefix}/bin/pvtkpython ${destroot}${prefix}/bin/pvtk-${branch}-${pyPort}
+        ln -f -s pvtk-${branch}-${pyPort} ${destroot}${prefix}/bin/pvtkpython 
+    }
+    if [file exists ${destroot}${prefix}/bin/vtkWrapPython] {
+        move ${destroot}${prefix}/bin/vtkWrapPython ${destroot}${prefix}/bin/vtk-${branch}-WrapPython${pyVer}
+        ln -f -s vtk-${branch}-WrapPython${pyVer} ${destroot}${prefix}/bin/vtkWrapPython 
+    }
+    if [file exists ${destroot}${prefix}/bin/vtkWrapPythonInit] {
+        move ${destroot}${prefix}/bin/vtkWrapPythonInit ${destroot}${prefix}/bin/vtk-${branch}-WrapPython${pyVer}Init
+        ln -f -s vtk-${branch}-WrapPython${pyVer}Init ${destroot}${prefix}/bin/vtkWrapPythonInit 
+    }
+    ################################################################################
+    # 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 vtkSitePackage ${destroot}${prefix}/${pySite}/vtk
+    foreach f [glob ${vtkSitePackage}/*.so] {
+        foreach dep [exec otool -L ${f}] {
+            if [string match "*libvtk*.dylib" ${dep}] {
+                set newdep [strsed ${dep} #${vtkBuildBinPath}#${vtkLibPath}#]
+                system "install_name_tool -change ${dep} ${newdep} ${f}"
+            }
+        }
+    }
+}
 
 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}
+        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} \
+        -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/${pyInc} \
+        -DPYTHON_LIBRARY:FILEPATH=${prefix}/${pyLib} \
+        -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/${pyLib} \
+        -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/${pyBin} \
         -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}"
-                }
-            }
-        }
+        pyPostDestroot 2 5
     }
 }
 
@@ -462,12 +575,18 @@
     # Note that python26 is installed as a framework (May 2009)
     setPython 2 6
     depends_lib-append \
-        port:${pyport}
+        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}/${pyInc} \
+        -DPYTHON_LIBRARY:FILEPATH=${prefix}/${pyLib} \
+        -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/${pyLib} \
+        -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/${pyBin} \
+        -DVTK_PYTHON_SETUP_ARGS:STRING='--prefix=${prefix}/${pyFrame} --root=${destroot}'
+    #configure.args-append \
         -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/${pyframe}/Headers \
         -DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/lib${python}.dylib \
         -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/lib/lib${python}.dylib \
@@ -476,30 +595,36 @@
         # 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}"
-                }
-            }
-        }
+        pyPostDestroot 2 6
     }
 }
 
 
+proc tclPostDestroot {} {
+    global branch destroot prefix
+    # Reset the name of the vtk tcl binaries; create symlinks to the
+    # version specific installation, in case other apps look for the binaries by
+    # a default name; these symlinks might conflict across vtk versions, may
+    # require a vtk-select port to set them if multiple vtk versions are
+    # installed.
+    if [file exists ${destroot}${prefix}/bin/vtk] {
+        move ${destroot}${prefix}/bin/vtk ${destroot}${prefix}/bin/vtk-${branch}-tcl
+        ln -f -s vtk-${branch}-tcl ${destroot}${prefix}/bin/vtk
+    }
+    if [file exists ${destroot}${prefix}/bin/pvtk] {
+        move ${destroot}${prefix}/bin/pvtk ${destroot}${prefix}/bin/pvtk-${branch}-tcl
+        ln -f -s pvtk-${branch}-tcl ${destroot}${prefix}/bin/pvtk
+    }
+    if [file exists ${destroot}${prefix}/bin/vtkWrapTcl] {
+        move ${destroot}${prefix}/bin/vtkWrapTcl ${destroot}${prefix}/bin/vtk-${branch}-WrapTcl
+        ln -f -s vtk-${branch}-WrapTcl ${destroot}${prefix}/bin/vtkWrapTcl 
+    }
+    if [file exists ${destroot}${prefix}/bin/vtkWrapTclInit] {
+        move ${destroot}${prefix}/bin/vtkWrapTclInit ${destroot}${prefix}/bin/vtk-${branch}-WrapTclInit
+        ln -f -s vtk-${branch}-WrapTclInit ${destroot}${prefix}/bin/vtkWrapTclInit 
+    }
+}
+
 variant tcl conflicts tcl_apple description "tcl wrapper (MacPorts tcl/tk)" {
     depends_lib-append \
         port:tcl \
@@ -515,14 +640,11 @@
         -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
+        tclPostDestroot
     }
 }
 
-variant tcl_apple conflicts tcl description "tcl wrapper (apple tcl/tk framework)" {
+variant tcl_apple conflicts tcl description "tcl wrapper (Apple tcl/tk framework)" {
     configure.args-delete \
         -DVTK_WRAP_TCL:BOOL=OFF
     configure.args-append \
@@ -533,19 +655,14 @@
         -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
+        tclPostDestroot
     }
 }
 
 
 # --- 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 \
@@ -655,15 +772,4 @@
 #        -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/20090707/e279e881/attachment-0001.html>


More information about the macports-changes mailing list