[90726] trunk/dports/graphics/vtk5/Portfile

adfernandes at macports.org adfernandes at macports.org
Tue Mar 13 12:47:05 PDT 2012


Revision: 90726
          http://trac.macports.org/changeset/90726
Author:   adfernandes at macports.org
Date:     2012-03-13 12:47:02 -0700 (Tue, 13 Mar 2012)
Log Message:
-----------
graphics/vtk5: fix cmake link errors as per #33465 and #33490

Modified Paths:
--------------
    trunk/dports/graphics/vtk5/Portfile

Modified: trunk/dports/graphics/vtk5/Portfile
===================================================================
--- trunk/dports/graphics/vtk5/Portfile	2012-03-13 19:34:41 UTC (rev 90725)
+++ trunk/dports/graphics/vtk5/Portfile	2012-03-13 19:47:02 UTC (rev 90726)
@@ -67,10 +67,6 @@
     default_variants +x11 +tcltk
 }
 
-if {![variant_isset python25] && ![variant_isset python26]} {
-    default_variants +python27
-}
-
 post-destroot {
     set vtkdest ${destroot}${prefix}/share/doc/${name}
     xinstall -d ${vtkdest}
@@ -108,55 +104,43 @@
         -DVTK_USE_CARBON:BOOL=ON
 }
 
-variant python requires python25 description {Compatibility variant, requires +python25} {}
+set pythons_suffixes {25 26 27}
 
-variant python25 description {Build Python 2.5 wrappers} conflicts python26 python27 {
-    depends_build-append    port:python25
-    configure.args-delete   \
-        -DVTK_WRAP_PYTHON:BOOL=OFF
-    configure.args-append   \
-        -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/lib/libpython2.5.dylib \
-        -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/python2.5 \
-        -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/include/python2.5 \
-        -DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/libpython2.5.dylib \
-        -DVTK_WRAP_PYTHON:BOOL=ON \
-        -DVTK_INSTALL_NO_PYTHON:BOOL=ON
-    post-destroot {
-        file mkdir ${destroot}${prefix}/lib/python2.5/site-packages
-        system "cd ${worksrcpath}/Wrapping/Python && ${prefix}/bin/python2.5 setup.py install --prefix=${prefix} --root=${destroot}"
-    }
+set pythons_ports {}
+foreach s ${pythons_suffixes} {
+    lappend pythons_ports python${s}
 }
 
-variant python26 description {Build Python 2.6 wrappers} conflicts python25 python27 {
-    depends_build-append    port:python26
-    configure.args-delete   \
-        -DVTK_WRAP_PYTHON:BOOL=OFF
-    configure.args-append   \
-        -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/lib/libpython2.6.dylib \
-        -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/python2.6 \
-        -DPYTHON_INCLUDE_PATH:FILEPATH=${frameworks_dir}/Python.framework/Versions/2.6/include/python2.6 \
-        -DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/libpython2.6.dylib \
-        -DVTK_WRAP_PYTHON:BOOL=ON \
-        -DVTK_INSTALL_NO_PYTHON:BOOL=ON
-    post-destroot {
-        system "cd ${worksrcpath}/Wrapping/Python && ${prefix}/bin/python2.6 setup.py install --prefix=${frameworks_dir}/Python.framework/Versions/2.6/ --root=${destroot}"
-    }
-}
+foreach s ${pythons_suffixes} {
+    set p python${s}
+    set v [string index ${s} 0].[string index ${s} 1]
+    set i [lsearch -exact ${pythons_ports} ${p}]
+    set c [lreplace ${pythons_ports} ${i} ${i}]
+    eval [subst {
+        variant ${p} description "Build Python ${v} wrappers" conflicts ${c} {
 
-variant python27 description {Build Python 2.7 wrappers} conflicts python25 python26 {
-    depends_build-append    port:python27
-    configure.args-delete   \
-        -DVTK_WRAP_PYTHON:BOOL=OFF
-    configure.args-append   \
-        -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/lib/libpython2.7.dylib \
-        -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/python2.7 \
-        -DPYTHON_INCLUDE_PATH:FILEPATH=${frameworks_dir}/Python.framework/Versions/2.7/include/python2.7 \
-        -DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/libpython2.7.dylib \
-        -DVTK_WRAP_PYTHON:BOOL=ON \
-        -DVTK_INSTALL_NO_PYTHON:BOOL=ON
-    post-destroot {
-        system "cd ${worksrcpath}/Wrapping/Python && ${prefix}/bin/python2.7 setup.py install --prefix=${frameworks_dir}/Python.framework/Versions/2.7/ --root=${destroot}"
-    }
+            configure.args-delete   \
+                -DVTK_WRAP_PYTHON:BOOL=OFF
+            configure.args-append   \
+                -DPYTHON_DEBUG_LIBRARY:FILEPATH=${frameworks_dir}/Python.framework/Versions/${v}/lib/libpython${v}.dylib \
+                -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/python${v} \
+                -DPYTHON_INCLUDE_PATH:FILEPATH=${frameworks_dir}/Python.framework/Versions/${v}/Headers \
+                -DPYTHON_LIBRARY:FILEPATH=${frameworks_dir}/Python.framework/Versions/${v}/lib/libpython${v}.dylib \
+                -DVTK_WRAP_PYTHON:BOOL=ON \
+                -DVTK_INSTALL_NO_PYTHON:BOOL=ON
+
+            post-configure {
+                system -W ${worksrcpath}/Wrapping/Python/CMakeFiles/vtkpython.dir "echo `cat link.txt` -L../../bin > link.txt"
+                system -W ${worksrcpath}/Wrapping/Python/CMakeFiles/vtkPythonCore.dir "echo `cat link.txt` -L../../bin > link.txt"
+            }
+
+            post-destroot {
+                file mkdir ${destroot}${prefix}/lib/python${v}/site-packages
+                system "cd ${worksrcpath}/Wrapping/Python && ${prefix}/bin/python${v} setup.py install --prefix=${frameworks_dir}/Python.framework/Versions/${v} --root=${destroot}"
+            }
+
+        }
+    }]
 }
 
 if {[variant_isset qt4_mac]} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120313/dcee6198/attachment.html>


More information about the macports-changes mailing list