Difference between revisions of "BuildingMacOSX"

From Mumble Wiki
Jump to: navigation, search
(Update to 1.2.X. Add protobuf.)
(Added link to new build docs)
 
(81 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Note: This guide is written for the current git HEAD (Mumble version 1.2.X). If you want instructions for 1.1.X, please check the history for this page.
+
{{Warning
 +
|message=The build instructions listed here only apply to Mumble v1.3.x or older. If you want to build Mumble starting from v1.4.0, checkout https://github.com/mumble-voip/mumble/tree/master/docs/dev/build-instructions
 +
}}
  
== Introduction ==
+
{{Building}}
  
This guide describes the method to get a fully working and redistributable version of Mumble and Murmur that works across both Tiger (10.4) and Leopard (10.5) both on Intel and PowerPC Macs. These are the steps used to build the official Mumble releases on Mac OS X.
+
=== Introduction ===
  
This means that the instructions are a little more complicated than they would be if you were just building for, say, Leopard x86. What it boils down to is this:
+
This guide describes the method to get a fully working and redistributable version of Mumble and Murmur that uses the Cocoa version of Qt 4.
 
 
* We build all libraries as Universal Binaries for both i386 and ppc.
 
* We build against the 10.4 (Tiger) SDK, even on Leopard, to make sure our binaries run on Tiger, as well as Leopard.
 
 
 
If you are just interested in building an optimized binary for your exact architecture and operating system, many of the instructions below can be greatly simplified:
 
 
 
* Do not pass custom CFLAGS or LDFLAGS to the configure scripts of the various dependencies.
 
* Do not set the MAC_OSX_DEPLOYMENT_TARGET.
 
* Do not pass the '-sdk' or '-universal' parameters to Qt's configure script.
 
 
 
Also, by default Mumble expects its build environment on Mac OS X to be universal. If you're not building universal binaries, pass CONFIG+='no-universal' to qmake when building Mumble.
 
 
 
== Dependencies ==
 
  
 
To build Mumble you will need:
 
To build Mumble you will need:
* Mac OS X 10.4 (Tiger) or 10.5 (Leopard)
+
* Mac OS X 10.8 (Mountain Lion)
* XCode (http://developer.apple.com/tools/xcode/, or from your Mac OS X install disks)
+
* Xcode 4.4
* pkg-config (http://pkg-config.freedesktop.org/)
 
* Expat (http://expat.sourceforge.net/)
 
* DBus (http://dbus.freedesktop.org/)
 
* Qt 4.5.0 (http://www.qtsoftware.com/developer/downloads/qt/mac)
 
* Boost (http://www.boost.org/)
 
* PortAudio (http://www.portaudio.com/)
 
* libogg (http://xiph.org/)
 
* Protocol Buffers (http://code.google.com/p/protobuf/)
 
  
=== Installing or building pkg-config ===
+
=== Creating a build environment ===
  
This is just a build tool, so you do not have to build it as universal binary.
+
The git repository at https://github.com/mumble-voip/mumble-releng contains pre-made scripts that build the current canonical Mumble OS X build environment.
  
If you have MacPorts installed, you probably already have pkg-config as well. If not, you can install it by doing
+
Simply clone the repo, and cd into it:
sudo port install pkgconfig
 
  
In case you want to compile it yourself, you'll have to download and unpack pkg-config.
+
  $ git clone https://github.com/mumble-voip/mumble-releng
sudo mkdir /usr/lib/pkgconfig (choose a path you like)
+
  $ cd mumble-releng/buildenv/1.3.x/osx
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
 
./configure && make && sudo make install
 
  
To make the path permanent add the following line to your ''~/.profile'' file:
+
Create a MumbleBuild directory in your home dir:
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
 
Also add a path entry to the pkg-config binary to this file:
 
export PATH=$PATH:/usr/local/bin
 
  
=== Building Expat ===
+
  $ mkdir -p ~/MumbleBuild
  
DBus depends on an XML parser, and fails to build with the libxml library included with Mac OS X, so we use Expat instead.
+
Copy the 'env' script to the directory you created in the previous step:
  
Grab version 2.0.1 from SourceForge: http://sourceforge.net/project/showfiles.php?group_id=10127 and unpack it.
+
  $ cp env ~/MumbleBuild/env
  
To build it:
+
Source the env script to set up the proper environment variables for the Mumble build environment:
  
export MACOSX_DEPLOYMENT_TARGET="10.4"
+
  $ source ~/MumbleBuild/env
export OSX_SDK="/Developer/SDKs/MacOSX10.4u.sdk"
 
export OSX_CFLAGS="-isysroot $OSX_SDK -arch ppc -arch i386"
 
export OSX_LDFLAGS="-Wl,-syslibroot,$OSX_SDK -arch ppc -arch i386"
 
CFLAGS="$OSX_CFLAGS" LDFLAGS="$OSX_LDFLAGS" ./configure --prefix=/opt/mumble/expat/
 
make
 
sudo make install
 
  
=== Building DBus ===
+
Build the enviroment:
  
Grab the latest release of DBus from http://dbus.freedesktop.org/. As of this writing that is version 1.2.12.
+
  $ ./build-all.bash
  
Unpack it, and build it:
+
Once this is done, you should have a fully functional installation of Mumble's dependencies (tools and libs) in a self-contained MumbleBuild directory in your home directory.
  
export MACOSX_DEPLOYMENT_TARGET="10.4"
+
=== Building Mumble ===
export OSX_SDK="/Developer/SDKs/MacOSX10.4u.sdk"
 
export OSX_CFLAGS="-isysroot $OSX_SDK -arch ppc -arch i386"
 
export OSX_LDFLAGS="-Wl,-syslibroot,$OSX_SDK -arch ppc -arch i386"
 
CFLAGS="$OSX_CFLAGS -I/opt/mumble/expat/include/" LDFLAGS="$OSX_LDFLAGS -L/opt/mumble/expat/lib/" ./configure --prefix=/opt/mumble/dbus/ --without-x --with-xml=expat --disable-dependency-tracking
 
make
 
sudo make install
 
  
After building and install DBus, you should make sure the /opt/mumble/dbus/lib/pkgconfig/ directory is in your PKG_CONFIG_PATH, so Qt is able to pick it up.
+
Make sure you've sourced ~/MumbleBuild/env into your current shell session:
  
=== Installing MySQL ===
+
$ source ~/MumbleBuild/env
  
We want users to be able to use a MySQL database with their Murmur installation, but we also want to make sure they can do that without too much hassle. Therefore we link against MySQL's official 10.4 universal binaries, so people can just use the official MySQL packages to get their database set up.
+
Fetch the Mumble source from Git into a directory of your choosing:
  
Grab the latest Universal .tar.gz package for 10.4 from MySQL's website: http://dev.mysql.com/downloads/mysql/5.1.html#macosx
+
git clone --recursive https://github.com/mumble-voip/mumble
  
To install it:
+
To build the client, execute:
 
 
cd /opt/mumble/
 
sudo tar -zxf path/to/mysql-5.1.31-osx10.4-universal.tar.gz
 
sudo ln -sf mysql-5.0.51-osx10.4-universal mysql
 
cd mysql/lib/
 
d=`pwd`; for i in `ls *.dylib`; do install_name_tool -id $d/$i $i; done
 
 
 
=== Building Qt ===
 
 
 
Download an unpack Qt.
 
  
Since we want our build to be as compatible as possible, we will build against the 10.4 (Tiger) SDK (even on Leopard). To build Qt, run:
+
  cd mumble
  export MACOSX_DEPLOYMENT_TARGET="10.4"
+
  qmake -recursive -Wall main.pro CONFIG+="release static"
  ./configure -debug-and-release -no-exceptions -universal -qt-sql-sqlite -qt-sql-mysql -qt-libpng -qt-libjpeg -qdbus -no-phonon -no-phonon-backend -no-webkit -no-qt3support -sdk /Developer/SDKs/MacOSX10.4u.sdk/ -prefix /opt/mumble/qt-framework-4.5.0/ -I /opt/mumble/mysql/include/ -L /opt/mumble/mysql/lib/
 
in the Qt directory.
 
If configure runs sucessfully, continue by executing:
 
 
  make
 
  make
sudo make install
 
  
To make the Qt tools visible add the following line to your ''~/.profile'' file:
+
If everything went well, you should now have a Mumble.app application bundle in the release directory of the root of the source tree.
export PATH=$PATH:/opt/mumble/qt-framework-4.5.0/bin/
 
 
 
=== Installing Boost ===
 
 
 
As Mumble only uses some Boost headers you do not have to build Boost from scratch - you just need to unpack it.
 
 
 
It is advisible to unpack Boost to /usr/local/include/, so the Boost headers will be available in /usr/local/include/boost-1_34_1/, since Mumble will look for the headers in this place by default.
 
  
If you have MacPorts installed, you can install Boost by executing
+
=== Building Murmur ===
sudo port install boost
 
  
Mumble will also look for the headers in /opt/local/include/boost-1_34_1/ - the default install location for MacPorts.
+
Make sure you've sourced ~/MumbleBuild/env into your current shell session:
  
=== Building PortAudio ===
+
$ source ~/MumbleBuild/env
  
Download and extract the latest nightly PortAudio snapshot:
+
Fetch the Mumble and Murmur source from Git into a directory of your choosing:
  
http://portaudio.com/archives/pa_snapshot.tar.gz
+
git clone --recursive https://github.com/mumble-voip/mumble
  
Build and install it:
+
To build the server, execute:
  
  export MACOSX_DEPLOYMENT_TARGET="10.4"
+
  cd mumble
  export OSX_SDK="/Developer/SDKs/MacOSX10.4u.sdk"
+
  qmake -spec unsupported/macx-clang -recursive CONFIG+="release static no-client no-dbus"
export OSX_CFLAGS="-isysroot $OSX_SDK -arch ppc -arch i386"
 
export OSX_LDFLAGS="-Wl,-syslibroot,$OSX_SDK -arch ppc -arch i386"
 
CFLAGS="-O2 -g $OSX_CFLAGS" LDFLAGS="$OSX_LDFLAGS" ./configure --disable-mac-universal --disable-dependency-tracking --prefix=/opt/mumble/portaudio/
 
 
  make
 
  make
sudo make install
 
  
=== Building libogg ===
+
If everything went well, you should now have a murmur binary in the release directory of the root of the source tree.
  
Download and extract the latest version of libogg. As of this writing, that is libogg 1.1.3.
+
=== Distributing Mumble ===
  
http://xiph.org/downloads/
+
If you wish to create a proper redistributable Mumble application bundle, please refer to the osxdist.py script in
 +
the macx/scripts directory. This will help you clean up your application bundle, include the needed dependencies, resources etc., and create a compressed disk image - ready to redistribute!
  
Build and install it:
+
The script expects you to be in the root of the source tree. After executing, it will spit out a .dmg of your Mumble build in the release folder.
 
 
export MACOSX_DEPLOYMENT_TARGET="10.4"
 
export OSX_SDK="/Developer/SDKs/MacOSX10.4u.sdk"
 
export OSX_CFLAGS="-isysroot $OSX_SDK -arch ppc -arch i386"
 
export OSX_LDFLAGS="-Wl,-syslibroot,$OSX_SDK -arch ppc -arch i386"
 
CFLAGS="$OSX_CFLAGS" LDFLAGS="$OSX_LDFLAGS" ./configure --prefix=/opt/mumble/libogg/ --disable-dependency-tracking
 
sed -i -e 's,CC \-dynamiclib,CC \-dynamiclib \\$OSX_LDFLAGS,' libtool
 
make
 
sudo make install
 
 
 
== Building Protocol Buffers ==
 
 
 
Grab the latest version of Protocol Buffers from its Google Code project: http://code.google.com/p/protobuf/. As of this writing, that is version 2.0.3.
 
Direct link: http://protobuf.googlecode.com/files/protobuf-2.0.3.tar.bz2
 
 
 
Build and install it:
 
 
 
export MACOSX_DEPLOYMENT_TARGET="10.4"
 
export OSX_SDK="/Developer/SDKs/MacOSX10.4u.sdk"
 
export OSX_CFLAGS="-isysroot $OSX_SDK -arch ppc -arch i386"
 
export OSX_LDFLAGS="-Wl,-syslibroot,$OSX_SDK -arch ppc -arch i386"
 
CFLAGS="$OSX_CFLAGS" CXXFLAGS="$OSX_CFLAGS" LDFLAGS="$OSX_LDFLAGS" ./configure --prefix=/opt/mumble/protobuf/ --disable-dependency-tracking
 
 
 
Also, make sure that /opt/mumble/protobuf/bin/ is in your PATH before you start your Mumble build.
 
 
 
== Building Mumble ==
 
 
 
Fetch the Mumble source from SVN.
 
 
 
To build the client, execute:
 
 
 
export PKG_CONFIG_PATH=/opt/mumble/portaudio/lib/pkgconfig/:$PKG_CONFIG_PATH
 
qmake main.pro CONFIG+='release'
 
make
 
 
 
Note: If you didn't install Boost in the advised directory or through MacPorts, you should add your own include path to src/mumble/mumble.pro (search for boost).
 
  
If everything went well, you should now have a Mumble.app application bundle in the release directory of the root of the source tree.
+
If you only have a Mumble.app, and have not built Murmur, you should also pass the
  
== Distributing Mumble ==
+
--no-server
  
If you wish to create a proper redistributable Mumble application bundle, please refer to the osxdist.sh script in
+
parameter to the osxdist.py script. This will not attempt to package Murmur-specific files in the generated .dmg.
the scripts directory. This will help you clean up your application bundle, include the needed dependencies, resources etc., and create a compressed disk image - ready to redistribute!
 
  
The script expects you to be in the root of the source tree. After executing, it will spit out a .dmg of your Mumble build in the release folder.
+
The script supports code signing, and among other things, allow you to build a copy of Mumble signed with your Developer ID certificates from Apple.
 +
To build with code signing enabled, use the following three parameters to the osxdist.py script:
  
Please note that the script currently is tuned for creating real redistributable versions of Mumble, and as such only works on universal (x86, ppc) release builds!
+
* --developer-id='<Name or Organization>'
 +
* --keychain=<keychain> (optional, defaults to 'login.keychain')
  
 
[[Category:Development]]
 
[[Category:Development]]

Latest revision as of 07:40, 12 October 2020

Icons oxygen 48x48 status task-attention.png
Warning: The build instructions listed here only apply to Mumble v1.3.x or older. If you want to build Mumble starting from v1.4.0, checkout https://github.com/mumble-voip/mumble/tree/master/docs/dev/build-instructions


Building Guides

This page is one of a set of Building pages/guides for the different OSes with information on building Mumble/Murmur.

BuildingLinux BuildingFreeBSD BuildingOpenBSD BuildingMacOSX BuildingWindows


Introduction

This guide describes the method to get a fully working and redistributable version of Mumble and Murmur that uses the Cocoa version of Qt 4.

To build Mumble you will need:

  • Mac OS X 10.8 (Mountain Lion)
  • Xcode 4.4

Creating a build environment

The git repository at https://github.com/mumble-voip/mumble-releng contains pre-made scripts that build the current canonical Mumble OS X build environment.

Simply clone the repo, and cd into it:

 $ git clone https://github.com/mumble-voip/mumble-releng
 $ cd mumble-releng/buildenv/1.3.x/osx

Create a MumbleBuild directory in your home dir:

 $ mkdir -p ~/MumbleBuild

Copy the 'env' script to the directory you created in the previous step:

 $ cp env ~/MumbleBuild/env

Source the env script to set up the proper environment variables for the Mumble build environment:

 $ source ~/MumbleBuild/env

Build the enviroment:

 $ ./build-all.bash

Once this is done, you should have a fully functional installation of Mumble's dependencies (tools and libs) in a self-contained MumbleBuild directory in your home directory.

Building Mumble

Make sure you've sourced ~/MumbleBuild/env into your current shell session:

$ source ~/MumbleBuild/env

Fetch the Mumble source from Git into a directory of your choosing:

git clone --recursive https://github.com/mumble-voip/mumble

To build the client, execute:

cd mumble
qmake -recursive -Wall main.pro CONFIG+="release static"
make

If everything went well, you should now have a Mumble.app application bundle in the release directory of the root of the source tree.

Building Murmur

Make sure you've sourced ~/MumbleBuild/env into your current shell session:

$ source ~/MumbleBuild/env

Fetch the Mumble and Murmur source from Git into a directory of your choosing:

git clone --recursive https://github.com/mumble-voip/mumble

To build the server, execute:

cd mumble
qmake -spec unsupported/macx-clang -recursive CONFIG+="release static no-client no-dbus"
make

If everything went well, you should now have a murmur binary in the release directory of the root of the source tree.

Distributing Mumble

If you wish to create a proper redistributable Mumble application bundle, please refer to the osxdist.py script in the macx/scripts directory. This will help you clean up your application bundle, include the needed dependencies, resources etc., and create a compressed disk image - ready to redistribute!

The script expects you to be in the root of the source tree. After executing, it will spit out a .dmg of your Mumble build in the release folder.

If you only have a Mumble.app, and have not built Murmur, you should also pass the

--no-server

parameter to the osxdist.py script. This will not attempt to package Murmur-specific files in the generated .dmg.

The script supports code signing, and among other things, allow you to build a copy of Mumble signed with your Developer ID certificates from Apple. To build with code signing enabled, use the following three parameters to the osxdist.py script:

  • --developer-id='<Name or Organization>'
  • --keychain=<keychain> (optional, defaults to 'login.keychain')