dev-libs/mtxclient: fix build with libfmt 11

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
This commit is contained in:
Anna (cybertailor) Vyalkova
2024-12-03 10:02:14 +05:00
parent 0fcf5249aa
commit 3c91b36e16
5 changed files with 51 additions and 47 deletions

View File

@@ -1,2 +1 @@
DIST mtxclient-0.10.0.tar.gz 633765 BLAKE2B c76c4592e51c46418e5ad610432b2edc39f4bcfe3a9f8642888addc91296b7aa129e5716b818a1257e6e1cc8b945bac7d3434d283d9ba9705cd9250f6b6ad59b SHA512 584831f67d7c15c293dd3c3cdca6e5b76c8fd477d5daa5eecea4de43431db0628f5af846f2c1cb1cfdabbd53e3f696b45c8aa736bd615729df583a33157958bd
DIST mtxclient-0.9.2.tar.gz 623481 BLAKE2B 322506eaac9abf2463c08bee5e17547d7a33cf473785839566ec185db97303f7e33d5b58aa85735fa066f7f2f507e682bec985dc9dffa83f9b9ac799ed78c80d SHA512 87c9cd23ce8a52b2f850e3770eb51d03f40f4a5e45b5e536b2446932fc866b8835212d9364c5890af7404843da2547bdc94bb5d3d1933903fea8374b8900fd73

View File

@@ -0,0 +1,49 @@
From 4a4726c77123f805cff8b954909663eaed296558 Mon Sep 17 00:00:00 2001
From: Kefu Chai <tchaikov@gmail.com>
Date: Mon, 15 Jul 2024 11:35:09 +0800
Subject: [PATCH] Fix build with fmt 11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
fmt 11 enforces that fmt::formatter<..>::format() should be const.
otherwise the tree does not build:
```
/usr/include/fmt/base.h:1392:29: error: passing ‘const fmt::v11::formatter<std::optional<mtx::http::ClientError> >’ as ‘this’ argument discards qualifiers [-fpermissive]
1392 | ctx.advance_to(cf.format(*static_cast<qualified_type*>(arg), ctx));
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
so let's mark the `format()` with `const` specifier.
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
---
include/mtxclient/http/errors.hpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/mtxclient/http/errors.hpp b/include/mtxclient/http/errors.hpp
index 2d0e7a4..b99ff90 100644
--- a/include/mtxclient/http/errors.hpp
+++ b/include/mtxclient/http/errors.hpp
@@ -87,7 +87,7 @@ struct fmt::formatter<mtx::http::ClientError>
// Formats the point p using the parsed format specification (presentation)
// stored in this formatter.
template<typename FormatContext>
- auto format(const mtx::http::ClientError &e, FormatContext &ctx) -> decltype(ctx.out())
+ auto format(const mtx::http::ClientError &e, FormatContext &ctx) const -> decltype(ctx.out())
{
// ctx.out() is an output iterator to write to.
bool prepend_comma = false;
@@ -132,7 +132,7 @@ struct fmt::formatter<std::optional<mtx::http::ClientError>> : formatter<mtx::ht
{
// parse is inherited from formatter<string_view>.
template<typename FormatContext>
- auto format(std::optional<mtx::http::ClientError> c, FormatContext &ctx)
+ auto format(std::optional<mtx::http::ClientError> c, FormatContext &ctx) const
{
if (!c)
return fmt::format_to(ctx.out(), "(no error)");
--
2.47.1

View File

@@ -31,7 +31,8 @@ DEPEND="
"
PATCHES=(
"${FILESDIR}/0.6.0_remove_network_tests.patch"
"${FILESDIR}"/${PN}-0.6.0-remove-network-tests.patch
"${FILESDIR}"/${PN}-0.10.0-fmt11.patch
)
src_configure() {

View File

@@ -1,45 +0,0 @@
# Copyright 2020-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake
DESCRIPTION="Client API library for Matrix, built on top of libcurl"
HOMEPAGE="https://github.com/Nheko-Reborn/mtxclient"
SRC_URI="https://github.com/Nheko-Reborn/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MIT"
SLOT="0/${PV}" # ABI may break even on patch version changes
KEYWORDS="~amd64"
IUSE="test"
RESTRICT="!test? ( test )"
RDEPEND="
>=dev-cpp/coeurl-0.3.0:=[ssl]
dev-libs/libfmt:=
dev-libs/olm
>=dev-libs/openssl-1.1.0:=
>=dev-libs/re2-0.2022.04.01:=
dev-libs/spdlog:=
"
DEPEND="
${RDEPEND}
dev-cpp/nlohmann_json
test? ( dev-cpp/gtest )
"
PATCHES=(
"${FILESDIR}/0.6.0_remove_network_tests.patch"
)
src_configure() {
local -a mycmakeargs=(
-DBUILD_LIB_TESTS="$(usex test)"
-DBUILD_LIB_EXAMPLES=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=OFF
)
cmake_src_configure
}