File 001_kodi.binary-addons-inputstream.adaptive_use-packaged_libwebm.patch of Package kodi.binary-addons-inputstream.adaptive

diff -uNr kodi.binary-addons-inputstream.adaptive-21.x+git.20230410T120451~2b4bc40.orig/CMakeLists.txt kodi.binary-addons-inputstream.adaptive-21.x+git.20230410T120451~2b4bc40/CMakeLists.txt
--- kodi.binary-addons-inputstream.adaptive-21.x+git.20230410T120451~2b4bc40.orig/CMakeLists.txt	2023-04-10 07:51:56.300310640 +0200
+++ kodi.binary-addons-inputstream.adaptive-21.x+git.20230410T120451~2b4bc40/CMakeLists.txt	2023-04-10 07:55:29.376792455 +0200
@@ -138,13 +138,16 @@
 
 include_directories(${INCLUDES}
                     ${KODI_INCLUDE_DIR}/.. # Hack way with "/..", need bigger Kodi cmake rework to match right include ways (becomes done in future)
-                    lib/webm_parser/include
-)
+                   )
 
 set(CMAKE_FIND_FRAMEWORK LAST)
 
 find_package(Bento4 REQUIRED)
 find_package(Pugixml REQUIRED)
+include(FindWEBM)
+find_package(WEBM REQUIRED)
+include_directories(${WEBM_INCLUDE_DIRS})
+list(APPEND DEPLIBS ${WEBM_LIBRARIES})
 
 if(WIN32)
   add_definitions(-DXML_STATIC -D_CRT_NONSTDC_NO_DEPRECATE)
@@ -166,20 +169,17 @@
 endif()
 
 add_subdirectory(lib/mpegts)
-add_subdirectory(lib/webm_parser)
 
 if(ENABLE_INTERNAL_BENTO4)
   include_directories(${BENTO4_INCLUDE_DIRS})
   add_dependencies(ssd_wv bento4)
   add_dependencies(mpegts bento4)
-  add_dependencies(webm_parser bento4)
 endif()
 
 set(DECRYPTERPATH "special://home/cdm")
 
 list(APPEND DEPLIBS ${BENTO4_LIBRARIES})
 list(APPEND DEPLIBS mpegts)
-list(APPEND DEPLIBS webm_parser)
 list(APPEND DEPLIBS ${PUGIXML_LIBRARIES})
 
 build_addon(inputstream.adaptive ADP DEPLIBS)
diff -uNr kodi.binary-addons-inputstream.adaptive-21.x+git.20230410T120451~2b4bc40.orig/FindWEBM.cmake kodi.binary-addons-inputstream.adaptive-21.x+git.20230410T120451~2b4bc40/FindWEBM.cmake
--- kodi.binary-addons-inputstream.adaptive-21.x+git.20230410T120451~2b4bc40.orig/FindWEBM.cmake	1970-01-01 01:00:00.000000000 +0100
+++ kodi.binary-addons-inputstream.adaptive-21.x+git.20230410T120451~2b4bc40/FindWEBM.cmake	2023-04-10 07:56:22.611147578 +0200
@@ -0,0 +1,28 @@
+# - Try to find webm
+# Once done this will define
+#
+# WEBM_FOUND - system has libwebm
+# WEBM_INCLUDE_DIRS - the libwebm include directory
+# WEBM_LIBRARIES - The libwebm libraries
+
+if(PKG_CONFIG_FOUND)
+  pkg_check_modules(PC_WEBM libwebm QUIET)
+endif()
+
+find_path(WEBM_INCLUDE_DIR webm/webm_parser.h PATHS ${PC_WEBM_INCLUDEDIR})
+find_library(WEBM_LIBRARY webm libwebm PATHS ${PC_WEBM_LIBDIR})
+
+set(WEBM_VERSION ${PC_WEBM_VERSION})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(WEBM
+                                  REQUIRED_VARS WEBM_INCLUDE_DIR WEBM_LIBRARY
+                                  VERSION_VAR WEBM_VERSION)
+
+if(WEBM_FOUND)
+  set(WEBM_LIBRARIES ${WEBM_LIBRARY})
+  set(WEBM_INCLUDE_DIRS ${WEBM_INCLUDE_DIR})
+endif()
+
+
+mark_as_advanced(WEBM_INCLUDE_DIRS WEBM_LIBRARIES)
openSUSE Build Service is sponsored by