Ticket #14365: Portfile-boost.diff

File Portfile-boost.diff, 2.3 KB (added by gui-dos (Guido Soranzio), 16 years ago)

Create relative links by using [file tail] of ${lib}

  • Portfile

    old new  
    3636                # with their final destination path (not the destroot path that
    3737                # they've just been installed to)
    3838                foreach lib [glob -directory ${destroot}${prefix}/lib/ *-${libver}.dylib] {
    39                         system "install_name_tool -id ${prefix}/lib/${lib} ${lib}"
     39                        set libtail [file tail ${lib}]
     40                        system "install_name_tool -id ${prefix}/lib/${libtail} ${lib}"
    4041                }
    4142
    4243                # create relative symbolic links to the versioned libraries (.dylib only;
    4344                # .a were built with unversioned extensions that are duplicate files of the
    4445                # versioned extensions... handled next)
    4546                foreach lib [glob -directory ${destroot}${prefix}/lib/ *-${libver}.dylib] {
    46                         set libname [join [lrange [split [file rootname ${lib}] {-}] 0 end-1] {-}]
     47                        set libtail [file tail ${lib}]
     48                        set libroot [join [lrange [split [file rootname ${lib}] {-}] 0 end-1] {-}]
     49                        set libname [file tail ${libroot}]
    4750                        set libext [file extension ${lib}]
    48                         set liblink "${libname}${libext}"
     51                        set liblink "${libroot}${libext}"
    4952                        if {![catch {set libtype [file type ${liblink}]}]} {
    5053                                if {${libtype} == "link"} {
    5154                                        file delete -force ${liblink}
    5255                                }
    5356                        }
    54                         system "cd  ${destroot}${prefix}/lib;ln -s ${lib} ${liblink}"
     57                        system "cd  ${destroot}${prefix}/lib;ln -s ${libtail} ${libname}${libext}"
    5558                }
    5659
    5760                # change the duplicated non-version-named .a libraries to
    5861                # symbolic links to the version-named .a libraries
    5962                foreach lib [glob -directory ${destroot}${prefix}/lib/ *-${libver}.a] {
    60                         set libname [join [lrange [split [file rootname ${lib}] {-}] 0 end-1] {-}]
     63                        set libtail [file tail ${lib}]
     64                        set libroot [join [lrange [split [file rootname ${lib}] {-}] 0 end-1] {-}]
     65                        set libname [file tail ${libroot}]
    6166                        set libext [file extension ${lib}]
    62                         set liblink "${libname}${libext}"
     67                        set liblink "${libroot}${libext}"
    6368                        # if this file is around, it is a duplicate, delete it
    6469                        if {[file exists ${liblink}]} {
    6570                                file delete -force ${liblink}
    6671                        }
    6772                        # add a symbolic link instead
    68                         system "cd  ${destroot}${prefix}/lib; ln -s ${lib} ${liblink}"
     73                        system "cd  ${destroot}${prefix}/lib; ln -s ${libtail} ${libname}${libext}"
    6974                }
    7075               
    7176                # create a symbolic link in the include directory pointing to the current