Difference between revisions of "BuildingWindows"

From Mumble Wiki
Jump to: navigation, search
(Compile Mumble and Murmur)
(Build using MXE on Debian and derivates)
 
(67 intermediate revisions by 10 users not shown)
Line 1: Line 1:
 
{{Building}}
 
{{Building}}
  
= Introduction =
+
= Commandline instructions =
 +
Whenever something appears
 +
like this
 +
you're supposed to enter it in that command shell (or copy it from this webpage and right click in the command window and select ''Paste'').
  
Mumble has quite a few dependencies for building on Windows, and as the feature set grows, so does the list of dependencies. This page will try to detail the steps required to set up a Win32 build environment suitable for compiling the current code found in our repository. Be aware that these steps might not work for older revisions of Mumble as dependencies might have been removed or updated to an incompatible version in the meantime. '''Note that you must follow each step in order, or you will have problems.'''
+
Note that ''each line'' is a separate command. So, if you wanted to do the following,
 +
cd mumble
 +
nmake
 +
you would type "cd mumble" in your command prompt, and press enter, and then you would type "nmake", and press enter.
  
The paths used here equal the defaults assumed in the Mumble build files. You are free to change them, but you might need to [[#Custom Dependency Paths|adjust the build files]] themselves. If you find any problems or incorrect steps in this article please either correct them or contact us and we will try our best to resolve the issue.
+
Ok. So you're ready to start working.
  
Also note, that if you are submitting a bug report for a self-built executable, we expect you to either
+
= Build using MSVC on Windows =
* Follow these instructions to the letter
 
or
 
* Report any deviations from these instructions
 
  
Deviations means anything, from "I installed to the D: drive" to "I changed the gcc build options for Qt" or "I used another version of Speex".
+
== Introduction ==
  
'''A note to those following this guide''': When you extract compressed files, sometimes they will have container folders and sometimes they will not. Please ensure (for example) that when you extract a compressed file like protobuf-2.2.0.zip, you see "bin" "include" and such folders as that directly inside of the folder named "protobuf-2.2.0". If you just see one folder and no other files, then you need to open that folder, and use the folder that is inside of it.
+
Mumble has quite a few dependencies for building on Windows, and as the feature set grows, so does the list of dependencies. Therefore we have built some automated scripts to create a sane build environment for Mumble. To make this build environment as similar as possible across all of Mumble's supported Platforms, the Windows build is strongly dependent on [https://www.cygwin.com/ Cygwin].
  
'''Also remember that this guide may not be updated every single time a build dependency gets updated. It's up to you to make sure that you have the latest versions on the various dependencies; it would also be appreciated if you would update this wiki to reflect any changes you run into.'''
+
The [https://github.com/mumble-voip/mumble-releng mumble-releng] Github repository has an [https://github.com/mumble-voip/mumble-releng/blob/master/buildenv/1.3.x/win32-static/README up-to-date README] on how to create the build environment!
 
+
{{Notice|message=
= Software which you will need =
+
The most up-to-date information on how to create a Mumble build environment are always to be found in this README file!
[http://go.microsoft.com/?linkid=9709949 Visual Studio 2010 Express], [http://code.google.com/p/msysgit/downloads/list Git for Windows], [http://code.google.com/p/tortoisegit/downloads/list TortoiseGIT], [http://www.activestate.com/activeperl/downloads ActivePerl], [http://www.nasm.us/ NASM], [http://notepad-plus-plus.org/download/ Notepad++], [http://7-zip.org/download.html 7-Zip], [https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20737 Bonjur] ([http://syf.z.hlds.pl/mumble/zaleznosci/Bonjour_SDK_WIN32.7z Mirror]), [http://syf.z.hlds.pl/mumble/zaleznosci/G15SDK.7z G15SDK], [http://www.mega-nerd.com/libsndfile/#Download libsndfile ], [http://www.microsoft.com/downloads/dlx/en-us/listdetailsview.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b Microsoft Windows SDK], [http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=6812 Microsoft DirectX SDK], [http://dev.mysql.com/downloads/mysql/ MySQL], [http://code.google.com/p/protobuf/downloads/list Protocol Buffers], ([http://sites.google.com/site/dmoulding/vld Visual Leak Detector]), [http://www.zeroc.com/download.html ZeroC Ice], [http://www.boost.org/users/download/ Boost], [http://www.openssl.org/source/ OpenSSL], [http://www.zlib.net/ zlib]
 
 
 
'''Dependency-Tree:'''
 
 
 
Mumble <- boost
 
        <- protobuf
 
        <- openssl  <- zlib
 
                    <- perl
 
        <- libsndfile
 
        //optional:
 
        <- ice
 
        <- (vld)
 
        <- bonjour
 
        <- asio
 
        <- g15sdk
 
        <- mysql
 
 
 
= Preparations =
 
 
 
== Tools Used in Compiling ==
 
=== Visual Studio ===
 
 
 
You'll need Visual Studio 2010 (or Visual C++ Express Edition) with SP1 or later.
 
 
 
Visual Studio 2010 trials: http://www.microsoft.com/visualstudio/en-us/try
 
 
 
Visual C++ 2010 Express Edition: http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express
 
 
 
=== Git ===
 
 
 
Download the most recent Git from http://code.google.com/p/msysgit/downloads/list and install it. Make sure you select "Run Git from the Windows Command Prompt."
 
 
 
'''After you install Git, start a command prompt and run'''
 
git config --global core.autocrlf true
 
 
 
{{Elaboration
 
|message=This will ensure line endings of text files you commit will be converted to LF line-endings ([http://kernel.org/pub/software/scm/git/docs/gitattributes.html#_end_of_line_conversion see]). The Mumble repository uses LF line endings only! This setting will also make Git convert LF to the system native line-endings for your working directory.
 
 
}}
 
}}
 
+
{{Elaboration|message=
=== TortoiseGit ===
+
There is an older deprecated version of this article at [[BuildingWindows (deprecated)]] showing how to build Mumble manually with QT4 which is far more complex.
 
 
[http://code.google.com/p/tortoisegit/downloads/list TortoiseGit] is a GUI frontend for Git. You can install this along with the one above for realtime information about changes to the Git code.
 
 
 
=== ActivePerl and NASM ===
 
 
 
Download and install ActivePerl from here: http://www.activestate.com/activeperl/<br>
 
 
 
Download NASM from http://www.nasm.us/ and install to "C:\dev\nasm".
 
 
 
=== 7-Zip and Notepad++ ===
 
 
 
Get 7-Zip [http://7-zip.org/ here]. After you install it, start the 7-Zip File Manager, go to Tools -> Options, and select the file associations you want. We recommend selecting .zip and .7z file extensions.
 
 
 
[http://notepad-plus-plus.org/download/ Notepad++]. After you install Notepad++, start it, go to Preferences -> New Document/Default Directory, and check "Unix" in the Format box.
 
 
 
== Libraries and Depedencies ==
 
 
 
=== Bonjour ===
 
Download the Bonjour SDK from [http://developer.apple.com/opensource/ Apple site] ''(Apple account is required)'' and install it to its default install location, or download it from [http://syf.z.hlds.pl/mumble/zaleznosci/Bonjour_SDK_WIN32.7z here.]
 
 
 
{{Notice|
 
message=Bonjour can be disabled by passing ''CONFIG+=no-bonjour'' to qmake. Compiling without Bonjour support means that you do not need the SDK at all.
 
 
}}
 
}}
  
=== G15SDK ===
+
== Software you will need ==
Download the G15 software from here: http://www.logitech.com/en-us/434/3498?section=downloads&WT.ac=sc|downloads||dd and install it, or download [http://syf.z.hlds.pl/mumble/zaleznosci/G15SDK.7z this].
+
{{Notice|message=
 
+
We currently depend on Visual Studio to be in their default locations, and the Windows 7 SDK to be in ''C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A'' (rather than the default ''C:\Program Files\…'').
Now go to ''C:\Program Files\Logitech Gaming Software\LCDSDK'' and extract "LCDSDK_3.06.109.zip". Take the folder that has been extracted and rename it to ''G15SDK''. Put this folder into ''c:\dev''.
 
 
 
{{Notice
 
|message=Support for G15 Displays can be disabled by passing ''CONFIG+=no-g15'' to qmake. The G15 software is not necessary if you're compiling without G15 support.
 
 
}}
 
}}
  
=== libsndfile ===
+
* ''Visual Studio Community 2015 Update 3'': You need MSVC 2015. During installation you can deselect the Windows SDKs, because we are going to install the up-to-date one, listed below.
Download the Win32 installer from http://www.mega-nerd.com/libsndfile/#Download and install it to its default install location.
+
* [https://www.microsoft.com/en-us/download/details.aspx?id=8279 Windows SDK 7] for XP/x86 Overlay (You may have to [http://stackoverflow.com/questions/19366006/error-when-installing-windows-sdk-7-1#23032807 temporarily remove ''Microsoft Visual C++ 2010 * Redistributable'' for the installer to work].)
 +
* [https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk Windows SDK] (If you are on Windows 7, don't select "Windows Performance Toolkit", because it isn't compatible)
 +
* [https://msysgit.github.io/ Git]: You can use any version of Git, it only has to be in your PATH variable.
  
{{Notice
+
== Creating the build environment ==
|message=This dependency is not needed for the server.
+
First you need to clone the mumble-releng repository into a directory in which your Windows user has write access. ''cd'' into that directory, then
}}
+
git clone https://github.com/mumble-voip/mumble-releng.git mumble-releng
 
 
=== Microsoft Windows SDK ===
 
 
 
At the time of writing this, the latest version is the "Microsoft Windows SDK for Windows 7 and .NET Framework 4". Download it from http://msdn.microsoft.com/en-us/windows/bb980924.aspx .
 
 
 
Install it to a location of your choice. When presented with "Installation Options" in the install process, make sure that all features are checked apart from "Samples" which is optional.
 
  
After installing the Windows SDK you must make sure Visual Studio uses it. Start the WindowsSdkVer.exe utility in the SDK's setup folder and change the used version to 7.X. If you get an error that says you don't have VS2005 or VS2008 installed see [http://blogs.msdn.com/b/windowssdk/archive/2009/08/21/windows-sdk-configuration-tool-may-report-an-error-when-os-display-format-is-not-english.aspx on how to fix it].
+
In the terminal window, change to the directory the scripts for Windows (32-bit) and static build reside in.
 +
cd mumble-releng/buildenv/1.3.x/win32-static
 +
and execute
 +
setup.cmd
 +
This should install a Mumble build environment in your ''C:\MumbleBuild'' directory named with a date and shortened commit hash like ''win32-static-1.3.x-2015-05-25-1234ab7''.
  
=== Microsoft DirectX SDK ===
+
If everything went right Windows Explorer should open up the new build environment directory as named above.
  
Go to http://msdn.microsoft.com/directx/sdk/ and download the latest SDK. Install it to a location of your choice.
+
== Build Mumble's dependencies ==
 
+
To start building Mumble's dependencies, double-click the "MumbleBuild - cygwin" shortcut. This will open a cygwin terminal. To change the current directory to the ''build environment's local clone'' of the mumble-releng repository type:
=== MySQL ===
+
cd mumble-releng/buildenv/1.3.x/win32-static
 
 
Download the latest release of MySQL Server (x86, 32-bit). It can be found here: http://dev.mysql.com/downloads/mysql/ (select "Without installer (unzip in C:\)"). Unzip it to ''c:\dev\MySQL''.
 
  
 
{{Notice|message=
 
{{Notice|message=
Compiling Qt (and thus Mumble) without MySQL support means you don’t need MySQL at all.
+
This mumble-releng directory is a copy. Should you want to update your build environment in the future, proceed from the original.
 
}}
 
}}
  
=== Protocol Buffers ===
+
To download and build all dependencies (this will take a long time!), execute
 +
./build-all.bash
  
* Download [http://code.google.com/p/protobuf/ Protocol Buffers from Google] (''protobuf-x.y.z.zip'')
+
Once all dependencies are built, you will be returned to your Cygwin shell. Make sure it did not stop because of an error.
* unpack it to ''c:\dev\protobuf-x.y.z''.
 
  
{{Notice|message=
+
The built dependencies are located in the corresponding ''.build'' folder.
You must have Visual Studio (see above) installed.
 
}}
 
* Open protobuf-x.y.z\vsprojects\protobuf.sln
 
* Find a dropdown box at the top right of VS2010 that says "Debug" on it. Change that to "Release"
 
* Right click the "Solution 'protobuf' (9 projects)" at the top left of VS2010 and select "Batch Build..." Click "Select All," then click "Build".
 
  
Now run the file ''C:\dev\protobuf-x.y.z\vsprojects\extract_includes.bat''.
+
== Building Mumble ==
 +
To build Mumble itself using your newly-built build environment, you should use the "MumbleBuild - cmd" shortcut to launch a Windows command prompt.
  
 +
Next, make a checkout of the Mumble source tree and enter the root of the source tree with
 +
git clone --recursive https://github.com/mumble-voip/mumble.git mumble
 +
cd mumble
 +
to generate Makefiles for use with the build environment, run
 +
qmake -recursive main.pro CONFIG+="release static no-elevation no-g15 no-asio" CONFIG-=sse2
 
{{Notice|message=
 
{{Notice|message=
You'll get errors, but for our purposes, you can ignore them
+
This build environment does not install the libraries and headers needed to build Mumble with G15 LCD or ASIO audio support. If you want to build Mumble with one of them you need to install them to the build environment on your own. In this case remove ''no-g15'' or rather ''no-asio'' accordingly.
 
}}
 
}}
  
{{Notice|message=
+
After all this preparation start the actual Mumble compilation with
The release version (''x.y.z'') in prep.bat (''introduced later'') has to match the version in the directory name or you (/the compilation process) won't be able to call ''protoc.exe''.
+
nmake
}}
+
You should end up with a mumble.exe and a murmur.exe binary (and a whole collection of .DLL files to go along with the two) in the "release" directory in the root of the Mumble source tree.
 +
 
 +
If you want to distribute your own mumble.exe you can either create an installer (see below) or collect mumble.exe and the needed .DLL files yourself.
  
=== Visual Leak Detector (optional) ===
+
== (Optional) Visual Leak Detector ==
  
 
{{Notice|message=
 
{{Notice|message=
Line 155: Line 96:
 
}}
 
}}
  
=== ZeroC Ice ===
+
== (Optional) Custom Dependency Paths ==
 
 
Download the latest version of ZeroC Ice from http://www.zeroc.com/download.html. Install to "C:\dev\Ice".
 
 
 
{{Notice|message=
 
Ice can be disabled by passing ''CONFIG+=no-ice'' to qmake. Bear in mind that the [[Ice]] RPC Interface is the recommended way to control the server. This dependency is not needed for building the client.
 
}}
 
 
 
= Create Prep =
 
 
 
Create ''C:\dev'', and inside that directory create a file ''prep.cmd'' containing:
 
@echo off
 
SET DIR=c:\dev
 
SET VSVER=10.0
 
SET LIB=
 
SET QT_DIR=%DIR%\QtMumble
 
SET MUMBLE_DIR=%DIR%\mumble
 
SET VLD_DIR=%DIR%\vld
 
SET MYSQL_DIR=%DIR%\mysql
 
SET NASM_DIR=%DIR%\nasm
 
SET ICE_DIR=%DIR%\Ice
 
 
CALL "%DXSDK_DIR%\Utilities\bin\dx_setenv.cmd" x86
 
 
IF DEFINED %PROGRAMFILES(X86)% (
 
  GOTO amd64
 
) ELSE (
 
  GOTO x86
 
)
 
 
:amd64
 
SET PROGPATH=%PROGRAMFILES(X86)%
 
GOTO Common
 
 
:x86
 
SET PROGPATH=%PROGRAMFILES%
 
GOTO Common
 
 
:Common
 
CALL "%PROGPATH%\Microsoft Visual Studio %VSVER%\VC\vcvarsall.bat" x86
 
SET PATH=%QT_DIR%\bin;%DIR%\OpenSSL\bin;%PROGPATH%\Mega-Nerd\libsndfile\bin;%MYSQL_DIR%\lib;%ICE_DIR%\bin\vc100;%DIR%\protobuf-2.4.0a\vsprojects\Release;%NASM_DIR%;%VLD_DIR%\bin;%PATH%
 
TITLE Mumble Development Environment
 
 
 
Now create a shortcut to ''C:\Windows\System32\cmd.exe /K "..\prep.cmd"'' on your desktop. Edit its properties to make it Start in ''C:\dev\mumble''.
 
You can also use an advanced script [[BuildingWindows/mde.cmd]] ([http://luki.net.pl/dl/mumble/mde.cmd download])
 
 
 
= Custom Dependency Paths =
 
  
The build files were modified to support custom dependency paths a while ago. This is for the people who have '''the dependencies installed in some other place than the C:\dev directory structure'''. To specify the custom paths you need to '''create a ''winpaths_custom.pri'' file''' to the root of your Mumble project. In this file you can override all paths found in ''winpaths_default.pri''. For example:
+
The build files were modified to support custom dependency paths a while ago. This is for the people who have '''the dependencies installed in some other place than the autogenerated directory structure'''. To specify the custom paths you need to '''create a ''winpaths_custom.pri'' file''' to the root of your Mumble project. In this file you can override all paths found in ''winpaths_default.pri''. For example:
  
   OPENSSL_PATH = /dev/MyOpenSSLIsSomewhereElse
+
   OPENSSL_PATH = C:\\dev\MyOpenSSLIsSomewhereElse
 
   ICE_PATH = C:\\Program Files (x86)\\ZeroC\\Ice-3.4.1
 
   ICE_PATH = C:\\Program Files (x86)\\ZeroC\\Ice-3.4.1
  
 
Would make the build process search its OpenSSL and Ice dependencies in the specified folders and use defaults for everything else. Note that you should only override the variables for dependencies you actually installed in non-default locations to prevent clashes with possible future updates.
 
Would make the build process search its OpenSSL and Ice dependencies in the specified folders and use defaults for everything else. Note that you should only override the variables for dependencies you actually installed in non-default locations to prevent clashes with possible future updates.
  
'''Note: If you choose to use the custom .pri file, delete the following lines from ''winpaths_custom.pri'':
+
 
 +
'''Note:''' If you copied ''winpaths_default.pri'' to create your ''winpaths_custom.pri'' make sure to delete the following lines from your ''winpaths_custom.pri'' file:
  
 
  # Include custom file if it exists
 
  # Include custom file if it exists
 
  exists(winpaths_custom.pri) {
 
  exists(winpaths_custom.pri) {
 
  include(winpaths_custom.pri)
 
  include(winpaths_custom.pri)
  }'''
+
  }
 
 
= Commandline Instructions =
 
Whenever something appears
 
like this
 
you're supposed to enter it in that command shell (or copy it from this webpage and right click in the command window and select ''Paste'').
 
 
 
Note that ''each line'' is a separate command. So, if you wanted to do the following,
 
cd mumble
 
prep
 
you would type "cd mumble" in your command prompt, and press enter, and then you would type "prep", and press enter.
 
 
 
Ok. So you're ready to start compiling.
 
 
 
Start a new command shell (run ''cmd.exe'')
 
cd \dev
 
prep
 
 
 
After you run prep make sure a message similar to "Setting environment for using Microsoft Visual Studio 2010 x86 tools" appears.
 
 
 
{{Notice|message=
 
If you set up a shortcut like described in the section above you can open it and it will run prep automatically.
 
}}
 
  
 +
== (Optional) Build a Mumble installer package ==
 +
If you want to create an installable .msi package from your self-compiled Mumble some additional steps are needed.
  
'''''When you later want to compile a dependency or program, always remember to call prep.bat first to set paths correctly.'''''
+
Download and install the latest WIX stable Version (currently 3.8) from [http://wixtoolset.org/releases/ here].
  
= Compile Mumble Dependencies =
+
Set the following environment variables as needed (see defaults in installer/Settings.wxi):
 +
  MumbleSourceDir  default: \dev\mumble
 +
  MumbleQtDir  default: \dev\QtMumble
 +
  MumbleDebugToolsDir  default: C:\Program Files (x86)\Debugging Tools for Windows (x86)
 +
  MumbleSndFileDir  default: \Program Files (x86)\Mega-Nerd\libsndfile\bin
 +
    Define MumbleNoSndFile to exclude  libsndfile
 +
  MumbleMySQLDir  default: \dev\MySQL
 +
    Define MumbleNoMySQL to exclude  MySQL
 +
  MumbleIceDir  default: \Program Files (x86)\ZeroC\Ice-3.4.2\bin\vc100
 +
    Define MumbleNoIce to exclude Ice
 +
  MumbleOpenSslDir  default: \dev\openssl
 +
  MumbleZlibDir  default: \dev\zlib
 +
  MumbleMergeModuleDir  default: C:\Program Files (x86)\Common Files\Merge Modules
 +
  Define MumbleSSE to include SSE
 +
  Define MumbleNoSSE2 to exclude SSE2
 +
  Define MumbleNoG15 to exclude G15
  
=== Boost ===
+
Open installer/MumbleInstall.sln, switch to release and build the installer.
  
Download the most recent Windows version of the [http://www.boost.org/ Boost C++ libraries] and unzip it to ''c:\dev''
+
Once this completed successfully run the ''build_installer.pl'' script to include all translations into your installer.
  
cd \dev
+
You should now have a working .msi installer.
prep
 
cd boost_*
 
bootstrap.bat
 
b2 --toolset=msvc-10.0 --prefix=C:\dev\Boost install
 
  
This might take a while (like hour), but when done you'll have Boost installed.
+
= Build using MXE on Debian and derivates =
  
 
{{Notice|message=
 
{{Notice|message=
If you get the warning, that some targets were skipped or failed, it can be ignored for our purposes.
+
Mumble supports MinGW since [https://github.com/mumble-voip/mumble/commit/10079ed9867308aad098231f86e260bd831b0ac6 commit 10079ed9867308aad098231f86e260bd831b0ac6] (March 2017, first stable version 1.3.0).
 
}}
 
}}
  
{{Notice|message=
+
== Introduction ==
None of the other build dependencies do themselves depend on boost (meaning: only Mumble does), so if you want you can just continue with the other dependencies in a new command shell (but remember to call ''prep.bat'').
 
}}
 
  
{{Notice|message=
+
It is possible to cross-compile Mumble using a MinGW toolchain. If you're more comfortable with a Unix-like system, you will probably prefer this method. The easiest way to cross-compile Mumble is by using MXE, which provides all the required dependencies.
Once all is done, you can safely delete the boost_* directory.
 
}}
 
 
 
=== OpenSSL ===
 
 
 
Download [http://www.zlib.net/ zlib] source and unpack it to ''C:\dev'' and rename the ''zlib-x.y.z'' folder to ''zlib''
 
 
 
[http://www.openssl.org/source/ Download the OpenSSL source] named "openssl-1.0.0d.tar.gz" and unpack it to ''c:\dev'' (it will create a directory called openssl-x.y.z)
 
  
cd c:\dev\openssl<press tab>
+
Features currently not available with MinGW:
perl Configure VC-WIN32 --prefix=c:\dev\OpenSSL zlib-dynamic --with-zlib-include=c:\\dev\\zlib
+
* Overlay
ms\do_nasm
+
* Logitech G15 LCD
nmake -f ms\ntdll.mak
+
* ZeroC Ice
nmake -f ms\ntdll.mak test
+
* Bonjour
 
 
Make sure all the tests passed, then run:
 
nmake -f ms\ntdll.mak install
 
  
 
{{Notice|message=
 
{{Notice|message=
You can remove the ''c:\dev\openssl-x.y.z'' folder after this.
+
In the guide there are some commands with ''${ARCH}'' in them.
 +
You need to replace it with the desired architecture, which can be ''x86-64'' (64 bit) or ''i686'' (32 bit).
 
}}
 
}}
  
=== Qt ===
+
== Installing the required MXE packages ==
  
Checkout the Mumble Qt git repo to C:\dev\QtMumble:
+
Add MXE's repository to your system's sources:
cd c:\dev
 
git clone git://gitorious.org/+mumble-developers/qt/mumble-developers-qt.git QtMumble
 
  
Switch to the 4.7-mumble branch:
+
'''Debian'''
 +
echo "deb https://dl.mumble.info/mirror/pkg.mxe.cc/repos/apt stretch main" | sudo tee /etc/apt/sources.list.d/mxe.list
 +
'''Ubuntu'''
 +
echo "deb https://dl.mumble.info/mirror/pkg.mxe.cc/repos/apt xenial main" | sudo tee /etc/apt/sources.list.d/mxe.list
  
cd QtMumble
+
Add the repository's key:
  git checkout --track -b 4.7-mumble origin/4.7-mumble
+
  sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 86B72ED9
  
{{Notice|message=
+
Update packages index:
For the latest Mumble Git, change the above "4.7" to the latest version listed [http://gitorious.org/+mumble-developers/qt/mumble-developers-qt here].'''
+
sudo apt update
}}
 
  
Now do
+
Install the required packages
  configure -debug-and-release -qt-sql-sqlite -qt-sql-mysql -no-qt3support -no-exceptions -qt-zlib -qt-libpng -qt-libjpeg -openssl -I c:\dev\OpenSSL\include -L c:\dev\OpenSSL\lib -I c:\dev\MySQL\include -L c:\dev\MySQL\lib -platform win32-msvc2010 -no-dbus -nomake demos -nomake examples -no-webkit -ltcg -mp
+
  sudo apt install \
nmake
+
mxe-${ARCH}-w64-mingw32.static-qtbase \
 +
mxe-${ARCH}-w64-mingw32.static-qtsvg \
 +
mxe-${ARCH}-w64-mingw32.static-qttools \
 +
mxe-${ARCH}-w64-mingw32.static-qttranslations \
 +
mxe-${ARCH}-w64-mingw32.static-boost \
 +
mxe-${ARCH}-w64-mingw32.static-protobuf \
 +
mxe-${ARCH}-w64-mingw32.static-sqlite \
 +
mxe-${ARCH}-w64-mingw32.static-flac \
 +
  mxe-${ARCH}-w64-mingw32.static-ogg \
 +
mxe-${ARCH}-w64-mingw32.static-vorbis \
 +
mxe-${ARCH}-w64-mingw32.static-libsndfile
  
{{Notice|message=
+
== Preparing the environment ==
The directory syntax  for the ''configure'' parameter listed above is '''case''' sensitive. ''-L c:\dev\mysql\lib'' is different from ''-L c:\dev\'''MySQL'''\lib''
 
}}
 
  
{{Notice|message=
+
Clone Mumble's Git repository
Compiling Qt will take a while. So if you want to compile Mumble without MySQL support, leave the ''-qt-sql-mysql'' parameter out on configure.
+
git clone https://github.com/mumble-voip/mumble.git
}}
+
cd mumble
{{Notice|message=
 
The [http://msdn.microsoft.com/en-us/library/xbf3tbeh%28v=vs.80%29.aspx -ltcg] and [http://msdn.microsoft.com/en-us/library/bb385193.aspx -mp (''multi-process compilation'')] parameters being passed are optimizations that should also speed up your compilation process.
 
}}
 
 
 
= Download, Compile and Run Mumble =
 
 
 
=== Download Mumble and Submodules ===
 
  
To clone the repositories you must open [[#Create Prep|Mumble Development Environment]] console and type:
+
Get the ASIO SDK
  git clone git://github.com/mumble-voip/mumble.git mumble && cd mumble && git submodule init && git submodule update
+
  wget https://www.steinberg.net/sdk_downloads/asiosdk2.3.zip -P /tmp/
 
+
unzip /tmp/asiosdk2.3.zip -d /tmp/
=== Compile Mumble and Murmur ===
+
  mv /tmp/ASIOSDK2.3 3rdparty/asio
 
 
Once all of the above is done we can get to compiling Mumble itself.  
 
 
 
If you want to have ASIO support you have to install an additional, proprietary, ASIO SDK.
 
 
 
There are three dependencies that most people who make their own compiles will not need:
 
# g15
 
# asio
 
# bonjour
 
 
 
The bonjour dependency is useful if you want to browse servers across a local network, but you can disable it if this feature is not needed.  
 
 
 
To compile Mumble without ASIO, G15, Bonjour, and with disabled privilege elevation (would require a valid code signing certificate) replace the qmake command below with this one:
 
 
 
  qmake CONFIG-=sse2 CONFIG+=no-asio CONFIG+=no-g15 CONFIG+=no-bonjour CONFIG+=no-elevation -recursive
 
 
 
{{Notice|message=
 
The compile ''will fail'' if you leave out these build flags and do not have the SDK(s) required.
 
}}
 
 
 
If you get errors about qt_*.ts files, then go to ''C:\dev\QtMumble\translations'' and copy and rename any qt_*.qm's to qt_*.ts.
 
 
 
To compile Mumble:
 
 
 
cd c:\dev\mumble
 
prep
 
qmake
 
nmake clean
 
nmake
 
  
Note that this builds the debug versions, which is what we strongly recommend to use while developing. If you want to send the binary to someone else, use
+
Export environment variable to tell QMake where MXE's protobuf compiler is
  nmake release
+
  export MUMBLE_PROTOC=/usr/lib/mxe/usr/x86_64-pc-linux-gnu/bin/protoc
instead of the  last ''nmake'' command listed above. This will result in a much smaller binary with fewer dependencies.
 
  
=== Run Mumble and Murmur ===
+
Add MXE's directory to PATH
 +
PATH=$PATH:/usr/lib/mxe/usr/bin
  
Once compiled, you can go into ''c:\dev\mumble\release'' or (''\debug'' if you compiled the debug version) and can execute mumble.exe or murmur.exe. Before executing Mumble or Murmur you need to open a command prompt and do
+
== Build ==
cd \dev
 
prep
 
cd mumble\debug (or release)
 
Then execute either Mumble or Murmur ''from the command prompt'' with
 
mumble.exe
 
or
 
murmur.exe
 
  
If you want to run the release build directly from Windows Explorer, you will need to collect all the library files into one folder, along with the executables you built when you compiled Mumble. Have a look at the files the official Mumble installer creates in ''Program Files\Mumble''.
+
Run QMake to process the project(s) files
 +
${ARCH}-w64-mingw32.static-qmake-qt5 -recursive CONFIG+="release g15-emulator no-overlay no-bonjour no-elevation no-ice"
  
 +
Start the build
 +
make
  
 
[[Category:Development]]
 
[[Category:Development]]

Latest revision as of 21:38, 12 September 2019

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


Commandline instructions

Whenever something appears

like this

you're supposed to enter it in that command shell (or copy it from this webpage and right click in the command window and select Paste).

Note that each line is a separate command. So, if you wanted to do the following,

cd mumble
nmake

you would type "cd mumble" in your command prompt, and press enter, and then you would type "nmake", and press enter.

Ok. So you're ready to start working.

Build using MSVC on Windows

Introduction

Mumble has quite a few dependencies for building on Windows, and as the feature set grows, so does the list of dependencies. Therefore we have built some automated scripts to create a sane build environment for Mumble. To make this build environment as similar as possible across all of Mumble's supported Platforms, the Windows build is strongly dependent on Cygwin.

The mumble-releng Github repository has an up-to-date README on how to create the build environment!

Icons oxygen 48x48 actions view-pim-notes.png
Note:
The most up-to-date information on how to create a Mumble build environment are always to be found in this README file!
Elaboration: There is an older deprecated version of this article at BuildingWindows (deprecated) showing how to build Mumble manually with QT4 which is far more complex.


Software you will need

Icons oxygen 48x48 actions view-pim-notes.png
Note:
We currently depend on Visual Studio to be in their default locations, and the Windows 7 SDK to be in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A (rather than the default C:\Program Files\…).

Creating the build environment

First you need to clone the mumble-releng repository into a directory in which your Windows user has write access. cd into that directory, then

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

In the terminal window, change to the directory the scripts for Windows (32-bit) and static build reside in.

cd mumble-releng/buildenv/1.3.x/win32-static

and execute

setup.cmd

This should install a Mumble build environment in your C:\MumbleBuild directory named with a date and shortened commit hash like win32-static-1.3.x-2015-05-25-1234ab7.

If everything went right Windows Explorer should open up the new build environment directory as named above.

Build Mumble's dependencies

To start building Mumble's dependencies, double-click the "MumbleBuild - cygwin" shortcut. This will open a cygwin terminal. To change the current directory to the build environment's local clone of the mumble-releng repository type:

cd mumble-releng/buildenv/1.3.x/win32-static
Icons oxygen 48x48 actions view-pim-notes.png
Note:
This mumble-releng directory is a copy. Should you want to update your build environment in the future, proceed from the original.

To download and build all dependencies (this will take a long time!), execute

./build-all.bash

Once all dependencies are built, you will be returned to your Cygwin shell. Make sure it did not stop because of an error.

The built dependencies are located in the corresponding .build folder.

Building Mumble

To build Mumble itself using your newly-built build environment, you should use the "MumbleBuild - cmd" shortcut to launch a Windows command prompt.

Next, make a checkout of the Mumble source tree and enter the root of the source tree with

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

to generate Makefiles for use with the build environment, run

qmake -recursive main.pro CONFIG+="release static no-elevation no-g15 no-asio" CONFIG-=sse2
Icons oxygen 48x48 actions view-pim-notes.png
Note:
This build environment does not install the libraries and headers needed to build Mumble with G15 LCD or ASIO audio support. If you want to build Mumble with one of them you need to install them to the build environment on your own. In this case remove no-g15 or rather no-asio accordingly.

After all this preparation start the actual Mumble compilation with

nmake

You should end up with a mumble.exe and a murmur.exe binary (and a whole collection of .DLL files to go along with the two) in the "release" directory in the root of the Mumble source tree.

If you want to distribute your own mumble.exe you can either create an installer (see below) or collect mumble.exe and the needed .DLL files yourself.

(Optional) Visual Leak Detector

Icons oxygen 48x48 actions view-pim-notes.png
Note:
VLD is no longer a default requirement for a Mumble build environment. You only have to install it if you want to use it in which case you have to manually enable it with CONFIG+=vld.

Download VLD and install it to its default install location.

If you're using Visual C++ Express Edition, you will need to manually extract the files using a tool like 7-zip . Extract it to C:\dev\ and adjust the VLD_PATH to point to it.

Icons oxygen 48x48 actions view-pim-notes.png
Note:
VLD is only enabled for debug builds. If you only compile Release builds you do not need it.

(Optional) Custom Dependency Paths

The build files were modified to support custom dependency paths a while ago. This is for the people who have the dependencies installed in some other place than the autogenerated directory structure. To specify the custom paths you need to create a winpaths_custom.pri file to the root of your Mumble project. In this file you can override all paths found in winpaths_default.pri. For example:

 OPENSSL_PATH = C:\\dev\MyOpenSSLIsSomewhereElse
 ICE_PATH = C:\\Program Files (x86)\\ZeroC\\Ice-3.4.1

Would make the build process search its OpenSSL and Ice dependencies in the specified folders and use defaults for everything else. Note that you should only override the variables for dependencies you actually installed in non-default locations to prevent clashes with possible future updates.


Note: If you copied winpaths_default.pri to create your winpaths_custom.pri make sure to delete the following lines from your winpaths_custom.pri file:

# Include custom file if it exists
exists(winpaths_custom.pri) {
	include(winpaths_custom.pri)
}

(Optional) Build a Mumble installer package

If you want to create an installable .msi package from your self-compiled Mumble some additional steps are needed.

Download and install the latest WIX stable Version (currently 3.8) from here.

Set the following environment variables as needed (see defaults in installer/Settings.wxi):

 MumbleSourceDir  default: \dev\mumble
 MumbleQtDir  default: \dev\QtMumble
 MumbleDebugToolsDir  default: C:\Program Files (x86)\Debugging Tools for Windows (x86)
 MumbleSndFileDir  default: \Program Files (x86)\Mega-Nerd\libsndfile\bin
   Define MumbleNoSndFile to exclude  libsndfile
 MumbleMySQLDir  default: \dev\MySQL
   Define MumbleNoMySQL to exclude  MySQL
 MumbleIceDir  default: \Program Files (x86)\ZeroC\Ice-3.4.2\bin\vc100
   Define MumbleNoIce to exclude Ice
 MumbleOpenSslDir  default: \dev\openssl
 MumbleZlibDir  default: \dev\zlib
 MumbleMergeModuleDir  default: C:\Program Files (x86)\Common Files\Merge Modules
 Define MumbleSSE to include SSE
 Define MumbleNoSSE2 to exclude SSE2
 Define MumbleNoG15 to exclude G15

Open installer/MumbleInstall.sln, switch to release and build the installer.

Once this completed successfully run the build_installer.pl script to include all translations into your installer.

You should now have a working .msi installer.

Build using MXE on Debian and derivates

Icons oxygen 48x48 actions view-pim-notes.png
Note:
Mumble supports MinGW since commit 10079ed9867308aad098231f86e260bd831b0ac6 (March 2017, first stable version 1.3.0).

Introduction

It is possible to cross-compile Mumble using a MinGW toolchain. If you're more comfortable with a Unix-like system, you will probably prefer this method. The easiest way to cross-compile Mumble is by using MXE, which provides all the required dependencies.

Features currently not available with MinGW:

  • Overlay
  • Logitech G15 LCD
  • ZeroC Ice
  • Bonjour
Icons oxygen 48x48 actions view-pim-notes.png
Note:
In the guide there are some commands with ${ARCH} in them. You need to replace it with the desired architecture, which can be x86-64 (64 bit) or i686 (32 bit).

Installing the required MXE packages

Add MXE's repository to your system's sources:

Debian

echo "deb https://dl.mumble.info/mirror/pkg.mxe.cc/repos/apt stretch main" | sudo tee /etc/apt/sources.list.d/mxe.list

Ubuntu

echo "deb https://dl.mumble.info/mirror/pkg.mxe.cc/repos/apt xenial main" | sudo tee /etc/apt/sources.list.d/mxe.list

Add the repository's key:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 86B72ED9

Update packages index:

sudo apt update

Install the required packages

sudo apt install \
	mxe-${ARCH}-w64-mingw32.static-qtbase \
	mxe-${ARCH}-w64-mingw32.static-qtsvg \
	mxe-${ARCH}-w64-mingw32.static-qttools \
	mxe-${ARCH}-w64-mingw32.static-qttranslations \
	mxe-${ARCH}-w64-mingw32.static-boost \
	mxe-${ARCH}-w64-mingw32.static-protobuf \
	mxe-${ARCH}-w64-mingw32.static-sqlite \
	mxe-${ARCH}-w64-mingw32.static-flac \
 	mxe-${ARCH}-w64-mingw32.static-ogg \
	mxe-${ARCH}-w64-mingw32.static-vorbis \
	mxe-${ARCH}-w64-mingw32.static-libsndfile

Preparing the environment

Clone Mumble's Git repository

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

Get the ASIO SDK

wget https://www.steinberg.net/sdk_downloads/asiosdk2.3.zip -P /tmp/
unzip /tmp/asiosdk2.3.zip -d /tmp/
mv /tmp/ASIOSDK2.3 3rdparty/asio

Export environment variable to tell QMake where MXE's protobuf compiler is

export MUMBLE_PROTOC=/usr/lib/mxe/usr/x86_64-pc-linux-gnu/bin/protoc

Add MXE's directory to PATH

PATH=$PATH:/usr/lib/mxe/usr/bin

Build

Run QMake to process the project(s) files

${ARCH}-w64-mingw32.static-qmake-qt5 -recursive CONFIG+="release g15-emulator no-overlay no-bonjour no-elevation no-ice"

Start the build

make