Difference between revisions of "BuildingMacOSX"

From Mumble Wiki
Jump to: navigation, search
(Building Qt)
(Added link to new build docs)
 
(73 intermediate revisions by 3 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 uses the Cocoa version of Qt 4. This build will work on both Intel and PowerPC Macs on Mac OS X 10.5 (Leopard).
+
=== Introduction ===
  
If you don't want a universal build, you can achieve this by passing CONFIG+='no-universal' to qmake.
+
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.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
* Git (http://www.git-scm.org/)
 
* pkg-config (http://pkg-config.freedesktop.org/)
 
* DBus (http://dbus.freedesktop.org/)
 
* Qt 4.5.2 (http://www.qtsoftware.com/developer/downloads/qt/mac)
 
* Boost (http://www.boost.org/)
 
* PortAudio (http://www.portaudio.com/)
 
* libsoundfile (http://www.mega-nerd.com/libsndfile/)
 
* Protocol Buffers (http://code.google.com/p/protobuf/)
 
* Berkeley DB (http://www.oracle.com/technology/products/berkeley-db/index.html) (Murmur only)
 
* mcpp (http://www.sourceforge.net/projects/mcpp/) (Murmur only)
 
* ZeroC Ice (http://www.zeroc.com) (Murmur only)
 
  
=== Setting up the build environment ===
+
=== Creating a build environment ===
  
#!/bin/bash
+
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.
 
# C compiler
 
export CC="$(xcode-select -print-path)/usr/bin/gcc-4.2"
 
export CXX="$(xcode-select -print-path)/usr/bin/g++-4.2"
 
 
# Mac OS X SDK stuff
 
export MACOSX_DEPLOYMENT_TARGET="10.5"
 
export OSX_SDK="/Developer/SDKs/MacOSX10.5.sdk"
 
 
# Autotools, etc. setup
 
export OSX_CFLAGS="-isysroot $OSX_SDK -arch ppc -arch i386"
 
export OSX_LDFLAGS="-Wl,-syslibroot,$OSX_SDK -arch ppc -arch i386"
 
export CFLAGS=$OSX_CFLAGS
 
export CXXFLAGS=$OSX_CFLAGS
 
export LDFLAGS=$OSX_LDFLAGS
 
 
# Mumble stuff
 
export MUMBLE_PREFIX=/opt/mumble-1.2/
 
 
# pkgconfig, PATH, etc.
 
export PKG_CONFIG_PATH=/usr/lib/pkgconfig/:$MUMBLE_PREFIX/lib/pkgconfig/:$PKG_CONFIG_PATH
 
export PATH=$MUMBLE_PREFIX/qt-framework-4.5.2/bin/:$PATH
 
export PATH=$MUMBLE_PREFIX/bin:$PATH
 
 
# ice path
 
ICE_PREFIX=$MUMBLE_PREFIX/ice-3.3.1/
 
export PATH=$ICE_PREFIX/bin/:$PATH
 
 
echo Now in Mumble 1.2 build environment
 
  
Remember to source the above script before doing any of the steps listed below.
+
Simply clone the repo, and cd into it:
  
=== Installing or building pkg-config ===
+
  $ git clone https://github.com/mumble-voip/mumble-releng
 +
  $ cd mumble-releng/buildenv/1.3.x/osx
  
This is just a build tool, so you do not have to build it as universal binary.
+
Create a MumbleBuild directory in your home dir:
  
If you have MacPorts installed, you probably already have pkg-config as well. If not, you can install it by doing
+
  $ mkdir -p ~/MumbleBuild
sudo port install pkgconfig
 
  
In case you want to compile it yourself, you'll have to download and unpack pkg-config.
+
Copy the 'env' script to the directory you created in the previous step:
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:
+
  $ cp env ~/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
 
  
=== Installing or getting Git ===
+
Source the env script to set up the proper environment variables for the Mumble build environment:
  
To grab a copy of Mumble, you need Git.
+
  $ source ~/MumbleBuild/env
  
You have three options:
+
Build the enviroment:
* Build it yourself.
 
* Install it via MacPorts: port install git-core
 
* Fetch the git-osx-installer package from Google Code: http://code.google.com/p/git-osx-installer/downloads/list?can=3
 
  
=== Building DBus ===
+
  $ ./build-all.bash
  
Grab the latest release of DBus from http://dbus.freedesktop.org/. As of this writing that is version 1.2.12.
+
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.
  
Unpack it, and build it:
+
=== Building Mumble ===
  
./configure --prefix=/opt/mumble/dbus/ --without-x --with-xml=expat --disable-dependency-tracking
+
Make sure you've sourced ~/MumbleBuild/env into your current shell session:
make
 
make install
 
  
=== Building Qt ===
+
$ source ~/MumbleBuild/env
  
Download and unpack Qt.
+
Fetch the Mumble source from Git into a directory of your choosing:
  
  unset CFLAGS
+
  git clone --recursive https://github.com/mumble-voip/mumble
unset CXXFLAGS
 
unset LDFLAGS
 
./configure configure -pch -debug-and-release -universal -cocoa -qt-sql-sqlite -system-zlib -qt-gif -qt-libpng -qt-libjpeg -qdbus -no-webkit -no-phonon ---no-phonon-backend -no-qt3support -sdk $OSX_SDK -prefix $MUMBLE_PREFIX/qt-framework-4.6-mumble/ -opensource -confirm-license
 
make
 
sudo make install
 
export CFLAGS=$OSX_CFLAGS
 
export CXXFLAGS=$OSX_CFLAGS
 
export LDFLAGS=$OSX_LDFLAGS
 
  
=== Installing Boost ===
+
To build the client, execute:
 
 
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 $MUMBLE_PREFIX/include/, so the Boost headers will be available in $MUMBLE_PREFIX/include/boost-1_39_1/, since Mumble will look for the headers in this place by default.
 
 
 
=== Building PortAudio ===
 
 
 
Download and extract the latest nightly PortAudio snapshot:
 
 
 
http://portaudio.com/archives/pa_snapshot.tar.gz
 
 
 
Build and install:
 
  
  wget http://www.scorpius-project.org/mumble-stuff/portaudio-fix.patch
+
  cd mumble
  patch -p1 < portaudio-fix.patch
+
  qmake -recursive -Wall main.pro CONFIG+="release static"
./configure --disable-mac-universal --disable-dependency-tracking --prefix=$MUMBLE_PREFIX
 
 
  make
 
  make
sudo make install
 
  
=== Building libsndfile ===
+
If everything went well, you should now have a Mumble.app application bundle in the release directory of the root of the source tree.
 
 
Grab the latest version. Build:
 
 
 
export CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc"
 
export CXXFLAGS=$CFLAGS
 
export LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch ppc"
 
./configure --prefix=$(pwd)/ppc-root/
 
make
 
make install
 
make distclean
 
export CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch i386"
 
export CXXFLAGS=$CFLAGS
 
export LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch i386"
 
./configure --prefix=$MUMBLE_PREFIX
 
make
 
sudomake install
 
lipo -create -arch ppc ppc-root/lib/libsndfile.1.dylib -arch i386 $MUMBLE_PREFIX/lib/libsndfile.1.dylib -output $MUMBLE_PREFIX/lib/libsndfile.1.dylib
 
export CFLAGS=$OSX_CFLAGS
 
export CXXFLAGS=$CFLAGS
 
export LDFLAGS=$OSX_LDFLAGS
 
  
=== Building Protocol Buffers ===
+
=== Building Murmur ===
  
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.2.0.
+
Make sure you've sourced ~/MumbleBuild/env into your current shell session:
Direct link: http://protobuf.googlecode.com/files/protobuf-2.2.0.tar.bz2
 
  
Build and install it:
+
$ source ~/MumbleBuild/env
  
./configure --disable-dependency-tracking --prefix=$MUMBLE_PREFIX
+
Fetch the Mumble and Murmur source from Git into a directory of your choosing:
make
 
sudo make install
 
  
=== Logitech LCD SDK (optional) ===
+
git clone --recursive https://github.com/mumble-voip/mumble
  
Grab it, install it. Build it:
+
To build the server, execute:
  
  sudo mkdir -p $MUMBLE_PREFIX/lglcd-sdk/
+
  cd mumble
  sudo tar -zxvf /Applications/Logitech/GamePanel\ Software/LCD\ Manager/LCDSDK/LCDSDK.tgz -C $MUMBLE_PREFIX/lglcd-sdk/
+
  qmake -spec unsupported/macx-clang -recursive CONFIG+="release static no-client no-dbus"
sudo chmod -vR +r $MUMBLE_PREFIX/lglcd-sdk/
 
 
 
=== libmcpp ===
 
 
 
Grab it. Build it:
 
 
 
./configure --disable-dependency-tracking --prefix=$MUMBLE_PREFIX --enable-mcpplib
 
 
  make
 
  make
sudo make install
 
  
=== Berkeley DB ===
+
If everything went well, you should now have a murmur binary in the release directory of the root of the source tree.
  
Grab it. Build it:
+
=== Distributing Mumble ===
  
for i in 1 2 3 4; do wget http://www.oracle.com/technology/products/berkeley-db/db/update/4.7.25/patch.4.7.25.$i; done
+
If you wish to create a proper redistributable Mumble application bundle, please refer to the osxdist.py script in
for i in 1 2 3; do patch -p0 < patch.4.7.25.$i; done
+
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!
patch -p1 < patch.4.7.25.4
 
cd build_unix
 
../dist/configure --disable-dependency-tracking --prefix=$MUMBLE_PREFIX --enable-cxx
 
  
=== ZeroC Ice ===
+
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.
 
 
Grab it. Build it:
 
 
 
make prefix=$ICE_PREFIX embedded_runpath_prefix=$ICE_PREFIX OPTIMIZE=yes CXX="$CXX $OSX_CFLAGS" CC="$CC $OSX_CFLAGS" DB_HOME=$MUMBLE_PREFIX MCPP_HOME=$MUMBLE_PREFIX
 
sudo make prefix=$ICE_PREFIX embedded_runpath_prefix=$ICE_PREFIX OPTIMIZE=yes CXX="$CXX $OSX_CFLAGS" CC="$CC $OSX_CFLAGS" DB_HOME=$MUMBLE_PREFIX MCPP_HOME=$MUMBLE_PREFIX install
 
 
 
== Building Mumble ==
 
  
Fetch the Mumble source from Git:
+
If you only have a Mumble.app, and have not built Murmur, you should also pass the
  
git clone git://mumble.git.sourceforge.net/gitroot/mumble mumble.git
+
--no-server
cd mumble.git
 
git submodule init
 
git submodule update
 
  
To build the client, execute:
+
parameter to the osxdist.py script. This will not attempt to package Murmur-specific files in the generated .dmg.
  
qmake main.pro CONFIG+='release'
+
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.
make
+
To build with code signing enabled, use the following three parameters to the osxdist.py script:
 
 
If everything went well, you should now have a Mumble.app application bundle 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.sh 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 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!
+
* --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')