Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/capnproto/files/, dev-libs/capnproto/
Date: Sun, 27 Feb 2022 23:48:19
Message-Id: 1646005661.8e8b3e9588eacd192978599a5199fbb54071a53e.sam@gentoo
1 commit: 8e8b3e9588eacd192978599a5199fbb54071a53e
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 27 23:47:41 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 27 23:47:41 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e8b3e95
7
8 dev-libs/capnproto: fix libatomic on PPC
9
10 Thanks to Arfrever; I skimmed the patch, thought it looked reasonable,
11 didn't notice the latter part was for CMake config file, not CMakeLists.txt.
12
13 Closes: https://bugs.gentoo.org/832816
14 Signed-off-by: Sam James <sam <AT> gentoo.org>
15
16 dev-libs/capnproto/capnproto-0.9.1.ebuild | 10 ++--
17 .../files/capnproto-0.9.1-libatomic.patch | 59 ----------------------
18 2 files changed, 5 insertions(+), 64 deletions(-)
19
20 diff --git a/dev-libs/capnproto/capnproto-0.9.1.ebuild b/dev-libs/capnproto/capnproto-0.9.1.ebuild
21 index d3be55f08340..69ef73c4bba3 100644
22 --- a/dev-libs/capnproto/capnproto-0.9.1.ebuild
23 +++ b/dev-libs/capnproto/capnproto-0.9.1.ebuild
24 @@ -3,7 +3,7 @@
25
26 EAPI=8
27
28 -inherit cmake
29 +inherit cmake flag-o-matic
30
31 DESCRIPTION="RPC/Serialization system with capabilities support"
32 HOMEPAGE="https://capnproto.org"
33 @@ -25,11 +25,11 @@ DEPEND="${RDEPEND}
34 test? ( dev-cpp/gtest )
35 "
36
37 -PATCHES=(
38 - "${FILESDIR}"/${PN}-0.9.1-libatomic.patch
39 -)
40 -
41 src_configure() {
42 + if use arm || use ppc || use mips || [[ ${CHOST} == *i486* ]] ; then
43 + append-libs -latomic
44 + fi
45 +
46 local mycmakeargs=(
47 -DWITH_OPENSSL=$(usex ssl)
48 -DBUILD_TESTING=$(usex test)
49
50 diff --git a/dev-libs/capnproto/files/capnproto-0.9.1-libatomic.patch b/dev-libs/capnproto/files/capnproto-0.9.1-libatomic.patch
51 deleted file mode 100644
52 index 654d3fc9873a..000000000000
53 --- a/dev-libs/capnproto/files/capnproto-0.9.1-libatomic.patch
54 +++ /dev/null
55 @@ -1,59 +0,0 @@
56 -https://bugs.gentoo.org/832816
57 -https://sources.debian.org/patches/capnproto/0.9.1-2/07_libatomic.patch/
58 -
59 -Description: link against libatomic
60 -Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1005066
61 ---- a/configure.ac
62 -+++ b/configure.ac
63 -@@ -16,6 +16,11 @@
64 -
65 - AM_INIT_AUTOMAKE([tar-ustar])
66 -
67 -+AC_ARG_WITH([libatomic],
68 -+ [AS_HELP_STRING([--with-libatomic],
69 -+ [build by linking against libatomic @<:@default=check@:>@])],
70 -+ [],[with_libatomic=check])
71 -+
72 - AC_ARG_WITH([external-capnp],
73 - [AS_HELP_STRING([--with-external-capnp],
74 - [use the system capnp binary (or the one specified with $CAPNP) instead of compiling a new
75 -@@ -195,8 +200,19 @@
76 - ])
77 - AM_CONDITIONAL([BUILD_KJ_TLS], [test "$with_openssl" != no])
78 -
79 --# CapnProtoConfig.cmake.in needs this variable.
80 -+AS_IF([test "$with_libatomic" = check], [
81 -+ AC_SEARCH_LIBS([__atomic_load_8], [atomic], [with_libatomic=yes], [with_libatomic=no])
82 -+], [
83 -+ AS_IF([test "$with_libatomic" = yes], [
84 -+ AC_SEARCH_LIBS([__atomic_load_8], [atomic], [:], [
85 -+ AC_MSG_ERROR([could not find libatomic])
86 -+ ])
87 -+ ])
88 -+])
89 -+
90 -+# CapnProtoConfig.cmake.in needs these variables.
91 - AC_SUBST(WITH_OPENSSL, $with_openssl)
92 -+AC_SUBST(WITH_LIBATOMIC, $with_libatomic)
93 -
94 - AM_CONDITIONAL([HAS_FUZZING_ENGINE], [test "x$LIB_FUZZING_ENGINE" != "x"])
95 -
96 ---- a/cmake/CapnProtoConfig.cmake.in
97 -+++ b/cmake/CapnProtoConfig.cmake.in
98 -@@ -62,6 +62,16 @@
99 - endif()
100 - endif()
101 -
102 -+if (@WITH_LIBATOMIC@) # WITH_LIBATOMIC
103 -+ include(CheckLibraryExists)
104 -+ check_library_exists(atomic __atomic_load_8 "" FOUND_LIBATOMIC)
105 -+ if (FOUND_LIBATOMIC)
106 -+ list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
107 -+ else()
108 -+ message(FATAL_ERROR "libatomic not found")
109 -+ endif()
110 -+endif()
111 -+
112 - include("${CMAKE_CURRENT_LIST_DIR}/CapnProtoTargets.cmake")
113 - include("${CMAKE_CURRENT_LIST_DIR}/CapnProtoMacros.cmake")
114 -