From 9254419b3b0663a8d182eb3399318964a34bc177 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Thu, 21 Mar 2024 21:04:05 -0400
Subject: [PATCH] Fix linux build of webrtc

---
 indra/cmake/WebRTC.cmake         | 2 +-
 indra/llwebrtc/llwebrtc.cpp      | 1 -
 indra/llwebrtc/llwebrtc_impl.h   | 1 +
 indra/newview/llvoicewebrtc.cpp  | 2 +-
 indra/newview/viewer_manifest.py | 3 +++
 5 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/indra/cmake/WebRTC.cmake b/indra/cmake/WebRTC.cmake
index a9adc418315..d6411e8da91 100644
--- a/indra/cmake/WebRTC.cmake
+++ b/indra/cmake/WebRTC.cmake
@@ -26,7 +26,7 @@ elseif (DARWIN)
         ${COCOA_LIBRARY}
     )
 elseif (LINUX)
-    target_link_libraries( ll::webrtc INTERFACE libwebrtc )
+    target_link_libraries( ll::webrtc INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libwebrtc.a X11 )
 endif (WINDOWS)
 
 
diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp
index 34d950b8049..3078b86a43d 100644
--- a/indra/llwebrtc/llwebrtc.cpp
+++ b/indra/llwebrtc/llwebrtc.cpp
@@ -26,7 +26,6 @@
 
 #include "llwebrtc_impl.h"
 #include <algorithm>
-#include <format>
 #include <string.h>
 
 #include "api/audio_codecs/audio_decoder_factory.h"
diff --git a/indra/llwebrtc/llwebrtc_impl.h b/indra/llwebrtc/llwebrtc_impl.h
index 38810a29b59..f4fa9ae82c4 100644
--- a/indra/llwebrtc/llwebrtc_impl.h
+++ b/indra/llwebrtc/llwebrtc_impl.h
@@ -35,6 +35,7 @@
 #define WEBRTC_POSIX 1
 #elif __linux__
 #define WEBRTC_LINUX 1
+#define WEBRTC_POSIX 1
 #endif
 
 #include "llwebrtc.h"
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index b53d2457186..d8f28cd1c39 100644
--- a/indra/newview/llvoicewebrtc.cpp
+++ b/indra/newview/llvoicewebrtc.cpp
@@ -2696,7 +2696,7 @@ void LLVoiceWebRTCConnection::OnDataReceivedImpl(const std::string &data, bool b
         nlohmann::json      user_gain = nlohmann::json::object();
         for (auto &participant_id : voice_data)
         {
-            LLUUID agent_id(participant_id);
+            LLUUID agent_id(to_string(participant_id));
             if (agent_id.isNull())
             {
                 LL_WARNS("Voice") << "Bad participant ID from data channel (" << participant_id << "):" << data << LL_ENDL;
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 0e64cadcb35..37758253c6b 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -1200,6 +1200,9 @@ def construct(self):
         with self.prefix(src=os.path.join(pkgdir, 'resources', 'locales'), dst=os.path.join('bin', 'llplugin', 'locales')):
             self.path("*.pak")
 
+        with self.prefix(src=os.path.join(self.args['build'], os.pardir, "llwebrtc"), dst="lib"):
+            self.path("libllwebrtc.so")
+
         self.path("featuretable_linux.txt")
 
         with self.prefix(src=pkgdir, dst="app_settings"):
-- 
GitLab