Build OLA Mac Packages

From OpenDMX.net

Jump to: navigation, search

These are my notes on building universal binary packages for mac. It's mostly based off the Apple developer notes

Contents

[edit] Directory setup

# extracted tarballs
~/mac-packaging/build/libmicrohttpd-0.4.2
~/mac-packaging/build/protobuf-2.2.0
~/mac-packaging/build/libusb-1.0.6
# install desintations
~/mac-packaging/non-flat-packages/libmicrohttpd
~/mac-packaging/non-flat-packages/protobuf
~/mac-packaging/non-flat-packages/libusb

[edit] Building OLA Dependancies

[edit] libusb

In ~/mac-packaging/build/libusb-1.0.6:

./configure  --disable-dependency-tracking
make CFLAGS="-arch ppc -arch i386 -arch x86_64"   LDFLAGS=" -arch ppc -arch i386 -arch x86_64"
DESTDIR=/Users/simonn/lighting/mac-packaging/non-flat-packages/libusb/ make install

[edit] libmicrohttpd

./configure  --disable-dependency-tracking --with-libgcrypt-prefix=/tmp/foo
make CFLAGS="-arch ppc -arch i386" CPPFLAGS="-arch ppc -arch i386 -arch x86_64"  LDFLAGS=" -arch ppc -arch i386 -arch x86_64"
DESTDIR=/Users/simonn/lighting/mac-packaging/non-flat-packages/microhttpd/ make install

[edit] protobuf

./configure  --disable-dependency-tracking
make CFLAGS="-arch ppc -arch i386 -arch x86_64" CPPFLAGS="-arch ppc -arch i386 -arch x86_64"  LDFLAGS=" -arch ppc -arch i386 -arch x86_64"
DESTDIR=/Users/simonn/lighting/mac-packaging/non-flat-packages/protobuf/ make install
./configure --disable-dependency-tracking
sudo make install
cd python
python setup.py  install --root ~/lighting/mac-packaging/non-flat-packages/protobuf --prefix /usr/local/

The second make install is required so that ola-examples builds. I'm sure there is a way around this but I can't figure it out...

[edit] Cleanup

In ~/lighting/mac-packaging/non-flat-packages, run

find ./ -name ".DS_Store" -exec rm {} \;

[edit] Creating Dependancy Packages

Using PackageMaker, create a distribution package for each of the dependancies. Remember to fix the permissions and set Package Location to 'Same Level'. Build the package and save it in ~/lighting/mac-packaging/non-flat-packages


~/lighting/mac-packaging/non-flat-packages should now look something like:

libusb 1.0.8.mpkg
libusb 1.0.8.pkg
microhttpd 0.4.2.mpkg 
microhttpd.pkg  
protobuf 2.2.0.mpkg 
protobuf 2.2.0.pkg  

[edit] Building ola & ola-examples

Unpack the ola tarball, then run

./configure --disable-dependency-tracking
make  CPPFLAGS="-arch ppc -arch i386 -arch x86_64 -mmacosx-version-min=10.5"  LDFLAGS=" -arch ppc -arch i386 -arch x86_64"
make check
sudo make install 
DESTDIR=/Users/simonn/lighting/mac-packaging/ola  make install


Again, The first make install is required so that ola-examples builds. I'm sure there is a way around this but I can't figure it out...


Unpack the ola-examples tarball and run:

./configure --disable-dependency-tracking 
make  CPPFLAGS="-arch ppc -arch i386 -arch x86_64 -mmacosx-version-min=10.5"  LDFLAGS=" -arch ppc -arch i386 -arch x86_64"
DESTDIR=/Users/simonn/lighting/mac-packaging/ola-examples make install

Clean up the .DS_Store and static libs in ola & ola-tools

find ./ -name "*.DS_Store" -exec rm {} \;
find ./ -name "*.a" -exec rm {} \;

[edit] Create the main package & build

Add the 4 dependancies, ola & ola-tools

Personal tools