[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#758334: dvbcut: Use pkg-config to determine FFmpeg linker flags



Source: dvbcut
Version: 0.5.4+svn178-7
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..3878f70
--- /dev/null
+++ b/debian/patches/pkg-config.patch
@@ -0,0 +1,25 @@
+Description: Use pkg-config to determine FFmpeg linker flags
+
+Author: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
+Last-Update: <2014-05-14>
+
+--- dvbcut-0.5.4+svn178.orig/configure.in
++++ dvbcut-0.5.4+svn178/configure.in
+@@ -80,13 +80,12 @@ LDFLAGS="-L$ffmpeg_lib $LDFLAGS"
+ 
+ dnl Checks for libraries.
+ 
+-FFMPEG_LIBS='-lavformat -lavcodec -lavutil'
+-AC_SUBST(FFMPEG_LIBS)
++PKG_CHECK_MODULES([FFMPEG], [libavformat libavcodec libavutil])
+ 
+ if test x$ffmpeg_internal != xffmpeg_internal; then
+-  AC_CHECK_LIB(swscale, main,
+-    [AC_DEFINE(HAVE_LIB_SWSCALE, 1, [Define this if you have libswscale.])
+-    FFMPEG_LIBS="$FFMPEG_LIBS -lswscale"])
++  PKG_CHECK_MODULES([swscale], [libswscale],
++   [AC_DEFINE(HAVE_LIB_SWSCALE, 1, [Define this if you have libswscale.])
++    FFMPEG_LIBS="$FFMPEG_LIBS $swscale_LIBS"])
+ fi
+ 
+ AC_CHECK_LIB(mad, mad_decoder_init,
diff --git a/debian/patches/series b/debian/patches/series
index aa68b97..0e18978 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ fix_gcc_4.7.patch
 updateimagedisplayfix.patch
 libav9.patch
 libav10.patch
+pkg-config.patch


Reply to: