From e5377e9545b78a14e69e47bb7a7e88dcea97fa96 Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Sun, 24 Mar 2019 20:29:42 +0100 Subject: [PATCH] package/gerbera: fix static build with ffmpeg Fixes: - http://autobuild.buildroot.org/results/2b99fabd798db84a0fce26ad696c58e54c6ff626 - http://autobuild.buildroot.org/results/95e410e5ab34c6d4626a58f97c0d2d5e6829a300 Signed-off-by: Fabrice Fontaine Signed-off-by: Peter Korsgaard (cherry picked from commit 8795cb2082437e4d27fa24fae66fdad350439e67) Signed-off-by: Peter Korsgaard --- ...cmake-FindFFMPEG-cmake-use-pkgconfig.patch | 175 ++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 package/gerbera/0002-cmake-FindFFMPEG-cmake-use-pkgconfig.patch diff --git a/package/gerbera/0002-cmake-FindFFMPEG-cmake-use-pkgconfig.patch b/package/gerbera/0002-cmake-FindFFMPEG-cmake-use-pkgconfig.patch new file mode 100644 index 0000000000..b5f79173b6 --- /dev/null +++ b/package/gerbera/0002-cmake-FindFFMPEG-cmake-use-pkgconfig.patch @@ -0,0 +1,175 @@ +From fbbc07ce53e884b1603461ee5642d5f02788678d Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Thu, 21 Mar 2019 16:32:44 +0100 +Subject: [PATCH] cmake/FindFFMPEG.cmake: use pkgconfig + +ffmpeg has too many optional dependencies (opus, openssl, ...) instead +of trying to find them all one by one, use pkg-config to get them and +fallback on current mechanism + +Fixes: + - http://autobuild.buildroot.org/results/2b99fabd798db84a0fce26ad696c58e54c6ff626 + - http://autobuild.buildroot.org/results/95e410e5ab34c6d4626a58f97c0d2d5e6829a300 + +Signed-off-by: Fabrice Fontaine +[Retrieved (and backported) from: +https://github.com/gerbera/gerbera/commit/fbbc07ce53e884b1603461ee5642d5f02788678d] +--- + cmake/FindFFMPEG.cmake | 147 +++++++++++++++++++++-------------------- + 1 file changed, 75 insertions(+), 72 deletions(-) + +diff --git a/cmake/FindFFMPEG.cmake b/cmake/FindFFMPEG.cmake +index 0a4a409f..9548b566 100644 +--- a/cmake/FindFFMPEG.cmake ++++ b/cmake/FindFFMPEG.cmake +@@ -82,70 +82,76 @@ ENDIF (NOT FFMPEG_INCLUDE_DIR) + # ffmpeg uses relative includes such as or + get_filename_component(FFMPEG_INCLUDE_DIR ${FFMPEG_INCLUDE_DIR} ABSOLUTE) + +-FIND_LIBRARY(FFMPEG_avformat_LIBRARY avformat +- /usr/local/lib +- /usr/lib +- ) +- +-FIND_LIBRARY(FFMPEG_avcodec_LIBRARY avcodec +- /usr/local/lib +- /usr/lib +- ) +- +-FIND_LIBRARY(FFMPEG_avutil_LIBRARY avutil +- /usr/local/lib +- /usr/lib +- ) +- +-FIND_LIBRARY(FFMPEG_swresample_LIBRARY swresample +- /usr/local/lib +- /usr/lib +- ) +- +-FIND_LIBRARY(FFMPEG_vorbis_LIBRARY vorbis +- /usr/local/lib +- /usr/lib +- ) +- +-FIND_LIBRARY(FFMPEG_dc1394_LIBRARY dc1394_control +- /usr/local/lib +- /usr/lib +- ) +- +-FIND_LIBRARY(FFMPEG_vorbisenc_LIBRARY vorbisenc +- /usr/local/lib +- /usr/lib +- ) +- +-FIND_LIBRARY(FFMPEG_theora_LIBRARY theora +- /usr/local/lib +- /usr/lib +- ) +- +-FIND_LIBRARY(FFMPEG_dts_LIBRARY dts +- /usr/local/lib +- /usr/lib +- ) +- +-FIND_LIBRARY(FFMPEG_gsm_LIBRARY gsm +- /usr/local/lib +- /usr/lib +- ) +- +-FIND_LIBRARY(FFMPEG_swscale_LIBRARY swscale +- /usr/local/lib +- /usr/lib +- ) +- +-FIND_LIBRARY(FFMPEG_z_LIBRARY z +- /usr/local/lib +- /usr/lib +- ) +- +-FIND_LIBRARY(FFMPEG_bz2_LIBRARY bz2 +- /usr/local/lib +- /usr/lib +- ) ++CHECK_STRUCT_HAS_MEMBER("struct AVStream" codecpar libavformat/avformat.h HAVE_AVSTREAM_CODECPAR LANGUAGE C) ++ ++FIND_PACKAGE(PkgConfig QUIET) ++PKG_CHECK_MODULES(FFMPEG QUIET libavformat libavutil) ++IF (NOT FFMPEG_FOUND) ++ FIND_LIBRARY(FFMPEG_avformat_LIBRARY avformat ++ /usr/local/lib ++ /usr/lib ++ ) ++ ++ FIND_LIBRARY(FFMPEG_avcodec_LIBRARY avcodec ++ /usr/local/lib ++ /usr/lib ++ ) ++ ++ FIND_LIBRARY(FFMPEG_avutil_LIBRARY avutil ++ /usr/local/lib ++ /usr/lib ++ ) ++ ++ FIND_LIBRARY(FFMPEG_swresample_LIBRARY swresample ++ /usr/local/lib ++ /usr/lib ++ ) ++ ++ FIND_LIBRARY(FFMPEG_vorbis_LIBRARY vorbis ++ /usr/local/lib ++ /usr/lib ++ ) ++ ++ FIND_LIBRARY(FFMPEG_dc1394_LIBRARY dc1394_control ++ /usr/local/lib ++ /usr/lib ++ ) ++ ++ FIND_LIBRARY(FFMPEG_vorbisenc_LIBRARY vorbisenc ++ /usr/local/lib ++ /usr/lib ++ ) ++ ++ FIND_LIBRARY(FFMPEG_theora_LIBRARY theora ++ /usr/local/lib ++ /usr/lib ++ ) ++ ++ FIND_LIBRARY(FFMPEG_dts_LIBRARY dts ++ /usr/local/lib ++ /usr/lib ++ ) ++ ++ FIND_LIBRARY(FFMPEG_gsm_LIBRARY gsm ++ /usr/local/lib ++ /usr/lib ++ ) ++ ++ FIND_LIBRARY(FFMPEG_swscale_LIBRARY swscale ++ /usr/local/lib ++ /usr/lib ++ ) ++ ++ FIND_LIBRARY(FFMPEG_z_LIBRARY z ++ /usr/local/lib ++ /usr/lib ++ ) ++ ++ FIND_LIBRARY(FFMPEG_bz2_LIBRARY bz2 ++ /usr/local/lib ++ /usr/lib ++ ) ++ENDIF(NOT FFMPEG_FOUND) + + SET(FFMPEG_LIBRARIES) + IF (FFMPEG_INCLUDE_DIR) +@@ -205,9 +211,6 @@ IF (FFMPEG_INCLUDE_DIR) + ENDIF (FFMPEG_bz2_LIBRARY) + + SET(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} CACHE INTERNAL "All presently found FFMPEG libraries.") +- +- CHECK_STRUCT_HAS_MEMBER("struct AVStream" codecpar libavformat/avformat.h HAVE_AVSTREAM_CODECPAR LANGUAGE C) +- + ENDIF (FFMPEG_avutil_LIBRARY) + ENDIF (FFMPEG_avcodec_LIBRARY) + ENDIF (FFMPEG_avformat_LIBRARY)