1 |
commit: 64d8afb7f3cd0f431e5b40fe486e1e89965131e5 |
2 |
Author: Hank Leininger <hlein <AT> korelogic <DOT> com> |
3 |
AuthorDate: Thu Jun 24 18:25:46 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jun 25 00:31:14 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=64d8afb7 |
7 |
|
8 |
dev-libs/spdlog: fix compiling with libfmt-8 installed |
9 |
|
10 |
See also upstream https://github.com/gabime/spdlog/issues/1975 |
11 |
|
12 |
Signed-off-by: Hank Leininger <hlein <AT> korelogic.com> |
13 |
Closes: https://bugs.gentoo.org/797394 |
14 |
Package-Manager: Portage-3.0.20, Repoman-3.0.3 |
15 |
Closes: https://github.com/gentoo/gentoo/pull/21413 |
16 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
17 |
|
18 |
.../spdlog/files/spdlog-1.8.5-libfmt-8-fix.patch | 13 ++++++ |
19 |
dev-libs/spdlog/spdlog-1.8.5-r1.ebuild | 49 ++++++++++++++++++++++ |
20 |
2 files changed, 62 insertions(+) |
21 |
|
22 |
diff --git a/dev-libs/spdlog/files/spdlog-1.8.5-libfmt-8-fix.patch b/dev-libs/spdlog/files/spdlog-1.8.5-libfmt-8-fix.patch |
23 |
new file mode 100644 |
24 |
index 00000000000..f59a9bca4b3 |
25 |
--- /dev/null |
26 |
+++ b/dev-libs/spdlog/files/spdlog-1.8.5-libfmt-8-fix.patch |
27 |
@@ -0,0 +1,13 @@ |
28 |
+See upstream https://github.com/gabime/spdlog/issues/1975 |
29 |
+ |
30 |
+--- a/include/spdlog/common-inl.h 2021-06-21 17:15:26.695992698 -0600 |
31 |
++++ b/include/spdlog/common-inl.h 2021-06-21 17:15:52.205992496 -0600 |
32 |
+@@ -60,7 +60,7 @@ |
33 |
+ SPDLOG_INLINE spdlog_ex::spdlog_ex(const std::string &msg, int last_errno) |
34 |
+ { |
35 |
+ memory_buf_t outbuf; |
36 |
+- fmt::format_system_error(outbuf, last_errno, msg); |
37 |
++ fmt::format_system_error(outbuf, last_errno, msg.c_str()); |
38 |
+ msg_ = fmt::to_string(outbuf); |
39 |
+ } |
40 |
+ |
41 |
|
42 |
diff --git a/dev-libs/spdlog/spdlog-1.8.5-r1.ebuild b/dev-libs/spdlog/spdlog-1.8.5-r1.ebuild |
43 |
new file mode 100644 |
44 |
index 00000000000..26e7cb42bce |
45 |
--- /dev/null |
46 |
+++ b/dev-libs/spdlog/spdlog-1.8.5-r1.ebuild |
47 |
@@ -0,0 +1,49 @@ |
48 |
+# Copyright 1999-2021 Gentoo Authors |
49 |
+# Distributed under the terms of the GNU General Public License v2 |
50 |
+ |
51 |
+EAPI=7 |
52 |
+ |
53 |
+inherit cmake |
54 |
+ |
55 |
+DESCRIPTION="Very fast, header only, C++ logging library" |
56 |
+HOMEPAGE="https://github.com/gabime/spdlog" |
57 |
+ |
58 |
+if [[ ${PV} == *9999 ]]; then |
59 |
+ inherit git-r3 |
60 |
+ EGIT_REPO_URI="https://github.com/gabime/${PN}" |
61 |
+else |
62 |
+ SRC_URI="https://github.com/gabime/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
63 |
+ KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86" |
64 |
+fi |
65 |
+ |
66 |
+LICENSE="MIT" |
67 |
+SLOT="0/1" |
68 |
+IUSE="test" |
69 |
+RESTRICT="!test? ( test )" |
70 |
+ |
71 |
+BDEPEND=" |
72 |
+ virtual/pkgconfig |
73 |
+" |
74 |
+DEPEND=" |
75 |
+ >=dev-libs/libfmt-6.1.2:= |
76 |
+" |
77 |
+RDEPEND="${DEPEND}" |
78 |
+ |
79 |
+PATCHES=( "${FILESDIR}/${P}-libfmt-8-fix.patch" ) |
80 |
+ |
81 |
+src_prepare() { |
82 |
+ cmake_src_prepare |
83 |
+ rm -r include/spdlog/fmt/bundled || die "Failed to delete bundled libfmt" |
84 |
+} |
85 |
+ |
86 |
+src_configure() { |
87 |
+ local mycmakeargs=( |
88 |
+ -DSPDLOG_BUILD_BENCH=no |
89 |
+ -DSPDLOG_BUILD_EXAMPLE=no |
90 |
+ -DSPDLOG_FMT_EXTERNAL=yes |
91 |
+ -DSPDLOG_BUILD_SHARED=yes |
92 |
+ -DSPDLOG_BUILD_TESTS=$(usex test) |
93 |
+ ) |
94 |
+ |
95 |
+ cmake_src_configure |
96 |
+} |