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

Bug#758336: ffmpegthumbs: Use pkg-config to determine FFmpeg linker flags



Source: ffmpegthumbs
Version: 4:4.13.3-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..2edde6f
--- /dev/null
+++ b/debian/patches/pkg-config.patch
@@ -0,0 +1,18 @@
+Description: Use pkg-config to determine FFmpeg linker flags
+
+Author: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
+Last-Update: <2014-05-18>
+
+--- ffmpegthumbs-4.12.2.orig/cmake/FindFFmpeg.cmake
++++ ffmpegthumbs-4.12.2/cmake/FindFFmpeg.cmake
+@@ -74,7 +74,9 @@ macro(find_component _component _pkgconf
+       ffmpeg
+   )
+ 
+-  find_library(${_component}_LIBRARIES NAMES ${_library}
++  string(REPLACE "-l" "" ${_component}_name "${PC_${_component}_LIBRARIES}")
++
++  find_library(${_component}_LIBRARIES NAMES ${${_component}_name} ${_library}
+       HINTS
+       ${PC_LIB${_component}_LIBDIR}
+       ${PC_LIB${_component}_LIBRARY_DIRS}
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..9937964
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+pkg-config.patch


Reply to: