Difference between revisions of "BuildingFreeBSD"

From Mumble Wiki
Jump to: navigation, search
m (Compatible FreeBSD Releases)
(ditch patch to compiler.pri as it's already been committed.)
 
(7 intermediate revisions by 2 users not shown)
Line 10: Line 10:
 
*FreeBSD 8.2
 
*FreeBSD 8.2
 
*FreeBSD 9.0
 
*FreeBSD 9.0
 +
*FreeBSD 9.1
 +
*FreeBSD 10.1
  
 
== Mumble Client ==
 
== Mumble Client ==
  
This is a placeholder. This guide is targeted towards Murmur from git at the moment. You should be able to install the Mumble client 1.2.3 from ports relatively pain-free:
+
This is a place holder. This guide is targeted towards Murmur from git at the moment. You should be able to install the Mumble client 1.2.8 from ports relatively pain-free:
  
 
  cd /usr/ports/audio/mumble
 
  cd /usr/ports/audio/mumble
Line 20: Line 22:
 
== Murmur from Ports ==
 
== Murmur from Ports ==
  
You can rather trivially install Murmur 1.2.3 from the ports tree:
+
You can rather trivially install Murmur 1.2.8 from the ports tree:
  
 
  cd /usr/ports/audio/murmur
 
  cd /usr/ports/audio/murmur
 
  make install clean
 
  make install clean
 
The binary packages for Murmur have been updated to 1.2.3 on 8-stable and 9-current. So far all release packages are still 1.2.2 or earlier, so build from ports on those versions.
 
  
 
== Murmur from git ==
 
== Murmur from git ==
Line 38: Line 38:
 
or for the impatient:
 
or for the impatient:
  
  pkg_add -r git
+
  pkg install git
  
 
Next, clone the entire repository:
 
Next, clone the entire repository:
Line 46: Line 46:
 
  git submodule init
 
  git submodule init
 
  git submodule update
 
  git submodule update
 +
 +
Alternatively, you can fetch a zip file of the entire repository, without the need for git, like so:
 +
 +
cd ~
 +
fetch https://github.com/mumble-voip/mumble/archive/master.zip
 +
unzip master.zip
 +
rm master.zip
 +
cd mumble-master
  
 
=== Install the dependencies ===
 
=== Install the dependencies ===
  
The following are the main dependencies required for building Murmur 1.2.x from git.
+
The following are the main dependencies required for building Murmur 1.2.x from git using Qt4.
  
 
*devel/boost (devel/boost-libs on 8.0+)
 
*devel/boost (devel/boost-libs on 8.0+)
Line 58: Line 66:
 
*devel/qt4-moc
 
*devel/qt4-moc
 
*net/qt4-network
 
*net/qt4-network
*devel/qmake4
+
*devel/qt4-qmake
 
*devel/qt4-rcc
 
*devel/qt4-rcc
 
*databases/qt4-mysql-plugin (See note below)
 
*databases/qt4-mysql-plugin (See note below)
Line 69: Line 77:
 
*net/avahi-qt4
 
*net/avahi-qt4
  
'''security/openssl port''': The port isn't required, however at the time of writing there's a rather nasty DoS in QSslSocket which is fixed by upgrading to OpenSSL 0.9.8o or 1.0.0a, neither of which are in base on any current release, but the latter of which is in security/openssl port at the time of writing. However, if you install this port, you'll need to rename /usr/lib/libssl.so to something else, because QT's runtime loader will grab the non-ports libssl and cause you all manner of grief.
+
'''security/openssl port''': The port isn't required, however at the time of writing there's a rather nasty DoS in QSslSocket which is fixed by upgrading to OpenSSL 0.9.8o or 1.0.0a, neither of which are in base on any current release, but the latter of which is in security/openssl port at the time of writing. However, if you install this port, you'll need to rename /usr/lib/libssl.so to something else, because Qt's runtime loader will grab the non-ports libssl and cause you all manner of grief.
  
 
'''databases/qt4-mysql-plugin port''': The port is only required if you wish to use the QMYSQL driver.
 
'''databases/qt4-mysql-plugin port''': The port is only required if you wish to use the QMYSQL driver.
 +
 +
=== Install the dependencies (Qt5) ===
 +
 +
I was able to build Murmur with Qt5 using the following dependencies:
 +
 +
pkg install boost-libs ice qt5-core qt5-network qt5-xml qt5-qmake qt5-sqldrivers-sqlite3 protobuf qt5-buildtools
 +
 +
The same OpenSSL caveat applies as above - with the recent changes in Murmur, it will segfault on run instead:
 +
 +
(gdb) bt
 +
#0  0x2830c0e6 in ssl_create_cipher_list () from /usr/local/lib/libssl.so.8
  
 
=== Compilation ===
 
=== Compilation ===
Line 78: Line 97:
  
 
  qmake-qt4 CONFIG+=no-client CONFIG+=no-dbus CONFIG+=no-bonjour main.pro
 
  qmake-qt4 CONFIG+=no-client CONFIG+=no-dbus CONFIG+=no-bonjour main.pro
 +
make release
 +
 +
For Qt5:
 +
 +
/usr/local/lib/qt5/bin/qmake CONFIG+=no-client CONFIG+=no-dbus CONFIG+=no-bonjour main.pro
 
  make release
 
  make release
  
Line 85: Line 109:
 
=== Run Murmur ===
 
=== Run Murmur ===
  
I actually prefer to build Murmur in a VM and send builds up to the production server. In case you're wondering, here are the run deps (without Bonjour support):
+
I actually prefer to build Murmur in a VM and send builds up to the production server. To view murmur's dynamic dependencies for your system and configuration, simply run <code>ldd `which murmurd`</code>.  In case you're wondering, here are the run deps (without Bonjour support):
  
         libprotobuf.so.3 => /usr/local/lib/libprotobuf.so.3 (0x28205000)
+
         libprotobuf.so.7 => /usr/local/lib/libprotobuf.so.7 (0x800a5e000)
         libcrypto.so.5 => /lib/libcrypto.so.5 (0x282fb000)
+
         libcrypto.so.6 => /lib/libcrypto.so.6 (0x800d84000)
         libIce.so.33 => /usr/local/lib/libIce.so.33 (0x28454000)
+
         libIce.so.34 => /usr/local/lib/libIce.so.34 (0x801122000)
         libIceUtil.so.33 => /usr/local/lib/libIceUtil.so.33 (0x286f9000)
+
         libIceUtil.so.34 => /usr/local/lib/libIceUtil.so.34 (0x80166b000)
         libQtSql.so.4 => /usr/local/lib/qt4/libQtSql.so.4 (0x28738000)
+
         libQtSql.so.4 => /usr/local/lib/qt4/libQtSql.so.4 (0x8018b9000)
         libQtXml.so.4 => /usr/local/lib/qt4/libQtXml.so.4 (0x28769000)
+
         libQtXml.so.4 => /usr/local/lib/qt4/libQtXml.so.4 (0x801b00000)
         libQtNetwork.so.4 => /usr/local/lib/qt4/libQtNetwork.so.4 (0x287a8000)
+
         libQtNetwork.so.4 => /usr/local/lib/qt4/libQtNetwork.so.4 (0x801d4e000)
         libQtCore.so.4 => /usr/local/lib/qt4/libQtCore.so.4 (0x28890000)
+
         libQtCore.so.4 => /usr/local/lib/qt4/libQtCore.so.4 (0x8020df000)
         libz.so.4 => /lib/libz.so.4 (0x28a71000)
+
         libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x802610000)
         libgthread-2.0.so.0 => /usr/local/lib/libgthread-2.0.so.0 (0x28a83000)
