Difference between revisions of "BuildingMacOSX"

From Mumble Wiki
Jump to: navigation, search
(Building Protocol Buffers: 2.4.1)
(Added link to new build docs)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{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
 +
}}
 +
 
{{Building}}
 
{{Building}}
  
Line 6: Line 10:
  
 
To build Mumble you will need:
 
To build Mumble you will need:
* Mac OS X 10.7 (Lion), or greater
+
* Mac OS X 10.8 (Mountain Lion)
* Xcode (from the Mac App Store, the Xcode Command Line installation may work as well, but has not been tested at present),
+
* Xcode 4.4
* pkg-config (http://pkg-config.freedesktop.org/)
 
* The Mumble Qt branch (http://qt.gitorious.org/+mumble-developers/qt/mumble-developers-qt)
 
* Boost (http://www.boost.org/)
 
* libogg (http://www.xiph.org)
 
* libvorbis (http://www.xiph.org/)
 
* libFLAC (http://www.xiph.org/)
 
* libsoundfile (http://www.mega-nerd.com/libsndfile/)
 
* Protocol Buffers (http://code.google.com/p/protobuf/)
 
  
=== Setting up the build environment ===
+
=== Creating a build environment ===
  
Start off by creating a directory to host your new environment. By default, we'll be using $HOME/MumbleBuild,
+
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.
but anything goes. (Just remember to change the script below:)
 
  
#!/bin/bash
+
Simply clone the repo, and cd into it:
  
# C compiler
+
  $ git clone https://github.com/mumble-voip/mumble-releng
export CC="clang"
+
  $ cd mumble-releng/buildenv/1.3.x/osx
export CXX="clang++"
 
  
# Mac OS X SDK stuff
+
Create a MumbleBuild directory in your home dir:
export MACOSX_DEPLOYMENT_TARGET="10.6"
 
export OSX_SDK="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/"
 
  
# Autotools, etc. setup
+
  $ mkdir -p ~/MumbleBuild
export OSX_CFLAGS="-isysroot $OSX_SDK -arch x86_64 -mmacosx-version-min=10.6"
 
export OSX_LDFLAGS="-isysroot $OSX_SDK -Wl,-syslibroot,$OSX_SDK -arch x86_64 -mmacosx-version-min=10.6"
 
  
export CFLAGS=$OSX_CFLAGS
+
Copy the 'env' script to the directory you created in the previous step:
export CXXFLAGS=$OSX_CFLAGS
 
export LDFLAGS=$OSX_LDFLAGS
 
  
# Mumble stuff
+
  $ cp env ~/MumbleBuild/env
export MUMBLE_PREFIX=$HOME/MumbleBuild
 
  
# pkgconfig, PATH, etc.
+
Source the env script to set up the proper environment variables for the Mumble build environment:
export PKG_CONFIG_PATH=/usr/lib/pkgconfig/:$MUMBLE_PREFIX/lib/pkgconfig/:$PKG_CONFIG_PATH
 
export PATH=$MUMBLE_PREFIX/Qt4.8/bin/:$PATH
 
export PATH=$MUMBLE_PREFIX/bin:$PATH
 
  
echo Now in x86-64 MumbleBuild environment
+
  $ source ~/MumbleBuild/env
  
Create a copy of the above script as $HOME/MumbleBuild/env, and remember to source it before continuing
+
Build the enviroment:
your build environment set up:
 
  
$ source $HOME/MumbleBuild/env
+
  $ ./build-all.bash
Now in x86-64 MumbleBuild environment
 
  
=== Installing or building pkg-config ===
+
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.
  
If you have Homebrew, MacPorts or Fink available, you probably already have pkg-config installed. If not, either of those packaging solutions are probably the easiest way of acquiring it.
+
=== Building Mumble ===
  
In case you want to compile it yourself, you'll have to download and unpack pkg-config.
+
Make sure you've sourced ~/MumbleBuild/env into your current shell session:
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
 
  
=== Building OpenSSL ===
+
Fetch the Mumble source from Git into a directory of your choosing:
  
Grab it from http://www.openssl.org/. The latest version we use is 1.0.0g.
+
git clone --recursive https://github.com/mumble-voip/mumble
  
Unpack and build:
+
To build the client, execute:
  
  ./Configure darwin64-x86_64-cc -shared --prefix=$MUMBLE_PREFIX --openssldir=$MUMBLE_PREFIX/openssl
+
  cd mumble
 +
qmake -recursive -Wall main.pro CONFIG+="release static"
 
  make
 
  make
make install
 
  
=== Building libxar ===
+
If everything went well, you should now have a Mumble.app application bundle in the release directory of the root of the source tree.
 
 
Fetch it via SVN:
 
 
 
svn checkout http://xar.googlecode.com/svn/trunk/ xar-read-only
 
 
 
And build it.  LibXAR seems not to want to read the OS X SDK version of libxml2's headers. Instead, it uses the system headers. Therefore we must override the include path.
 
 
 
We also want libxar to link against our own OpenSSL dylibs, which is why we also add the include path and lib dir for our $MUMBLE_PREFIX.
 
 
 
cd xar-read-only/xar
 
export CFLAGS="-I$OSX_SDK/usr/include/libxml2 ${CFLAGS} -I${MUMBLE_PREFIX}/include/"
 
export LDFLAGS="${LDFLAGS} -L${MUMBLE_PREFIX}/lib/"
 
./autogen.sh --prefix=${MUMBLE_PREFIX}
 
make
 
 
 
After the build, it's a good thing to make sure things went as they should. We want the built libxar to be able to run on both Lion and Snow Leopard.
 
Check that it's linking against our own libcrypto, and that it's linking against the 9.0.0 compatibility version of libxml2 (that's the Leopard version).
 
  
FIXME:
+
=== Building Murmur ===
$ otool -L lib/libxar.1.dylib
 
    [...]
 
    $HOME/MumbleBuild/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
 
    /usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.3.0)
 
    [...]
 
  
When all is well, install it:
+
Make sure you've sourced ~/MumbleBuild/env into your current shell session:
  
  make install
+
  $ source ~/MumbleBuild/env
  
=== Building Qt ===
+
Fetch the Mumble and Murmur source from Git into a directory of your choosing:
  
Download and unpack Qt:
+
git clone --recursive https://github.com/mumble-voip/mumble
  
git clone git://gitorious.org/+mumble-developers/qt/mumble-developers-qt.git
+
To build the server, execute:
cd mumble-developers-qt
 
git branch -t 4.8-mumble origin/4.8-mumble
 
git checkout 4.8-mumble
 
  
Then build it:
+
  cd mumble
 
+
  qmake -spec unsupported/macx-clang -recursive CONFIG+="release static no-client no-dbus"
unset CFLAGS
 
unset CXXFLAGS
 
  unset LDFLAGS
 
  export CFLAGS="-I$MUMBLE_PREFIX/include"
 
export CXXFLAGS="-I$MUMBLE_PREFIX/include"
 
OPENSSL_LIBS="-L$MUMBLE_PREFIX/lib -lssl -lcrypto" ./configure -no-pch -fast -nomake examples -nomake demos -nomake docs -debug-and-release -arch x86_64 -cocoa -qt-sql-sqlite -no-dbus -no-webkit -no-phonon -no-phonon-backend -no-qt3support -openssl-linked -mysql_config no -sdk $OSX_SDK -prefix $MUMBLE_PREFIX/Qt4.8 -opensource -confirm-license
 
 
  make
 
  make
make install
 
export CFLAGS=$OSX_CFLAGS
 
export CXXFLAGS=$OSX_CFLAGS
 
export LDFLAGS=$OSX_LDFLAGS
 
  
=== Installing Qt icns icon engine ===
+
If everything went well, you should now have a murmur binary in the release directory of the root of the source tree.
  
Grab it:
+
=== Distributing Mumble ===
git clone git://github.com/mkrautz/qt-icns-iconengine.git
 
  
Build and install it
+
If you wish to create a proper redistributable Mumble application bundle, please refer to the osxdist.py script in
cd qt-icns-iconengine
+
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!
qmake -spec unsupported/macx-clang CONFIG+='release'
 
make
 
cp libqicnsicon.dylib $MUMBLE_PREFIX/Qt4.8/plugins/iconengines/libqicnsicon.dylib
 
make distclean
 
qmake -spec unsupported/macx-clang CONFIG+='debug'
 
make
 
cp libqicnsicon.dylib $MUMBLE_PREFIX/Qt4.8/plugins/iconengines/libqicnsicon_debug.dylib
 
  
=== Installing Boost ===
+
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 the latest version of Boost from http://www.boost.org/, as of current writing, that is 1.48.0.
 
 
 
Apply the patch available at https://dl.dropbox.com/s/24yu9j77qpy0x5u/nilfix.patch
 
 
 
It is advisible to unpack Boost to $MUMBLE_PREFIX/include/, so the Boost headers will be available in $MUMBLE_PREFIX/include/boost-1_48_0/, since Mumble will look for the headers in this place by default.
 
 
 
=== Building libogg ===
 
 
 
Grab the latest version (current 1.3.0). Build:
 
 
 
./configure --disable-dependency-tracking --prefix=$MUMBLE_PREFIX
 
make
 
sudo make install
 
 
 
=== Building libvorbis ===
 
 
 
Grab the latest version (current 1.3.2). Build:
 
 
 
./configure --disable-dependency-tracking --prefix=$MUMBLE_PREFIX
 
make
 
sudo make install
 
 
 
=== Building libFLAC ===
 
 
 
Grab the latest version (currently 1.2.1). Build (x86-64):
 
 
 
./configure --build=x86_64-apple-darwin$(uname -r) --prefix=$MUMBLE_PREFIX
 
make
 
sudo make install
 
 
 
=== Building libsndfile ===
 
 
 
Grab the latest version (currently 1.0.25).
 
 
 
Patch with: https://dl.dropbox.com/s/a4avgl8itvkh6yq/libsndfile-1.0.25-carbon-header.patch
 
 
 
Build:
 
 
 
./configure --prefix=$MUMBLE_PREFIX --disable-sqlite
 
make
 
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.4.1.
 
Direct link: http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.bz2
 
 
 
Build and install it:
 
 
 
./configure --disable-dependency-tracking --prefix=$MUMBLE_PREFIX
 
make
 
make install
 
 
 
=== Logitech LCD SDK (optional) ===
 
 
 
Grab it, install it. Build it:
 
 
 
sudo mkdir -p $MUMBLE_PREFIX/lglcd-sdk/
 
sudo tar -zxvf /Applications/Logitech/GamePanel\ Software/LCD\ Manager/LCDSDK/LCDSDK.tgz -C $MUMBLE_PREFIX/lglcd-sdk/
 
sudo chmod -vR +r $MUMBLE_PREFIX/lglcd-sdk/
 
 
 
== Building Mumble ==
 
 
 
Fetch the Mumble source from Git:
 
 
 
git clone git://mumble.git.sourceforge.net/gitroot/mumble mumble.git
 
cd mumble.git
 
git submodule init
 
git submodule update
 
 
 
To build the client, execute:
 
  
qmake main.pro CONFIG+='release no-server'
+
If you only have a Mumble.app, and have not built Murmur, you should also pass the
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.
+
--no-server
  
== Distributing Mumble ==
+
parameter to the osxdist.py script. This will not attempt to package Murmur-specific files in the generated .dmg.
  
If you wish to create a proper redistributable Mumble application bundle, please refer to the osxdist.py script in
+
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.
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!
+
To build with code signing enabled, use the following three parameters to the osxdist.py script:
 
 
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')