MacPortsInstall

Version 1 (admin, 20/03/2012 14:22) → Version 2/6 (coder, 01/11/2013 22:52)

{{>toc}}

This page describe how to fulfill libavg dependencies using MacPorts. An alternative method (which uses self-contained dependencies) is described here: [[MacSourceInstall]].

h1. Installing the required dependencies

* Install XCode (http://developer.apple.com/technology/xcode.html). We tested XCode 5.0.1. 4.2.
* Install MacPorts (http://www.macports.org/install.php)
* Install the following packages:

<pre>
$ sudo port install boost +python27 +python26
$ sudo port install gdk-pixbuf GraphicsMagick autoconf automake ffmpeg libsdl pango subversion \
libtool libdc1394 python_select
</pre>

* Make sure MacPort has correctly added /opt/local/bin to PATH (usually on .profile)
* Switch to MacPort's python 2.7 2.6

<pre>
$ sudo python_select python27 python26
</pre>

h1. Fetching and compiling libavg

h2. Checkout

<pre>
$ svn co https://www.libavg.de/svn/trunk/libavg
</pre>

h2. Bootstrap

_for revisions_ >= 7066

<pre>
cd libavg
./bootstrap
</pre>

_for revisions_ < 7066

<pre>
cd libavg
glibtoolize --copy --force
aclocal -I m4
autoheader
automake --foreign --add-missing --copy
autoconf
</pre>

h2. Configure

_for revisions_ >= 7066

<pre>
./configure
</pre>

_for revisions_ < 7066 and >= r5230:

<pre>
LIBS=-L/opt/local/lib ./configure
</pre>

_for revisions_ < r5230:

<pre>
CPPFLAGS=-D__STDC_CONSTANT_MACROS LIBS=-L/opt/local/lib ./configure
</pre>

h2. Compile

Compile with (adjust the concurrency parameter to the number of CPU cores you have + 1):

<pre>
make -j3
</pre>

h2. Test

If everything runs fine, you may run the unit tests. Be aware that at first time startup, fontconfig requires several seconds to initialize its fonts cache:

<pre>
make check
</pre>

h1. Installation

Staging libavg is only matter of issuing a make _install_. Anyway, there is a present issue with the install location, which defaults to _/usr/local/lib/python2.7/site-packages/libavg_ _/usr/local/lib/python2.6/site-packages/libavg_ instead of _/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.6/site-packages_. _/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages_.

In order to circumvent this problem, add _/usr/local/lib/python2.6/site-packages_ to PYTHONPATH:

<pre>
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH PYTHONPATH=/usr/local/lib/python2.6/site-packages:$PYTHONPATH
</pre>

Add this line to _.profile_ to make it permanent.