[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/01: gnu: libtgvoip: Fix failing build on i686-linux.
From: |
guix-commits |
Subject: |
01/01: gnu: libtgvoip: Fix failing build on i686-linux. |
Date: |
Sun, 5 Jan 2020 20:34:22 -0500 (EST) |
brettgilio pushed a commit to branch master
in repository guix.
commit 1792a70655507625cbe654a0eec1428f210d2fd3
Author: Brett Gilio <address@hidden>
Date: Sun Jan 5 19:31:07 2020 -0600
gnu: libtgvoip: Fix failing build on i686-linux.
* gnu/local.mk (libtgvoip): Add patches for libtgvoip-disable-sse2.patch
and libtgvoip-disable-webrtc.patch
* gnu/packages/patches/libtgvoip-disable-sse2.patch: New file.
* gnu/packages/patches/libtgvoip-disable-webrtc.patch: New file.
* gnu/packages/telephony.scm (libtgvoip): Fix building on i686-linux.
[source]: Reference patches for correcting failing build on i686-linux
architecture.
Reported-by: Diego Nicola Barbato <address@hidden>
Fixes <bugs.gnu.org/38944>.
---
gnu/local.mk | 2 +
gnu/packages/patches/libtgvoip-disable-sse2.patch | 51 ++++++++++++++++++++++
.../patches/libtgvoip-disable-webrtc.patch | 47 ++++++++++++++++++++
gnu/packages/telephony.scm | 6 +++
4 files changed, 106 insertions(+)
diff --git a/gnu/local.mk b/gnu/local.mk
index 83bba6b..b7fa503 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1113,6 +1113,8 @@ dist_patch_DATA =
\
%D%/packages/patches/libsndfile-CVE-2017-8362.patch \
%D%/packages/patches/libsndfile-CVE-2017-12562.patch \
%D%/packages/patches/libtar-CVE-2013-4420.patch \
+ %D%/packages/patches/libtgvoip-disable-sse2.patch \
+ %D%/packages/patches/libtgvoip-disable-webrtc.patch \
%D%/packages/patches/libtheora-config-guess.patch \
%D%/packages/patches/libtommath-fix-linkage.patch \
%D%/packages/patches/libtool-skip-tests2.patch \
diff --git a/gnu/packages/patches/libtgvoip-disable-sse2.patch
b/gnu/packages/patches/libtgvoip-disable-sse2.patch
new file mode 100644
index 0000000..0e4faea
--- /dev/null
+++ b/gnu/packages/patches/libtgvoip-disable-sse2.patch
@@ -0,0 +1,51 @@
+Copied from Debian.
+
+Description: Disable SSE2 code on i386
+ This patch is not complete. A high-graded solution may use automatic switching
+ between SSE2 and C++ implementations based on the results of runtime checks.
+ The webrtc code already provides for one of them inside its GetCPUInfo
function.
+Bug-Debian: https://bugs.debian.org/892823
+Author: Nicholas Guriev <address@hidden>
+Last-Update: Tue, 29 Jan 2019 23:26:38 +0300
+
+--- a/libtgvoip.gyp
++++ b/libtgvoip.gyp
+@@ -871,11 +871,7 @@
+ 'WEBRTC_POSIX',
+ ],
+ 'conditions': [
+- [ '"<!(uname -m)" == "i686"', {
+- 'cflags_cc': [
+- '-msse2',
+- ],
+- }], ['"<!(uname -s)" == "Linux"', {
++ [ '"<!(uname -s)" == "Linux"', {
+ 'defines': [
+ 'WEBRTC_LINUX',
+ ],
+--- a/webrtc_dsp/rtc_base/system/arch.h
++++ b/webrtc_dsp/rtc_base/system/arch.h
+@@ -28,7 +28,10 @@
+ #define WEBRTC_ARCH_64_BITS
+ #define WEBRTC_ARCH_LITTLE_ENDIAN
+ #elif defined(_M_IX86) || defined(__i386__)
++#if defined(__SSE2__)
++// This macro is mostly used to detect SSE2 extension.
+ #define WEBRTC_ARCH_X86_FAMILY
++#endif
+ #define WEBRTC_ARCH_X86
+ #define WEBRTC_ARCH_32_BITS
+ #define WEBRTC_ARCH_LITTLE_ENDIAN
+--- a/webrtc_dsp/typedefs.h
++++ b/webrtc_dsp/typedefs.h
+@@ -28,7 +28,10 @@
+ #define WEBRTC_ARCH_64_BITS
+ #define WEBRTC_ARCH_LITTLE_ENDIAN
+ #elif defined(_M_IX86) || defined(__i386__)
++#if defined(__SSE2__)
++// This macro is mostly used to detect SSE2 extension.
+ #define WEBRTC_ARCH_X86_FAMILY
++#endif
+ #define WEBRTC_ARCH_X86
+ #define WEBRTC_ARCH_32_BITS
+ #define WEBRTC_ARCH_LITTLE_ENDIAN
diff --git a/gnu/packages/patches/libtgvoip-disable-webrtc.patch
b/gnu/packages/patches/libtgvoip-disable-webrtc.patch
new file mode 100644
index 0000000..0ca5323
--- /dev/null
+++ b/gnu/packages/patches/libtgvoip-disable-webrtc.patch
@@ -0,0 +1,47 @@
+Copied from Debian.
+
+Description: Fix build of WebRTC on non-Linux systems
+ * Define the WEBRTC_LINUX macro only on Linux, and not on GNU/Hurd or FreeBSD.
+ * Fix type cast in the CurrentThreadId function.
+Bug-Debian: https://bugs.debian.org/920851
+Author: Nicholas Guriev <address@hidden>
+Last-Update: Tue, 29 Jan 2019 23:26:44 +0300
+
+--- a/libtgvoip.gyp
++++ b/libtgvoip.gyp
+@@ -869,20 +869,18 @@
+ '"<(OS)" == "linux"', {
+ 'defines': [
+ 'WEBRTC_POSIX',
+- 'WEBRTC_LINUX',
+ ],
+ 'conditions': [
+ [ '"<!(uname -m)" == "i686"', {
+ 'cflags_cc': [
+ '-msse2',
+ ],
++ }], ['"<!(uname -s)" == "Linux"', {
++ 'defines': [
++ 'WEBRTC_LINUX',
++ ],
+ }]
+ ],
+- 'direct_dependent_settings': {
+- 'libraries': [
+-
+- ],
+- },
+ },
+ ],
+ ],
+--- a/webrtc_dsp/rtc_base/platform_thread_types.cc
++++ b/webrtc_dsp/rtc_base/platform_thread_types.cc
+@@ -31,7 +31,7 @@ PlatformThreadId CurrentThreadId() {
+ return syscall(__NR_gettid);
+ #else
+ // Default implementation for nacl and solaris.
+- return reinterpret_cast<pid_t>(pthread_self());
++ return static_cast<pid_t>(pthread_self());
+ #endif
+ #endif // defined(WEBRTC_POSIX)
+ }
diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 11eeeed..8e7384b 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -960,6 +960,12 @@ This package provides the Jami client for the GNOME
desktop.")
(url "https://github.com/grishka/libtgvoip.git")
(commit version)))
(file-name (git-file-name name version))
+ ;; Fix compilation on i686-linux architecture.
+ ;; NOTE: Applying these patches is order-dependent!
+ ;; The patch for WebRTC /must/ precede the patch for SSE2.
+ (patches
+ (search-patches "libtgvoip-disable-webrtc.patch"
+ "libtgvoip-disable-sse2.patch"))
(sha256
(base32
"122kn3jx6v0kkldlzlpzvlwqxgp6pmzxsjhrhcxw12bx9c08sar5"))))