Personal tools
The Open Lighting Project has moved!

We've launched our new site at www.openlighting.org. This wiki will remain and be updated with more technical information.

Difference between revisions of "Build OLA Mac Packages"

From wiki.openlighting.org

Jump to: navigation, search
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
These are my notes on building universal binary packages for mac.
+
These are my notes on building universal binary packages for mac. It's mostly based off the [http://developer.apple.com/library/mac/#documentation/Porting/Conceptual/PortingUnix/compiling/compiling.html#//apple_ref/doc/uid/TP40002850-TPXREF101 Apple developer notes ]
  
 
==Directory setup==
 
==Directory setup==
Line 5: Line 5:
 
<pre>
 
<pre>
 
# extracted tarballs
 
# extracted tarballs
~/mac-packaging/build/libartnet-1.1.0
 
 
~/mac-packaging/build/libmicrohttpd-0.4.2
 
~/mac-packaging/build/libmicrohttpd-0.4.2
 
~/mac-packaging/build/protobuf-2.2.0
 
~/mac-packaging/build/protobuf-2.2.0
~/mac-packaging/build/ctemplate-
+
~/mac-packaging/build/libusb-1.0.6
 
# install desintations
 
# install desintations
~/mac-packaging/non-flat-packages/libartnet
 
 
~/mac-packaging/non-flat-packages/libmicrohttpd
 
~/mac-packaging/non-flat-packages/libmicrohttpd
 
~/mac-packaging/non-flat-packages/protobuf
 
~/mac-packaging/non-flat-packages/protobuf
~/mac-packaging/non-flat-packages/ctemplate
+
~/mac-packaging/non-flat-packages/libusb
 
</pre>
 
</pre>
  
 
== Building OLA Dependancies ==
 
== Building OLA Dependancies ==
  
=== libartnet ===
 
  
In ~/mac-packaging/build/libartnet-1.1.0:
+
=== libusb ===
 +
 
 +
In ~/mac-packaging/build/libusb-1.0.6:
  
 
<pre>
 
<pre>
/configure prefix=/Users/simonn/lighting/mac-packaging/non-flat-packages/libartnet/ --disable-dependency-tracking
+
./configure --disable-dependency-tracking
make CFLAGS="-arch ppc -arch i386"  LDFLAGS=" -arch ppc -arch i386"
+
make CFLAGS="-arch ppc -arch i386 -arch x86_64"  LDFLAGS=" -arch ppc -arch i386 -arch x86_64"
make install
+
DESTDIR=/Users/simonn/lighting/mac-packaging/non-flat-packages/libusb/ make install
 
</pre>
 
</pre>
  
Line 31: Line 30:
  
 
<pre>
 
<pre>
./configure prefix=~/mac-packaging/non-flat-packages/microhttpd/ --disable-dependency-tracking --with-libgcrypt-prefix=/tmp/foo
+
./configure --disable-dependency-tracking --with-libgcrypt-prefix=/tmp/foo
make CFLAGS="-arch ppc -arch i386" CPPFLAGS="-arch ppc -arch i386"  LDFLAGS=" -arch ppc -arch i386"
+
make CFLAGS="-arch ppc -arch i386" CPPFLAGS="-arch ppc -arch i386 -arch x86_64"  LDFLAGS=" -arch ppc -arch i386 -arch x86_64"
make install
+
DESTDIR=/Users/simonn/lighting/mac-packaging/non-flat-packages/microhttpd/ make install
 
</pre>
 
</pre>
  
Line 39: Line 38:
  
 
<pre>
 
<pre>
./configure prefix=~/lighting/mac-packaging/non-flat-packages/protobuf/ --disable-dependency-tracking
+
./configure --disable-dependency-tracking
make CFLAGS="-arch ppc -arch i386" CPPFLAGS="-arch ppc -arch i386"  LDFLAGS=" -arch ppc -arch i386"
+
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"
make install
+
DESTDIR=/Users/simonn/lighting/mac-packaging/non-flat-packages/protobuf/ make install
 
./configure --disable-dependency-tracking
 
./configure --disable-dependency-tracking
 
sudo make install
 
sudo make install
 +
cd python
 +
python setup.py  install --root ~/lighting/mac-packaging/non-flat-packages/protobuf --prefix /usr/local/
 
</pre>
 
</pre>
  
 
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...
 
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...
 
=== ctemplate ===
 
 
<pre>
 
./configure prefix=/Users/simonn/lighting/mac-packaging/non-flat-packages/ctemplate/ --disable-dependency-tracking
 
make CFLAGS="-arch ppc -arch i386" CPPFLAGS="-arch ppc -arch i386"  LDFLAGS=" -arch ppc -arch i386"
 
make check
 
make install
 
</pre>
 
  
 
=== Cleanup ===
 
=== Cleanup ===
Line 65: Line 57:
 
</pre>
 
</pre>
  
== Creating Dependancies Packages ==
+
== 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
 
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
Line 73: Line 65:
  
 
<pre>
 
<pre>
ctemplate 0.96.mpkg  
+
libusb 1.0.8.mpkg
ctemplate.pkg 
+
libusb 1.0.8.pkg
libartnet 1.1.0.mpkg
 
libartnet 1.1.0.pkg
 
 
microhttpd 0.4.2.mpkg  
 
microhttpd 0.4.2.mpkg  
 
microhttpd.pkg   
 
microhttpd.pkg   
Line 89: Line 79:
 
<pre>
 
<pre>
 
./configure --disable-dependency-tracking
 
./configure --disable-dependency-tracking
make  CPPFLAGS="-arch ppc -arch i386"  LDFLAGS=" -arch ppc -arch i386"
+
make  CPPFLAGS="-arch ppc -arch i386 -arch x86_64 -mmacosx-version-min=10.5"  LDFLAGS=" -arch ppc -arch i386 -arch x86_64"
 
make check
 
make check
sudo make install
+
sudo make install  
# flip the install location to the temp directory
+
DESTDIR=/Users/simonn/lighting/mac-packaging/ola make install
./configure --disable-dependency-tracking --prefix=/Users/simonn/lighting/mac-packaging/ola
 
make install
 
 
</pre>
 
</pre>
  
Line 104: Line 92:
  
 
<pre>
 
<pre>
/configure --disable-dependency-tracking --prefix=/Users/simonn/lighting/mac-packaging/ola-tools
+
./configure --disable-dependency-tracking  
make  CPPFLAGS="-arch ppc -arch i386"  LDFLAGS=" -arch ppc -arch i386"
+
make  CPPFLAGS="-arch ppc -arch i386 -arch x86_64 -mmacosx-version-min=10.5"  LDFLAGS=" -arch ppc -arch i386 -arch x86_64"
make install
+
DESTDIR=/Users/simonn/lighting/mac-packaging/ola-examples make install
 
</pre>
 
</pre>
  
Clean up the .DS_Store files in ola & ola-tools
+
Clean up the .DS_Store and static libs in ola & ola-tools
  
 
<pre>
 
<pre>
 
find ./ -name "*.DS_Store" -exec rm {} \;
 
find ./ -name "*.DS_Store" -exec rm {} \;
<pre>
+
find ./ -name "*.a" -exec rm {} \;
 +
</pre>
  
 
== Create the main package & build ==
 
== Create the main package & build ==
  
 
Add the 4 dependancies, ola & ola-tools
 
Add the 4 dependancies, ola & ola-tools

Latest revision as of 08:00, 28 April 2011

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

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

Building OLA Dependancies

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

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

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...

Cleanup

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

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

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  

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 {} \;

Create the main package & build

Add the 4 dependancies, ola & ola-tools