Bug#656502: blender: [FTBFS] Does not build with libav 0.8~beta2

2012-01-19 Thread Thomas Preud'homme
Source: blender
Version: 6.3.1
Severity: serious
Tags: patch upstream
Justification: Fails to build from source

In addition to #654428, blender also fails to build from source because
of API changes in libav 0.9~beta2. Attached is a patch which fix all (3)
the issues I found until #654428 build failure.

Note the change related to avformat_alloc_output_context2 in
ffmpeg_compat.h header. Blender is likely to need the same kind of
change when a future version of libav will be uploaded to Debian.

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: armhf (armv7l)

Kernel: Linux 2.6.38-ac2-ac100 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Description: Adapt to libavutil API changes
 Add include for libavutil/mathematics.h in ffmpeg_compat.h and writeffmpeg.c
 since it is no longer included in libavutil/avutil.h
Author: Thomas Preud'homme 
Origin: vendor
Forwarded: no
Last-Update: 2012-01-19
---

--- blender-2.61.orig/intern/ffmpeg/ffmpeg_compat.h
+++ blender-2.61/intern/ffmpeg/ffmpeg_compat.h
@@ -35,6 +35,7 @@
 
 #include 
 #include 
+#include 
 
 #if (LIBAVFORMAT_VERSION_MAJOR > 52) || ((LIBAVFORMAT_VERSION_MAJOR >= 52) && (LIBAVFORMAT_VERSION_MINOR >= 101))
 #define FFMPEG_HAVE_PARSE_UTILS 1

--- blender-2.61.orig/source/blender/blenkernel/intern/writeffmpeg.c
+++ blender-2.61/source/blender/blenkernel/intern/writeffmpeg.c
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
>From 63b4c577c951245904fd59ac8c6021bab18b0de4 Mon Sep 17 00:00:00 2001
From: Antonio Ospite 
Date: Sat, 17 Dec 2011 15:45:16 +0100
Subject: [PATCH] Make blender compile with FFmpeg from Debian.
X-Face: z*RaLf`X<@C75u6Ig9}{oW$H;1_\2t5)({*|jhM/Vb;]yA5\I~93>J<_`<4)A{':UrE

avformat_alloc_output_context2() should be in the libavformat 53.2.0 but
it isn't in Debian, re-define it.

Signed-off-by: Antonio Ospite 
---
 intern/ffmpeg/ffmpeg_compat.h |   61 +
 1 files changed, 61 insertions(+), 0 deletions(-)

diff --git a/intern/ffmpeg/ffmpeg_compat.h b/intern/ffmpeg/ffmpeg_compat.h
index dfdad22..5259f69 100644
--- a/intern/ffmpeg/ffmpeg_compat.h
+++ b/intern/ffmpeg/ffmpeg_compat.h
@@ -48,6 +48,67 @@
 #define FFMPEG_HAVE_AVIO 1
 #endif
 
+#if (LIBAVFORMAT_VERSION_MAJOR < 53) || ((LIBAVFORMAT_VERSION_MAJOR == 53) && (LIBAVFORMAT_VERSION_MINOR < 21))
+/* XXX The last check above should be (LIBAVFORMAT_VERSION_MINOR < 2),
+ * look at http://patches.libav.org/patch// but ffmpeg in Debian is
+ * strange: 53.2.0 should have avformat_alloc_output_context2() but it does
+ * not.
+ */
+#include 
+static int avformat_alloc_output_context2(AVFormatContext **avctx, AVOutputFormat *oformat,
+   const char *format, const char *filename)
+{
+AVFormatContext *s = avformat_alloc_context();
+int ret = 0;
+
+*avctx = NULL;
+if (!s)
+goto nomem;
+
+if (!oformat) {
+if (format) {
+oformat = av_guess_format(format, NULL, NULL);
+if (!oformat) {
+av_log(s, AV_LOG_ERROR, "Requested output format '%s' is not a suitable output format\n", format);
+ret = AVERROR(EINVAL);
+goto error;
+}
+} else {
+oformat = av_guess_format(NULL, filename, NULL);
+if (!oformat) {
+ret = AVERROR(EINVAL);
+av_log(s, AV_LOG_ERROR, "Unable to find a suitable output format for '%s'\n",
+   filename);
+goto error;
+}
+}
+}
+
+s->oformat = oformat;
+if (s->oformat->priv_data_size > 0) {
+s->priv_data = av_mallocz(s->oformat->priv_data_size);
+if (!s->priv_data)
+goto nomem;
+if (s->oformat->priv_class) {
+*(const AVClass**)s->priv_data= s->oformat->priv_class;
+av_opt_set_defaults(s->priv_data);
+}
+} else
+s->priv_data = NULL;
+
+if (filename)
+av_strlcpy(s->filename, filename, sizeof(s->filename));
+*avctx = s;
+return 0;
+nomem:
+av_log(s, AV_LOG_ERROR, "Out of memory\n");
+ret = AVERROR(ENOMEM);
+error:
+avformat_free_context(s);
+return ret;
+}
+#endif
+
 #if (LIBAVCODEC_VERSION_MAJOR > 53) || ((LIBAVCODEC_VERSION_MAJOR == 53) && (LIBAVCODEC_VERSION_MINOR > 1)) || ((LIBAVCODEC_VERSION_MAJOR == 53) && (LIBAVCODEC_VERSION_MINOR == 1) && (LIBAVCODEC_VERSION_MICRO >= 1)) || ((LIBAVCODEC_VERSION_MAJOR == 52) && (LIBAVCODEC_VERSION_MINOR >= 121))
 #define FFMPEG_HAVE_DEFAULT_VAL_UNION 1
 #endif
-- 
1.7.7.3

___
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-multimedia-maintainers

Bug#608680: Only supported for x86 target

2011-01-02 Thread Thomas Preud'homme
-march=native is only supported for (Intel 386 and AMD x86-64)-like targets. A 
simple solution would be to just disable this flag. Another option would be to 
populate CPPFLAGS in debian/rules with -march=native depending on the output 
of dpkg-architecture and the value of DEB_BUILD_OPTIONS.


signature.asc
Description: This is a digitally signed message part.
___
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-multimedia-maintainers