[51603] users/dweber/graphics/InsightToolkit/Portfile

dweber at macports.org dweber at macports.org
Thu May 28 19:52:45 PDT 2009


Revision: 51603
          http://trac.macports.org/changeset/51603
Author:   dweber at macports.org
Date:     2009-05-28 19:52:43 -0700 (Thu, 28 May 2009)
Log Message:
-----------
-m "ensure post-destroot and any other hacks do not depend on the port name, so the port can be renamed; created $itkName to serve as a global variable to identify the conventional library name for ITK"

Modified Paths:
--------------
    users/dweber/graphics/InsightToolkit/Portfile

Modified: users/dweber/graphics/InsightToolkit/Portfile
===================================================================
--- users/dweber/graphics/InsightToolkit/Portfile	2009-05-28 23:42:47 UTC (rev 51602)
+++ users/dweber/graphics/InsightToolkit/Portfile	2009-05-29 02:52:43 UTC (rev 51603)
@@ -3,9 +3,6 @@
 
 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
@@ -56,7 +53,12 @@
 # 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.
+# Global variables, used in variants, where a destroot prefix is appended,
+# when necessary.  There are numerous default build assumptions in both cmake
+# and ITK that use the 'InsightToolkit' name, and many post-destroot hacks in
+# this port that assume this name also.  If the port is renamed, say
+# InsightToolkit312, the post-destroot hacks must use ${itkName}.
+set itkName         InsightToolkit
 set itkBuildBin     ${build.dir}/bin
 set itkIncPath      ${prefix}/include/${distname}
 set itkLibPath      ${prefix}/lib/${distname}
@@ -114,11 +116,11 @@
 
 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}
+    move ${destroot}${prefix}/lib/${itkName}       ${destroot}${itkLibPath}
+    move ${destroot}${prefix}/include/${itkName}   ${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}
+    ln -sf ${distname} ${destroot}${prefix}/lib/${itkName}
+    ln -sf ${distname} ${destroot}${prefix}/include/${itkName}
     # 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]
@@ -129,7 +131,7 @@
     set maclib ${prefix}/lib/InsightToolkit
     reinplace "s|${stdlib}|${maclib}\\\n    ${maclib}-${branch}\\\n    ${stdlib}|g" ${destroot}${findITKbranch}
     # Change the content of ITKConfig.cmake
-    reinplace "s|${name}|${distname}|g" ${destroot}${itkLibPath}/ITKConfig.cmake
+    reinplace "s|${itkName}|${distname}|g" ${destroot}${itkLibPath}/ITKConfig.cmake
     copy ${destroot}${itkLibPath}/ITKConfig.cmake ${destroot}${itkLibPath}/itk-${branch}-config.cmake
 }
 
@@ -408,7 +410,7 @@
         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
+    # variable setting, it will default to "lib/${itkName}/WrapITK" without the
     # version specific ${distname}
     set itkWrapInstallPath /lib/${distname}/WrapITK
     configure.args-append \
@@ -436,7 +438,7 @@
         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|${itkName}|${distname}|g" ${itkwishSh}
         reinplace "s|//|/|g" ${itkwishSh}
         # Reset dynamic library dependency paths for itkwish binary
         set itkwishBin ${destroot}/${itkLibPath}/WrapITK/bin/itkwish
@@ -571,11 +573,11 @@
         -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|${itkName}|${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|${itkName}|${distname}|g" ${findWrapITK}
         reinplace "s|//|/|g" ${findWrapITK}
         # Reset dynamic library dependency paths (see proc above)
         resetWrapLibs ${destroot}/${itkLibPath}/WrapITK/lib/*.so
@@ -595,11 +597,11 @@
         -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|${itkName}|${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|${itkName}|${distname}|g" ${findWrapITK}
         reinplace "s|//|/|g" ${findWrapITK}
         # Reset dynamic library dependency paths (see proc above)
         resetWrapLibs ${destroot}/${itkLibPath}/WrapITK/lib/*.so
@@ -626,7 +628,7 @@
 #        -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|${itkName}|${distname}|g" ${destroot}/${prefix}/${pySite}/WrapITK.pth
 #        # Reset dynamic library dependency paths (see proc above)
 #        resetWrapLibs ${destroot}/${itkLibPath}/WrapITK/lib/*.so
 #    }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090528/9875ef68/attachment.html>


More information about the macports-changes mailing list