Hi Rogério,

On 21.05.2014 22:19, Rogério Brito wrote:
I don't know how things will impact
getting handbrake being compiled with ffmpeg, but I guess that we can always
file a new bug when that time comes.

Handbrake compiles fine with FFmpeg, but to get it to compile with the Debian FFmpeg packages, one has to teach it to use pkg-config to determine the FFmpeg linker flags. This is due to the fact that the Debian FFmpeg packages use library names like libavcodec-ffmpeg and thus linking with '-lavcodec' fails.

The attached handbrake_pkg-config.patch does that.
With it applied you can simply add alternative build-dependencies to the FFmpeg development packages instead of the Libav ones, as the other patch does.

Then handbrake compiles fine with the Debian FFmpeg packages, if they are installed instead of the Libav ones.

Best regards,
Andreas

PS: Thanks again for filing the FFmpeg RFP bug.
diff --git a/debian/patches/pkg-config.patch b/debian/patches/pkg-config.patch
new file mode 100644
index 0000000..4ec87ee
--- /dev/null
+++ b/debian/patches/pkg-config.patch
@@ -0,0 +1,36 @@
+Description: Use pkg-config to check for FFMPEG
+
+Author: Andreas Cadhalpun <andreas.cadhal...@googlemail.com>
+Last-Update: <2014-05-21>
+
+--- handbrake-0.9.9+svn6032+dfsg1.orig/gtk/configure.ac
++++ handbrake-0.9.9+svn6032+dfsg1/gtk/configure.ac
+@@ -183,7 +183,9 @@ case $host in
+     ;;
+ esac
+ 
+-HB_LIBS="-lhandbrake -la52 -lavresample -lavformat -lavcodec -lavutil -ldvdnav -ldvdread -lmp3lame -lvorbis -lvorbisenc -logg -lsamplerate -lx264 -lswscale -ltheoraenc -ltheoradec -lz -lbz2 -lpthread -lbluray -lass -lfontconfig -lfreetype -lxml2 -ldl"
++PKG_CHECK_MODULES([FFMPEG], [libavresample libavformat libavcodec libavutil libswscale])
++
++HB_LIBS="-lhandbrake -la52 $FFMPEG_LIBS -ldvdnav -ldvdread -lmp3lame -lvorbis -lvorbisenc -logg -lsamplerate -lx264 -ltheoraenc -ltheoradec -lz -lbz2 -lpthread -lbluray -lass -lfontconfig -lfreetype -lxml2 -ldl"
+ 
+ if test "x$use_fdk_aac" = "xyes" ; then
+     HB_LIBS+=" -lfdk-aac"
+--- handbrake-0.9.9+svn6032+dfsg1.orig/test/module.defs
++++ handbrake-0.9.9+svn6032+dfsg1/test/module.defs
+@@ -11,10 +11,13 @@ TEST.exe = $(BUILD/)$(call TARGET.exe,$(
+ 
+ TEST.libs = $(LIBHB.a)
+ 
++FFMPEG_LIBS = $(shell $(PKGCONFIG.exe) --libs libavcodec libavformat libavutil libavresample libswscale)
++FFMPEG_NAMES = $(subst -l,,$(FFMPEG_LIBS))
++
+ TEST.GCC.l = \
+-        a52 ass avcodec avformat avutil avresample dvdnav dvdread \
++        a52 ass $(FFMPEG_NAMES) dvdnav dvdread \
+         fontconfig mp3lame ogg \
+-        samplerate swscale theoraenc theoradec vorbis vorbisenc x264 \
++        samplerate theoraenc theoradec vorbis vorbisenc x264 \
+         bluray freetype xml2 bz2 z
+ 
+ ifeq (1,$(FEATURE.qsv))
diff --git a/debian/patches/series b/debian/patches/series
index b887273..4e453ae 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 001-Do-not-require-wget-or-curl.patch
 002-Remove-embedded-downloaded-copies-of-various-librari.patch
 004-link-fix-add-ldl.patch
+pkg-config.patch
diff --git a/debian/control b/debian/control
index 0e34047..2f7da07 100644
--- a/debian/control
+++ b/debian/control
@@ -16,10 +16,10 @@ Build-Depends:
  intltool,
  liba52-0.7.4-dev (>= 0.7.4-17),
  libass-dev,
- libavcodec-dev (>= 6:10~),
- libavformat-dev (>= 6:10~),
- libavresample-dev (>= 6:10~),
- libavutil-dev (>= 6:10~),
+ libavcodec-dev (>= 6:10~) | libavcodec-ffmpeg-dev,
+ libavformat-dev (>= 6:10~) | libavformat-ffmpeg-dev,
+ libavresample-dev (>= 6:10~) | libavresample-ffmpeg-dev,
+ libavutil-dev (>= 6:10~) | libavutil-ffmpeg-dev,
  libbluray-dev,
  libbz2-dev,
  libdbus-glib-1-dev,
@@ -38,7 +38,7 @@ Build-Depends:
  libnotify-dev (>= 0.7.3),
  libogg-dev,
  libsamplerate0-dev,
- libswscale-dev,
+ libswscale-dev | libswscale-ffmpeg-dev,
  libtheora-dev,
  libtool,
  libvorbis-dev,

Reply via email to