commit:     d434c5e1300bbfc46969178ab76d0c8471795c9b
Author:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 20 16:47:52 2020 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Sun Sep 20 16:47:52 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d434c5e1

net-misc/mcproxy: fix compilation with clang

Closes: https://bugs.gentoo.org/740796
Package-Manager: Portage-3.0.6, Repoman-3.0.1
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>

 net-misc/mcproxy/files/mcproxy-1.1.1-clang.patch | 93 ++++++++++++++++++++++++
 net-misc/mcproxy/mcproxy-1.1.1-r1.ebuild         |  5 +-
 2 files changed, 97 insertions(+), 1 deletion(-)

diff --git a/net-misc/mcproxy/files/mcproxy-1.1.1-clang.patch 
b/net-misc/mcproxy/files/mcproxy-1.1.1-clang.patch
new file mode 100644
index 00000000000..e3db8f75409
--- /dev/null
+++ b/net-misc/mcproxy/files/mcproxy-1.1.1-clang.patch
@@ -0,0 +1,93 @@
+From 842e2859669f8a721c10c4f8d019f78f37e29e48 Mon Sep 17 00:00:00 2001
+From: Conrad Kostecki <con...@kostecki.com>
+Date: Sun, 20 Sep 2020 16:28:39 +0200
+Subject: [PATCH] mcproxy/mcproxy.pro: fix compilation with clang
+
+If -L/usr/lib is being included, this will break compiling on 64-bit with 
clang.
+
+Signed-off-by: Conrad Kostecki <con...@kostecki.com>
+---
+ mcproxy/mcproxy.pro | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/mcproxy.pro b/mcproxy.pro
+index 5216198..b576b3c 100644
+--- a/mcproxy.pro
++++ b/mcproxy.pro
+@@ -15,7 +15,7 @@ tester {
+     HEADERS += include/tester/config_map.hpp \
+            include/tester/tester.hpp
+ 
+-    LIBS += -L/usr/lib -lboost_regex
++    LIBS += -lboost_regex
+ }
+ 
+ mcproxy { #default mode
+@@ -123,7 +123,7 @@ HEADERS += include/hamcast_logging.h \
+            include/parser/parser.hpp \
+            include/parser/interface.hpp
+ 
+-LIBS += -L/usr/lib -lpthread 
++LIBS += -lpthread
+ 
+ QMAKE_CLEAN += thread* 
+   
+From 5b2f3e3e2ea23c3bb8e72a90e18177f69e350d37 Mon Sep 17 00:00:00 2001
+From: Conrad Kostecki <con...@kostecki.com>
+Date: Sun, 20 Sep 2020 16:38:03 +0200
+Subject: [PATCH] include/proxy/message_queue.hpp: fix compilation with clang
+
+Signed-off-by: Conrad Kostecki <con...@kostecki.com>
+---
+ mcproxy/include/proxy/message_queue.hpp | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/include/proxy/message_queue.hpp b/include/proxy/message_queue.hpp
+index 347a616..ede35ab 100644
+--- a/include/proxy/message_queue.hpp
++++ b/include/proxy/message_queue.hpp
+@@ -101,7 +101,7 @@ bool message_queue<T, Compare>::is_empty() const
+ {
+     HC_LOG_TRACE("");
+ 
+-    std::lock_guard<std::mutex> lock(m_global_lock);
++    std::lock_guard<std::mutex> lock(this->m_global_lock);
+ 
+     return m_q.empty();
+ }
+@@ -111,7 +111,7 @@ unsigned int message_queue<T, Compare>::size() const
+ {
+     HC_LOG_TRACE("");
+ 
+-    std::lock_guard<std::mutex> lock(m_global_lock);
++    std::lock_guard<std::mutex> lock(this->m_global_lock);
+ 
+     return m_q.size();
+ }
+@@ -130,7 +130,7 @@ bool message_queue<T, Compare>::enqueue_loseable(const T& 
t)
+     HC_LOG_TRACE("");
+ 
+     {
+-        std::unique_lock<std::mutex> lock(m_global_lock);
++        std::unique_lock<std::mutex> lock(this->m_global_lock);
+         if (m_q.size() < m_size) {
+             m_q.push(t);
+         } else {
+@@ -148,7 +148,7 @@ void message_queue<T, Compare>::enqueue(const T& t)
+     HC_LOG_TRACE("");
+ 
+     {
+-        std::unique_lock<std::mutex> lock(m_global_lock);
++        std::unique_lock<std::mutex> lock(this->m_global_lock);
+         m_q.push(t);
+     }
+     cond_empty.notify_one();
+@@ -162,7 +162,7 @@ T message_queue<T, Compare>::dequeue(void)
+ 
+     T t;
+     {
+-        std::unique_lock<std::mutex> lock(m_global_lock);
++        std::unique_lock<std::mutex> lock(this->m_global_lock);
+         cond_empty.wait(lock, [&]() {
+             return m_q.size() != 0;
+         });

diff --git a/net-misc/mcproxy/mcproxy-1.1.1-r1.ebuild 
b/net-misc/mcproxy/mcproxy-1.1.1-r1.ebuild
index 77232c3d992..e69713a190c 100644
--- a/net-misc/mcproxy/mcproxy-1.1.1-r1.ebuild
+++ b/net-misc/mcproxy/mcproxy-1.1.1-r1.ebuild
@@ -21,7 +21,10 @@ DEPEND="
 
 S="${WORKDIR}/${P}/${PN}"
 
-PATCHES=( "${FILESDIR}/fix_checksum_calculation.patch" )
+PATCHES=(
+       "${FILESDIR}/${P}-clang.patch"
+       "${FILESDIR}/fix_checksum_calculation.patch"
+)
 
 CONFIG_CHECK="~IP_MULTICAST ~IP_MROUTE"
 

Reply via email to