All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2, 1/1] package/gerbera: fix static build with ffmpeg
Date: Sun, 24 Mar 2019 20:29:42 +0100	[thread overview]
Message-ID: <20190324192942.28620-1-fontaine.fabrice@gmail.com> (raw)

Fixes:
 - http://autobuild.buildroot.org/results/2b99fabd798db84a0fce26ad696c58e54c6ff626
 - http://autobuild.buildroot.org/results/95e410e5ab34c6d4626a58f97c0d2d5e6829a300

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
Changes v1 -> v2:
 - Update patch to fix issue with dynamic linking

 ...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 <fontaine.fabrice@gmail.com>
+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 <fontaine.fabrice@gmail.com>
+[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 <ffmpeg/avformat.h> or <libavcodec/avformat.h>
+ 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)
-- 
2.20.1

             reply	other threads:[~2019-03-24 19:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-24 19:29 Fabrice Fontaine [this message]
2019-03-25 10:07 ` [Buildroot] [PATCH v2, 1/1] package/gerbera: fix static build with ffmpeg Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190324192942.28620-1-fontaine.fabrice@gmail.com \
    --to=fontaine.fabrice@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.