======== How to build nicotine.app - notes by hedonist
1. Install macports from http://www.macports.org

2. Patch the macports installation (you need to re-do this each time you 'port selfupdate' macports):
$ cd /
$ sudo patch -p 0 < /path/to/nicotine/tree/tools/macports.patch

3. This will take a long time (hours) - run
$ sudo port install py25-gtk +universal +quartz +no_x11 py25-py2app +universal +quartz +no_x11 py25-bz2 +universal +quartz +no_x11 py25-mutagen +universal +quartz +no_x11

4. Run
$ ./build-osxapp.sh

5. The nicotine.app should be in the dist directory

Thanks to 
http://www.danplanet.com/home/82-codemonkeying/88-using-py2app-with-gtk
and http://zorns-lemon.com/blog/2007/9/19/cells-gtk-on-mac-os-x/
for the incredibly helpful hints.

If you run into problems, open a ticket at http://www.nicotine-plus.org/newticket

======== Old notes, might be irrelevant

== Global

1) Install py2app, fe. version 0.3.6
2) Make setup.py: py2applet --make-setup nicotine.py files/nicotine_blue_upscaled.icns
3) Test alias mode: python setup.py py2app -A
   You should now find a .app folder in dist/ with an icon - opening this should start an instance of n+
4) Pack: python setup.py py2app


== Problem solving

Problem:
    RuntimeError: Don't know how to handle ''<some path>''
Solution:
    This problem occurs because py2app/graphmodule doesnt process files based
    on what they are, but how they are named. The solution is to rename the files
    to their correct extensions, F.E.,:
        Problem:
            RuntimeError: Don't know how to handle ''/gentoo/usr/lib/python2.5/site-packages/gtk-2.0/gtk/_gtk.so''
        Solution:
            Rename the .so to .bundle
        Problem:
            RuntimeError: Don't know how to handle ''/gentoo/usr/lib/python2.5/site-packages/pygtk.py-2.0''
        Solution:
            The dir will /gentoo/usr/lib/python2.5/site-packages/ look like this:
                lrwxr-xr-x  1 gentoo staff    12 2008-11-14 20:41 pygtk.py -> pygtk.py-2.0
                -rw-r--r--  1 gentoo staff  2946 2008-11-14 20:41 pygtk.py-2.0
            Overwrite the pygtk.py symlink with the pygtk.py-2.0 file
    Make sure you revert the changes after nicotine+ is packed, otherwise stuff will break down fast.
    This *also* means you need to rename nicotine to nicotine.py if you ever want to be able to create an .app

Problem:
    Unknown load command: 27
Solution:
    Installed dev version of macholib: easy_install macholib==dev

Problem:
    ValueError: New Mach-O header is too large to relocate
Solution:
    Recompile offending library with LD="-headerpad_max_install_names", fe. by putting this in /gentoo/etc/make.conf
    The offending library is not the latest one mentioned, but the ones that
    has the "create" line in it, for me it crashed on atk but pygtk needed to
    be recompiled

Removing build/ and dist/ after changing stuff can solve problems as well

