[meta-multimedia] gerbera: Fix build with fmt 8.1+

Message ID 20220125205939.1310384-1-raj.khem@gmail.com
State New
Headers show
Series [meta-multimedia] gerbera: Fix build with fmt 8.1+ | expand

Commit Message

Khem Raj Jan. 25, 2022, 8:59 p.m. UTC
The APIs have changes and we use external fmt library in spdlog
which is used here

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...Explicitly-cast-scanmode-enum-to-int.patch | 35 +++++++++++++++++++
 .../gerbera/gerbera_1.9.2.bb                  |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 meta-multimedia/recipes-multimedia/gerbera/gerbera/0001-Explicitly-cast-scanmode-enum-to-int.patch

Patch

diff --git a/meta-multimedia/recipes-multimedia/gerbera/gerbera/0001-Explicitly-cast-scanmode-enum-to-int.patch b/meta-multimedia/recipes-multimedia/gerbera/gerbera/0001-Explicitly-cast-scanmode-enum-to-int.patch
new file mode 100644
index 0000000000..bff0b2418d
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/gerbera/gerbera/0001-Explicitly-cast-scanmode-enum-to-int.patch
@@ -0,0 +1,35 @@ 
+From 9eaf38dd6e4f7d24d7eaa1c6572495f3b4f2e969 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 25 Jan 2022 12:51:45 -0800
+Subject: [PATCH] Explicitly cast scanmode enum to int
+
+Newer fmt library needs this now, fmt::format does not accept
+the enum as part of va_list
+
+Fixes
+/usr/include/fmt/core.h:1727:3: error: static_assert failed due to requ
+irement 'formattable' "Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt"
+  static_assert(
+
+Upstream-Status: Submitted [https://github.com/gerbera/gerbera/pull/2391]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/content/autoscan.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/content/autoscan.cc b/src/content/autoscan.cc
+index fa5702cf..3c4a9020 100644
+--- a/src/content/autoscan.cc
++++ b/src/content/autoscan.cc
+@@ -121,7 +121,7 @@ std::string_view AutoscanDirectory::mapScanmode(ScanMode scanmode)
+     case ScanMode::INotify:
+         return "inotify";
+     }
+-    throw_std_runtime_error("Illegal scanmode ({}) given to mapScanmode()", scanmode);
++    throw_std_runtime_error("Illegal scanmode ({}) given to mapScanmode()", static_cast<int>(scanmode));
+ }
+ 
+ ScanMode AutoscanDirectory::remapScanmode(const std::string& scanmode)
+-- 
+2.35.0
+
diff --git a/meta-multimedia/recipes-multimedia/gerbera/gerbera_1.9.2.bb b/meta-multimedia/recipes-multimedia/gerbera/gerbera_1.9.2.bb
index 94657ba534..0424ce89c7 100644
--- a/meta-multimedia/recipes-multimedia/gerbera/gerbera_1.9.2.bb
+++ b/meta-multimedia/recipes-multimedia/gerbera/gerbera_1.9.2.bb
@@ -4,6 +4,7 @@  LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://LICENSE.md;md5=25cdec9afe3f1f26212ead6bd2f7fac8"
 
 SRC_URI = "git://github.com/v00d00/gerbera.git;protocol=https;branch=master \
+           file://0001-Explicitly-cast-scanmode-enum-to-int.patch \
           "
 
 SRCREV = "3b93d362ec33f738868a4e896a2c9ee8e9d7a92a"