mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
dev-libs/cereal: fix build with recent clang, unbundle doctest
Now builds & passes tests with gcc-16 & clang-22. Bug: https://bugs.gentoo.org/792444 Closes: https://bugs.gentoo.org/946812 Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com> Part-of: https://codeberg.org/gentoo/gentoo/pulls/1199 Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
committed by
Sam James
parent
40fb544bb0
commit
59256b1b5e
60
dev-libs/cereal/cereal-1.3.2-r4.ebuild
Normal file
60
dev-libs/cereal/cereal-1.3.2-r4.ebuild
Normal file
@@ -0,0 +1,60 @@
|
||||
# Copyright 1999-2026 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit cmake
|
||||
|
||||
DESCRIPTION="Header-only C++11 serialization library"
|
||||
HOMEPAGE="https://uscilab.github.io/cereal/"
|
||||
SRC_URI="https://github.com/USCiLab/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 ~arm arm64 ~loong ~ppc64 ~riscv x86"
|
||||
IUSE="doc test"
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
BDEPEND="doc? ( app-text/doxygen )
|
||||
test? ( dev-cpp/doctest )
|
||||
"
|
||||
DEPEND="dev-libs/rapidjson"
|
||||
RDEPEND="${DEPEND}"
|
||||
|
||||
PATCHES=( "${FILESDIR}"/1.3.2-clang-tuple.patch )
|
||||
|
||||
src_prepare() {
|
||||
if ! use doc ; then
|
||||
cmake_comment_add_subdirectory doc
|
||||
fi
|
||||
|
||||
# remove bundled rapidjson (bug 792444)
|
||||
# rapidxml cannot be unbundled easily, see the bug for details.
|
||||
rm -r include/cereal/external/rapidjson || die 'could not remove bundled rapidjson'
|
||||
sed -e '/rapidjson/s|cereal/external/||' \
|
||||
-e 's/CEREAL_RAPIDJSON_NAMESPACE/rapidjson/g' \
|
||||
-i include/cereal/archives/json.hpp || die
|
||||
|
||||
# remove bundled doctest
|
||||
rm unittests/doctest.h || die 'could not remove bundled doctest'
|
||||
sed -e 's/\"doctest\.h\"/<doctest\/doctest.h>/g' \
|
||||
-i unittests/common.hpp || die
|
||||
|
||||
cmake_src_prepare
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
local mycmakeargs=(
|
||||
-DBUILD_TESTS=$(usex test)
|
||||
|
||||
# Avoid Boost dependency
|
||||
-DSKIP_PERFORMANCE_COMPARISON=ON
|
||||
|
||||
-DWITH_WERROR=OFF
|
||||
)
|
||||
|
||||
# TODO: Enable if multilib?
|
||||
use test && mycmakeargs+=( -DSKIP_PORTABILITY_TEST=ON )
|
||||
|
||||
cmake_src_configure
|
||||
}
|
||||
34
dev-libs/cereal/files/1.3.2-clang-tuple.patch
Normal file
34
dev-libs/cereal/files/1.3.2-clang-tuple.patch
Normal file
@@ -0,0 +1,34 @@
|
||||
https://bugs.gentoo.org/946812
|
||||
https://github.com/USCiLab/cereal/issues/852
|
||||
https://github.com/USCiLab/cereal/pull/872
|
||||
|
||||
From: nindanaoto <matsuoka.kotaro@gmail.com>
|
||||
Date: Sun, 14 Sep 2025 11:02:03 +0000
|
||||
Subject: [PATCH] Fix llvm20 compile issue in tuple.hpp
|
||||
|
||||
---
|
||||
include/cereal/types/tuple.hpp | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/include/cereal/types/tuple.hpp b/include/cereal/types/tuple.hpp
|
||||
index 80c68075..d6bef110 100644
|
||||
--- a/include/cereal/types/tuple.hpp
|
||||
+++ b/include/cereal/types/tuple.hpp
|
||||
@@ -95,7 +95,7 @@ namespace cereal
|
||||
template <class Archive, class ... Types> inline
|
||||
static void apply( Archive & ar, std::tuple<Types...> & tuple )
|
||||
{
|
||||
- serialize<Height - 1>::template apply( ar, tuple );
|
||||
+ serialize<Height - 1>::template apply<Archive, Types...>( ar, tuple );
|
||||
ar( CEREAL_NVP_(tuple_element_name<Height - 1>::c_str(),
|
||||
std::get<Height - 1>( tuple )) );
|
||||
}
|
||||
@@ -116,7 +116,7 @@ namespace cereal
|
||||
template <class Archive, class ... Types> inline
|
||||
void CEREAL_SERIALIZE_FUNCTION_NAME( Archive & ar, std::tuple<Types...> & tuple )
|
||||
{
|
||||
- tuple_detail::serialize<std::tuple_size<std::tuple<Types...>>::value>::template apply( ar, tuple );
|
||||
+ tuple_detail::serialize<std::tuple_size<std::tuple<Types...>>::value>::template apply<Archive, Types...>( ar, tuple );
|
||||
}
|
||||
} // namespace cereal
|
||||
|
||||
Reference in New Issue
Block a user