Source: forked-daapd
Version: 21.0-1
Severity: wishlist
Tags: patch
Usertags: reintroducing-ffmpeg

Dear maintainer,

I am working on reintroducing FFmpeg to Debian [1-2].

In order to make FFmpeg co-installable with Libav, the libraries were
renamed to lib*-ffmpeg. Thus using linker flags like '-lavcodec' doesn't
work with the FFmpeg packages.

To get the correct linking flags for both FFmpeg and Libav, one can
(and should) use pkg-config.

Attached patch achieves that for this package. Please apply it to
facilitate building your package with FFmpeg in Debian.

If you want to facilitate this even further, you can also add
lib*-ffmpeg-dev alternatives to the Libav build-dependencies.

While the FFmpeg package is still waiting in the NEW queue [3], it can
already be built from the git repository [4].

Best regards,
Andreas


1: https://lists.debian.org/debian-devel/2014/07/msg01010.html
2: https://bugs.debian.org/729203
3: https://ftp-master.debian.org/new/ffmpeg_7:2.3.1-1.html
4: https://anonscm.debian.org/cgit/collab-maint/ffmpeg.git

diff --git a/debian/patches/pkg-config.patch b/debian/patches/pkg-config.patch
new file mode 100644
index 0000000..d5070e5
--- /dev/null
+++ b/debian/patches/pkg-config.patch
@@ -0,0 +1,24 @@
+Description: Use pkg-config to determine FFmpeg linker flags
+
+Author: Andreas Cadhalpun <[email protected]>
+Last-Update: <2014-06-03>
+
+--- forked-daapd-20.0+git20140530+gc740e6e.orig/configure.ac
++++ forked-daapd-20.0+git20140530+gc740e6e/configure.ac
+@@ -142,11 +142,14 @@ PKG_CHECK_EXISTS([ libavcodec >= 54.35 ]
+   PKG_CHECK_MODULES(LIBAV, [ libavformat libavcodec libswscale libavutil ])
+ ])
+ 
++PKG_CHECK_MODULES([LIBAVCODEC], [libavcodec])
++avc_name=`echo $LIBAVCODEC_LIBS | sed 's/-l//'`
++
+ save_LIBS="$LIBS"
+ dnl Check for av_lock_manager (ffmpeg >= 0.5.1)
+-AC_CHECK_LIB([avcodec], [av_lockmgr_register], , AC_MSG_ERROR([libav (ffmpeg) >= 0.5.1 required]))
++AC_CHECK_LIB([$avc_name], [av_lockmgr_register], , AC_MSG_ERROR([libav (ffmpeg) >= 0.5.1 required]))
+ dnl Check for avcodec_find_best_pix_fmt_of_list (is only in ffmpeg, not libav)
+-AC_CHECK_LIB([avcodec], [avcodec_find_best_pix_fmt_of_list],
++AC_CHECK_LIB([$avc_name], [avcodec_find_best_pix_fmt_of_list],
+ 	AC_DEFINE(FFMPEG_INCOMPATIBLE_API, 1, [Define to 1 if you have ffmpeg (and not libav).]))
+ LIBS="$save_LIBS"
+ 
diff --git a/debian/patches/series b/debian/patches/series
index e69de29..9937964 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -0,0 +1 @@
+pkg-config.patch

Reply via email to