Changeset 51603


Ignore:
Timestamp:
May 29, 2009, 2:52:43 AM (8 years ago)
Author:
dweber@…
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • users/dweber/graphics/InsightToolkit/Portfile

    r51600 r51603  
    44PortSystem      1.0
    55
    6 # Note: don't change this name, only change the distname, as there are numerous
    7 # default build assumptions in both cmake and ITK that use this specific name,
    8 # and many post-destroot hacks in this port that depend on this name.
    96name            InsightToolkit
    107version         3.12.0
     
    5754#use_parallel_build  yes
    5855
    59 # Global variables, used in variants, where a destroot prefix is appended, when necessary.
     56# Global variables, used in variants, where a destroot prefix is appended,
     57# when necessary.  There are numerous default build assumptions in both cmake
     58# and ITK that use the 'InsightToolkit' name, and many post-destroot hacks in
     59# this port that assume this name also.  If the port is renamed, say
     60# InsightToolkit312, the post-destroot hacks must use ${itkName}.
     61set itkName         InsightToolkit
    6062set itkBuildBin     ${build.dir}/bin
    6163set itkIncPath      ${prefix}/include/${distname}
     
    115117post-destroot {
    116118    # For some reason, cmake does not install into the CMAKE_INSTALL_NAME_DIR
    117     move ${destroot}${prefix}/lib/${name}       ${destroot}${itkLibPath}
    118     move ${destroot}${prefix}/include/${name}   ${destroot}${itkIncPath}
     119    move ${destroot}${prefix}/lib/${itkName}       ${destroot}${itkLibPath}
     120    move ${destroot}${prefix}/include/${itkName}   ${destroot}${itkIncPath}
    119121    # Create a symlink from the generic lib and include for InsightToolkit to this version
    120     ln -sf ${distname} ${destroot}${prefix}/lib/${name}
    121     ln -sf ${distname} ${destroot}${prefix}/include/${name}
     122    ln -sf ${distname} ${destroot}${prefix}/lib/${itkName}
     123    ln -sf ${distname} ${destroot}${prefix}/include/${itkName}
    122124    # copy FindITK.cmake to a version specific file, which might persist even
    123125    # when cmake is updated, deactivated, etc.
     
    130132    reinplace "s|${stdlib}|${maclib}\\\n    ${maclib}-${branch}\\\n    ${stdlib}|g" ${destroot}${findITKbranch}
    131133    # Change the content of ITKConfig.cmake
    132     reinplace "s|${name}|${distname}|g" ${destroot}${itkLibPath}/ITKConfig.cmake
     134    reinplace "s|${itkName}|${distname}|g" ${destroot}${itkLibPath}/ITKConfig.cmake
    133135    copy ${destroot}${itkLibPath}/ITKConfig.cmake ${destroot}${itkLibPath}/itk-${branch}-config.cmake
    134136}
     
    409411        port:tcl
    410412    # The WrapITK install path assumes a prefix of ${prefix}, but without this
    411     # variable setting, it will default to "lib/${name}/WrapITK" without the
     413    # variable setting, it will default to "lib/${itkName}/WrapITK" without the
    412414    # version specific ${distname}
    413415    set itkWrapInstallPath /lib/${distname}/WrapITK
     
    437439        ln -s itkwish-${branch} ${destroot}/${prefix}/bin/itkwish
    438440        # Change the content of itkwish
    439         reinplace "s|${name}|${distname}|g" ${itkwishSh}
     441        reinplace "s|${itkName}|${distname}|g" ${itkwishSh}
    440442        reinplace "s|//|/|g" ${itkwishSh}
    441443        # Reset dynamic library dependency paths for itkwish binary
     
    572574    post-destroot {
    573575        # Change the content of WrapITK.pth (for any python version)
    574         reinplace "s|${name}|${distname}|g" ${destroot}/${prefix}/${pySite}/WrapITK.pth
     576        reinplace "s|${itkName}|${distname}|g" ${destroot}/${prefix}/${pySite}/WrapITK.pth
    575577        reinplace "s|//|/|g" ${destroot}/${prefix}/${pySite}/WrapITK.pth
    576578        # Change the content of FindWrapITK.cmake (for any python version)
    577579        set findWrapITK [glob ${destroot}/${prefix}/share/cmake-*/Modules/FindWrapITK.cmake]
    578         reinplace "s|${name}|${distname}|g" ${findWrapITK}
     580        reinplace "s|${itkName}|${distname}|g" ${findWrapITK}
    579581        reinplace "s|//|/|g" ${findWrapITK}
    580582        # Reset dynamic library dependency paths (see proc above)
     
    596598    post-destroot {
    597599        # Change the content of WrapITK.pth (for any python version)
    598         reinplace "s|${name}|${distname}|g" ${destroot}/${prefix}/${pySite}/WrapITK.pth
     600        reinplace "s|${itkName}|${distname}|g" ${destroot}/${prefix}/${pySite}/WrapITK.pth
    599601        reinplace "s|//|/|g" ${destroot}/${prefix}/${pySite}/WrapITK.pth
    600602        # Change the content of FindWrapITK.cmake (for any python version)
    601603        set findWrapITK [glob ${destroot}/${prefix}/share/cmake-*/Modules/FindWrapITK.cmake]
    602         reinplace "s|${name}|${distname}|g" ${findWrapITK}
     604        reinplace "s|${itkName}|${distname}|g" ${findWrapITK}
    603605        reinplace "s|//|/|g" ${findWrapITK}
    604606        # Reset dynamic library dependency paths (see proc above)
     
    627629#    post-destroot {
    628630#        # Change the content of WrapITK.pth (for any python version)
    629 #        reinplace "s|${name}|${distname}|g" ${destroot}/${prefix}/${pySite}/WrapITK.pth
     631#        reinplace "s|${itkName}|${distname}|g" ${destroot}/${prefix}/${pySite}/WrapITK.pth
    630632#        # Reset dynamic library dependency paths (see proc above)
    631633#        resetWrapLibs ${destroot}/${itkLibPath}/WrapITK/lib/*.so
Note: See TracChangeset for help on using the changeset viewer.