This guide details the process I've used to build Tiger-compatible Picard app bundles on OS X. There are many ways to achieve this, but I've found these steps to be the simplest and most compatible after much trial and error.
This guide was tested in a VM running Leopard. If you're using anything above Snow Leopard (Lion, Mountain Lion) you won't be able to install XCode 3, so this guide won't work.
Last updated on 2012-06-03 for Picard 1.0.
There are a lot of architecture issues in MacPorts that took days to debug. After working around those, Qt4 had broken functionality, such as drag and drop from Finder not working. Qt4 takes an entire day to build on my machine, whereas the precompiled Qt package from Nokia works just fine. The rest of the dependencies will be installed manually to /usr/local.
Make sure /usr/local/bin is in your PATH, and have the following variables set in your .profile or .bash_profile (or do it manually):
export CFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -I/usr/local/include" export CXXFLAGS="$CFLAGS" export LDFLAGS="-arch i386 -Xlinker -headerpad_max_install_names -L/usr/local/lib" export MACOSX_DEPLOYMENT_TARGET="10.4"
Make sure you're using gcc 4.0.2. On Snow Leopard, I had to change the symlinks, because setting CC= didn't work for some dependencies. (I did this, but for 4.0 instead of 4.2.)
Now you have to install a bunch of dependencies by hand. Or, that's what you would have to do if
I hadn't written this super-convenient (hacked-together) script for you:
chmod +x and run from an empty directory.
I have no doubt the script will break somewhere for someone—help me fix it. :)
Finally, you'll need two Python modules: py2app and mutagen. Install them manually or just use easy_install. Be sure to install them for the correct Python version!
Create the file build.cfg in the source directory. Mine looks like this:
[libofa] libs = -arch i386 -L/usr/local/lib -lofa cflags = -arch i386 -I/usr/local/include [avcodec] libs = -arch i386 -L/usr/local/lib -lavcodec -lavformat -lavutil -lvorbis -lvorbisenc -logg -lmp3lame -lfaac cflags = -arch i386 -I/usr/local/include [build] with-directshow = False with-avcodec = True with-libofa = True
Now we should be able to build a Picard app bundle. This requires a few commands, so I use a bash script to run them all:
#!/bin/bash rm -rf build dist python setup.py clean python setup.py build_ext -i python setup.py py2app cd dist # Strip any non-i386 code from the app bundle ditto -rsrc --arch i386 MusicBrainz\ Picard.app MusicBrainz\ Picard.tmp rm -r MusicBrainz\ Picard.app mv MusicBrainz\ Picard.tmp MusicBrainz\ Picard.app
If all goes well, you'll end up with an app bundle in the dist directory. We're done! Yay!