summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Singer2018-01-15 04:42:15 +0100
committerFelix Singer2018-01-15 04:42:15 +0100
commitc07840ed453168984ebbb3a5d8a099298fd4d61b (patch)
tree17a6a92207ad87b7c146dff5832d44717388cf76
parent8c208b716d7e919b2b486a097364e45804923a66 (diff)
downloadaur-c07840ed453168984ebbb3a5d8a099298fd4d61b.tar.gz
Fix compile error by applying pull request 3287
Pull request: https://github.com/mumble-voip/mumble/pull/3287 Thanks to Brottweiler for reporting this issue.
-rw-r--r--.SRCINFO2
-rw-r--r--01-add-pr-3287.patch137
-rw-r--r--PKGBUILD4
3 files changed, 141 insertions, 2 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 7b031447f10..cb0de622a93 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = mumble-snapshot-minimal
pkgdesc = Mumble is an open source voice chat application similar to TeamSpeak. This release doesn't include Text2Speech, Overlay and several plugins.
pkgver = 1.3.0_2586_g894ade2
- pkgrel = 1
+ pkgrel = 2
url = https://mumble.info
arch = i686
arch = x86_64
diff --git a/01-add-pr-3287.patch b/01-add-pr-3287.patch
new file mode 100644
index 00000000000..3aa079b97c7
--- /dev/null
+++ b/01-add-pr-3287.patch
@@ -0,0 +1,137 @@
+From ea861fe86743c8402bbad77d8d1dd9de8dce447e Mon Sep 17 00:00:00 2001
+From: Mikkel Krautz <mikkel@krautz.dk>
+Date: Fri, 29 Dec 2017 14:47:25 +0100
+Subject: [PATCH 1/3] AudioOutput: do not use non-existant template version of
+ std::abs.
+
+This change fixes AudioOutput to use the float overload of std::abs:
+
+ float std::abs(float);
+
+instead of a non-existant template version.
+
+Fixes mumble-voip/mumble#3281
+
+Needs-Backport: 1.2.x
+---
+ src/mumble/AudioOutput.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/mumble/AudioOutput.cpp b/src/mumble/AudioOutput.cpp
+index cbe0c0e2b..7a0a5e2ab 100644
+--- a/src/mumble/AudioOutput.cpp
++++ b/src/mumble/AudioOutput.cpp
+@@ -437,7 +437,7 @@ bool AudioOutput::mix(void *outbuff, unsigned int nsamp) {
+ top[2] = 0.0f;
+ }
+
+- if (std::abs<float>(front[0] * top[0] + front[1] * top[1] + front[2] * top[2]) > 0.01f) {
++ if (std::abs(front[0] * top[0] + front[1] * top[1] + front[2] * top[2]) > 0.01f) {
+ // Not perpendicular. Assume Y up and rotate 90 degrees.
+
+ float azimuth = 0.0f;
+
+From a221fedfd3ebc4e722077f56e057c11260839e44 Mon Sep 17 00:00:00 2001
+From: Mikkel Krautz <mikkel@krautz.dk>
+Date: Sun, 31 Dec 2017 01:33:51 +0100
+Subject: [PATCH 2/3] mumble_pch.hpp: explicitly include <cmath>.
+
+Previously, we implicitly relied on <cmath> being included
+by some other header.
+
+Make it explicit.
+---
+ src/mumble/mumble_pch.hpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/mumble/mumble_pch.hpp b/src/mumble/mumble_pch.hpp
+index ba87eab3b..dac5ba629 100644
+--- a/src/mumble/mumble_pch.hpp
++++ b/src/mumble/mumble_pch.hpp
+@@ -82,6 +82,7 @@
+ #include <boost/weak_ptr.hpp>
+
+ #include <algorithm>
++#include <cmath>
+
+ #ifdef Q_OS_WIN
+ #include "../qos2_mingw.h"
+
+From 6ca110a2226b0559fca85d22f287ec8a14eee1d1 Mon Sep 17 00:00:00 2001
+From: Mikkel Krautz <mikkel@krautz.dk>
+Date: Fri, 29 Dec 2017 15:05:03 +0100
+Subject: [PATCH 3/3] src/tests: add TestStdAbs test.
+
+This adds a 'just-in-case' test for correct runtime behavior of std::abs's
+float overload.
+---
+ src/tests/TestStdAbs/TestStdAbs.cpp | 31 +++++++++++++++++++++++++++++++
+ src/tests/TestStdAbs/TestStdAbs.pro | 9 +++++++++
+ src/tests/tests.pro | 3 ++-
+ 3 files changed, 42 insertions(+), 1 deletion(-)
+ create mode 100644 src/tests/TestStdAbs/TestStdAbs.cpp
+ create mode 100644 src/tests/TestStdAbs/TestStdAbs.pro
+
+diff --git a/src/tests/TestStdAbs/TestStdAbs.cpp b/src/tests/TestStdAbs/TestStdAbs.cpp
+new file mode 100644
+index 000000000..ae06787a9
+--- /dev/null
++++ b/src/tests/TestStdAbs/TestStdAbs.cpp
+@@ -0,0 +1,31 @@
++// Copyright 2005-2017 The Mumble Developers. All rights reserved.
++// Use of this source code is governed by a BSD-style license
++// that can be found in the LICENSE file at the root of the
++// Mumble source tree or at <https://www.mumble.info/LICENSE>.
++
++#include <QtCore>
++#include <QtTest>
++
++#include <cmath>
++
++/// Test the std::abs works with floats.
++/// In fixing mumble-voip/mumble#3281, I
++/// stumbled upon http://eigen.tuxfamily.org/bz/show_bug.cgi?id=619.
++/// It seems that, on some platforms, std::abs
++/// might not call through to the correct libc
++/// function.
++/// Test that it works for us.
++class TestStdAbs : public QObject {
++ Q_OBJECT
++ private slots:
++ void floatWorks();
++};
++
++void TestStdAbs::floatWorks() {
++ const float in = -1.5;
++ float out = std::abs(in);
++ QVERIFY(out > 1.2 && out < 1.8);
++}
++
++QTEST_MAIN(TestStdAbs)
++#include "TestStdAbs.moc"
+diff --git a/src/tests/TestStdAbs/TestStdAbs.pro b/src/tests/TestStdAbs/TestStdAbs.pro
+new file mode 100644
+index 000000000..6fbff2969
+--- /dev/null
++++ b/src/tests/TestStdAbs/TestStdAbs.pro
+@@ -0,0 +1,9 @@
++# Copyright 2005-2017 The Mumble Developers. All rights reserved.
++# Use of this source code is governed by a BSD-style license
++# that can be found in the LICENSE file at the root of the
++# Mumble source tree or at <https://www.mumble.info/LICENSE>.
++
++include(../test.pri)
++
++TARGET = TestStdAbs
++SOURCES = TestStdAbs.cpp
+diff --git a/src/tests/tests.pro b/src/tests/tests.pro
+index ee778fb1b..1b55d0ae7 100644
+--- a/src/tests/tests.pro
++++ b/src/tests/tests.pro
+@@ -18,4 +18,5 @@ SUBDIRS += \
+ TestServerResolver \
+ TestSelfSignedCertificate \
+ TestSSLLocks \
+- TestFFDHE
++ TestFFDHE \
++ TestStdAbs
diff --git a/PKGBUILD b/PKGBUILD
index ac4e691896b..285151d9a8e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
_pkgname=mumble
pkgname=${_pkgname}-snapshot-minimal
pkgver=1.3.0_2586_g894ade2
-pkgrel=1
+pkgrel=2
arch=('i686' 'x86_64')
pkgdesc="Mumble is an open source voice chat application similar to TeamSpeak. This release doesn't include Text2Speech, Overlay and several plugins."
license=('BSD')
@@ -18,6 +18,8 @@ sha512sums=('fec5b0d1ee8391ad17f629c6c6d0ad74eec99095dc44013905ce66161cdc8ff3aaf
build() {
cd $srcdir/mumble-${pkgver//_/\~}~snapshot
+ patch -p1 < ../../01-add-pr-3287.patch
+
qmake-qt5 main.pro \
CONFIG+="bundled-celt no-bundled-opus no-bundled-speex no-g15 no-xevie no-server no-embed-qt-translations no-update no-speechd no-overlay no-bonjour" \
DEFINES+="PLUGIN_PATH=/usr/lib/mumble" \