Embedding Nu

Do you want to ship an application that uses Nu without requiring your users to install it?

You can do that easily by embedding Nu as a private framework inside your application.

Here's how.

First, build your application as usual with nuke.

Then, inside your application's bundle, add a directory called Frameworks under the Contents directory. Then copy Nu.framework inside this directory.

Finally, you have to tell your compiled application code to look in its private Frameworks directory for Nu.framework.
Do this with a program called installnametool (see its man page for details). Here's how you'd do it for one of the Nu sample programs:

% install_name_tool -change "Nu.framework/Versions/A/Nu" 

To confirm your change, remove Nu.framework from /Library/Frameworks and run your application.

You can also confirm your change by checking your application's shared library dependencies with otool -L.

% otool -L Benwanu.app/Contents/MacOS/Benwanu 
(compatibility version 1.0.0, current version 12.0.0) 
(compatibility version 0.0.0, current version 0.0.0) 
        /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) 
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 111.0.0) 
        /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0) 
(compatibility version 300.0.0, current version 677.0.0)