Source: mediatomb
Version: 0.12.1-5
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/control b/debian/control
index 84ae488..59419c3 100644
--- a/debian/control
+++ b/debian/control
@@ -20,7 +20,8 @@ Build-Depends:
  libmysqlclient-dev,
  libsqlite3-dev,
  libtag1-dev,
- libz-dev
+ libz-dev,
+ pkg-config
 Standards-Version: 3.9.4
 Homepage: http://mediatomb.cc/
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-multimedia/mediatomb.git
diff --git a/debian/patches/0012_pkg-config.patch b/debian/patches/0012_pkg-config.patch
new file mode 100644
index 0000000..cd349ce
--- /dev/null
+++ b/debian/patches/0012_pkg-config.patch
@@ -0,0 +1,22 @@
+Description: Use pkg-config to determine FFmpeg linker flags
+
+Author: Andreas Cadhalpun <[email protected]>
+Last-Update: <2014-05-15>
+
+--- mediatomb-0.12.1.orig/configure.ac
++++ mediatomb-0.12.1/configure.ac
+@@ -1556,8 +1556,12 @@ if test "x$FFMPEG_OPTION_ENABLED" = xyes
+     fi
+ 
+     if test "x$AVFORMAT_STATUS" = xyes; then
+-        MT_CHECK_LIBRARY([avformat], [avformat], [av_register_all])
+-        MT_CHECK_LIBRARY([avutil], [avutil], [av_log_set_callback])
++        PKG_CHECK_MODULES([libavformat],[libavformat])
++        avf_name=`echo $libavformat_LIBS | sed 's/-l//'`
++        MT_CHECK_LIBRARY([avformat], [$avf_name], [av_register_all])
++        PKG_CHECK_MODULES([libavutil],[libavutil])
++        avu_name=`echo $libavutil_LIBS | sed 's/-l//'`
++        MT_CHECK_LIBRARY([avutil], [$avu_name], [av_log_set_callback])
+     fi
+     AC_LANG_RESTORE
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 404e199..2904c79 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -13,3 +13,4 @@
 0009b_fix_ffmpeg_metadata.patch
 0010_fix_libmp4v2_build.patch
 0011_libav_9_support.patch
+0012_pkg-config.patch

Reply via email to