Source: openscenegraph
Version: 3.2.0~rc1-5.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..27efb6f
--- /dev/null
+++ b/debian/patches/pkg-config.patch
@@ -0,0 +1,26 @@
+Description: Use pkg-config to determine FFmpeg linker flags
+
+Author: Andreas Cadhalpun <andreas.cadhal...@googlemail.com>
+Last-Update: <2014-05-19>
+
+--- openscenegraph-3.2.0~rc1.orig/OpenSceneGraph/CMakeModules/FindFFmpeg.cmake
++++ openscenegraph-3.2.0~rc1/OpenSceneGraph/CMakeModules/FindFFmpeg.cmake
+@@ -27,6 +27,9 @@
+ MACRO(FFMPEG_FIND varname shortname headername)
+     # old version of ffmpeg put header in $prefix/include/[ffmpeg]
+     # so try to find header in include directory
++    
++    pkg_check_modules(FFMPEG_${varname} lib${shortname})
++    string(REPLACE "-l" "" ${varname}_name "${FFMPEG_${varname}_LIBRARIES}")
+ 
+     FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS lib${shortname}/${headername}
+         PATHS
+@@ -63,7 +66,7 @@ MACRO(FFMPEG_FIND varname shortname head
+     )
+ 
+     FIND_LIBRARY(FFMPEG_${varname}_LIBRARIES
+-        NAMES ${shortname}
++        NAMES ${shortname} ${${varname}_name}
+         PATHS
+         ${FFMPEG_ROOT}/lib
+         $ENV{FFMPEG_DIR}/lib
diff --git a/debian/patches/series b/debian/patches/series
index 3761b78..9e52703 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@ Upstream-fix-(b801ae)-for-bug-#736350 -p1
 fix_for_multithreaded_vrml_loading
 osgDB_freetype.so_no_longer_built
 libav10.patch
+pkg-config.patch

Reply via email to