Bug#758346: kde4libs: Use pkg-config to determine FFmpeg linker flags
Source: kde4libs
Version: 4:4.13.3-2
Severity: wishlist
Tags: patch
Usertags: reintroducing-ffmpeg
Control: affects -1 k3b kfilemetadata nepomuk-core
Dear maintainer,
I am working on reintroducing FFmpeg to Debian [1-4].
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.
The package kdelibs5-dev contains the cmake module FindFFmpeg.cmake,
which is used by k3b, kfilemetadata and nepomuk-core.
Attached patch changes this cmake module to prefer using pkg-config to
determine the FFmpeg linker flags. Please apply it to
facilitate building the affected packages with FFmpeg in Debian.
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..2a8a95f
--- /dev/null
+++ b/debian/patches/pkg-config.patch
@@ -0,0 +1,24 @@
+Description: Use pkg-config to determine FFmpeg linker flags
+
+Author: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
+Last-Update: <2014-08-05>
+
+--- kde4libs-4.13.3.orig/cmake/modules/FindFFmpeg.cmake
++++ kde4libs-4.13.3/cmake/modules/FindFFmpeg.cmake
+@@ -63,6 +63,7 @@ macro(find_component _component _pkgconf
+ find_package(PkgConfig)
+ if (PKG_CONFIG_FOUND)
+ pkg_check_modules(PC_${_component} ${_pkgconfig})
++ string(REPLACE "-l" "" ${_component}_name "${PC_${_component}_LIBRARIES}")
+ endif ()
+ endif (NOT WIN32)
+
+@@ -74,7 +75,7 @@ macro(find_component _component _pkgconf
+ ffmpeg
+ )
+
+- find_library(${_component}_LIBRARIES NAMES ${_library}
++ 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
index 194dae9..01b0792 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -30,3 +30,4 @@ disable_bogus_tests
upstream-make_include_style_be_the_same_for_QtCore.patch
fix_solidlex_destroy_signature.patch
upstream_use-dbus-system-bus-name-instead-of-pid.patch
+pkg-config.patch
Reply to: