1 |
commit: b2812d756f23179a480f982ef877f3ff5b7e4116 |
2 |
Author: brahmajit das <listout <AT> protonmail <DOT> com> |
3 |
AuthorDate: Fri Jul 29 18:53:09 2022 +0000 |
4 |
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Aug 17 16:17:56 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b2812d75 |
7 |
|
8 |
dev-libs/sink: Musl fix build error, missing execinfo.h |
9 |
|
10 |
On musl execinfo.h is not present, it results in build error for missing |
11 |
header file. Hence we are going check first for execinfo.h then include |
12 |
and use it for backtrace. |
13 |
|
14 |
Closes: https://bugs.gentoo.org/830945 |
15 |
Signed-off-by: brahmajit das <listout <AT> protonmail.com> |
16 |
Closes: https://github.com/gentoo/gentoo/pull/26655 |
17 |
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org> |
18 |
|
19 |
dev-libs/sink/files/sink-0.8.0-musl-execinfo.patch | 48 ++++++++++++++++++++++ |
20 |
dev-libs/sink/sink-0.8.0-r3.ebuild | 6 ++- |
21 |
2 files changed, 53 insertions(+), 1 deletion(-) |
22 |
|
23 |
diff --git a/dev-libs/sink/files/sink-0.8.0-musl-execinfo.patch b/dev-libs/sink/files/sink-0.8.0-musl-execinfo.patch |
24 |
new file mode 100644 |
25 |
index 000000000000..b5085702a33e |
26 |
--- /dev/null |
27 |
+++ b/dev-libs/sink/files/sink-0.8.0-musl-execinfo.patch |
28 |
@@ -0,0 +1,48 @@ |
29 |
+# Since musl doesn't have execinfo. We're going to avoid including it and make |
30 |
+# the printStacktrace function void |
31 |
+# Closes: https://bugs.gentoo.org/830945 |
32 |
+--- a/synchronizer/CMakeLists.txt |
33 |
++++ b/synchronizer/CMakeLists.txt |
34 |
+@@ -2,6 +2,12 @@ project(sink_synchronizer) |
35 |
+ |
36 |
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) |
37 |
+ |
38 |
++INCLUDE(CheckIncludeFiles) |
39 |
++CHECK_INCLUDE_FILES("execinfo.h" HAVE_EXECINFO) |
40 |
++IF (HAVE_EXECINFO) |
41 |
++ add_compile_definitions(HAVE_EXECINFO_H) |
42 |
++ENDIF(HAVE_EXECINFO) |
43 |
++ |
44 |
+ set(sinksynchronizer_SRCS |
45 |
+ main.cpp |
46 |
+ backtrace.cpp |
47 |
+--- a/synchronizer/backtrace.cpp |
48 |
++++ b/synchronizer/backtrace.cpp |
49 |
+@@ -31,7 +31,9 @@ |
50 |
+ #include <chrono> |
51 |
+ |
52 |
+ #ifndef Q_OS_WIN |
53 |
++#ifdef HAVE_EXECINFO_H |
54 |
+ #include <execinfo.h> |
55 |
++#endif // HAVE_EXECINFO_H |
56 |
+ #include <unistd.h> |
57 |
+ #include <cxxabi.h> |
58 |
+ #include <dlfcn.h> |
59 |
+@@ -143,7 +145,7 @@ private: |
60 |
+ //Print a demangled stacktrace |
61 |
+ static void printStacktrace() |
62 |
+ { |
63 |
+-#ifndef Q_OS_WIN |
64 |
++#if !defined(Q_OS_WIN) && defined(HAVE_EXECINFO_H) |
65 |
+ int skip = 1; |
66 |
+ void *callstack[128]; |
67 |
+ const int nMaxFrames = sizeof(callstack) / sizeof(callstack[0]); |
68 |
+@@ -178,7 +180,7 @@ static void printStacktrace() |
69 |
+ trace_buf << "[truncated]\n"; |
70 |
+ } |
71 |
+ std::cerr << trace_buf.str(); |
72 |
+-#else |
73 |
++#elif defined(Q_OS_WIN) |
74 |
+ enum { maxStackFrames = 100 }; |
75 |
+ DebugSymbolResolver resolver(GetCurrentProcess()); |
76 |
+ if (resolver.isValid()) { |
77 |
|
78 |
diff --git a/dev-libs/sink/sink-0.8.0-r3.ebuild b/dev-libs/sink/sink-0.8.0-r3.ebuild |
79 |
index 78d2b574ac2b..c8108f329bf4 100644 |
80 |
--- a/dev-libs/sink/sink-0.8.0-r3.ebuild |
81 |
+++ b/dev-libs/sink/sink-0.8.0-r3.ebuild |
82 |
@@ -1,4 +1,4 @@ |
83 |
-# Copyright 1999-2021 Gentoo Authors |
84 |
+# Copyright 1999-2022 Gentoo Authors |
85 |
# Distributed under the terms of the GNU General Public License v2 |
86 |
|
87 |
EAPI=7 |
88 |
@@ -42,6 +42,10 @@ DEPEND="${RDEPEND} |
89 |
# fails to build |
90 |
RESTRICT+=" test" |
91 |
|
92 |
+PATCHES=( |
93 |
+ "${FILESDIR}"/${PN}-0.8.0-musl-execinfo.patch |
94 |
+) |
95 |
+ |
96 |
src_prepare() { |
97 |
cmake_src_prepare |
98 |
# tests are sprinkled all over the place, and examples are needed... |