+
         libm.so.5 => /lib/libm.so.5 (0x80290b000)
         libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x28a88000)
+
         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x802b29000)
         libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x28b38000)
+
         libthr.so.3 => /lib/libthr.so.3 (0x802d36000)
         libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x28c2d000)
+
         libc.so.7 => /lib/libc.so.7 (0x802f58000)
         libm.so.5 => /lib/libm.so.5 (0x28d22000)
+
         libz.so.6 => /lib/libz.so.6 (0x8032a2000)
         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x28d37000)
+
         libbz2.so.4 => /usr/lib/libbz2.so.4 (0x8034b7000)
         libthr.so.3 => /lib/libthr.so.3 (0x28d42000)
+
         libgthread-2.0.so.0 => /usr/local/lib/libgthread-2.0.so.0 (0x8036c8000)
         libc.so.7 => /lib/libc.so.7 (0x28d60000)
+
         libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x8038cc000)
         libbz2.so.3 => /usr/lib/libbz2.so.3 (0x28e62000)
+
         libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x803bae000)
         libintl.so.8 => /usr/local/lib/libintl.so.8 (0x28e73000)
+
         libintl.so.9 => /usr/local/lib/libintl.so.9 (0x803eaa000)
         libpcre.so.0 => /usr/local/lib/libpcre.so.0 (0x28e7c000)
+
         libpcre.so.3 => /usr/local/lib/libpcre.so.3 (0x8040b4000)
  
 
* see [[Running Murmur]] for information on how to start the server.
 
* see [[Running Murmur]] for information on how to start the server.
Line 114: Line 138:
 
=== No SSL ciphers of at least 128 bit found ===
 
=== No SSL ciphers of at least 128 bit found ===
  
