| From bb9e80f4225d4ecb0d75d80c16b0ba3ddb12b1dc Mon Sep 17 00:00:00 2001 |
| From: Dario Binacchi <dario.binacchi@amarulasolutions.com> |
| Date: Mon, 2 Sep 2024 23:30:19 +0200 |
| Subject: [PATCH] Build against fmt 11.0.0 |
| |
| Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> |
| Upstream: backport from upstream https://github.com/gerbera/gerbera/commit/f1f266efbb0a6adac160e428cd14c20f6ecd3e5d |
| --- |
| README.md | 2 +- |
| scripts/install-spdlog.sh | 4 +++- |
| scripts/versions.sh | 2 +- |
| src/database/sql_format.h | 3 +++ |
| src/util/logger.h | 5 ++++- |
| src/util/url_utils.cc | 7 ++++++- |
| test/scripting/mock/duk_helper.cc | 4 +++- |
| 7 files changed, 21 insertions(+), 6 deletions(-) |
| |
| diff --git a/README.md b/README.md |
| index a1992738f009..990a9af8855f 100644 |
| --- a/README.md |
| +++ b/README.md |
| @@ -53,7 +53,7 @@ sudo make install |
| | libiconv | | | | Required | Charset conversion | | |
| | sqlite3 | 3.7.0 | 3.35.5 | 3.36.0 | Required | Database storage | | |
| | zlib | | | | Required | Data compression | | |
| -| [fmtlib] | 7.1.3 | 7.1.3 | 9.1.0 | Required | Fast string formatting | | |
| +| [fmtlib] | 7.1.3 | 9.1.0 | 11.0.0 | Required | Fast string formatting | | |
| | [spdlog] | 1.8.1 | 1.8.5 | 1.11.0 | Required | Runtime logging | | |
| | [duktape] | 2.1.0 | 2.6.0 | 2.7.0 | Optional | Scripting Support | Enabled | |
| | mysql | | | | Optional | Alternate database storage | Disabled | |
| diff --git a/scripts/install-spdlog.sh b/scripts/install-spdlog.sh |
| index 8a758e35b579..5c1426e3d44f 100755 |
| --- a/scripts/install-spdlog.sh |
| +++ b/scripts/install-spdlog.sh |
| @@ -39,7 +39,9 @@ fi |
| mkdir build |
| cd build |
| |
| -cmake .. -DSPDLOG_FMT_EXTERNAL=ON -DBUILD_SHARED_LIBS=${BUILD_SHARED} |
| +cmake .. -DSPDLOG_FMT_EXTERNAL=ON \ |
| + -DBUILD_SHARED_LIBS=${BUILD_SHARED} \ |
| + -DSPDLOG_BUILD_EXAMPLE=OFF |
| |
| if command -v nproc >/dev/null 2>&1; then |
| make "-j$(nproc)" |
| diff --git a/scripts/versions.sh b/scripts/versions.sh |
| index 19a0f80f79ac..8c1ffe7d590d 100644 |
| --- a/scripts/versions.sh |
| +++ b/scripts/versions.sh |
| @@ -36,7 +36,7 @@ else |
| EBML="1.4.4" |
| EXIV2="v0.27.5" |
| FFMPEGTHUMBNAILER="2.2.2" |
| - FMT="9.1.0" |
| + FMT="11.0.0" |
| GOOGLETEST="1.12.1" |
| LASTFM="0.4.0" |
| MATROSKA="1.7.1" |
| diff --git a/src/database/sql_format.h b/src/database/sql_format.h |
| index 551122eb7cf7..d64edae69372 100644 |
| --- a/src/database/sql_format.h |
| +++ b/src/database/sql_format.h |
| @@ -26,6 +26,9 @@ |
| #define __SQL_FORMAT_H__ |
| |
| #include <fmt/format.h> |
| +#if FMT_VERSION >= 100202 |
| +#include <fmt/ranges.h> |
| +#endif |
| |
| struct SQLIdentifier { |
| constexpr SQLIdentifier(std::string_view name, char quote_begin, char quote_end) |
| diff --git a/src/util/logger.h b/src/util/logger.h |
| index a121ead31e95..d51e60430ed9 100644 |
| --- a/src/util/logger.h |
| +++ b/src/util/logger.h |
| @@ -36,6 +36,9 @@ |
| |
| #include <array> |
| #include <fmt/format.h> |
| +#if FMT_VERSION >= 100202 |
| +#include <fmt/ranges.h> |
| +#endif |
| #include <map> |
| #include <spdlog/spdlog.h> |
| #include <type_traits> |
| @@ -135,7 +138,7 @@ template <typename T> |
| struct fmt::formatter<T, std::enable_if_t<std::is_enum_v<T>, char>> |
| : formatter<std::underlying_type_t<T>> { |
| template <typename FormatContext> |
| - auto format(const T& value, FormatContext& ctx) -> decltype(ctx.out()) |
| + auto format(const T& value, FormatContext& ctx) const -> decltype(ctx.out()) |
| { |
| return fmt::formatter<std::underlying_type_t<T>>::format( |
| static_cast<std::underlying_type_t<T>>(value), ctx); |
| diff --git a/src/util/url_utils.cc b/src/util/url_utils.cc |
| index b1c9fecef863..84f6f3be43d4 100644 |
| --- a/src/util/url_utils.cc |
| +++ b/src/util/url_utils.cc |
| @@ -23,11 +23,16 @@ Gerbera - https://gerbera.io/ |
| |
| #include "url_utils.h" // API |
| |
| +#include "exceptions.h" |
| + |
| + |
| #include <fmt/format.h> |
| +#if FMT_VERSION >= 100202 |
| +#include <fmt/ranges.h> |
| +#endif |
| #include <sstream> |
| |
| #include "common.h" |
| -#include "exceptions.h" |
| |
| namespace URLUtils { |
| |
| diff --git a/test/scripting/mock/duk_helper.cc b/test/scripting/mock/duk_helper.cc |
| index 71bdc5d025f7..f1ab1cfef8a7 100644 |
| --- a/test/scripting/mock/duk_helper.cc |
| +++ b/test/scripting/mock/duk_helper.cc |
| @@ -24,8 +24,10 @@ |
| #include "duk_helper.h" |
| #include <duk_config.h> |
| #include <duktape.h> |
| -#include <fmt/core.h> |
| #include <fmt/format.h> |
| +#if FMT_VERSION >= 100202 |
| +#include <fmt/ranges.h> |
| +#endif |
| #include <regex> |
| |
| std::vector<std::string> DukTestHelper::arrayToVector(duk_context* ctx, duk_idx_t idx) |
| -- |
| 2.43.0 |
| |