How to fix "broken ports"?

Marko Käning MK-MacPorts at techno.ms
Mon May 21 13:11:20 PDT 2012


On May 21, 2012, at 1:33 PM, Clemens Lang wrote:

> Can you re-run with -d? While this output tells you which files are
> broken, it unfortunately does not tell you why. Running with -d should
> print that information.
yes, I did it and received this:
---
$ port -d rev-upgrade 
--->  Scanning binaries for linking errors
Could not open /opt/macports-test/lib/libexiv2.10.dylib: Error opening or reading file (referenced from /opt/macports-test/lib/strigi/strigiea_jpeg.so)
DEBUG: Marking /opt/macports-test/lib/strigi/strigiea_jpeg.so as broken

Could not open /opt/macports-test/lib/libMagickCore.4.dylib: Error opening or reading file (referenced from /opt/macports-test/bin/dmtxread)
DEBUG: Marking /opt/macports-test/bin/dmtxread as broken

Could not open /opt/macports-test/lib/libMagickWand.4.dylib: Error opening or reading file (referenced from /opt/macports-test/bin/dmtxread)
DEBUG: Marking /opt/macports-test/bin/dmtxread as broken
DEBUG: Marking /opt/macports-test/bin/dmtxwrite as broken
DEBUG: Marking /opt/macports-test/bin/dmtxwrite as broken
Warning: Error parsing file /opt/macports-test/libexec/dbus-daemon-launch-helper: Error opening or reading file

Could not open lib/libphonon.4.dylib: Error opening or reading file (referenced from /opt/macports-test/lib/libphononexperimental.4.6.0.dylib)
DEBUG: Marking /opt/macports-test/lib/libphononexperimental.4.6.0.dylib as broken
DEBUG: Marking /opt/macports-test/lib/qt4/plugins/designer/libphononwidgets.so as broken
DEBUG: Marking /opt/macports-test/lib/kde4/kfileaudiopreview.so as broken
DEBUG: Marking /opt/macports-test/lib/kde4/khtmlimagepart.so as broken
DEBUG: Marking /opt/macports-test/lib/kde4/libkhtmlpart.so as broken
DEBUG: Marking /opt/macports-test/lib/libkhtml.5.8.0.dylib as broken
DEBUG: Marking /opt/macports-test/lib/libknotifyconfig.4.8.0.dylib as broken
DEBUG: Marking /opt/macports-test/lib/libplasma.3.0.0.dylib as broken
DEBUG: Marking /opt/macports-test/lib/libakonadi-calendar.4.8.0.dylib as broken
DEBUG: Marking /opt/macports-test/lib/libakonadi-contact.4.8.0.dylib as broken
DEBUG: Marking /opt/macports-test/Applications/KDE4/khelpcenter.app/Contents/MacOS/khelpcenter as broken
DEBUG: Marking /opt/macports-test/Applications/KDE4/knotify4.app/Contents/MacOS/knotify4 as broken
DEBUG: Marking /opt/macports-test/lib/kde4/libkmanpart.so as broken
DEBUG: Marking /opt/macports-test/lib/libkdeinit4_khelpcenter.dylib as broken
DEBUG: Marking /opt/macports-test/Applications/KDE4/kmymoney.app/Contents/MacOS/kmymoney as broken
DEBUG: Marking /opt/macports-test/lib/kde4/kcm_kmm_printcheck.so as broken
DEBUG: Marking /opt/macports-test/lib/kde4/kmm_printcheck.so as broken
DEBUG: Marking /opt/macports-test/lib/kde4/kmm_reconciliationreport.so as broken

--->  Found 23 broken file(s), matching files to ports
--->  Found 7 broken port(s):
     kde4-runtime @4.8.3 
         /opt/macports-test/Applications/KDE4/khelpcenter.app/Contents/MacOS/khelpcenter
         /opt/macports-test/Applications/KDE4/knotify4.app/Contents/MacOS/knotify4
         /opt/macports-test/lib/kde4/libkmanpart.so
         /opt/macports-test/lib/libkdeinit4_khelpcenter.dylib
     kmymoney4-devel @4.6-20120521 +no_x11
         /opt/macports-test/Applications/KDE4/kmymoney.app/Contents/MacOS/kmymoney
         /opt/macports-test/lib/kde4/kcm_kmm_printcheck.so
         /opt/macports-test/lib/kde4/kmm_printcheck.so
         /opt/macports-test/lib/kde4/kmm_reconciliationreport.so
     libdmtx @0.7.2 
         /opt/macports-test/bin/dmtxread
         /opt/macports-test/bin/dmtxwrite
     kdelibs4 @4.8.3 
         /opt/macports-test/lib/kde4/kfileaudiopreview.so
         /opt/macports-test/lib/kde4/khtmlimagepart.so
         /opt/macports-test/lib/kde4/libkhtmlpart.so
         /opt/macports-test/lib/libkhtml.5.8.0.dylib
         /opt/macports-test/lib/libknotifyconfig.4.8.0.dylib
         /opt/macports-test/lib/libplasma.3.0.0.dylib
     kdepimlibs4 @4.8.3 
         /opt/macports-test/lib/libakonadi-calendar.4.8.0.dylib
         /opt/macports-test/lib/libakonadi-contact.4.8.0.dylib
     phonon @4.6.0 
         /opt/macports-test/lib/libphononexperimental.4.6.0.dylib
         /opt/macports-test/lib/qt4/plugins/designer/libphononwidgets.so
     strigi @0.7.5 +debug
         /opt/macports-test/lib/strigi/strigiea_jpeg.so
---


I see, so it looks like lib/libphonon.4.dylib is responsible for all the broken kde4 ports…
Yeah, the absolute path is not correct. It should be /opt/macports-test/lib/libphonon.4.dylib which is where the file is actually installed in the system:
---
$ port contents phonon  | grep libphonon.4.dylib
  /opt/macports-test/lib/libphonon.4.dylib
---




The question is now how I tell our culprit  /opt/macports-test/lib/libphononexperimental.4.6.0.dylib that the library as indeed installed as above?
For the installed files otool gives me this:
---
$ otool -L  /opt/macports-test/lib/libphononexperimental.4.6.0.dylib
/opt/macports-test/lib/libphononexperimental.4.6.0.dylib:
	lib/libphononexperimental.4.dylib (compatibility version 4.0.0, current version 4.6.0)
	lib/libphonon.4.dylib (compatibility version 4.0.0, current version 4.6.0)
	/opt/macports-test/lib/libQtCore.4.dylib (compatibility version 4.8.0, current version 4.8.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
	/opt/macports-test/lib/libQtGui.4.dylib (compatibility version 4.8.0, current version 4.8.0)
	/opt/macports-test/lib/libQtDBus.4.dylib (compatibility version 4.8.0, current version 4.8.0)
	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
---




But the install_name_tool command
---
$ sudo install_name_tool -change lib/libphononexperimental.4.dylib /opt/macports-test/lib/libphononexperimental.4.dylib /opt/macports-test/lib/libphononexperimental.4.6.0.dylib
---
does not change the path in the library. otool's output stays the same as above.

Obviously I am doing something wrong (apart from the fact that I do this on the currently installed files and not in the destroot phase during a port installation).

Greets,
Marko


More information about the macports-dev mailing list