This is mainly a reminder of some light troubles encountered whilst upgrading from moutain-lion to mavericks.
Certainly, many people could be concerned because Apple decided to give this upgrade for free (which is a good turn in my opinion).
Most of the troubles come from the upgrade process, a fresh maverick installation might have much less problems.
upgrading xcode
Using the App Store to download Xcode-5.0.2 isn’t enough, one has to select the proper command-line tools. Now the trouble with upgrading is that invoking
“xcode-select –install”
right after the upgrade won’t work. I personally had to shut down the machine and restart the OS in order to get it to pop-up the selection window … (probably a reminder of the previous Xcode ?)
The most tricky point with that strange behaviour of xcode is that most build will be okay, probably because of older binaries or
settings of previous xcode being used, but some package will definitely be reluctant (ex: openmotif) ; so
check carefully that step before continuing further.
upgrading macports
There is a complete documentation for this, particularly about saving the list of port installed.
Now, when running into a lot of troubles, one will probably go fast and might forget some steps. Or rather, like it occurred to me, partially crash the previous install by trying a port selfupdate right after the OS upgrade !
Anyhow I backed-up the former port tree and some off the apps installed:
mv /opt/local /opt/local-OLD cd /Applications/Macports && for NOM in * ; do mv "${NOM}" "${NOM}-"`date '+%Y%m%d-%H%M'` ; done
From that point, whenever the old list of ports was needed, I used the following ugly trick :
sqlite3 -line /opt/local-OLD/var/macports/registry/registry.db "select * from ports" | grep 'name =' | sed 's/^.*name = //' | sort -u
At this point, with nothing in the way anymore, I simply downloaded macports-2.2.1-10.9 and followed the regular install.
But at this point, in order to work around some bugs, some trick was needed …
Tuning the macports’ builds [edit : not needed since release @114492 ]
Some packages need the libtool .la files in order to build (for dependencies calculations ?), but the current macports doesn’t
install them anymore. Yet, I don’t have any other workaround than keeping the whole build and parse them back for those .la files.
So we must instruct macports to keep the build trees : tune the /opt/local/etc/macports/macports.conf with
portautoclean no
Probably at some point, some cleaning will become mandatory in order to free space.
the lib*.la troubles [edit : not needed since release @114492 ]
Most port builds won’t need the libtool’s *.la files, and some build will crash with DYLIB path injections. However some build will
choke explicitely on missing lib*la files.
I simply used this uggly script in order to copy some parsed .la files from the build-trees :
#!/bin/bash ls -ctr `find /opt/local/var/macports/build/ -name 'lib*.la' -type f` | while read LIBLA do SHORTNAME=`echo ${LIBLA} | rev | cut -d/ -f1 | rev | sed 's/\.la$//'` if [ ! -f "/opt/local/lib/${SHORTNAME}.la" ] then sed 's#/opt/local/var/macports/build[_/abcdefghijklmnopqrstuvwxyz\.1234567890+-]*/\(lib[_/abcdefghijklmnopqrstuvwxyz\.1234567890+-]*\.la\)#/opt/local/lib/\1#g' < "${LIBLA}" > "/opt/local/lib/${SHORTNAME}.la" fi done
The best being probably to move those out of the way right after the build of the “la-needing” packages, but keep them for future use :
mkdir /opt/local/libla && mv /opt/local/lib/lib*.la /opt/local/libla
forcing install of dbus
dbus port may fail from previous install, in which case a simple port install -f dbus will do the trick.
upgrading ddd and gdd
The new ddd isn’t necessarly fully compatible with the previous release, I had to remove the ~/.ddd directory in
order to get a new clean one ; otherwise ddd was stuck waiting for gdb to answer.
mv ~/.ddd ~/.ddd-`date '+%Y%m%d-%H%M'`
The 5.0.2 version of xcode doesn’t include the gdb debugger anymore, and the ddd port doesn’t yet depend on gdb. a simple port install gdb will provide a new one.
Now for some reason, the gdb port-provided is called ggdb, so ddd won’t find it right out. Two solutions here :
either invoke ddd session with :
ddd --debugger /opt/local/bin/ggdb [args]
or tune the ressource file for the proper gdb name, ~/.ddd/init :
! addition to locate and use the macports supplied gdb : Ddd*debuggerCommand: /opt/local/bin/ggdb ! DO NOT ADD ANYTHING BELOW THIS LINE -- DDD WILL OVERWRITE IT Ddd*dddinitVersion: 3.3.12 .../...
conclusion
Finally, the vast majority of ports do build flawlessly, confirming the quality of those sources and the work of macports authors !