It seems to me like there's a problem with QT on FreeBSD. When you have OpenSSL from ports, and the ABI is different from the one in base (say, OpenSSL 1.0 from ports, 0.9.8 from base) QT does some weird things. It'll load half the library from ports (the part that ld(1) loads), then QT comes along and loads it's share from base. The result is lots of unexpected behavior, with "No SSL ciphers of at least 128 bit found" being the most common.
+
It seems to me like there's a problem with Qt on FreeBSD. When you have OpenSSL from ports, and the ABI is different from the one in base (say, OpenSSL 1.0 from ports, 0.9.8 from base) Qt does some weird things. It'll load half the library from ports (the part that ld(1) loads), then Qt comes along and loads it's share from base. The result is lots of unexpected behavior, with "No SSL ciphers of at least 128 bit found" being the most common.
  
The dirty fix if you have root access is simply to rename the base libssl.so to something so that QT's loader doesn't find it, and looks in /usr/local/lib instead:
+
The dirty fix if you have root access is simply to rename the base libssl.so to something so that Qt's loader doesn't find it, and looks in /usr/local/lib instead:
  
 
  # mv /usr/lib/libssl.so /usr/lib/libssl.so.old
 
  # mv /usr/lib/libssl.so /usr/lib/libssl.so.old
 +
 +
'''Note:''' On FreeBSD 10.1 with Qt5, you have to rename /usr/lib/libssl.so.7, which breaks a lot of stuff including git. :(
  
 
=== No certificates could be verified ===
 
=== No certificates could be verified ===

Latest revision as of 11:42, 5 June 2015

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


Compatible FreeBSD Releases

I can only confirm that Murmur runs on the following FreeBSD releases. However, it should build and run on others just fine. Feel free to edit this to add more versions that you've had success with.

  • FreeBSD 7.1
  • FreeBSD 7.2
  • FreeBSD 8.0
  • FreeBSD 8.1
  • FreeBSD 8.2
  • FreeBSD 9.0
  • FreeBSD 9.1
  • FreeBSD 10.1

Mumble Client

This is a place holder. This guide is targeted towards Murmur from git at the moment. You should be able to install the Mumble client 1.2.8 from ports relatively pain-free:

cd /usr/ports/audio/mumble
make install clean

Murmur from Ports

You can rather trivially install Murmur 1.2.8 from the ports tree:

cd /usr/ports/audio/murmur
make install clean

Murmur from git

Grabbing sources from git

I put this part here because I got sick of going over to the Linux page every time I build Murmur on a new machine. If you haven't already installed git:

cd /usr/ports/devel/git
make install clean

or for the impatient:

pkg install git

Next, clone the entire repository:

git clone git://github.com/mumble-voip/mumble.git mumble
cd mumble
git submodule init
git submodule update

Alternatively, you can fetch a zip file of the entire repository, without the need for git, like so:

cd ~
fetch https://github.com/mumble-voip/mumble/archive/master.zip
unzip master.zip
rm master.zip
cd mumble-master

Install the dependencies

The following are the main dependencies required for building Murmur 1.2.x from git using Qt4.

  • devel/boost (devel/boost-libs on 8.0+)
  • devel/ice
  • security/openssl (See notes below)
  • devel/protobuf
  • devel/qt4-corelib
  • devel/qt4-moc
  • net/qt4-network
  • devel/qt4-qmake
  • devel/qt4-rcc
  • databases/qt4-mysql-plugin (See note below)
  • databases/qt4-sql
  • databases/qt4-sqlite-plugin
  • textproc/qt4-xml

If you want to include Bonjour support, include these deps as well:

  • net/avahi
  • net/avahi-qt4

security/openssl port: The port isn't required, however at the time of writing there's a rather nasty DoS in QSslSocket which is fixed by upgrading to OpenSSL 0.9.8o or 1.0.0a, neither of which are in base on any current release, but the latter of which is in security/openssl port at the time of writing. However, if you install this port, you'll need to rename /usr/lib/libssl.so to something else, because Qt's runtime loader will grab the non-ports libssl and cause you all manner of grief.

databases/qt4-mysql-plugin port: The port is only required if you wish to use the QMYSQL driver.

Install the dependencies (Qt5)

I was able to build Murmur with Qt5 using the following dependencies:

pkg install boost-libs ice qt5-core qt5-network qt5-xml qt5-qmake qt5-sqldrivers-sqlite3 protobuf qt5-buildtools

The same OpenSSL caveat applies as above - with the recent changes in Murmur, it will segfault on run instead:

(gdb) bt
#0  0x2830c0e6 in ssl_create_cipher_list () from /usr/local/lib/libssl.so.8

Compilation

To build the server, Murmur:

qmake-qt4 CONFIG+=no-client CONFIG+=no-dbus CONFIG+=no-bonjour main.pro
make release

For Qt5:

/usr/local/lib/qt5/bin/qmake CONFIG+=no-client CONFIG+=no-dbus CONFIG+=no-bonjour main.pro
make release

Note, I currently don't use CONFIG+=optimize because I'm building on 7.2 and running the binary on 7.1. I have no idea what possible consequences could come of that. I would not expect anything, but I'm just being on the safe side.

Run Murmur

I actually prefer to build Murmur in a VM and send builds up to the production server. To view murmur's dynamic dependencies for your system and configuration, simply run ldd `which murmurd`. In case you're wondering, here are the run deps (without Bonjour support):

       libprotobuf.so.7 => /usr/local/lib/libprotobuf.so.7 (0x800a5e000)
       libcrypto.so.6 => /lib/libcrypto.so.6 (0x800d84000)
       libIce.so.34 => /usr/local/lib/libIce.so.34 (0x801122000)
       libIceUtil.so.34 => /usr/local/lib/libIceUtil.so.34 (0x80166b000)
       libQtSql.so.4 => /usr/local/lib/qt4/libQtSql.so.4 (0x8018b9000)
       libQtXml.so.4 => /usr/local/lib/qt4/libQtXml.so.4 (0x801b00000)
       libQtNetwork.so.4 => /usr/local/lib/qt4/libQtNetwork.so.4 (0x801d4e000)
       libQtCore.so.4 => /usr/local/lib/qt4/libQtCore.so.4 (0x8020df000)
       libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x802610000)
       libm.so.5 => /lib/libm.so.5 (0x80290b000)
       libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x802b29000)
       libthr.so.3 => /lib/libthr.so.3 (0x802d36000)
       libc.so.7 => /lib/libc.so.7 (0x802f58000)
       libz.so.6 => /lib/libz.so.6 (0x8032a2000)
       libbz2.so.4 => /usr/lib/libbz2.so.4 (0x8034b7000)
       libgthread-2.0.so.0 => /usr/local/lib/libgthread-2.0.so.0 (0x8036c8000)
       libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x8038cc000)
       libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x803bae000)
       libintl.so.9 => /usr/local/lib/libintl.so.9 (0x803eaa000)
       libpcre.so.3 => /usr/local/lib/libpcre.so.3 (0x8040b4000)

