Building on Mac OS X

From HalyardWiki

Jump to: navigation, search

Halyard has highly experimental support for Mac OS X. Many features still aren't working, and there are lots of bugs.

Contents

[edit] Setting up your environment

First, install MacPorts. This will require an up-to-date version of Xcode and X11. Also, make sure that /opt/local/bin appears before /usr/bin in your PATH. Without this, MacPorts will tend to fail part way through the build process.

Once you have MacPorts installed, install the following packages and their dependencies:

sudo port install freetype libxml2 curl sqlite3 mzscheme wxwidgets \
    gnupg boost log4cplus cairo

If you are going to be checking out from Git instead of using a tarball, you will also need:

sudo port install pkgconfig automake autoconf git-core tk

You now need to set up your framework search path to include MzScheme:

cd /Library/Frameworks
ln -s /opt/local/Library/Frameworks/PLT_MzScheme.framework .

[edit] Fixing common problems

If your MacPorts is too old, run:

sudo port selfupdate
sudo port sync

If you have trouble with boost, run:

sudo port clean boost
sudo port install boost

if you have trouble installing mzscheme directly, try:

sudo port build mzscheme
sudo port install mzscheme

Note: The mzscheme in MacPorts doesn't appear to build on PowerPC. You'll probably have to follow the alternate install below.

[edit] PLT v372: Alternative install

If you have trouble installing mzscheme, you can instead download PLT Scheme v372, and install it at /Applications/Development/PLT-v372 (or another path with no spaces in it).

Then, create symlinks to the PLT frameworks:

cd /Library/Frameworks
ln -s /Applications/Development/PLT-v372/lib/PLT_MzScheme.framework .
ln -s /Applications/Development/PLT-v372/lib/PLT_MrEd.framework .

You may also need to help mzscheme find its standard collections. Try:

cd ~
mkdir -p "Library/PLT Scheme/372/collects"
cd "Library/PLT Scheme/372/collects"
ln -s /Applications/Development/PLT-v372/collects .

We'll deal with these issues a bit better in the future.

[edit] Checking out the source

Clone the repository:

git clone git://imlsrc.dartmouth.edu/halyard
cd halyard

By default, this checks out the master branch. Right now, the master branch will usually build on the Mac, and is the most up-to-date.

[edit] Working from a tarball

We recommend using git, because it makes it easier to update to new versions quickly.

But instead of checking the source out from Git, you can also download one of distribution tarballs, as of version 0.5.7. All you need is the halyard-x.y.z.tar.gz, though if you're interested in testing out media playback, you should also download halyard-media-x.y.z.tar.gz. Put the tarballs in the same directory, and from that directory, run:

tar xzf halyard-''x''.''y''.''z''.tar.gz
tar xzf halyard-media-''x''.''y''.''z''.tar.gz
cd halyard

[edit] Building

First, set up the GNU autotools for this project. If you're working from the tarball (0.5.9 or later), you can skip this step.

./autogen.sh

If you have problems with autoconf or configure, make sure you're using the MacPorts versions of automake and autoconf.

Next, configure and build the project:

./configure
make
make check

If you aren't building against the MacPorts mzscheme you may need to run ./configure --with-mzscheme=/Applications/Development/PLT-v372 instead.

[edit] Running Halyard

Type the following on the command line:

cd wx/src
open Halyard.app

Open up halyard/test/application.halyard from the GUI, and try it out!

In order to get the updater unit test to work, you'll need to find your copy of gpgv, and copy it into halyard/test/gpgv.exe (yes, we need to update it to not require the .exe, which is left over from our Windows build).

[edit] Optional: Much faster reloads

WARNING: I don't even know whether this is still applicable.

Note: This is probably not a good idea unless you're running mzscheme v372, because our custom-patched collections are for use with PLT v372.

First, you'll need to get rid of PLT's collection directory. If you're using the alternative install method, try:

rm ~/Library/PLT\ Scheme/372/collects

If you installed the MacPorts version of mzscheme, you'll probably have to do something with environment variables.

Then you'll need to install our patched version of PLT's compiler module:

git submodule init libs/plt
git submodule update

Now reload two or three times, and watch compilation times decrease dramatically.

This provides a version of the compilation manager that still works if you wrap the load/use-compiled handler with a version that calls the heartbeat function and updates the screen.

[edit] Running under Xcode's debugger

To run under Xcode's debugger, open the Halyard xcode project in wx/xcode/Halyard.xcodeproj. You will need to add the Halyard executable as a custom executable. Choose Project > New Custom Executable... and choose wx/src/Halyard.app. Now you should be able to build and run the program under the debugger. When you run the program, the debugger window may not come up immediately; if it doesn't, you can use Run > Debugger to open it up. I have found that it is helpful to pause execution once towards the beginning, to get the debugger to load symbols, because there seems to sometimes be a problem trying to load symbols after the program crashes or hits a breakpoint.

Note: when you build the program, Xcode simply executes make in the top level directory. This works fine for regular rebuilds, but fails if make has to run autoconf or automake, since the environment is not set up to run the MacPorts version. There's probably a way to load the right environment variables into Xcode to do this.

[edit] Codecs and media

Try XiphQT and Perian. The Perian VP3 codecs (used in most of our example program) aren't working very well right now, and only display key frames. We see this same behavior in Apple's Movie Player, so we don't believe that this is a bug in Halyard.

To get media files:

git submodule init test/Media
git submodule update

[edit] Reporting bugs

For now, use the Google Code bug tracker.

Personal tools