- Add 0001-fix-update-to_string_view-function-for-fmt-11.1-3301.patch

to cope with fmt 11.1

OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/spdlog?expand=0&rev=112
This commit is contained in:
Bernd Ritter 2024-12-27 14:15:28 +00:00 committed by Git OBS Bridge
commit c4d558650f
8 changed files with 1265 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View File

@ -0,0 +1,35 @@
From 276ee5f5c0eb13626bd367b006ace5eae9526d8a Mon Sep 17 00:00:00 2001
From: Rui Chen <rui@chenrui.dev>
Date: Thu, 26 Dec 2024 02:13:57 -0500
Subject: [PATCH] fix: update to_string_view function for fmt 11.1 (#3301)
Signed-off-by: Rui Chen <rui@chenrui.dev>
---
include/spdlog/common.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/include/spdlog/common.h b/include/spdlog/common.h
index aca483c2..2d73f830 100644
--- a/include/spdlog/common.h
+++ b/include/spdlog/common.h
@@ -365,10 +365,17 @@ SPDLOG_CONSTEXPR_FUNC spdlog::wstring_view_t to_string_view(spdlog::wstring_view
#endif
#ifndef SPDLOG_USE_STD_FORMAT
+#if FMT_VERSION >= 110100
+template <typename T, typename... Args>
+inline fmt::basic_string_view<T> to_string_view(fmt::basic_format_arg<T> fmt) {
+ return fmt;
+}
+#else
template <typename T, typename... Args>
inline fmt::basic_string_view<T> to_string_view(fmt::basic_format_string<T, Args...> fmt) {
return fmt;
}
+#endif
#elif __cpp_lib_format >= 202207L
template <typename T, typename... Args>
SPDLOG_CONSTEXPR_FUNC std::basic_string_view<T> to_string_view(
--
2.47.1

1
baselibs.conf Normal file
View File

@ -0,0 +1 @@
libspdlog1_15

1081
spdlog.changes Normal file

File diff suppressed because it is too large Load Diff

118
spdlog.spec Normal file
View File

@ -0,0 +1,118 @@
#
# spec file for package spdlog
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: spdlog
%define lname libspdlog1_15
%define sover 1.15
Version: 1.15.0
Release: 0
Summary: C++ logging library
License: MIT
Group: Development/Libraries/C and C++
URL: https://github.com/gabime/spdlog
Source0: https://github.com/gabime/%{name}/archive/refs/tags/v%{version}.tar.gz
Source99: baselibs.conf
Patch1: 0001-fix-update-to_string_view-function-for-fmt-11.1-3301.patch
BuildRequires: cmake >= 3.10
%if 0%{?suse_version} > 1500
BuildRequires: gcc-c++ >= 13
%else
BuildRequires: gcc13-c++
%endif
BuildRequires: ninja
BuildRequires: pkgconfig
BuildRequires: (pkgconfig(catch2) >= 3)
BuildRequires: (pkgconfig(fmt) >= 11)
BuildRequires: pkgconfig(libsystemd)
%description
A header-only/compiled, C++ logging library.
* Asynchronous mode (optional)
* Multi/Single threaded loggers.
* Various log targets (rotating/daily files, console, with colors,
syslog, custom target)
%package devel
Summary: Header files for spdlog
Requires: %{lname} = %{version}
Requires: libstdc++-devel
Requires: pkgconfig(fmt)
%description devel
The %{name}-devel package contains C++ header files for developing
applications that use %{name}.
%package -n %{lname}
Summary: C++ logging library
%description -n %{lname}
A header-only/compiled, C++ logging library.
* Asynchronous mode (optional)
* Multi/Single threaded loggers.
* Various log targets (rotating/daily files, console, with colors,
syslog, custom target)
%prep
%autosetup -p1
find . -name .gitignore -delete
sed -i -e "s,\r,," README.md LICENSE
%build
export CXX=g++
test -x "$(type -p g++-13)" && export CXX=g++-13
# spdlog embodies fmt ABI; add some symvers so both ld.so and rpm notice the change.
v=v$(rpm -q --qf="%%{VERSION}" --whatprovides "pkgconfig(fmt)" | sed -e 's/\..*//')
echo "FMT_$v { global: _ZN6spdlog*N3fmt${#v}${v}*; };" >spdlog.sym
v="$PWD/spdlog.sym"
%cmake -G Ninja \
-DSPDLOG_BUILD_TESTS=ON \
-DSPDLOG_BUILD_BENCH=OFF \
-DSPDLOG_FMT_EXTERNAL=ON \
-DCMAKE_BUILD_TYPE=Release \
-DSPDLOG_BUILD_EXAMPLE=OFF \
-DSPDLOG_BUILD_SHARED=ON \
-DCMAKE_SHARED_LINKER_FLAGS="%{?build_ldflags} -Wl,--as-needed -Wl,-z,now -Wl,--version-script=$v" \
..
%ninja_build
%install
%ninja_install -C build
%check
export LD_LIBRARY_PATH="$PWD/build"
%ctest
%ldconfig_scriptlets -n %{lname}
%files devel
%license LICENSE
%doc README.md
%{_includedir}/spdlog/
%{_libdir}/libspdlog.so
%{_libdir}/cmake/spdlog/
%{_libdir}/pkgconfig/spdlog.pc
%{_libdir}/cmake
%files -n %{lname}
%{_libdir}/libspdlog.so.*
%changelog

3
v1.14.1.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1586508029a7d0670dfcb2d97575dcdc242d3868a259742b69f100801ab4e16b
size 270896

3
v1.15.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9962648c9b4f1a7bbc76fd8d9172555bad1871fdb14ff4f842ef87949682caa5
size 276012