Difference between revisions of "BuildingMacOSX"

From Mumble Wiki
Jump to: navigation, search
(Boost and MacPorts)
(Added link to new build docs)
 
(99 intermediate revisions by 4 users not shown)
Line 1: Line 1:
== Universal or not Universal? ==
+
{{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
 +
}}
  
If you want to build Mumble as universal binary you will first have to build all dependencies as universal binary.
+
{{Building}}
 +
 
 +
=== 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.
  
== 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/)
+
 
* Qt 4.3.4 (http://trolltech.com/developer/downloads/qt/mac)
+
=== Creating a build environment ===
* Boost (http://www.boost.org/)
+
 
* Portaudio (http://www.portaudio.com/)
+
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:
  
=== Compiling pkg-config ===
+
  $ mkdir -p ~/MumbleBuild
  
This is just a build tool, so you do not have to build it as universal binary.
+
Copy the 'env' script to the directory you created in the previous step:
  
If you have MacPorts installed, you probably already have pkg-config as well. If not, you can install it by doing
+
  $ cp env ~/MumbleBuild/env
sudo port install pkgconfig
 
  
In case you want to compile it yourself, you'll have to download and unpack pkg-config.
+
Source the env script to set up the proper environment variables for the Mumble build environment:
sudo mkdir /usr/lib/pkgconfig (choose a path you like)
 
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:
+
  $ source ~/MumbleBuild/env
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
 
  
=== Compiling QT ===
+
Build the enviroment:
  
Download an unpack QT.
+
  $ ./build-all.bash
  
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:
+
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"
 
./configure -universal -qt-sql-sqlite -qt-libpng -sdk /Developer/SDKs/MacOSX10.4u.sdk
 
in the Qt directory.
 
If configure runs sucessfully, continue by executing:
 
make && sudo make install
 
Qt will be installed to the directory ''/usr/local/Trolltech/Qt-4.3.4''.
 
  
To make the Qt tools visible add the following line to your ''~/.profile'' file:
+
=== Building Mumble ===
export PATH=$PATH:/usr/local/Trolltech/Qt-4.3.4/bin
 
  
=== Compiling Boost ===
+
Make sure you've sourced ~/MumbleBuild/env into your current shell session:
  
As Mumble only uses some Boost headers you do not have to build/install this. Just unpack Boost.
+
$ source ~/MumbleBuild/env
  
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.
+
Fetch the Mumble source from Git into a directory of your choosing:
  
If you have MacPorts installed, you can install Boost by executing
+
  git clone --recursive https://github.com/mumble-voip/mumble
  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.
+
To build the client, execute:
  
=== Compiling Portaudio ===
+
cd mumble
 +
qmake -recursive -Wall main.pro CONFIG+="release static"
 +
make
  
PortAudio builds universal binaries by default - it will also try to make your binaries as backwards compatible as possible, so there's no need to explicitly tell it to build against the 10.4 SDK. Therefore, just download, unpack and:
+
If everything went well, you should now have a Mumble.app application bundle in the release directory of the root of the source tree.
./configure && make
 
  
For the Mumble build system to find PortAudio you will have to modify the included ''portaudio-2.0.pc.in'', rename it to ''portaudio-2.0.pc'' and put it in your PKG_CONFIG_PATH.
+
=== Building Murmur ===
My ''portaudio-2.0.pc'' file looks like this:
 
  
prefix=/Users/username/Development/portaudio
+
Make sure you've sourced ~/MumbleBuild/env into your current shell session:
exec_prefix=${prefix}
 
libdir=${exec_prefix}/lib
 
includedir=${exec_prefix}/include
 
 
Name: PortAudio
 
Description: Portable audio I/O
 
Requires:
 
Version: 19
 
 
Libs: -L${libdir} -lportaudio
 
Cflags: -I${includedir}
 
  
== Building Mumble ==
+
$ source ~/MumbleBuild/env
  
Fetch the Mumble source from SVN. First build speex by changing into the ''speexbuild'' subdirectory and running:
+
Fetch the Mumble and Murmur source from Git into a directory of your choosing:
qmake speexbuild.pro && make release
 
  
After that change to the ''src/mumble'' subdirectory. Here you might have to change some parameters in ''mumble.pro'', so open it in a text editor.
+
git clone --recursive https://github.com/mumble-voip/mumble
Change the path in the line:
 
INCLUDEPATH += /usr/local/include/boost-1_34/
 
to the path where your boost headers are located.
 
  
then run:
+
To build the server, execute:
qmake mumble.pro && make release
 
  
If everything went well, you should now have a Mumble.app application bundle in the release directory of the root of the source tree.
+
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 ==
+
=== Distributing Mumble ===
  
If you wish to create a proper redistributable Mumble application bundle, please refer to the osxdist.sh script in
+
If you wish to create a proper redistributable Mumble application bundle, please refer to the osxdist.py script in
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 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.
 
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.
  
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!
+
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')
 +
 
 +
[[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')