commit:     3c91b36e1687d3282276b8a63d21b2d342410957
Author:     Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
AuthorDate: Tue Dec  3 05:02:14 2024 +0000
Commit:     Anna Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
CommitDate: Tue Dec  3 05:59:27 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=3c91b36e

dev-libs/mtxclient: fix build with libfmt 11

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq.in>

 dev-libs/mtxclient/Manifest                        |  1 -
 .../mtxclient/files/mtxclient-0.10.0-fmt11.patch   | 49 ++++++++++++++++++++++
 ... => mtxclient-0.6.0-remove-network-tests.patch} |  0
 ...nt-0.10.0.ebuild => mtxclient-0.10.0-r1.ebuild} |  3 +-
 dev-libs/mtxclient/mtxclient-0.9.2.ebuild          | 45 --------------------
 5 files changed, 51 insertions(+), 47 deletions(-)

diff --git a/dev-libs/mtxclient/Manifest b/dev-libs/mtxclient/Manifest
index 14c76d1a2..b70c34226 100644
--- a/dev-libs/mtxclient/Manifest
+++ b/dev-libs/mtxclient/Manifest
@@ -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

diff --git a/dev-libs/mtxclient/files/mtxclient-0.10.0-fmt11.patch 
b/dev-libs/mtxclient/files/mtxclient-0.10.0-fmt11.patch
new file mode 100644
index 000000000..ba8113582
--- /dev/null
+++ b/dev-libs/mtxclient/files/mtxclient-0.10.0-fmt11.patch
@@ -0,0 +1,49 @@
+From 4a4726c77123f805cff8b954909663eaed296558 Mon Sep 17 00:00:00 2001
+From: Kefu Chai <[email protected]>
+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 <[email protected]>
+---
+ 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
+

diff --git a/dev-libs/mtxclient/files/0.6.0_remove_network_tests.patch 
b/dev-libs/mtxclient/files/mtxclient-0.6.0-remove-network-tests.patch
similarity index 100%
rename from dev-libs/mtxclient/files/0.6.0_remove_network_tests.patch
rename to dev-libs/mtxclient/files/mtxclient-0.6.0-remove-network-tests.patch

diff --git a/dev-libs/mtxclient/mtxclient-0.10.0.ebuild 
b/dev-libs/mtxclient/mtxclient-0.10.0-r1.ebuild
similarity index 90%
rename from dev-libs/mtxclient/mtxclient-0.10.0.ebuild
rename to dev-libs/mtxclient/mtxclient-0.10.0-r1.ebuild
index 9fd6e27ac..7401a8509 100644
--- a/dev-libs/mtxclient/mtxclient-0.10.0.ebuild
+++ b/dev-libs/mtxclient/mtxclient-0.10.0-r1.ebuild
@@ -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() {

diff --git a/dev-libs/mtxclient/mtxclient-0.9.2.ebuild 
b/dev-libs/mtxclient/mtxclient-0.9.2.ebuild
deleted file mode 100644
index fa3a99ce4..000000000
--- a/dev-libs/mtxclient/mtxclient-0.9.2.ebuild
+++ /dev/null
@@ -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
-}

Reply via email to