diff options
author | Sam James <sam@gentoo.org> | 2022-02-27 23:29:45 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-02-27 23:29:55 +0000 |
commit | adbf12388bbda19a3ad3911b7488c14d67b95df1 (patch) | |
tree | a0fdd7061844f020ff8ec61f4fa36bc746b78919 /dev-libs/capnproto | |
parent | Linux patch 5.17-rc6 (diff) | |
download | gentoo-adbf12388bbda19a3ad3911b7488c14d67b95df1.tar.gz gentoo-adbf12388bbda19a3ad3911b7488c14d67b95df1.tar.bz2 gentoo-adbf12388bbda19a3ad3911b7488c14d67b95df1.zip |
dev-libs/capnproto: fix build on PPC (-latomic)
Closes: https://bugs.gentoo.org/832816
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-libs/capnproto')
-rw-r--r-- | dev-libs/capnproto/capnproto-0.9.1.ebuild | 4 | ||||
-rw-r--r-- | dev-libs/capnproto/files/capnproto-0.9.1-libatomic.patch | 59 |
2 files changed, 63 insertions, 0 deletions
diff --git a/dev-libs/capnproto/capnproto-0.9.1.ebuild b/dev-libs/capnproto/capnproto-0.9.1.ebuild index ecd0a5027d58..d3be55f08340 100644 --- a/dev-libs/capnproto/capnproto-0.9.1.ebuild +++ b/dev-libs/capnproto/capnproto-0.9.1.ebuild @@ -25,6 +25,10 @@ DEPEND="${RDEPEND} test? ( dev-cpp/gtest ) " +PATCHES=( + "${FILESDIR}"/${PN}-0.9.1-libatomic.patch +) + src_configure() { local mycmakeargs=( -DWITH_OPENSSL=$(usex ssl) diff --git a/dev-libs/capnproto/files/capnproto-0.9.1-libatomic.patch b/dev-libs/capnproto/files/capnproto-0.9.1-libatomic.patch new file mode 100644 index 000000000000..654d3fc9873a --- /dev/null +++ b/dev-libs/capnproto/files/capnproto-0.9.1-libatomic.patch @@ -0,0 +1,59 @@ +https://bugs.gentoo.org/832816 +https://sources.debian.org/patches/capnproto/0.9.1-2/07_libatomic.patch/ + +Description: link against libatomic +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1005066 +--- a/configure.ac ++++ b/configure.ac +@@ -16,6 +16,11 @@ + + AM_INIT_AUTOMAKE([tar-ustar]) + ++AC_ARG_WITH([libatomic], ++ [AS_HELP_STRING([--with-libatomic], ++ [build by linking against libatomic @<:@default=check@:>@])], ++ [],[with_libatomic=check]) ++ + AC_ARG_WITH([external-capnp], + [AS_HELP_STRING([--with-external-capnp], + [use the system capnp binary (or the one specified with $CAPNP) instead of compiling a new +@@ -195,8 +200,19 @@ + ]) + AM_CONDITIONAL([BUILD_KJ_TLS], [test "$with_openssl" != no]) + +-# CapnProtoConfig.cmake.in needs this variable. ++AS_IF([test "$with_libatomic" = check], [ ++ AC_SEARCH_LIBS([__atomic_load_8], [atomic], [with_libatomic=yes], [with_libatomic=no]) ++], [ ++ AS_IF([test "$with_libatomic" = yes], [ ++ AC_SEARCH_LIBS([__atomic_load_8], [atomic], [:], [ ++ AC_MSG_ERROR([could not find libatomic]) ++ ]) ++ ]) ++]) ++ ++# CapnProtoConfig.cmake.in needs these variables. + AC_SUBST(WITH_OPENSSL, $with_openssl) ++AC_SUBST(WITH_LIBATOMIC, $with_libatomic) + + AM_CONDITIONAL([HAS_FUZZING_ENGINE], [test "x$LIB_FUZZING_ENGINE" != "x"]) + +--- a/cmake/CapnProtoConfig.cmake.in ++++ b/cmake/CapnProtoConfig.cmake.in +@@ -62,6 +62,16 @@ + endif() + endif() + ++if (@WITH_LIBATOMIC@) # WITH_LIBATOMIC ++ include(CheckLibraryExists) ++ check_library_exists(atomic __atomic_load_8 "" FOUND_LIBATOMIC) ++ if (FOUND_LIBATOMIC) ++ list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic") ++ else() ++ message(FATAL_ERROR "libatomic not found") ++ endif() ++endif() ++ + include("${CMAKE_CURRENT_LIST_DIR}/CapnProtoTargets.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/CapnProtoMacros.cmake") + |