Hi,

thanks for your patch, but I think this is something upstream should decide and adopt.


-------- Weitergeleitete Nachricht --------
Betreff:        Bug#758357: mlt: Use pkg-config to determine FFmpeg linker flags
Weitersenden-Datum:     Sat, 16 Aug 2014 21:43:18 +0000
Weitersenden-Von:       Andreas Cadhalpun <andreas.cadhal...@googlemail.com>
Weitersenden-An:        debian-bugs-d...@lists.debian.org
Weitersenden-CC:        Fathi Boudra <f...@debian.org>
Datum:  Sat, 16 Aug 2014 23:41:41 +0200
Von:    Andreas Cadhalpun <andreas.cadhal...@googlemail.com>
Antwort an: Andreas Cadhalpun <andreas.cadhal...@googlemail.com>, 758...@bugs.debian.org
An:     Debian Bug Tracking System <sub...@bugs.debian.org>



Source: mlt
Version: 0.9.2-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/02-pkg-config.patch b/debian/patches/02-pkg-config.patch
new file mode 100644
index 0000000..286a46e
--- /dev/null
+++ b/debian/patches/02-pkg-config.patch
@@ -0,0 +1,56 @@
+Description:Use pkg-config to determine FFmpeg linker flags
+ Use 'pkg-config --libs' instead of 'pkg-config --libs-only-L'.
+
+Author: Andreas Cadhalpun <andreas.cadhal...@googlemail.com>
+Last-Update: <2014-05-15>
+
+--- mlt-0.9.0+dfsg1.orig/src/modules/avformat/Makefile
++++ mlt-0.9.0+dfsg1/src/modules/avformat/Makefile
+@@ -4,10 +4,6 @@ LDFLAGS += -L../../framework -lmlt -lpth
+ include ../../../config.mak
+ include config.mak
+ 
+-LDFLAGS += -lavformat$(AVFORMAT_SUFFIX)
+-LDFLAGS += -lavcodec$(AVFORMAT_SUFFIX)
+-LDFLAGS += -lavutil$(AVFORMAT_SUFFIX)
+-LDFLAGS += -lswscale$(AVFORMAT_SUFFIX)
+ LDFLAGS += $(EXTRA_LIBS)
+ 
+ ifndef CODECS
+@@ -39,7 +35,6 @@ endif
+ 
+ ifdef DEVICES
+ CFLAGS += -DAVDEVICE
+-LDFLAGS += -lavdevice$(AVFORMAT_SUFFIX)
+ endif
+ 
+ SRCS := $(OBJS:.o=.c)
+--- mlt-0.9.0+dfsg1.orig/src/modules/avformat/configure
++++ mlt-0.9.0+dfsg1/src/modules/avformat/configure
+@@ -123,19 +123,23 @@ else
+ 				echo "CFLAGS+=-DAVDATADIR=\\\"${shared_ffmpeg}/share/ffmpeg${avformat_suffix}/\\\"" >> config.mak
+ 			;;
+ 		esac
++		echo "CFLAGS+=$(pkg-config --cflags libavcodec${avformat_suffix})" >> config.mak
++		echo "LDFLAGS+=$(pkg-config --libs libavcodec${avformat_suffix})" >> config.mak
++		echo "CFLAGS+=$(pkg-config --cflags libavutil${avformat_suffix})" >> config.mak
++		echo "LDFLAGS+=$(pkg-config --libs libavutil${avformat_suffix})" >> config.mak
+ 		echo "CFLAGS+=$(pkg-config --cflags libavformat${avformat_suffix})" >> config.mak
+-		echo "LDFLAGS+=$(pkg-config --libs-only-L libavformat${avformat_suffix})" >> config.mak
++		echo "LDFLAGS+=$(pkg-config --libs libavformat${avformat_suffix})" >> config.mak
+ 		echo "CFLAGS+=$(pkg-config --cflags libswscale${avformat_suffix})" >> config.mak
+-		echo "LDFLAGS+=$(pkg-config --libs-only-L libswscale${avformat_suffix})" >> config.mak
++		echo "LDFLAGS+=$(pkg-config --libs libswscale${avformat_suffix})" >> config.mak
+ 		if [ "$devices" = "true" ]
+ 		then
+ 			if ! $(pkg-config libavdevice${avformat_suffix}); then
+ 				echo "- libavdevice not found: disabling"
+ 				touch ../disable-avformat
+ 				exit 0
+ 			fi
+ 			echo "CFLAGS+=$(pkg-config --cflags libavdevice${avformat_suffix})" >> config.mak
+-			echo "LDFLAGS+=$(pkg-config --libs-only-L libavdevice${avformat_suffix})" >> config.mak
++			echo "LDFLAGS+=$(pkg-config --libs libavdevice${avformat_suffix})" >> config.mak
+ 		fi
+ 		
+ 		if [ "$vdpau" = "true" ]
diff --git a/debian/patches/series b/debian/patches/series
index b53e8bc..0893c97 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,1 +1,2 @@
 01-changed-preset-path.diff
+02-pkg-config.patch


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to