How to fix "broken ports"?

Bradley Giesbrecht pixilla at macports.org
Wed May 23 12:53:51 PDT 2012


On May 23, 2012, at 12:22 PM, Marko Käning wrote:

> 
> On May 23, 2012, at 6:40 PM, Bradley Giesbrecht wrote:
>> If memory serves me correctly, the first line in "otool -L" is the "id".
> yes, you're right!
> 
>> Try:
>> sudo install_name_tool -id /opt/macports-test/lib/libphonon.4.dylib /opt/macports-test/lib/libphonon.4.dylib
> It worked, as also Michael hinted out to me via PM.
> 
> BUT, the question is how to I change the 2nd or 3rd entry in case of need???

Here are examples for install_name_tool:
echo $MP_SVNDPORTS
/opt/local/var/macports/sources/svn.macports.org/trunk/dports
find $MP_SVNDPORTS -maxdepth 3 -name Portfile -exec echo {} \; -exec grep -B3 -A1 -E "install_name_tool" {} \; | grep -B1 -v /Portfile


For lots of files you might try something like this:
...
post-destroot {
    foreach lib [glob -directory ${destroot}${prefix}/lib *.dylib*] {
        system "install_name_tool -id ${prefix}/lib/[strsed ${lib} /^.*\\///] ${lib}"

        foreach dep [exec otool -L ${lib}] {
            if [string match "${prefix}/wrong/dir/*" ${dep}] {
                system "install_name_tool -change ${dep} ${prefix}/right/dir/[strsed ${dep} /^.*\\///] ${lib}"
            }
        }
    }
}
...


Regards,
Bradley Giesbrecht (pixilla)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2763 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20120523/7cbedafe/attachment-0001.bin>


More information about the macports-dev mailing list