Caveats and Historical problems

No SSL ciphers of at least 128 bit found

It seems to me like there's a problem with Qt on FreeBSD. When you have OpenSSL from ports, and the ABI is different from the one in base (say, OpenSSL 1.0 from ports, 0.9.8 from base) Qt does some weird things. It'll load half the library from ports (the part that ld(1) loads), then Qt comes along and loads it's share from base. The result is lots of unexpected behavior, with "No SSL ciphers of at least 128 bit found" being the most common.

The dirty fix if you have root access is simply to rename the base libssl.so to something so that Qt's loader doesn't find it, and looks in /usr/local/lib instead:

# mv /usr/lib/libssl.so /usr/lib/libssl.so.old

Note: On FreeBSD 10.1 with Qt5, you have to rename /usr/lib/libssl.so.7, which breaks a lot of stuff including git. :(

No certificates could be verified

Note that recent versions of OpenSSL will verify the server's own certificate at the start of a TLS session, so you might get an error like "No certificates could be verified". Older versions of Murmur didn't have the FreeBSD cert store in the search path, so you needed to tell it where to find it:

qmake-qt4 CONFIG+=no-client CONFIG+=no-dbus CONFIG+=no-bonjour \
DEFINES+="SYSTEM_CA_BUNDLE=/usr/local/share/certs/ca-root-nss.crt" main.pro

slice2cpp errors

If you get errors about slice2cpp or Ice/SliceChecksumDict.ice, you must edit src/murmur/murmur.pro and add another include path (/usr/local/share/Ice) to the slice2cpp line (#72 at time of writing), like so:

slice2cpp --checksum -I/usr/local/share/Ice ....

... or you could just symlink that directory to one of the directories the Makefile searches already, or use patch #3026518.

This error has been fixed for a while.

alloca.h missing

When building 1.1.8 or earlier, build fails because of a missing alloca.h header. On FreeBSD, alloca() is declared in stdlib.h, so it's safe to comment the line out (in src/murmur/murmur_pch.h). This has been fixed in git for quite some time, and is apparently fixed in the port of 1.1.8.

Requesting crypt-nonce resync

On 64-bit FreeBSD installations, Murmur 1.1.x and early 1.2 builds would fail, spamming "Requesting crypt-nonce resync" messages in the log, as reported here and here.

Crypto was broken on amd64 (and presumably others), however it's fixed in git. If you're trying to build a 1.1.8 server from source, this patch might help.

This was fixed in ports (ports/139384), so if you're building from ports, make sure your ports tree is up to date.