1 |
commit: adbf12388bbda19a3ad3911b7488c14d67b95df1 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Feb 27 23:29:45 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Feb 27 23:29:55 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=adbf1238 |
7 |
|
8 |
dev-libs/capnproto: fix build on PPC (-latomic) |
9 |
|
10 |
Closes: https://bugs.gentoo.org/832816 |
11 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
12 |
|
13 |
dev-libs/capnproto/capnproto-0.9.1.ebuild | 4 ++ |
14 |
.../files/capnproto-0.9.1-libatomic.patch | 59 ++++++++++++++++++++++ |
15 |
2 files changed, 63 insertions(+) |
16 |
|
17 |
diff --git a/dev-libs/capnproto/capnproto-0.9.1.ebuild b/dev-libs/capnproto/capnproto-0.9.1.ebuild |
18 |
index ecd0a5027d58..d3be55f08340 100644 |
19 |
--- a/dev-libs/capnproto/capnproto-0.9.1.ebuild |
20 |
+++ b/dev-libs/capnproto/capnproto-0.9.1.ebuild |
21 |
@@ -25,6 +25,10 @@ DEPEND="${RDEPEND} |
22 |
test? ( dev-cpp/gtest ) |
23 |
" |
24 |
|
25 |
+PATCHES=( |
26 |
+ "${FILESDIR}"/${PN}-0.9.1-libatomic.patch |
27 |
+) |
28 |
+ |
29 |
src_configure() { |
30 |
local mycmakeargs=( |
31 |
-DWITH_OPENSSL=$(usex ssl) |
32 |
|
33 |
diff --git a/dev-libs/capnproto/files/capnproto-0.9.1-libatomic.patch b/dev-libs/capnproto/files/capnproto-0.9.1-libatomic.patch |
34 |
new file mode 100644 |
35 |
index 000000000000..654d3fc9873a |
36 |
--- /dev/null |
37 |
+++ b/dev-libs/capnproto/files/capnproto-0.9.1-libatomic.patch |
38 |
@@ -0,0 +1,59 @@ |
39 |
+https://bugs.gentoo.org/832816 |
40 |
+https://sources.debian.org/patches/capnproto/0.9.1-2/07_libatomic.patch/ |
41 |
+ |
42 |
+Description: link against libatomic |
43 |
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1005066 |
44 |
+--- a/configure.ac |
45 |
++++ b/configure.ac |
46 |
+@@ -16,6 +16,11 @@ |
47 |
+ |
48 |
+ AM_INIT_AUTOMAKE([tar-ustar]) |
49 |
+ |
50 |
++AC_ARG_WITH([libatomic], |
51 |
++ [AS_HELP_STRING([--with-libatomic], |
52 |
++ [build by linking against libatomic @<:@default=check@:>@])], |
53 |
++ [],[with_libatomic=check]) |
54 |
++ |
55 |
+ AC_ARG_WITH([external-capnp], |
56 |
+ [AS_HELP_STRING([--with-external-capnp], |
57 |
+ [use the system capnp binary (or the one specified with $CAPNP) instead of compiling a new |
58 |
+@@ -195,8 +200,19 @@ |
59 |
+ ]) |
60 |
+ AM_CONDITIONAL([BUILD_KJ_TLS], [test "$with_openssl" != no]) |
61 |
+ |
62 |
+-# CapnProtoConfig.cmake.in needs this variable. |
63 |
++AS_IF([test "$with_libatomic" = check], [ |
64 |
++ AC_SEARCH_LIBS([__atomic_load_8], [atomic], [with_libatomic=yes], [with_libatomic=no]) |
65 |
++], [ |
66 |
++ AS_IF([test "$with_libatomic" = yes], [ |
67 |
++ AC_SEARCH_LIBS([__atomic_load_8], [atomic], [:], [ |
68 |
++ AC_MSG_ERROR([could not find libatomic]) |
69 |
++ ]) |
70 |
++ ]) |
71 |
++]) |
72 |
++ |
73 |
++# CapnProtoConfig.cmake.in needs these variables. |
74 |
+ AC_SUBST(WITH_OPENSSL, $with_openssl) |
75 |
++AC_SUBST(WITH_LIBATOMIC, $with_libatomic) |
76 |
+ |
77 |
+ AM_CONDITIONAL([HAS_FUZZING_ENGINE], [test "x$LIB_FUZZING_ENGINE" != "x"]) |
78 |
+ |
79 |
+--- a/cmake/CapnProtoConfig.cmake.in |
80 |
++++ b/cmake/CapnProtoConfig.cmake.in |
81 |
+@@ -62,6 +62,16 @@ |
82 |
+ endif() |
83 |
+ endif() |
84 |
+ |
85 |
++if (@WITH_LIBATOMIC@) # WITH_LIBATOMIC |
86 |
++ include(CheckLibraryExists) |
87 |
++ check_library_exists(atomic __atomic_load_8 "" FOUND_LIBATOMIC) |
88 |
++ if (FOUND_LIBATOMIC) |
89 |
++ list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic") |
90 |
++ else() |
91 |
++ message(FATAL_ERROR "libatomic not found") |
92 |
++ endif() |
93 |
++endif() |
94 |
++ |
95 |
+ include("${CMAKE_CURRENT_LIST_DIR}/CapnProtoTargets.cmake") |
96 |
+ include("${CMAKE_CURRENT_LIST_DIR}/CapnProtoMacros.cmake") |
97 |
+ |