summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-gfx/blender/files')
-rw-r--r--media-gfx/blender/files/blender-2.37-dirs.patch16
-rw-r--r--media-gfx/blender/files/blender-2.44-scriptsdir.patch91
-rw-r--r--media-gfx/blender/files/blender-2.46-cve-2008-1103-1.patch12
-rw-r--r--media-gfx/blender/files/blender-2.46-ffmpeg.patch100
-rw-r--r--media-gfx/blender/files/blender-2.48-ffmpeg-20081014.patch25
-rw-r--r--media-gfx/blender/files/blender-2.48a-CVE-2008-4863.patch15
-rw-r--r--media-gfx/blender/files/blender-2.49a-bake.patch13
-rw-r--r--media-gfx/blender/files/blender-2.49a-sys-openjpeg.patch11
-rw-r--r--media-gfx/blender/files/blender-2.49b-CVE-2009-3850-v3.patch105
-rw-r--r--media-gfx/blender/files/blender-2.49b-CVE-2009-3850-v4.patch139
-rw-r--r--media-gfx/blender/files/blender-2.49b-insecure.desktop9
-rw-r--r--media-gfx/blender/files/blender-2.49b-libav-0.7.patch425
-rw-r--r--media-gfx/blender/files/blender-2.49b-subversion-1.7.patch14
-rw-r--r--media-gfx/blender/files/blender-2.57-CVE-2009-3850-v1.patch105
-rw-r--r--media-gfx/blender/files/blender-2.57-CVE-2009-3850-v2.patch172
-rw-r--r--media-gfx/blender/files/blender-2.57-bmake.patch15
-rw-r--r--media-gfx/blender/files/blender-2.57-desktop.patch20
-rw-r--r--media-gfx/blender/files/blender-2.57-doxygen.patch33
-rw-r--r--media-gfx/blender/files/blender-2.57-eigen.patch22
-rw-r--r--media-gfx/blender/files/blender-2.57-enable_site_module.patch32
-rw-r--r--media-gfx/blender/files/blender-2.57-glew.patch22
-rw-r--r--media-gfx/blender/files/blender-2.57-insecure.desktop15
-rw-r--r--media-gfx/blender/files/blender-2.57-libav-0.7.patch296
-rw-r--r--media-gfx/blender/files/blender-2.57-linux-3.patch12
-rw-r--r--media-gfx/blender/files/blender-2.60-bmake.patch114
-rw-r--r--media-gfx/blender/files/blender-2.60-doxyfile.patch11
-rw-r--r--media-gfx/blender/files/blender-2.60-eigen.patch293
-rw-r--r--media-gfx/blender/files/blender-2.60-glew.patch48
-rw-r--r--media-gfx/blender/files/blender-2.60-openjpeg.patch37
-rw-r--r--media-gfx/blender/files/blender-2.60a-CVE-2009-3850-v3.patch149
-rw-r--r--media-gfx/blender/files/blender-2.60a-collada.patch11
-rw-r--r--media-gfx/blender/files/blender-2.60a-desktop.patch20
-rw-r--r--media-gfx/blender/files/blender-2.60a-enable_site_module.patch32
-rw-r--r--media-gfx/blender/files/blender-2.60a-insecure.desktop15
-rw-r--r--media-gfx/blender/files/blender-2.60a-libav-0.7.patch30
-rw-r--r--media-gfx/blender/files/blender-2.60a-linux-3.patch12
-rw-r--r--media-gfx/blender/files/blender.desktop9
-rw-r--r--media-gfx/blender/files/blender.pngbin0 -> 2119 bytes
38 files changed, 2500 insertions, 0 deletions
diff --git a/media-gfx/blender/files/blender-2.37-dirs.patch b/media-gfx/blender/files/blender-2.37-dirs.patch
new file mode 100644
index 0000000..1b6837f
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.37-dirs.patch
@@ -0,0 +1,16 @@
+diff -ruN blender.orig/source/blender/src/language.c blender/source/blender/src/language.c
+--- blender.orig/source/blender/src/language.c 2005-06-01 10:59:36.000000000 +0200
++++ blender/source/blender/src/language.c 2005-06-01 11:07:15.000000000 +0200
+@@ -358,9 +358,9 @@
+ strcpy(name, bundlePath);
+ strcat(name, "/Contents/Resources/.Blanguages");
+ #else
+- /* Check the CWD. Takes care of the case where users
+- * unpack blender tarball; cd blender-dir; ./blender */
+- strcpy(name, ".blender/.Blanguages");
++ /* Check the standar location. Takes care of the case
++ * in which the distribution installs blender */
++ strcpy(name, "/usr/share/blender/.Blanguages");
+ #endif
+ lines= BLI_read_file_as_lines(name);
+
diff --git a/media-gfx/blender/files/blender-2.44-scriptsdir.patch b/media-gfx/blender/files/blender-2.44-scriptsdir.patch
new file mode 100644
index 0000000..398ccc5
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.44-scriptsdir.patch
@@ -0,0 +1,91 @@
+--- blender-2.44/source/blender/python/api2_2x/EXPP_interface.c.orig 2006-05-01 14:24:56.000000000 +0200
++++ blender-2.44/source/blender/python/api2_2x/EXPP_interface.c 2007-06-21 22:25:39.000000000 +0200
+@@ -52,85 +52,13 @@
+ */
+ char *bpy_gethome(int append_scriptsdir)
+ {
+- static char homedir[FILE_MAXDIR];
+- static char scriptsdir[FILE_MAXDIR];
+- char tmpdir[FILE_MAXDIR];
+- char bprogdir[FILE_MAXDIR];
+- char *s;
+- int i;
++ static char homedir[FILE_MAXDIR]="/usr/share/blender";
++ static char scriptsdir[FILE_MAXDIR]="/usr/share/blender/scripts";
+
+ if (append_scriptsdir) {
+- if (scriptsdir[0] != '\0')
+ return scriptsdir;
+ }
+- else if (homedir[0] != '\0')
+- return homedir;
+-
+- /* BLI_gethome() can return NULL if env vars are not set */
+- s = BLI_gethome();
+-
+- if( !s ) /* bail if no $HOME */
+- {
+- printf("$HOME is NOT set\n");
+- return NULL;
+- }
+-
+- if( strstr( s, ".blender" ) )
+- PyOS_snprintf( homedir, FILE_MAXDIR, s );
+- else
+- BLI_make_file_string( "/", homedir, s, ".blender" );
+-
+- /* if userhome/.blender/ exists, return it */
+- if( BLI_exists( homedir ) ) {
+- if (append_scriptsdir) {
+- BLI_make_file_string("/", scriptsdir, homedir, "scripts");
+- if (BLI_exists (scriptsdir)) return scriptsdir;
+- }
+- else return homedir;
+- }
+- else homedir[0] = '\0';
+-
+- /* if either:
+- * no homedir was found or
+- * append_scriptsdir = 1 but there's no scripts/ inside homedir,
+- * use argv[0] (bprogname) to get .blender/ in
+- * Blender's installation dir */
+- s = BLI_last_slash( bprogname );
+-
+- i = s - bprogname + 1;
+-
+- PyOS_snprintf( bprogdir, i, "%s", bprogname );
+-
+- /* using tmpdir to preserve homedir (if) found above:
+- * the ideal is to have a home dir with scripts dir inside
+- * it, but if that isn't available, it's possible to
+- * have a 'broken' home dir somewhere and a scripts dir in the
+- * cvs sources */
+- BLI_make_file_string( "/", tmpdir, bprogdir, ".blender" );
+-
+- if (BLI_exists(tmpdir)) {
+- if (append_scriptsdir) {
+- BLI_make_file_string("/", scriptsdir, tmpdir, "scripts");
+- if (BLI_exists(scriptsdir)) {
+- PyOS_snprintf(homedir, FILE_MAXDIR, "%s", tmpdir);
+- return scriptsdir;
+- }
+- else {
+- homedir[0] = '\0';
+- scriptsdir[0] = '\0';
+- }
+- }
+- else return homedir;
+- }
+-
+- /* last try for scripts dir: blender in cvs dir, scripts/ inside release/: */
+- if (append_scriptsdir) {
+- BLI_make_file_string("/", scriptsdir, bprogdir, "release/scripts");
+- if (BLI_exists(scriptsdir)) return scriptsdir;
+- else scriptsdir[0] = '\0';
+- }
+-
+- return NULL;
++ return homedir;
+ }
+
+ /* PyDrivers */
diff --git a/media-gfx/blender/files/blender-2.46-cve-2008-1103-1.patch b/media-gfx/blender/files/blender-2.46-cve-2008-1103-1.patch
new file mode 100644
index 0000000..c45a811
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.46-cve-2008-1103-1.patch
@@ -0,0 +1,12 @@
+diff -up blender/source/blender/blenkernel/intern/blender.c.cve blender/source/blender/blenkernel/intern/blender.c
+--- blender/source/blender/blenkernel/intern/blender.c.cve 2008-05-07 17:37:52.000000000 +0200
++++ blender/source/blender/blenkernel/intern/blender.c 2008-05-07 17:38:22.000000000 +0200
+@@ -716,7 +716,7 @@ void BKE_undo_save_quit(void)
+
+ BLI_make_file_string("/", str, btempdir, "quit.blend");
+
+- file = open(str,O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666);
++ file = open(str,O_BINARY+O_WRONLY+O_CREAT+O_TRUNC+O_EXCL, 0666);
+ if(file == -1) {
+ error("Unable to save %s, check you have permissions", str);
+ return;
diff --git a/media-gfx/blender/files/blender-2.46-ffmpeg.patch b/media-gfx/blender/files/blender-2.46-ffmpeg.patch
new file mode 100644
index 0000000..b06854c
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.46-ffmpeg.patch
@@ -0,0 +1,100 @@
+diff -urN blender-2.46/source/blender/blenkernel/intern/writeffmpeg.c blender-2.46.orig/source/blender/blenkernel/intern/writeffmpeg.c
+--- blender-2.46/source/blender/blenkernel/intern/writeffmpeg.c 2008-05-20 12:02:12.000000000 +0200
++++ blender-2.46.orig/source/blender/blenkernel/intern/writeffmpeg.c 2008-05-19 16:38:16.000000000 +0200
+@@ -29,11 +29,11 @@
+
+ #include <stdlib.h>
+
++#include <libavformat/avformat.h>
++#include <libavcodec/avcodec.h>
++#include <libavutil/rational.h>
++#include <libswscale/swscale.h>
++#include <libavcodec/opt.h>
+-#include <ffmpeg/avformat.h>
+-#include <ffmpeg/avcodec.h>
+-#include <ffmpeg/rational.h>
+-#include <ffmpeg/swscale.h>
+-#include <ffmpeg/opt.h>
+
+ #if LIBAVFORMAT_VERSION_INT < (49 << 16)
+ #define FFMPEG_OLD_FRAME_RATE 1
+diff -urN blender-2.46/source/blender/imbuf/intern/anim.c blender-2.46.orig/source/blender/imbuf/intern/anim.c
+--- blender-2.46/source/blender/imbuf/intern/anim.c 2008-05-20 12:05:41.000000000 +0200
++++ blender-2.46.orig/source/blender/imbuf/intern/anim.c 2008-05-19 16:38:41.000000000 +0200
+@@ -83,10 +83,10 @@
+ #include "IMB_anim5.h"
+
+ #ifdef WITH_FFMPEG
++#include <libavformat/avformat.h>
++#include <libavcodec/avcodec.h>
++#include <libavutil/rational.h>
++#include <libswscale/swscale.h>
+-#include <ffmpeg/avformat.h>
+-#include <ffmpeg/avcodec.h>
+-#include <ffmpeg/rational.h>
+-#include <ffmpeg/swscale.h>
+
+ #if LIBAVFORMAT_VERSION_INT < (49 << 16)
+ #define FFMPEG_OLD_FRAME_RATE 1
+diff -urN blender-2.46/source/blender/imbuf/intern/IMB_anim.h blender-2.46.orig/source/blender/imbuf/intern/IMB_anim.h
+--- blender-2.46/source/blender/imbuf/intern/IMB_anim.h 2008-05-20 12:04:33.000000000 +0200
++++ blender-2.46.orig/source/blender/imbuf/intern/IMB_anim.h 2008-05-19 16:38:41.000000000 +0200
+@@ -76,9 +76,9 @@
+ #endif /* WITH_QUICKTIME */
+
+ #ifdef WITH_FFMPEG
++#include <libavformat/avformat.h>
++#include <libavcodec/avcodec.h>
++#include <libswscale/swscale.h>
+-#include <ffmpeg/avformat.h>
+-#include <ffmpeg/avcodec.h>
+-#include <ffmpeg/swscale.h>
+ #endif
+
+ #include "IMB_imbuf_types.h"
+diff -urN blender-2.46/source/blender/imbuf/intern/util.c blender-2.46.orig/source/blender/imbuf/intern/util.c
+--- blender-2.46/source/blender/imbuf/intern/util.c 2008-05-20 12:05:04.000000000 +0200
++++ blender-2.46.orig/source/blender/imbuf/intern/util.c 2008-05-19 16:38:41.000000000 +0200
+@@ -62,8 +62,8 @@
+ #endif
+
+ #ifdef WITH_FFMPEG
++#include <libavcodec/avcodec.h>
++#include <libavformat/avformat.h>
+-#include <ffmpeg/avcodec.h>
+-#include <ffmpeg/avformat.h>
+
+ #if LIBAVFORMAT_VERSION_INT < (49 << 16)
+ #define FFMPEG_OLD_FRAME_RATE 1
+diff -urN blender-2.46/source/blender/src/buttons_scene.c blender-2.46.orig/source/blender/src/buttons_scene.c
+--- blender-2.46/source/blender/src/buttons_scene.c 2008-05-20 12:03:50.000000000 +0200
++++ blender-2.46.orig/source/blender/src/buttons_scene.c 2008-05-19 16:38:39.000000000 +0200
+@@ -108,9 +108,9 @@
+
+ #ifdef WITH_FFMPEG
+
++#include <libavcodec/avcodec.h> /* for PIX_FMT_* and CODEC_ID_* */
++#include <libavformat/avformat.h>
++#include <libavcodec/opt.h>
+-#include <ffmpeg/avcodec.h> /* for PIX_FMT_* and CODEC_ID_* */
+-#include <ffmpeg/avformat.h>
+-#include <ffmpeg/opt.h>
+
+ static int ffmpeg_preset_sel = 0;
+
+diff -urN blender-2.46/source/blender/src/hddaudio.c blender-2.46.orig/source/blender/src/hddaudio.c
+--- blender-2.46/source/blender/src/hddaudio.c 2008-05-20 12:02:42.000000000 +0200
++++ blender-2.46.orig/source/blender/src/hddaudio.c 2008-05-19 16:38:39.000000000 +0200
+@@ -33,9 +33,9 @@
+ #endif
+
+ #ifdef WITH_FFMPEG
++#include <libavformat/avformat.h>
++#include <libavcodec/avcodec.h>
++#include <libavutil/rational.h>
+-#include <ffmpeg/avformat.h>
+-#include <ffmpeg/avcodec.h>
+-#include <ffmpeg/rational.h>
+ #if LIBAVFORMAT_VERSION_INT < (49 << 16)
+ #define FFMPEG_OLD_FRAME_RATE 1
+ #else
diff --git a/media-gfx/blender/files/blender-2.48-ffmpeg-20081014.patch b/media-gfx/blender/files/blender-2.48-ffmpeg-20081014.patch
new file mode 100644
index 0000000..93ae633
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.48-ffmpeg-20081014.patch
@@ -0,0 +1,25 @@
+Index: blender-2.47/source/blender/src/hddaudio.c
+===================================================================
+--- blender-2.47.orig/source/blender/src/hddaudio.c
++++ blender-2.47/source/blender/src/hddaudio.c
+@@ -302,7 +302,8 @@ static void sound_hdaudio_extract_small_
+ audio_pkt_size = packet.size;
+
+ while (audio_pkt_size > 0) {
+- len = avcodec_decode_audio(
++ data_size= AVCODEC_MAX_AUDIO_FRAME_SIZE;
++ len = avcodec_decode_audio2(
+ hdaudio->pCodecCtx,
+ hdaudio->decode_cache
+ + decode_pos,
+@@ -469,7 +470,8 @@ static void sound_hdaudio_extract_small_
+ }
+
+ while (audio_pkt_size > 0) {
+- len = avcodec_decode_audio(
++ data_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
++ len = avcodec_decode_audio2(
+ hdaudio->pCodecCtx,
+ hdaudio->decode_cache
+ + decode_pos,
+
diff --git a/media-gfx/blender/files/blender-2.48a-CVE-2008-4863.patch b/media-gfx/blender/files/blender-2.48a-CVE-2008-4863.patch
new file mode 100644
index 0000000..3162a0d
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.48a-CVE-2008-4863.patch
@@ -0,0 +1,15 @@
+diff -up blender-2.48a/source/blender/python/BPY_interface.c.cve blender-2.48a/source/blender/python/BPY_interface.c
+--- blender-2.48a/source/blender/python/BPY_interface.c.cve 2008-11-03 17:31:19.000000000 +0100
++++ blender-2.48a/source/blender/python/BPY_interface.c 2008-11-03 17:35:01.000000000 +0100
+@@ -225,6 +225,11 @@ void BPY_start_python( int argc, char **
+ Py_Initialize( );
+
+ PySys_SetArgv( argc_copy, argv_copy );
++
++ /* Sanitize sys.path to prevent relative imports loading modules in
++ the current working directory */
++ PyRun_SimpleString("import sys; sys.path = filter(None, sys.path)");
++
+ /* Initialize thread support (also acquires lock) */
+ PyEval_InitThreads();
+
diff --git a/media-gfx/blender/files/blender-2.49a-bake.patch b/media-gfx/blender/files/blender-2.49a-bake.patch
new file mode 100644
index 0000000..53674da
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.49a-bake.patch
@@ -0,0 +1,13 @@
+Index: source/blender/render/intern/source/rendercore.c
+===================================================================
+--- source/blender/render/intern/source/rendercore.c (revision 21781)
++++ source/blender/render/intern/source/rendercore.c (working copy)
+@@ -2241,7 +2241,7 @@
+ /* no direction checking for now, doesn't always improve the result
+ * (INPR(shi->facenor, bs->dir) > 0.0f); */
+
+- return (R.objectinstance[ob].obr->ob != bs->actob);
++ return (R.objectinstance[ob & ~RE_RAY_TRANSFORM_OFFS].obr->ob != bs->actob);
+ }
+
+ static int bake_intersect_tree(RayTree* raytree, Isect* isect, float *start, float *dir, float sign, float *hitco, float *dist)
diff --git a/media-gfx/blender/files/blender-2.49a-sys-openjpeg.patch b/media-gfx/blender/files/blender-2.49a-sys-openjpeg.patch
new file mode 100644
index 0000000..a9e46ea
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.49a-sys-openjpeg.patch
@@ -0,0 +1,11 @@
+--- blender/tools/Blender.py.orig 2009-06-16 14:57:16.000000000 +0200
++++ blender/tools/Blender.py 2009-07-02 15:53:49.000000000 +0200
+@@ -170,6 +170,8 @@
+ if lenv['WITH_BF_OPENAL']:
+ if not lenv['WITH_BF_STATICOPENAL']:
+ syslibs += Split(lenv['BF_OPENAL_LIB'])
++ if lenv['WITH_BF_OPENJPEG']:
++ syslibs += Split(lenv['BF_OPENJPEG_LIB'])
+ if lenv['WITH_BF_OPENMP'] and lenv['CC'] != 'icc':
+ if lenv['CC'] == 'cl.exe':
+ syslibs += ['vcomp']
diff --git a/media-gfx/blender/files/blender-2.49b-CVE-2009-3850-v3.patch b/media-gfx/blender/files/blender-2.49b-CVE-2009-3850-v3.patch
new file mode 100644
index 0000000..9cf17a5
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.49b-CVE-2009-3850-v3.patch
@@ -0,0 +1,105 @@
+From 072e11130a2f96642972b0d4ac7ad2a9cd19fbf2 Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Wed, 20 Apr 2011 16:42:17 +0200
+Subject: [PATCH] Flip default of "Auto Run Python Scripts" to disabled
+ (CVE-2009-3850)
+
+Manual overriding through new parameter -666 is supported
+---
+ source/blender/blenkernel/intern/blender.c | 11 ++++++++++-
+ source/blender/python/api2_2x/sceneRender.c | 3 ++-
+ source/creator/creator.c | 14 ++++++++++----
+ 3 files changed, 22 insertions(+), 6 deletions(-)
+
+diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
+index bf208c8..029b7cf 100644
+--- a/source/blender/blenkernel/intern/blender.c
++++ b/source/blender/blenkernel/intern/blender.c
+@@ -388,7 +388,16 @@ static void setup_app_data(BlendFileData *bfd, char *filename)
+ if (G.f & G_DEBUG) bfd->globalf |= G_DEBUG;
+ else bfd->globalf &= ~G_DEBUG;
+
+- if ((U.flag & USER_DONT_DOSCRIPTLINKS)) bfd->globalf &= ~G_DOSCRIPTLINKS;
++ if (G.f & G_DOSCRIPTLINKS) {
++ /* Blender running in -666 mode */
++ /* NOTE: In background mode U.flag has not been initialized from ~/.B.blend */
++ if (! G.background && (U.flag & USER_DONT_DOSCRIPTLINKS))
++ /* Prefer disabled "Auto Run Python Scripts" over -666 */
++ bfd->globalf &= ~G_DOSCRIPTLINKS;
++ } else {
++ /* Blender NOT running in -666 mode, deny pulling G_DOSCRIPTLINKS in */
++ bfd->globalf &= ~G_DOSCRIPTLINKS;
++ }
+
+ G.f= bfd->globalf;
+
+diff --git a/source/blender/python/api2_2x/sceneRender.c b/source/blender/python/api2_2x/sceneRender.c
+index 1bf2b75..e34a361 100644
+--- a/source/blender/python/api2_2x/sceneRender.c
++++ b/source/blender/python/api2_2x/sceneRender.c
+@@ -498,7 +498,8 @@ static PyObject *RenderData_Render( BPy_RenderData * self )
+
+ RE_BlenderFrame(re, G.scene, G.scene->r.cfra);
+
+- BPY_do_all_scripts(SCRIPT_POSTRENDER, 0);
++ if (G.f & G_DOSCRIPTLINKS)
++ BPY_do_all_scripts(SCRIPT_POSTRENDER, 0);
+
+ set_scene_bg( oldsce );
+ }
+diff --git a/source/creator/creator.c b/source/creator/creator.c
+index a562fc3..994180d 100644
+--- a/source/creator/creator.c
++++ b/source/creator/creator.c
+@@ -232,7 +232,8 @@ static void print_help(void)
+ printf (" -nojoystick\tDisable joystick support\n");
+ printf (" -noglsl\tDisable GLSL shading\n");
+ printf (" -h\t\tPrint this help text\n");
+- printf (" -y\t\tDisable automatic python script execution (scriptlinks, pydrivers, pyconstraints, pynodes)\n");
++ printf (" -666\t\tEnables automatic python script execution (scriptlinks, pydrivers, pyconstraints, pynodes)\n");
++ printf (" -y\t\tDisable automatic python script execution (scriptlinks, pydrivers, pyconstraints, pynodes) (default)\n");
+ printf (" -P <filename>\tRun the given Python script (filename or Blender Text)\n");
+ #ifdef WIN32
+ printf (" -R\t\tRegister .blend extension\n");
+@@ -366,7 +367,7 @@ int main(int argc, char **argv)
+
+ /* first test for background */
+
+- G.f |= G_DOSCRIPTLINKS; /* script links enabled by default */
++ G.f &= ~G_DOSCRIPTLINKS; /* script links disabled by default */
+
+ for(a=1; a<argc; a++) {
+
+@@ -388,6 +389,10 @@ int main(int argc, char **argv)
+ exit(0);
+ }
+
++ if (!strcmp(argv[a], "-666")){
++ G.f |= G_DOSCRIPTLINKS;
++ }
++
+ /* Handle -* switches */
+ else if(argv[a][0] == '-') {
+ switch(argv[a][1]) {
+@@ -405,7 +410,7 @@ int main(int argc, char **argv)
+ a= argc;
+ break;
+
+- case 'y':
++ case 'y': /* NOTE: -y works the exact opposite way in version 2.57! */
+ G.f &= ~G_DOSCRIPTLINKS;
+ break;
+
+@@ -680,7 +685,8 @@ int main(int argc, char **argv)
+ #endif
+ RE_BlenderAnim(re, G.scene, frame, frame, G.scene->frame_step);
+ #ifndef DISABLE_PYTHON
+- BPY_do_all_scripts(SCRIPT_POSTRENDER, 0);
++ if (G.f & G_DOSCRIPTLINKS)
++ BPY_do_all_scripts(SCRIPT_POSTRENDER, 0);
+ #endif
+ }
+ } else {
+--
+1.7.5.rc1
+
diff --git a/media-gfx/blender/files/blender-2.49b-CVE-2009-3850-v4.patch b/media-gfx/blender/files/blender-2.49b-CVE-2009-3850-v4.patch
new file mode 100644
index 0000000..9349879
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.49b-CVE-2009-3850-v4.patch
@@ -0,0 +1,139 @@
+From f3a8d00d03cc8bdf1739936998a784c9e4e64bb9 Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Sun, 24 Apr 2011 00:00:36 +0200
+Subject: [PATCH] Disable execution of embedded Python code unless run with
+ -666 (CVE-2009-3850)
+
+---
+ source/blender/blenkernel/intern/blender.c | 11 ++++++++++-
+ source/blender/python/api2_2x/sceneRender.c | 3 ++-
+ source/blender/src/buttons_script.c | 4 +++-
+ source/creator/creator.c | 18 ++++++++++++++----
+ 4 files changed, 29 insertions(+), 7 deletions(-)
+
+diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
+index bf208c8..029b7cf 100644
+--- a/source/blender/blenkernel/intern/blender.c
++++ b/source/blender/blenkernel/intern/blender.c
+@@ -388,7 +388,16 @@ static void setup_app_data(BlendFileData *bfd, char *filename)
+ if (G.f & G_DEBUG) bfd->globalf |= G_DEBUG;
+ else bfd->globalf &= ~G_DEBUG;
+
+- if ((U.flag & USER_DONT_DOSCRIPTLINKS)) bfd->globalf &= ~G_DOSCRIPTLINKS;
++ if (G.f & G_DOSCRIPTLINKS) {
++ /* Blender running in -666 mode */
++ /* NOTE: In background mode U.flag has not been initialized from ~/.B.blend */
++ if (! G.background && (U.flag & USER_DONT_DOSCRIPTLINKS))
++ /* Prefer disabled "Auto Run Python Scripts" over -666 */
++ bfd->globalf &= ~G_DOSCRIPTLINKS;
++ } else {
++ /* Blender NOT running in -666 mode, deny pulling G_DOSCRIPTLINKS in */
++ bfd->globalf &= ~G_DOSCRIPTLINKS;
++ }
+
+ G.f= bfd->globalf;
+
+diff --git a/source/blender/python/api2_2x/sceneRender.c b/source/blender/python/api2_2x/sceneRender.c
+index 1bf2b75..e34a361 100644
+--- a/source/blender/python/api2_2x/sceneRender.c
++++ b/source/blender/python/api2_2x/sceneRender.c
+@@ -498,7 +498,8 @@ static PyObject *RenderData_Render( BPy_RenderData * self )
+
+ RE_BlenderFrame(re, G.scene, G.scene->r.cfra);
+
+- BPY_do_all_scripts(SCRIPT_POSTRENDER, 0);
++ if (G.f & G_DOSCRIPTLINKS)
++ BPY_do_all_scripts(SCRIPT_POSTRENDER, 0);
+
+ set_scene_bg( oldsce );
+ }
+diff --git a/source/blender/src/buttons_script.c b/source/blender/src/buttons_script.c
+index 647fc66..6166133 100644
+--- a/source/blender/src/buttons_script.c
++++ b/source/blender/src/buttons_script.c
+@@ -107,6 +107,8 @@
+ #include "blendef.h"
+ #include "butspace.h"
+
++extern int button_enable_script_links_enabled;
++
+ /* ************************ function prototypes ********************** */
+ void draw_scriptlink(uiBlock *, ScriptLink *, int , int , int ) ;
+
+@@ -323,7 +325,7 @@ static void script_panel_scriptlink(void)
+ block= uiNewBlock(&curarea->uiblocks, "script_panel_scriptlink", UI_EMBOSS, UI_HELV, curarea->win);
+ if(uiNewPanel(curarea, block, "Scriptlinks", "Script", 0, 0, 318, 204)==0) return;
+
+- uiDefButBitI(block, TOG, G_DOSCRIPTLINKS, REDRAWBUTSSCRIPT,
++ uiDefButBitI(block, button_enable_script_links_enabled ? TOG : BUT, G_DOSCRIPTLINKS, REDRAWBUTSSCRIPT,
+ "Enable Script Links", xco, 200, 150, 20, &G.f, 0, 0, 0, 0,
+ "Enable execution of all assigned Script links and Space Handelers");
+ /* for proper alignment: */
+diff --git a/source/creator/creator.c b/source/creator/creator.c
+index a562fc3..ccea569 100644
+--- a/source/creator/creator.c
++++ b/source/creator/creator.c
+@@ -108,6 +108,8 @@
+ #include "binreloc.h"
+ #endif
+
++int button_enable_script_links_enabled = 0;
++
+ // from buildinfo.c
+ #ifdef BUILD_DATE
+ extern char * build_date;
+@@ -232,7 +234,8 @@ static void print_help(void)
+ printf (" -nojoystick\tDisable joystick support\n");
+ printf (" -noglsl\tDisable GLSL shading\n");
+ printf (" -h\t\tPrint this help text\n");
+- printf (" -y\t\tDisable automatic python script execution (scriptlinks, pydrivers, pyconstraints, pynodes)\n");
++ printf (" -666\t\tEnables automatic python script execution (scriptlinks, pydrivers, pyconstraints, pynodes)\n");
++ printf (" -y\t\tDisable automatic python script execution (scriptlinks, pydrivers, pyconstraints, pynodes) (default)\n");
+ printf (" -P <filename>\tRun the given Python script (filename or Blender Text)\n");
+ #ifdef WIN32
+ printf (" -R\t\tRegister .blend extension\n");
+@@ -366,7 +369,7 @@ int main(int argc, char **argv)
+
+ /* first test for background */
+
+- G.f |= G_DOSCRIPTLINKS; /* script links enabled by default */
++ G.f &= ~G_DOSCRIPTLINKS; /* script links disabled by default */
+
+ for(a=1; a<argc; a++) {
+
+@@ -388,6 +391,11 @@ int main(int argc, char **argv)
+ exit(0);
+ }
+
++ if (!strcmp(argv[a], "-666")){
++ G.f |= G_DOSCRIPTLINKS;
++ button_enable_script_links_enabled = 1;
++ }
++
+ /* Handle -* switches */
+ else if(argv[a][0] == '-') {
+ switch(argv[a][1]) {
+@@ -405,8 +413,9 @@ int main(int argc, char **argv)
+ a= argc;
+ break;
+
+- case 'y':
++ case 'y': /* NOTE: -y works the exact opposite way in version 2.57! */
+ G.f &= ~G_DOSCRIPTLINKS;
++ button_enable_script_links_enabled = 0;
+ break;
+
+ case 'Y':
+@@ -680,7 +689,8 @@ int main(int argc, char **argv)
+ #endif
+ RE_BlenderAnim(re, G.scene, frame, frame, G.scene->frame_step);
+ #ifndef DISABLE_PYTHON
+- BPY_do_all_scripts(SCRIPT_POSTRENDER, 0);
++ if (G.f & G_DOSCRIPTLINKS)
++ BPY_do_all_scripts(SCRIPT_POSTRENDER, 0);
+ #endif
+ }
+ } else {
+--
+1.7.5.rc1
+
diff --git a/media-gfx/blender/files/blender-2.49b-insecure.desktop b/media-gfx/blender/files/blender-2.49b-insecure.desktop
new file mode 100644
index 0000000..6b36a0a
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.49b-insecure.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=Blender 2.4x (reduced security)
+Comment=3D modeling, animation, rendering and post-production.
+Exec=blender -666
+Icon=blender
+Terminal=0
+Type=Application
+Categories=Graphics;Application;
diff --git a/media-gfx/blender/files/blender-2.49b-libav-0.7.patch b/media-gfx/blender/files/blender-2.49b-libav-0.7.patch
new file mode 100644
index 0000000..d0661ad
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.49b-libav-0.7.patch
@@ -0,0 +1,425 @@
+diff -urN blender-2.49b.orig//source/blender/blenkernel/intern/writeffmpeg.c blender-2.49b/source/blender/blenkernel/intern/writeffmpeg.c
+--- blender-2.49b.orig//source/blender/blenkernel/intern/writeffmpeg.c 2009-09-01 17:21:17.000000000 +0200
++++ blender-2.49b/source/blender/blenkernel/intern/writeffmpeg.c 2011-11-13 05:36:23.000000000 +0100
+@@ -32,6 +32,7 @@
+ #include <libavformat/avformat.h>
+ #include <libavcodec/avcodec.h>
+ #include <libavutil/rational.h>
++#include <libavutil/mathematics.h>
+ #include <libswscale/swscale.h>
+ #include <libavcodec/opt.h>
+
+@@ -149,10 +150,9 @@
+ #else
+ pkt.pts = c->coded_frame->pts;
+ #endif
+- fprintf(stderr, "Audio Frame PTS: %lld\n", pkt.pts);
+
+ pkt.stream_index = audio_stream->index;
+- pkt.flags |= PKT_FLAG_KEY;
++ pkt.flags |= AV_PKT_FLAG_KEY;
+ if (av_interleaved_write_frame(outfile, &pkt) != 0) {
+ error("Error writing audio packet");
+ return -1;
+@@ -271,7 +271,7 @@
+ fprintf(stderr, "Video Frame PTS: not set\n");
+ }
+ if (c->coded_frame->key_frame)
+- packet.flags |= PKT_FLAG_KEY;
++ packet.flags |= AV_PKT_FLAG_KEY;
+ packet.stream_index = video_stream->index;
+ packet.data = video_buffer;
+ packet.size = outsize;
+@@ -373,7 +373,7 @@
+ switch(prop->type) {
+ case IDP_STRING:
+ fprintf(stderr, "%s.\n", IDP_String(prop));
+- rv = av_set_string(c, prop->name, IDP_String(prop));
++ av_set_string3(c, prop->name, IDP_String(prop), 0, &rv);
+ break;
+ case IDP_FLOAT:
+ fprintf(stderr, "%g.\n", IDP_Float(prop));
+@@ -384,12 +384,12 @@
+
+ if (param) {
+ if (IDP_Int(prop)) {
+- rv = av_set_string(c, name, param);
++ av_set_string3(c, name, param, 0, &rv);
+ } else {
+ return;
+ }
+ } else {
+- rv = av_set_int(c, prop->name, IDP_Int(prop));
++ av_set_int(c, prop->name, IDP_Int(prop));
+ }
+ break;
+ }
+@@ -438,7 +438,7 @@
+
+ c = get_codec_from_stream(st);
+ c->codec_id = codec_id;
+- c->codec_type = CODEC_TYPE_VIDEO;
++ c->codec_type = AVMEDIA_TYPE_VIDEO;
+
+
+ /* Get some values from the current render settings */
+@@ -496,7 +496,7 @@
+ c->pix_fmt = PIX_FMT_YUV422P;
+ }
+
+- if (codec_id == CODEC_ID_XVID) {
++ if (codec_id == CODEC_ID_MPEG4) {
+ /* arghhhh ... */
+ c->pix_fmt = PIX_FMT_YUV420P;
+ }
+@@ -557,7 +557,7 @@
+
+ c = get_codec_from_stream(st);
+ c->codec_id = codec_id;
+- c->codec_type = CODEC_TYPE_AUDIO;
++ c->codec_type = AVMEDIA_TYPE_AUDIO;
+
+ c->sample_rate = G.scene->audio.mixrate;
+ c->bit_rate = ffmpeg_audio_bitrate*1000;
+@@ -652,14 +652,14 @@
+ error("No valid formats found");
+ return;
+ }
+- fmt = guess_format(NULL, exts[0], NULL);
++ fmt = av_guess_format(NULL, exts[0], NULL);
+ if (!fmt) {
+ G.afbreek = 1; /* Abort render */
+ error("No valid formats found");
+ return;
+ }
+
+- of = av_alloc_format_context();
++ of = avformat_alloc_context();
+ if (!of) {
+ G.afbreek = 1;
+ error("Error opening output file");
+@@ -699,7 +699,7 @@
+ fmt->video_codec = CODEC_ID_H264;
+ break;
+ case FFMPEG_XVID:
+- fmt->video_codec = CODEC_ID_XVID;
++ fmt->video_codec = CODEC_ID_MPEG4;
+ break;
+ case FFMPEG_FLV:
+ fmt->video_codec = CODEC_ID_FLV1;
+diff -urN blender-2.49b.orig//source/blender/imbuf/intern/anim.c blender-2.49b/source/blender/imbuf/intern/anim.c
+--- blender-2.49b.orig//source/blender/imbuf/intern/anim.c 2009-09-01 17:21:50.000000000 +0200
++++ blender-2.49b/source/blender/imbuf/intern/anim.c 2011-11-13 06:21:37.000000000 +0100
+@@ -550,7 +550,7 @@
+ videoStream=-1;
+ for(i=0; i<pFormatCtx->nb_streams; i++)
+ if(get_codec_from_stream(pFormatCtx->streams[i])->codec_type
+- == CODEC_TYPE_VIDEO) {
++ == AVMEDIA_TYPE_VIDEO) {
+ videoStream=i;
+ break;
+ }
+@@ -683,10 +683,10 @@
+ && position - (anim->curposition + 1) < anim->preseek) {
+ while(av_read_frame(anim->pFormatCtx, &packet)>=0) {
+ if (packet.stream_index == anim->videoStream) {
+- avcodec_decode_video(
++ avcodec_decode_video2(
+ anim->pCodecCtx,
+ anim->pFrame, &frameFinished,
+- packet.data, packet.size);
++ &packet);
+
+ if (frameFinished) {
+ anim->curposition++;
+@@ -741,9 +741,9 @@
+
+ while(av_read_frame(anim->pFormatCtx, &packet)>=0) {
+ if(packet.stream_index == anim->videoStream) {
+- avcodec_decode_video(anim->pCodecCtx,
++ avcodec_decode_video2(anim->pCodecCtx,
+ anim->pFrame, &frameFinished,
+- packet.data, packet.size);
++ &packet);
+
+ if (frameFinished && !pos_found) {
+ if (packet.dts >= pts_to_search) {
+diff -urN blender-2.49b.orig//source/blender/imbuf/intern/util.c blender-2.49b/source/blender/imbuf/intern/util.c
+--- blender-2.49b.orig//source/blender/imbuf/intern/util.c 2009-09-01 17:21:50.000000000 +0200
++++ blender-2.49b/source/blender/imbuf/intern/util.c 2011-11-13 04:37:27.000000000 +0100
+@@ -324,7 +324,7 @@
+ return 0;
+ }
+
+- if(UTIL_DEBUG) dump_format(pFormatCtx, 0, filename, 0);
++ if(UTIL_DEBUG) av_dump_format(pFormatCtx, 0, filename, 0);
+
+
+ /* Find the first video stream */
+@@ -332,7 +332,7 @@
+ for(i=0; i<pFormatCtx->nb_streams; i++)
+ if(pFormatCtx->streams[i] &&
+ get_codec_from_stream(pFormatCtx->streams[i]) &&
+- (get_codec_from_stream(pFormatCtx->streams[i])->codec_type==CODEC_TYPE_VIDEO))
++ (get_codec_from_stream(pFormatCtx->streams[i])->codec_type==AVMEDIA_TYPE_VIDEO))
+ {
+ videoStream=i;
+ break;
+Binary files blender-2.49b.orig//source/blender/python/api2_2x/BGL.o and blender-2.49b/source/blender/python/api2_2x/BGL.o differ
+Binary files blender-2.49b.orig//source/blender/python/api2_2x/bpy_internal_import.o and blender-2.49b/source/blender/python/api2_2x/bpy_internal_import.o differ
+Binary files blender-2.49b.orig//source/blender/python/api2_2x/constant.o and blender-2.49b/source/blender/python/api2_2x/constant.o differ
+Binary files blender-2.49b.orig//source/blender/python/api2_2x/euler.o and blender-2.49b/source/blender/python/api2_2x/euler.o differ
+Binary files blender-2.49b.orig//source/blender/python/api2_2x/Geometry.o and blender-2.49b/source/blender/python/api2_2x/Geometry.o differ
+Binary files blender-2.49b.orig//source/blender/python/api2_2x/Mathutils.o and blender-2.49b/source/blender/python/api2_2x/Mathutils.o differ
+Binary files blender-2.49b.orig//source/blender/python/api2_2x/matrix.o and blender-2.49b/source/blender/python/api2_2x/matrix.o differ
+Binary files blender-2.49b.orig//source/blender/python/api2_2x/quat.o and blender-2.49b/source/blender/python/api2_2x/quat.o differ
+Binary files blender-2.49b.orig//source/blender/python/api2_2x/vector.o and blender-2.49b/source/blender/python/api2_2x/vector.o differ
+diff -urN blender-2.49b.orig//source/blender/src/buttons_scene.c blender-2.49b/source/blender/src/buttons_scene.c
+--- blender-2.49b.orig//source/blender/src/buttons_scene.c 2009-09-01 17:21:46.000000000 +0200
++++ blender-2.49b/source/blender/src/buttons_scene.c 2011-11-13 05:38:04.000000000 +0100
+@@ -2169,7 +2169,7 @@
+ "Quicktime", FFMPEG_MOV,
+ "DV", FFMPEG_DV,
+ "H264", FFMPEG_H264,
+- "XVid", FFMPEG_XVID,
++ "XVID", FFMPEG_XVID,
+ #if 0
+ /* ifdef WITH_OGG, disabled, since broken within ffmpeg bundled with blender */
+ "OGG", FFMPEG_OGG,
+@@ -2212,7 +2212,7 @@
+ "HuffYUV", CODEC_ID_HUFFYUV,
+ "DV", CODEC_ID_DVVIDEO,
+ "H264", CODEC_ID_H264,
+- "XVid", CODEC_ID_XVID,
++ "XVid", CODEC_ID_MPEG4,
+ #ifdef WITH_OGG
+ "Theora", CODEC_ID_THEORA,
+ #endif
+@@ -2723,12 +2723,12 @@
+ switch (o->type) {
+ case FF_OPT_TYPE_INT:
+ case FF_OPT_TYPE_INT64:
+- val.i = o->default_val;
++ val.i = o->default_val.dbl;
+ idp_type = IDP_INT;
+ break;
+ case FF_OPT_TYPE_DOUBLE:
+ case FF_OPT_TYPE_FLOAT:
+- val.f = o->default_val;
++ val.f = o->default_val.dbl;
+ idp_type = IDP_FLOAT;
+ break;
+ case FF_OPT_TYPE_STRING:
+diff -urN blender-2.49b.orig//source/blender/src/hddaudio.c blender-2.49b/source/blender/src/hddaudio.c
+--- blender-2.49b.orig//source/blender/src/hddaudio.c 2009-09-01 17:21:45.000000000 +0200
++++ blender-2.49b/source/blender/src/hddaudio.c 2011-11-13 06:27:23.000000000 +0100
+@@ -126,7 +126,7 @@
+ audioStream=-1;
+ for(i=0; i<pFormatCtx->nb_streams; i++)
+ if(get_codec_from_stream(pFormatCtx->streams[i])
+- ->codec_type == CODEC_TYPE_AUDIO)
++ ->codec_type == AVMEDIA_TYPE_AUDIO)
+ {
+ audioStream=i;
+ break;
+@@ -382,39 +382,30 @@
+ continue;
+ }
+
+- audio_pkt_data = packet.data;
+- audio_pkt_size = packet.size;
+-
+- while (audio_pkt_size > 0) {
+- data_size=AVCODEC_MAX_AUDIO_FRAME_SIZE;
+- len = avcodec_decode_audio2(
+- hdaudio->pCodecCtx,
+- hdaudio->decode_cache
+- + decode_pos
+- * hdaudio->decode_sample_format_size,
+- &data_size,
+- audio_pkt_data,
+- audio_pkt_size);
+- if (len <= 0) {
+- audio_pkt_size = 0;
+- break;
+- }
+-
+- audio_pkt_size -= len;
+- audio_pkt_data += len;
+-
+- if (data_size <= 0) {
+- continue;
+- }
+-
+- decode_pos += data_size
+- / hdaudio->decode_sample_format_size;
+- if (decode_pos + data_size
+- / hdaudio->decode_sample_format_size
+- > hdaudio->decode_cache_size) {
+- break;
+- }
+- }
++ data_size=AVCODEC_MAX_AUDIO_FRAME_SIZE;
++ len = avcodec_decode_audio3(
++ hdaudio->pCodecCtx,
++ hdaudio->decode_cache
++ + decode_pos
++ * hdaudio->decode_sample_format_size,
++ &data_size,
++ &packet);
++ if (len <= 0) {
++ audio_pkt_size = 0;
++ break;
++ }
++
++ if (data_size <= 0) {
++ continue;
++ }
++
++ decode_pos += data_size
++ / hdaudio->decode_sample_format_size;
++ if (decode_pos + data_size
++ / hdaudio->decode_sample_format_size
++ > hdaudio->decode_cache_size) {
++ break;
++ }
+ av_free_packet(&packet);
+
+ if (decode_pos + data_size / hdaudio->decode_sample_format_size
+@@ -534,36 +525,29 @@
+ decode_cache_zero_init = 1;
+ }
+
+- while (audio_pkt_size > 0) {
+- data_size=AVCODEC_MAX_AUDIO_FRAME_SIZE;
+- len = avcodec_decode_audio2(
+- hdaudio->pCodecCtx,
+- hdaudio->decode_cache
+- + decode_pos
+- * hdaudio->decode_sample_format_size,
+- &data_size,
+- audio_pkt_data,
+- audio_pkt_size);
+- if (len <= 0) {
+- audio_pkt_size = 0;
+- break;
+- }
+-
+- audio_pkt_size -= len;
+- audio_pkt_data += len;
+-
+- if (data_size <= 0) {
+- continue;
+- }
+-
+- decode_pos += data_size
+- / hdaudio->decode_sample_format_size;
+- if (decode_pos + data_size
+- / hdaudio->decode_sample_format_size
+- > hdaudio->decode_cache_size) {
+- break;
+- }
+- }
++ data_size=AVCODEC_MAX_AUDIO_FRAME_SIZE;
++ len = avcodec_decode_audio3(
++ hdaudio->pCodecCtx,
++ hdaudio->decode_cache
++ + decode_pos
++ * hdaudio->decode_sample_format_size,
++ &data_size,
++ &packet);
++ if (len <= 0) {
++ break;
++ }
++
++ if (data_size <= 0) {
++ continue;
++ }
++
++ decode_pos += data_size
++ / hdaudio->decode_sample_format_size;
++ if (decode_pos + data_size
++ / hdaudio->decode_sample_format_size
++ > hdaudio->decode_cache_size) {
++ break;
++ }
+
+ av_free_packet(&packet);
+
+diff -urN blender-2.49b.orig//source/gameengine/VideoTexture/VideoFFmpeg.cpp blender-2.49b/source/gameengine/VideoTexture/VideoFFmpeg.cpp
+--- blender-2.49b.orig//source/gameengine/VideoTexture/VideoFFmpeg.cpp 2009-09-01 17:20:53.000000000 +0200
++++ blender-2.49b/source/gameengine/VideoTexture/VideoFFmpeg.cpp 2011-11-13 07:56:56.000000000 +0100
+@@ -26,7 +26,6 @@
+ #define __STDC_CONSTANT_MACROS
+ #include <stdint.h>
+
+-
+ #include "MEM_guardedalloc.h"
+ #include "PIL_time.h"
+
+@@ -177,7 +176,7 @@
+ {
+ if(formatCtx->streams[i] &&
+ get_codec_from_stream(formatCtx->streams[i]) &&
+- (get_codec_from_stream(formatCtx->streams[i])->codec_type==CODEC_TYPE_VIDEO))
++ (get_codec_from_stream(formatCtx->streams[i])->codec_type==AVMEDIA_TYPE_VIDEO))
+ {
+ videoStream=i;
+ break;
+@@ -358,9 +357,9 @@
+ BLI_remlink(&video->m_packetCacheBase, cachePacket);
+ // use m_frame because when caching, it is not used in main thread
+ // we can't use currentFrame directly because we need to convert to RGB first
+- avcodec_decode_video(video->m_codecCtx,
++ avcodec_decode_video2(video->m_codecCtx,
+ video->m_frame, &frameFinished,
+- cachePacket->packet.data, cachePacket->packet.size);
++ &cachePacket->packet);
+ if(frameFinished)
+ {
+ AVFrame * input = video->m_frame;
+@@ -628,7 +627,7 @@
+ if (m_captRate <= 0.f)
+ m_captRate = defFrameRate;
+ sprintf(rateStr, "%f", m_captRate);
+- av_parse_video_frame_rate(&frameRate, rateStr);
++ av_parse_video_rate(&frameRate, rateStr);
+ // populate format parameters
+ // need to specify the time base = inverse of rate
+ formatParams.time_base.num = frameRate.den;
+@@ -887,10 +886,10 @@
+ {
+ if (packet.stream_index == m_videoStream)
+ {
+- avcodec_decode_video(
++ avcodec_decode_video2(
+ m_codecCtx,
+ m_frame, &frameFinished,
+- packet.data, packet.size);
++ &packet);
+ if (frameFinished)
+ m_curPosition++;
+ }
+@@ -966,9 +965,9 @@
+ {
+ if(packet.stream_index == m_videoStream)
+ {
+- avcodec_decode_video(m_codecCtx,
++ avcodec_decode_video2(m_codecCtx,
+ m_frame, &frameFinished,
+- packet.data, packet.size);
++ &packet);
+
+ if (frameFinished && !posFound)
+ {
+diff -urN blender-2.49b.orig//source/gameengine/VideoTexture/VideoFFmpeg.h blender-2.49b/source/gameengine/VideoTexture/VideoFFmpeg.h
+--- blender-2.49b.orig//source/gameengine/VideoTexture/VideoFFmpeg.h 2009-09-01 17:20:53.000000000 +0200
++++ blender-2.49b/source/gameengine/VideoTexture/VideoFFmpeg.h 2011-11-13 08:03:51.000000000 +0100
+@@ -28,6 +28,7 @@
+ #include <libavformat/avformat.h>
+ #include <libavcodec/avcodec.h>
+ #include <libavutil/rational.h>
++#include <libavutil/parseutils.h>
+ #include <libswscale/swscale.h>
+ #include "DNA_listBase.h"
+ #include "BLI_threads.h"
diff --git a/media-gfx/blender/files/blender-2.49b-subversion-1.7.patch b/media-gfx/blender/files/blender-2.49b-subversion-1.7.patch
new file mode 100644
index 0000000..34b4b8a
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.49b-subversion-1.7.patch
@@ -0,0 +1,14 @@
+--- tools/Blender.py 2011-10-29 06:32:11.706449854 +0200
++++ tools/Blender.py 2011-10-29 06:32:15.923397138 +0200
+@@ -219,7 +219,10 @@
+ """
+ build_date = time.strftime ("%Y-%m-%d")
+ build_time = time.strftime ("%H:%M:%S")
+- build_rev = os.popen('svnversion').read()[:-1] # remove \n
++ # svn 1.6 says "exported"
++ # svn 1.7 says "Unversioned directory"
++ # Latter breaks the build somewhere, former doesn't.
++ build_rev = 'exported'
+
+ obj = []
+ if lenv['BF_BUILDINFO']:
diff --git a/media-gfx/blender/files/blender-2.57-CVE-2009-3850-v1.patch b/media-gfx/blender/files/blender-2.57-CVE-2009-3850-v1.patch
new file mode 100644
index 0000000..9c0f39f
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.57-CVE-2009-3850-v1.patch
@@ -0,0 +1,105 @@
+From dfb6ecd9a4a129b976b7a8d2002e32146125340f Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Sun, 24 Apr 2011 18:26:47 +0200
+Subject: [PATCH] Disable execution of embedded Python code unless run with
+ --enable-autoexec|-y|-666 (CVE-2009-3850)
+
+---
+ source/blender/blenkernel/intern/blender.c | 3 ++-
+ source/blender/makesrna/intern/rna_userdef.c | 9 ++++++---
+ source/blender/windowmanager/intern/wm_files.c | 3 ++-
+ source/creator/creator.c | 10 ++++++----
+ 4 files changed, 16 insertions(+), 9 deletions(-)
+
+diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
+index 5f08505..9c27ac7 100644
+--- a/source/blender/blenkernel/intern/blender.c
++++ b/source/blender/blenkernel/intern/blender.c
+@@ -141,7 +141,8 @@ void initglobals(void)
+ G.charmin = 0x0000;
+ G.charmax = 0xffff;
+
+- G.f |= G_SCRIPT_AUTOEXEC;
++ G.f &= ~G_SCRIPT_AUTOEXEC;
++ G.f |= G_SCRIPT_OVERRIDE_PREF; /* Disables turning G_SCRIPT_AUTOEXEC on from user prefs */
+ }
+
+ /***/
+diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
+index e9a9ddc..a120857 100644
+--- a/source/blender/makesrna/intern/rna_userdef.c
++++ b/source/blender/makesrna/intern/rna_userdef.c
+@@ -99,9 +99,12 @@ static void rna_userdef_show_manipulator_update(Main *bmain, Scene *scene, Point
+
+ static void rna_userdef_script_autoexec_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+ {
+- UserDef *userdef = (UserDef*)ptr->data;
+- if (userdef->flag & USER_SCRIPT_AUTOEXEC_DISABLE) G.f &= ~G_SCRIPT_AUTOEXEC;
+- else G.f |= G_SCRIPT_AUTOEXEC;
++ if ((G.f & G_SCRIPT_OVERRIDE_PREF) == 0) {
++ /* Blender run with --enable-autoexec */
++ UserDef *userdef = (UserDef*)ptr->data;
++ if (userdef->flag & USER_SCRIPT_AUTOEXEC_DISABLE) G.f &= ~G_SCRIPT_AUTOEXEC;
++ else G.f |= G_SCRIPT_AUTOEXEC;
++ }
+ }
+
+ static void rna_userdef_mipmap_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
+index f4f7af0..c1bacc6 100644
+--- a/source/blender/windowmanager/intern/wm_files.c
++++ b/source/blender/windowmanager/intern/wm_files.c
+@@ -270,7 +270,8 @@ static void wm_init_userdef(bContext *C)
+
+ /* set the python auto-execute setting from user prefs */
+ /* enabled by default, unless explicitly enabled in the command line which overrides */
+- if((G.f & G_SCRIPT_OVERRIDE_PREF) == 0) {
++ if (! G.background && ((G.f & G_SCRIPT_OVERRIDE_PREF) == 0)) {
++ /* Blender run with --enable-autoexec */
+ if ((U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0) G.f |= G_SCRIPT_AUTOEXEC;
+ else G.f &= ~G_SCRIPT_AUTOEXEC;
+ }
+diff --git a/source/creator/creator.c b/source/creator/creator.c
+index c687cc2..1da282f 100644
+--- a/source/creator/creator.c
++++ b/source/creator/creator.c
+@@ -278,6 +278,7 @@ static int print_help(int UNUSED(argc), const char **UNUSED(argv), void *data)
+
+ printf("\n");
+
++ BLI_argsPrintArgDoc(ba, "-666");
+ BLI_argsPrintArgDoc(ba, "--enable-autoexec");
+ BLI_argsPrintArgDoc(ba, "--disable-autoexec");
+
+@@ -359,14 +360,14 @@ static int end_arguments(int UNUSED(argc), const char **UNUSED(argv), void *UNUS
+ static int enable_python(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
+ {
+ G.f |= G_SCRIPT_AUTOEXEC;
+- G.f |= G_SCRIPT_OVERRIDE_PREF;
++ G.f &= ~G_SCRIPT_OVERRIDE_PREF; /* Enables turning G_SCRIPT_AUTOEXEC off from user prefs */
+ return 0;
+ }
+
+ static int disable_python(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
+ {
+ G.f &= ~G_SCRIPT_AUTOEXEC;
+- G.f |= G_SCRIPT_OVERRIDE_PREF;
++ G.f |= G_SCRIPT_OVERRIDE_PREF; /* Disables turning G_SCRIPT_AUTOEXEC on from user prefs */
+ return 0;
+ }
+
+@@ -1075,8 +1076,9 @@ static void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle)
+
+ BLI_argsAdd(ba, 1, "-v", "--version", "\n\tPrint Blender version and exit", print_version, NULL);
+
+- BLI_argsAdd(ba, 1, "-y", "--enable-autoexec", "\n\tEnable automatic python script execution (default)", enable_python, NULL);
+- BLI_argsAdd(ba, 1, "-Y", "--disable-autoexec", "\n\tDisable automatic python script execution (pydrivers, pyconstraints, pynodes)", disable_python, NULL);
++ BLI_argsAdd(ba, 1, NULL, "-666", "\n\tEnable automatic python script execution (port from CVE-2009-3850 patch to Blender 2.49b)", enable_python, NULL);
++ BLI_argsAdd(ba, 1, "-y", "--enable-autoexec", "\n\tEnable automatic python script execution", enable_python, NULL);
++ BLI_argsAdd(ba, 1, "-Y", "--disable-autoexec", "\n\tDisable automatic python script execution (pydrivers, pyconstraints, pynodes) (default)", disable_python, NULL);
+
+ BLI_argsAdd(ba, 1, "-b", "--background", "<file>\n\tLoad <file> in background (often used for UI-less rendering)", background_mode, NULL);
+
+--
+1.7.5.rc1
+
diff --git a/media-gfx/blender/files/blender-2.57-CVE-2009-3850-v2.patch b/media-gfx/blender/files/blender-2.57-CVE-2009-3850-v2.patch
new file mode 100644
index 0000000..526e0f7
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.57-CVE-2009-3850-v2.patch
@@ -0,0 +1,172 @@
+From c4181c5639da5c6a6df31b434498a44d0d680487 Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Tue, 17 May 2011 17:37:11 +0200
+Subject: [PATCH] Disable execution of embedded Python code unless run with
+ --enable-autoexec|-y|-666 (CVE-2009-3850)
+
+---
+ source/blender/blenkernel/intern/blender.c | 3 ++-
+ source/blender/makesrna/intern/rna_userdef.c | 16 +++++++++++++---
+ source/blender/windowmanager/intern/wm_files.c | 7 ++++++-
+ source/blender/windowmanager/intern/wm_operators.c | 16 ++++++++++++----
+ source/creator/creator.c | 10 ++++++----
+ 5 files changed, 39 insertions(+), 13 deletions(-)
+
+diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
+index 5f08505..9c27ac7 100644
+--- a/source/blender/blenkernel/intern/blender.c
++++ b/source/blender/blenkernel/intern/blender.c
+@@ -141,7 +141,8 @@ void initglobals(void)
+ G.charmin = 0x0000;
+ G.charmax = 0xffff;
+
+- G.f |= G_SCRIPT_AUTOEXEC;
++ G.f &= ~G_SCRIPT_AUTOEXEC;
++ G.f |= G_SCRIPT_OVERRIDE_PREF; /* Disables turning G_SCRIPT_AUTOEXEC on from user prefs */
+ }
+
+ /***/
+diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
+index e9a9ddc..218b50a 100644
+--- a/source/blender/makesrna/intern/rna_userdef.c
++++ b/source/blender/makesrna/intern/rna_userdef.c
+@@ -99,9 +99,17 @@ static void rna_userdef_show_manipulator_update(Main *bmain, Scene *scene, Point
+
+ static void rna_userdef_script_autoexec_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+ {
+- UserDef *userdef = (UserDef*)ptr->data;
+- if (userdef->flag & USER_SCRIPT_AUTOEXEC_DISABLE) G.f &= ~G_SCRIPT_AUTOEXEC;
+- else G.f |= G_SCRIPT_AUTOEXEC;
++ if ((G.f & G_SCRIPT_OVERRIDE_PREF) == 0) {
++ /* Blender run with --enable-autoexec */
++ UserDef *userdef = (UserDef*)ptr->data;
++ if (userdef->flag & USER_SCRIPT_AUTOEXEC_DISABLE) G.f &= ~G_SCRIPT_AUTOEXEC;
++ else G.f |= G_SCRIPT_AUTOEXEC;
++ }
++}
++
++static int rna_userdef_script_autoexec_editable(Main *bmain, Scene *scene, PointerRNA *ptr) {
++ /* Disable "Auto Run Python Scripts" checkbox unless Blender run with --enable-autoexec */
++ return !(G.f & G_SCRIPT_OVERRIDE_PREF);
+ }
+
+ static void rna_userdef_mipmap_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+@@ -2505,6 +2513,8 @@ static void rna_def_userdef_system(BlenderRNA *brna)
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_SCRIPT_AUTOEXEC_DISABLE);
+ RNA_def_property_ui_text(prop, "Auto Run Python Scripts", "Allow any .blend file to run scripts automatically (unsafe with blend files from an untrusted source)");
+ RNA_def_property_update(prop, 0, "rna_userdef_script_autoexec_update");
++ /* Disable "Auto Run Python Scripts" checkbox unless Blender run with --enable-autoexec */
++ RNA_def_property_editable_func(prop, "rna_userdef_script_autoexec_editable");
+
+ prop= RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TXT_TABSTOSPACES_DISABLE);
+diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
+index f4f7af0..37a9664 100644
+--- a/source/blender/windowmanager/intern/wm_files.c
++++ b/source/blender/windowmanager/intern/wm_files.c
+@@ -270,11 +270,16 @@ static void wm_init_userdef(bContext *C)
+
+ /* set the python auto-execute setting from user prefs */
+ /* enabled by default, unless explicitly enabled in the command line which overrides */
+- if((G.f & G_SCRIPT_OVERRIDE_PREF) == 0) {
++ if (! G.background && ((G.f & G_SCRIPT_OVERRIDE_PREF) == 0)) {
++ /* Blender run with --enable-autoexec */
+ if ((U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0) G.f |= G_SCRIPT_AUTOEXEC;
+ else G.f &= ~G_SCRIPT_AUTOEXEC;
+ }
+ if(U.tempdir[0]) BLI_where_is_temp(btempdir, FILE_MAX, 1);
++
++ /* Workaround to fix default of "Auto Run Python Scripts" checkbox */
++ if ((G.f & G_SCRIPT_OVERRIDE_PREF) && !(G.f & G_SCRIPT_AUTOEXEC))
++ U.flag |= USER_SCRIPT_AUTOEXEC_DISABLE;
+ }
+
+ void WM_read_file(bContext *C, const char *name, ReportList *reports)
+diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
+index 28df023..a2142a5 100644
+--- a/source/blender/windowmanager/intern/wm_operators.c
++++ b/source/blender/windowmanager/intern/wm_operators.c
+@@ -1471,12 +1471,13 @@ static int wm_open_mainfile_exec(bContext *C, wmOperator *op)
+ G.fileflags &= ~G_FILE_NO_UI;
+ else
+ G.fileflags |= G_FILE_NO_UI;
+-
+- if(RNA_boolean_get(op->ptr, "use_scripts"))
++
++ /* Restrict "Trusted Source" mode to Blender in --enable-autoexec mode */
++ if(RNA_boolean_get(op->ptr, "use_scripts") && (!(G.f & G_SCRIPT_OVERRIDE_PREF)))
+ G.f |= G_SCRIPT_AUTOEXEC;
+ else
+ G.f &= ~G_SCRIPT_AUTOEXEC;
+-
++
+ // XXX wm in context is not set correctly after WM_read_file -> crash
+ // do it before for now, but is this correct with multiple windows?
+ WM_event_add_notifier(C, NC_WINDOW, NULL);
+@@ -1488,6 +1489,8 @@ static int wm_open_mainfile_exec(bContext *C, wmOperator *op)
+
+ static void WM_OT_open_mainfile(wmOperatorType *ot)
+ {
++ PropertyRNA * use_scripts_checkbox = NULL;
++
+ ot->name= "Open Blender File";
+ ot->idname= "WM_OT_open_mainfile";
+ ot->description="Open a Blender file";
+@@ -1499,7 +1502,12 @@ static void WM_OT_open_mainfile(wmOperatorType *ot)
+ WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_OPENFILE, WM_FILESEL_FILEPATH);
+
+ RNA_def_boolean(ot->srna, "load_ui", 1, "Load UI", "Load user interface setup in the .blend file");
+- RNA_def_boolean(ot->srna, "use_scripts", 1, "Trusted Source", "Allow blend file execute scripts automatically, default available from system preferences");
++ use_scripts_checkbox = RNA_def_boolean(ot->srna, "use_scripts",
++ !!(G.f & G_SCRIPT_AUTOEXEC), "Trusted Source",
++ "Allow blend file execute scripts automatically, default available from system preferences");
++ /* Disable "Trusted Source" checkbox unless Blender run with --enable-autoexec */
++ if (use_scripts_checkbox && (G.f & G_SCRIPT_OVERRIDE_PREF))
++ RNA_def_property_clear_flag(use_scripts_checkbox, PROP_EDITABLE);
+ }
+
+ /* **************** link/append *************** */
+diff --git a/source/creator/creator.c b/source/creator/creator.c
+index c687cc2..1da282f 100644
+--- a/source/creator/creator.c
++++ b/source/creator/creator.c
+@@ -278,6 +278,7 @@ static int print_help(int UNUSED(argc), const char **UNUSED(argv), void *data)
+
+ printf("\n");
+
++ BLI_argsPrintArgDoc(ba, "-666");
+ BLI_argsPrintArgDoc(ba, "--enable-autoexec");
+ BLI_argsPrintArgDoc(ba, "--disable-autoexec");
+
+@@ -359,14 +360,14 @@ static int end_arguments(int UNUSED(argc), const char **UNUSED(argv), void *UNUS
+ static int enable_python(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
+ {
+ G.f |= G_SCRIPT_AUTOEXEC;
+- G.f |= G_SCRIPT_OVERRIDE_PREF;
++ G.f &= ~G_SCRIPT_OVERRIDE_PREF; /* Enables turning G_SCRIPT_AUTOEXEC off from user prefs */
+ return 0;
+ }
+
+ static int disable_python(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
+ {
+ G.f &= ~G_SCRIPT_AUTOEXEC;
+- G.f |= G_SCRIPT_OVERRIDE_PREF;
++ G.f |= G_SCRIPT_OVERRIDE_PREF; /* Disables turning G_SCRIPT_AUTOEXEC on from user prefs */
+ return 0;
+ }
+
+@@ -1075,8 +1076,9 @@ static void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle)
+
+ BLI_argsAdd(ba, 1, "-v", "--version", "\n\tPrint Blender version and exit", print_version, NULL);
+
+- BLI_argsAdd(ba, 1, "-y", "--enable-autoexec", "\n\tEnable automatic python script execution (default)", enable_python, NULL);
+- BLI_argsAdd(ba, 1, "-Y", "--disable-autoexec", "\n\tDisable automatic python script execution (pydrivers, pyconstraints, pynodes)", disable_python, NULL);
++ BLI_argsAdd(ba, 1, NULL, "-666", "\n\tEnable automatic python script execution (port from CVE-2009-3850 patch to Blender 2.49b)", enable_python, NULL);
++ BLI_argsAdd(ba, 1, "-y", "--enable-autoexec", "\n\tEnable automatic python script execution", enable_python, NULL);
++ BLI_argsAdd(ba, 1, "-Y", "--disable-autoexec", "\n\tDisable automatic python script execution (pydrivers, pyconstraints, pynodes) (default)", disable_python, NULL);
+
+ BLI_argsAdd(ba, 1, "-b", "--background", "<file>\n\tLoad <file> in background (often used for UI-less rendering)", background_mode, NULL);
+
+--
+1.7.5.rc3
+
diff --git a/media-gfx/blender/files/blender-2.57-bmake.patch b/media-gfx/blender/files/blender-2.57-bmake.patch
new file mode 100644
index 0000000..b78d5a4
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.57-bmake.patch
@@ -0,0 +1,15 @@
+--- release/plugins/bmake 2010-03-21 17:44:20.500741049 +0100
++++ release/plugins/bmake 2010-03-21 17:44:33.659740173 +0100
+@@ -57,10 +57,10 @@
+ LDFLAGS="-Bshareable";
+ elif ( test $UNAME = "Linux" ) then
+ CC="gcc";
+- CFLAGS="-fPIC -funsigned-char -O2";
++# CFLAGS="-fPIC -funsigned-char -O2";
+
+ LD="ld";
+- LDFLAGS="-Bshareable";
++# LDFLAGS="-Bshareable";
+ elif ( test $UNAME = "SunOS" ) then
+ CC="cc";
+ CFLAGS="-O";
diff --git a/media-gfx/blender/files/blender-2.57-desktop.patch b/media-gfx/blender/files/blender-2.57-desktop.patch
new file mode 100644
index 0000000..6a40e3b
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.57-desktop.patch
@@ -0,0 +1,20 @@
+--- release/freedesktop/blender.desktop 2010-09-12 00:05:51.000000000 -0700
++++ release/freedesktop/blender.desktop 2010-09-12 00:07:32.000000000 -0700
+@@ -1,5 +1,5 @@
+ [Desktop Entry]
+-Name=Blender
++Name=Blender 2.5x
+ GenericName=3D modeller
+ GenericName[es]=modelador 3D
+ GenericName[de]=3D Modellierer
+@@ -7,8 +7,8 @@
+ GenericName[ru]=Редактор 3D-моделей
+ Comment=3D modeling, animation, rendering and post-production
+ Comment[es]=modelado 3D, animación, renderizado y post-producción
+-Exec=blender
+-Icon=blender
++Exec=blender-2.5
++Icon=blender-2.5.svg
+ Terminal=false
+ Type=Application
+ Categories=Graphics;3DGraphics;
diff --git a/media-gfx/blender/files/blender-2.57-doxygen.patch b/media-gfx/blender/files/blender-2.57-doxygen.patch
new file mode 100644
index 0000000..335b289
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.57-doxygen.patch
@@ -0,0 +1,33 @@
+--- doc/doxygen/Doxyfile 2011-02-19 18:51:40.216999981 +0100
++++ doc/doxygen/Doxyfile 2011-02-19 18:57:46.628999965 +0100
+@@ -559,26 +559,26 @@
+ # The QUIET tag can be used to turn on/off the messages that are generated
+ # by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+-QUIET = NO
++QUIET = YES
+
+ # The WARNINGS tag can be used to turn on/off the warning messages that are
+ # generated by doxygen. Possible values are YES and NO. If left blank
+ # NO is used.
+
+-WARNINGS = YES
++WARNINGS = NO
+
+ # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+ # for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+ # automatically be disabled.
+
+-WARN_IF_UNDOCUMENTED = YES
++WARN_IF_UNDOCUMENTED = NO
+
+ # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+ # potential errors in the documentation, such as not documenting some
+ # parameters in a documented function, or documenting parameters that
+ # don't exist or using markup commands wrongly.
+
+-WARN_IF_DOC_ERROR = YES
++WARN_IF_DOC_ERROR = NO
+
+ # The WARN_NO_PARAMDOC option can be enabled to get warnings for
+ # functions that are documented, but have no documentation for their parameters
diff --git a/media-gfx/blender/files/blender-2.57-eigen.patch b/media-gfx/blender/files/blender-2.57-eigen.patch
new file mode 100644
index 0000000..91d8af4
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.57-eigen.patch
@@ -0,0 +1,22 @@
+--- intern/itasc/SConscript 2009-09-26 09:14:02.000000000 +0200
++++ intern/itasc/SConscript 2009-09-26 09:14:54.000000000 +0200
+@@ -5,7 +5,8 @@
+ sources += env.Glob('kdl/*.cpp')
+ sources += env.Glob('kdl/utilities/*.cpp')
+
+-incs = '. ../../extern/Eigen2'
++#incs = '. ../../extern/Eigen2'
++incs = '. /usr/include/eigen2'
+
+ env.BlenderLib ('bf_ITASC', sources, Split(incs), [], libtype=['intern','player'], priority=[20,100] )
+
+--- source/blender/ikplugin/SConscript
++++ source/blender/ikplugin/SConscript
+@@ -4,6 +4,6 @@
+ sources = env.Glob('intern/*.c') + env.Glob('intern/*.cpp')
+
+ incs = '#/intern/guardedalloc #/intern/iksolver/extern ../makesdna ../blenlib'
+-incs += ' ../blenkernel ../include ../ikplugin #/intern/itasc #/extern/Eigen2'
++incs += ' ../blenkernel ../include ../ikplugin #/intern/itasc /usr/include/eigen2'
+
+ env.BlenderLib ( 'bf_ikplugin', sources, Split(incs), [], libtype=['core','player'], priority=[180, 190] )
diff --git a/media-gfx/blender/files/blender-2.57-enable_site_module.patch b/media-gfx/blender/files/blender-2.57-enable_site_module.patch
new file mode 100644
index 0000000..c38be79
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.57-enable_site_module.patch
@@ -0,0 +1,32 @@
+--- source/blender/python/intern/bpy_interface.c
++++ source/blender/python/intern/bpy_interface.c
+@@ -244,11 +244,6 @@
+
+ bpy_python_start_path(); /* allow to use our own included python */
+
+- /* Python 3.2 now looks for '2.57/python/include/python3.2d/pyconfig.h' to parse
+- * from the 'sysconfig' module which is used by 'site', so for now disable site.
+- * alternatively we could copy the file. */
+- Py_NoSiteFlag= 1;
+-
+ Py_Initialize();
+
+ // PySys_SetArgv(argc, argv); // broken in py3, not a huge deal
+--- source/gameengine/Ketsji/KX_PythonInit.cpp
++++ source/gameengine/Ketsji/KX_PythonInit.cpp
+@@ -1773,7 +1773,6 @@
+ STR_String pname = progname;
+ Py_SetProgramName(pname.Ptr());
+ #endif
+- Py_NoSiteFlag=1;
+ Py_FrozenFlag=1;
+
+ /* must run before python initializes */
+@@ -1843,7 +1842,6 @@
+ STR_String pname = progname;
+ Py_SetProgramName(pname.Ptr());
+ #endif
+- Py_NoSiteFlag=1;
+ Py_FrozenFlag=1;
+
+ initPyTypes();
diff --git a/media-gfx/blender/files/blender-2.57-glew.patch b/media-gfx/blender/files/blender-2.57-glew.patch
new file mode 100644
index 0000000..5e63c7c
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.57-glew.patch
@@ -0,0 +1,22 @@
+--- extern/SConscript
++++ extern/SConscript
+@@ -2,8 +2,6 @@
+
+ Import('env')
+
+-SConscript(['glew/SConscript'])
+-
+ if env['WITH_BF_BULLET']:
+ SConscript(['bullet2/src/SConscript'])
+
+--- source/blender/editors/include/BIF_gl.h
++++ source/blender/editors/include/BIF_gl.h
+@@ -31,7 +31,7 @@
+ #ifndef BIF_GL_H
+ #define BIF_GL_H
+
+-#include "GL/glew.h"
++#include <GL/glew.h>
+
+ /*
+ * these should be phased out. cpack should be replaced in
diff --git a/media-gfx/blender/files/blender-2.57-insecure.desktop b/media-gfx/blender/files/blender-2.57-insecure.desktop
new file mode 100644
index 0000000..e427957
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.57-insecure.desktop
@@ -0,0 +1,15 @@
+[Desktop Entry]
+Name=Blender 2.5x (reduced security)
+GenericName=3D modeller (reduced security)
+GenericName[es]=modelador 3D (reduced security)
+GenericName[de]=3D Modellierer (weniger Sicherheit)
+GenericName[fr]=modeleur 3D (reduced security)
+GenericName[ru]=Редактор 3D-моделей (reduced security)
+Comment=3D modeling, animation, rendering and post-production
+Comment[es]=modelado 3D, animación, renderizado y post-producción
+Exec=blender-2.5 --enable-autoexec
+Icon=blender-2.5.svg
+Terminal=false
+Type=Application
+Categories=Graphics;3DGraphics;
+MimeType=application/x-blender;
diff --git a/media-gfx/blender/files/blender-2.57-libav-0.7.patch b/media-gfx/blender/files/blender-2.57-libav-0.7.patch
new file mode 100644
index 0000000..7b4ca47
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.57-libav-0.7.patch
@@ -0,0 +1,296 @@
+diff -burN blender-2.57.orig//intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp blender-2.57/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp
+--- blender-2.57.orig//intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp 2011-04-14 17:06:35.000000000 +0200
++++ blender-2.57/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp 2011-05-04 01:44:30.184004582 +0200
+@@ -64,15 +64,10 @@
+
+ // read samples from the packet
+ data_size = buf_size - buf_pos;
+- /*read_length = avcodec_decode_audio3(m_codecCtx,
++ read_length = avcodec_decode_audio3(m_codecCtx,
+ (int16_t*)(((data_t*)buffer.getBuffer())+buf_pos),
+ &data_size,
+- packet);*/
+- read_length = avcodec_decode_audio2(m_codecCtx,
+- (int16_t*)(((data_t*)buffer.getBuffer()) + buf_pos),
+- &data_size,
+- audio_pkg_data,
+- audio_pkg_size);
++ packet);
+
+ // read error, next packet!
+ if(read_length < 0)
+@@ -112,7 +107,7 @@
+
+ for(unsigned int i = 0; i < m_formatCtx->nb_streams; i++)
+ {
+- if((m_formatCtx->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO)
++ if((m_formatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
+ && (m_stream < 0))
+ {
+ m_stream=i;
+diff -burN blender-2.57.orig//source/blender/blenkernel/intern/writeffmpeg.c blender-2.57/source/blender/blenkernel/intern/writeffmpeg.c
+--- blender-2.57.orig//source/blender/blenkernel/intern/writeffmpeg.c 2011-04-14 17:17:03.000000000 +0200
++++ blender-2.57/source/blender/blenkernel/intern/writeffmpeg.c 2011-05-04 03:36:08.365219076 +0200
+@@ -163,7 +163,7 @@
+ }
+
+ pkt.stream_index = audio_stream->index;
+- pkt.flags |= PKT_FLAG_KEY;
++ pkt.flags |= AV_PKT_FLAG_KEY;
+ if (av_interleaved_write_frame(outfile, &pkt) != 0) {
+ fprintf(stderr, "Error writing audio packet!\n");
+ return -1;
+@@ -290,7 +290,7 @@
+ fprintf(stderr, "Video Frame PTS: not set\n");
+ }
+ if (c->coded_frame->key_frame)
+- packet.flags |= PKT_FLAG_KEY;
++ packet.flags |= AV_PKT_FLAG_KEY;
+ packet.stream_index = video_stream->index;
+ packet.data = video_buffer;
+ packet.size = outsize;
+@@ -396,7 +396,7 @@
+ switch(prop->type) {
+ case IDP_STRING:
+ fprintf(stderr, "%s.\n", IDP_String(prop));
+- rv = av_set_string(c, prop->name, IDP_String(prop));
++ av_set_string3(c, prop->name, IDP_String(prop), 0, &rv);
+ break;
+ case IDP_FLOAT:
+ fprintf(stderr, "%g.\n", IDP_Float(prop));
+@@ -407,7 +407,7 @@
+
+ if (param) {
+ if (IDP_Int(prop)) {
+- rv = av_set_string(c, name, param);
++ av_set_string3(c, name, param, 0, &rv);
+ } else {
+ return;
+ }
+@@ -461,7 +461,7 @@
+
+ c = get_codec_from_stream(st);
+ c->codec_id = codec_id;
+- c->codec_type = CODEC_TYPE_VIDEO;
++ c->codec_type = AVMEDIA_TYPE_VIDEO;
+
+
+ /* Get some values from the current render settings */
+@@ -519,7 +519,7 @@
+ c->pix_fmt = PIX_FMT_YUV422P;
+ }
+
+- if (codec_id == CODEC_ID_XVID) {
++ if (codec_id == CODEC_ID_MPEG4) {
+ /* arghhhh ... */
+ c->pix_fmt = PIX_FMT_YUV420P;
+ c->codec_tag = (('D'<<24) + ('I'<<16) + ('V'<<8) + 'X');
+@@ -588,7 +588,7 @@
+
+ c = get_codec_from_stream(st);
+ c->codec_id = codec_id;
+- c->codec_type = CODEC_TYPE_AUDIO;
++ c->codec_type = AVMEDIA_TYPE_AUDIO;
+
+ c->sample_rate = rd->ffcodecdata.audio_mixrate;
+ c->bit_rate = ffmpeg_audio_bitrate*1000;
+@@ -666,13 +666,13 @@
+ BKE_report(reports, RPT_ERROR, "No valid formats found.");
+ return 0;
+ }
+- fmt = guess_format(NULL, exts[0], NULL);
++ fmt = av_guess_format(NULL, exts[0], NULL);
+ if (!fmt) {
+ BKE_report(reports, RPT_ERROR, "No valid formats found.");
+ return 0;
+ }
+
+- of = av_alloc_format_context();
++ of = avformat_alloc_context();
+ if (!of) {
+ BKE_report(reports, RPT_ERROR, "Error opening output file");
+ return 0;
+@@ -713,7 +713,7 @@
+ fmt->video_codec = CODEC_ID_H264;
+ break;
+ case FFMPEG_XVID:
+- fmt->video_codec = CODEC_ID_XVID;
++ fmt->video_codec = CODEC_ID_MPEG4;
+ break;
+ case FFMPEG_FLV:
+ fmt->video_codec = CODEC_ID_FLV1;
+@@ -834,7 +834,7 @@
+ fprintf(stderr, "Video Frame PTS: not set\n");
+ }
+ if (c->coded_frame->key_frame) {
+- packet.flags |= PKT_FLAG_KEY;
++ packet.flags |= AV_PKT_FLAG_KEY;
+ }
+ packet.stream_index = video_stream->index;
+ packet.data = video_buffer;
+@@ -1314,7 +1314,7 @@
+ case FFMPEG_PRESET_XVID:
+ if(preset == FFMPEG_PRESET_XVID) {
+ rd->ffcodecdata.type = FFMPEG_AVI;
+- rd->ffcodecdata.codec = CODEC_ID_XVID;
++ rd->ffcodecdata.codec = CODEC_ID_MPEG4;
+ }
+ else if(preset == FFMPEG_PRESET_THEORA) {
+ rd->ffcodecdata.type = FFMPEG_OGG; // XXX broken
+@@ -1357,7 +1357,7 @@
+ }
+ }
+ else if(rd->imtype == R_XVID) {
+- if(rd->ffcodecdata.codec != CODEC_ID_XVID) {
++ if(rd->ffcodecdata.codec != CODEC_ID_MPEG4) {
+ ffmpeg_set_preset(rd, FFMPEG_PRESET_XVID);
+ audio= 1;
+ }
+diff -burN blender-2.57.orig//source/blender/imbuf/intern/anim_movie.c blender-2.57/source/blender/imbuf/intern/anim_movie.c
+--- blender-2.57.orig//source/blender/imbuf/intern/anim_movie.c 2011-04-14 17:19:18.000000000 +0200
++++ blender-2.57/source/blender/imbuf/intern/anim_movie.c 2011-05-04 03:33:56.724566283 +0200
+@@ -566,7 +566,7 @@
+ videoStream=-1;
+ for(i=0; i<pFormatCtx->nb_streams; i++)
+ if(get_codec_from_stream(pFormatCtx->streams[i])->codec_type
+- == CODEC_TYPE_VIDEO) {
++ == AVMEDIA_TYPE_VIDEO) {
+ videoStream=i;
+ break;
+ }
+@@ -830,10 +830,10 @@
+ && position - (anim->curposition + 1) < anim->preseek) {
+ while(av_read_frame(anim->pFormatCtx, &packet)>=0) {
+ if (packet.stream_index == anim->videoStream) {
+- avcodec_decode_video(
++ avcodec_decode_video2(
+ anim->pCodecCtx,
+ anim->pFrame, &frameFinished,
+- packet.data, packet.size);
++ &packet);
+
+ if (frameFinished) {
+ anim->curposition++;
+@@ -915,9 +915,9 @@
+
+ while(av_read_frame(anim->pFormatCtx, &packet)>=0) {
+ if(packet.stream_index == anim->videoStream) {
+- avcodec_decode_video(anim->pCodecCtx,
++ avcodec_decode_video2(anim->pCodecCtx,
+ anim->pFrame, &frameFinished,
+- packet.data, packet.size);
++ &packet);
+
+ if (seek_by_bytes && preseek_count > 0) {
+ preseek_count--;
+diff -burN blender-2.57.orig//source/blender/imbuf/intern/util.c blender-2.57/source/blender/imbuf/intern/util.c
+--- blender-2.57.orig//source/blender/imbuf/intern/util.c 2011-04-14 17:19:18.000000000 +0200
++++ blender-2.57/source/blender/imbuf/intern/util.c 2011-05-04 02:15:26.369208909 +0200
+@@ -292,7 +292,7 @@
+ for(i=0; i<pFormatCtx->nb_streams; i++)
+ if(pFormatCtx->streams[i] &&
+ get_codec_from_stream(pFormatCtx->streams[i]) &&
+- (get_codec_from_stream(pFormatCtx->streams[i])->codec_type==CODEC_TYPE_VIDEO))
++ (get_codec_from_stream(pFormatCtx->streams[i])->codec_type==AVMEDIA_TYPE_VIDEO))
+ {
+ videoStream=i;
+ break;
+diff -burN blender-2.57.orig//source/blender/makesrna/intern/rna_scene.c blender-2.57/source/blender/makesrna/intern/rna_scene.c
+--- blender-2.57.orig//source/blender/makesrna/intern/rna_scene.c 2011-04-14 17:18:53.000000000 +0200
++++ blender-2.57/source/blender/makesrna/intern/rna_scene.c 2011-05-04 02:19:10.326319453 +0200
+@@ -2135,7 +2135,7 @@
+ {CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""},
+ {CODEC_ID_DVVIDEO, "DV", 0, "DV", ""},
+ {CODEC_ID_H264, "H264", 0, "H.264", ""},
+- {CODEC_ID_XVID, "XVID", 0, "Xvid", ""},
++ {CODEC_ID_MPEG4, "XVID", 0, "Xvid", ""},
+ {CODEC_ID_THEORA, "THEORA", 0, "Theora", ""},
+ {CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
+ {CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""},
+diff -burN blender-2.57.orig//source/gameengine/VideoTexture/VideoFFmpeg.cpp blender-2.57/source/gameengine/VideoTexture/VideoFFmpeg.cpp
+--- blender-2.57.orig//source/gameengine/VideoTexture/VideoFFmpeg.cpp 2011-04-14 17:13:34.000000000 +0200
++++ blender-2.57/source/gameengine/VideoTexture/VideoFFmpeg.cpp 2011-05-04 02:49:31.147348425 +0200
+@@ -182,7 +182,7 @@
+ {
+ if(formatCtx->streams[i] &&
+ get_codec_from_stream(formatCtx->streams[i]) &&
+- (get_codec_from_stream(formatCtx->streams[i])->codec_type==CODEC_TYPE_VIDEO))
++ (get_codec_from_stream(formatCtx->streams[i])->codec_type==AVMEDIA_TYPE_VIDEO))
+ {
+ videoStream=i;
+ break;
+@@ -368,9 +368,9 @@
+ BLI_remlink(&video->m_packetCacheBase, cachePacket);
+ // use m_frame because when caching, it is not used in main thread
+ // we can't use currentFrame directly because we need to convert to RGB first
+- avcodec_decode_video(video->m_codecCtx,
++ avcodec_decode_video2(video->m_codecCtx,
+ video->m_frame, &frameFinished,
+- cachePacket->packet.data, cachePacket->packet.size);
++ &cachePacket->packet);
+ if(frameFinished)
+ {
+ AVFrame * input = video->m_frame;
+@@ -641,7 +641,7 @@
+ if (m_captRate <= 0.f)
+ m_captRate = defFrameRate;
+ sprintf(rateStr, "%f", m_captRate);
+- av_parse_video_frame_rate(&frameRate, rateStr);
++ av_parse_video_rate(&frameRate, rateStr);
+ // populate format parameters
+ // need to specify the time base = inverse of rate
+ formatParams.time_base.num = frameRate.den;
+@@ -924,10 +924,10 @@
+ {
+ if (packet.stream_index == m_videoStream)
+ {
+- avcodec_decode_video(
++ avcodec_decode_video2(
+ m_codecCtx,
+ m_frame, &frameFinished,
+- packet.data, packet.size);
++ &packet);
+ if (frameFinished)
+ {
+ m_curPosition = (long)((packet.dts-startTs) * (m_baseFrameRate*timeBase) + 0.5);
+@@ -999,9 +999,9 @@
+ {
+ if(packet.stream_index == m_videoStream)
+ {
+- avcodec_decode_video(m_codecCtx,
++ avcodec_decode_video2(m_codecCtx,
+ m_frame, &frameFinished,
+- packet.data, packet.size);
++ &packet);
+ // remember dts to compute exact frame number
+ dts = packet.dts;
+ if (frameFinished && !posFound)
+diff -burN blender-2.57.orig//source/gameengine/VideoTexture/VideoFFmpeg.h blender-2.57/source/gameengine/VideoTexture/VideoFFmpeg.h
+--- blender-2.57.orig//source/gameengine/VideoTexture/VideoFFmpeg.h 2011-04-14 17:13:34.000000000 +0200
++++ blender-2.57/source/gameengine/VideoTexture/VideoFFmpeg.h 2011-05-04 03:11:53.106002831 +0200
+@@ -34,6 +34,7 @@
+ #include <libavformat/avformat.h>
+ #include <libavcodec/avcodec.h>
+ #include <libavutil/rational.h>
++#include <libavutil/parseutils.h>
+ #include <libswscale/swscale.h>
+ #include "DNA_listBase.h"
+ #include "BLI_threads.h"
+diff -burN blender-2.57.orig/source/blender/blenkernel/intern/writeffmpeg.c /var/tmp/portage/media-gfx/blender-2.57-r1/work/blender-2.57/source/blender/blenkernel/intern/writeffmpeg.c
+--- blender-2.57.orig/source/blender/blenkernel/intern/writeffmpeg.c 2011-11-07 13:17:59.001736099 -0800
++++ blender-2.57/source/blender/blenkernel/intern/writeffmpeg.c 2011-11-07 13:18:35.726734562 -0800
+@@ -1101,12 +1101,12 @@
+ switch (o->type) {
+ case FF_OPT_TYPE_INT:
+ case FF_OPT_TYPE_INT64:
+- val.i = o->default_val;
++ val.i = o->default_val.dbl;
+ idp_type = IDP_INT;
+ break;
+ case FF_OPT_TYPE_DOUBLE:
+ case FF_OPT_TYPE_FLOAT:
+- val.f = o->default_val;
++ val.f = o->default_val.dbl;
+ idp_type = IDP_FLOAT;
+ break;
+ case FF_OPT_TYPE_STRING:
diff --git a/media-gfx/blender/files/blender-2.57-linux-3.patch b/media-gfx/blender/files/blender-2.57-linux-3.patch
new file mode 100644
index 0000000..6a96b49
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.57-linux-3.patch
@@ -0,0 +1,12 @@
+--- SConstruct 2011-10-29 05:18:43.149564401 +0200
++++ SConstruct 2011-10-29 05:19:37.332887017 +0200
+@@ -165,6 +165,9 @@
+ if crossbuild and platform not in ('win32-vc', 'win64-vc'):
+ platform = 'linuxcross'
+
++if platform == 'linux3':
++ platform = 'linux2' # Workaround for Linux 3.x
++
+ env['OURPLATFORM'] = platform
+
+ configfile = os.path.join("build_files", "scons", "config", platform + "-config.py")
diff --git a/media-gfx/blender/files/blender-2.60-bmake.patch b/media-gfx/blender/files/blender-2.60-bmake.patch
new file mode 100644
index 0000000..0ce8fa7
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.60-bmake.patch
@@ -0,0 +1,114 @@
+diff -Npur release/plugins.orig/bmake release/plugins/bmake
+--- release/plugins.orig/bmake 2011-11-11 15:00:26.339924887 +0100
++++ release/plugins/bmake 2011-11-11 15:01:40.637923565 +0100
+@@ -57,10 +57,10 @@
+ LDFLAGS="-Bshareable";
+ elif ( test $UNAME = "Linux" ) then
+ CC="gcc";
+- CFLAGS="-fPIC -funsigned-char -O2";
++# CFLAGS="-fPIC -funsigned-char -O2";
+
+ LD="ld";
+- LDFLAGS="-Bshareable";
++# LDFLAGS="-Bshareable";
+ elif ( test $UNAME = "SunOS" ) then
+ CC="cc";
+ CFLAGS="-O";
+@@ -109,22 +109,20 @@ elif ( test -f "../plugin.h" ) then
+ INCLUDES=-I..;
+ elif ( test -f "../include/plugin.h" ) then
+ INCLUDES=-I../include
++elif ( test -f "../../../source/blender/blenpluginapi/plugin.h" ) then
++ INCLUDES=-I../../../source/blender/blenpluginapi
+ else
+ echo "Couldn't find plugin.h";
+ exit;
+ fi
+
+ LIBM=`fgrep "#include <math.h>" $CFILE`
+-LIBC=`fgrep "#include <std" $CFILE`
+
+-LIBS=
++LIBS="-lc"
+
+ if ( test -n "$LIBM" ) then
+ LIBS="$LIBS -lm";
+ fi
+-if ( test -n "$LIBC" ) then
+- LIBS="$LIBS -lc";
+-fi
+
+ echo "$CC $CFLAGS -c $CFILE $INCLUDES"
+ $CC $CFLAGS -c $CFILE $INCLUDES
+diff -Npur release/plugins.orig/sequence/color-correction-hsv.c release/plugins/sequence/color-correction-hsv.c
+--- release/plugins.orig/sequence/color-correction-hsv.c 2011-11-11 15:00:26.339924887 +0100
++++ release/plugins/sequence/color-correction-hsv.c 2011-11-11 15:03:47.233921332 +0100
+@@ -15,7 +15,7 @@
+ *
+ */
+
+-#include "math.h"
++#include <math.h>
+ #include "plugin.h"
+ #include <stdio.h>
+
+diff -Npur release/plugins.orig/sequence/color-correction-yuv.c release/plugins/sequence/color-correction-yuv.c
+--- release/plugins.orig/sequence/color-correction-yuv.c 2011-11-11 15:00:26.339924887 +0100
++++ release/plugins/sequence/color-correction-yuv.c 2011-11-11 15:02:10.446923031 +0100
+@@ -15,7 +15,7 @@
+ *
+ */
+
+-#include "math.h"
++#include <math.h>
+ #include "plugin.h"
+ #include <stdio.h>
+
+diff -Npur release/plugins.orig/sequence/dnr.c release/plugins/sequence/dnr.c
+--- release/plugins.orig/sequence/dnr.c 2011-11-11 15:00:26.339924887 +0100
++++ release/plugins/sequence/dnr.c 2011-11-11 15:03:30.049921648 +0100
+@@ -15,7 +15,7 @@
+ *
+ */
+
+-#include "math.h"
++#include <math.h>
+ #include "plugin.h"
+ #include <stdio.h>
+
+diff -Npur release/plugins.orig/sequence/gamma.c release/plugins/sequence/gamma.c
+--- release/plugins.orig/sequence/gamma.c 2011-11-11 15:00:26.339924887 +0100
++++ release/plugins/sequence/gamma.c 2011-11-11 15:01:58.982923268 +0100
+@@ -15,7 +15,7 @@
+ *
+ */
+
+-#include "math.h"
++#include <math.h>
+ #include "plugin.h"
+ #include "util.h"
+ #include <stdio.h>
+diff -Npur release/plugins.orig/texture/clouds2.c release/plugins/texture/clouds2.c
+--- release/plugins.orig/texture/clouds2.c 2011-11-11 15:00:26.339924887 +0100
++++ release/plugins/texture/clouds2.c 2011-11-11 15:02:23.104922789 +0100
+@@ -27,7 +27,7 @@
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+-#include "math.h"
++#include <math.h>
+ #include "plugin.h"
+
+ /* ******************** GLOBAL VARIABLES ***************** */
+diff -Npur release/plugins.orig/texture/tiles.c release/plugins/texture/tiles.c
+--- release/plugins.orig/texture/tiles.c 2011-11-11 15:00:26.339924887 +0100
++++ release/plugins/texture/tiles.c 2011-11-11 15:04:05.749921038 +0100
+@@ -27,7 +27,7 @@
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+-#include "math.h"
++#include <math.h>
+ #include "plugin.h"
+
+ /* ******************** GLOBAL VARIABLES ***************** */
diff --git a/media-gfx/blender/files/blender-2.60-doxyfile.patch b/media-gfx/blender/files/blender-2.60-doxyfile.patch
new file mode 100644
index 0000000..aa61c55
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.60-doxyfile.patch
@@ -0,0 +1,11 @@
+--- blender-2.58a/doc/doxygen/Doxyfile 2011-07-11 23:27:33.975642545 -0300
++++ blender-2.58a/doc/doxygen/Doxyfile 2011-07-11 23:28:54.913642574 -0300
+@@ -42,7 +42,7 @@
+ # exceed 55 pixels and the maximum width should not exceed 200 pixels.
+ # Doxygen will copy the logo to the output directory.
+
+-PROJECT_LOGO = ../../release/freedesktop/icons/48x48/blender.png
++PROJECT_LOGO = ../../release/freedesktop/icons/48x48/apps/blender.png
+
+ # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+ # base path where the generated documentation will be put.
diff --git a/media-gfx/blender/files/blender-2.60-eigen.patch b/media-gfx/blender/files/blender-2.60-eigen.patch
new file mode 100644
index 0000000..6955ee1
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.60-eigen.patch
@@ -0,0 +1,293 @@
+--- intern/itasc/SConscript 2009-09-26 09:14:02.000000000 +0200
++++ intern/itasc/SConscript 2009-09-26 09:14:54.000000000 +0200
+@@ -5,7 +5,8 @@
+ sources += env.Glob('kdl/*.cpp')
+ sources += env.Glob('kdl/utilities/*.cpp')
+
+-incs = '. ../../extern/Eigen2'
++#incs = '. ../../extern/Eigen2'
++incs = '. /usr/include/eigen2'
+
+ env.BlenderLib ('bf_intern_itasc', sources, Split(incs), [], libtype=['intern','player'], priority=[20,100] )
+
+--- source/blender/ikplugin/SConscript
++++ source/blender/ikplugin/SConscript
+@@ -4,6 +4,6 @@
+ sources = env.Glob('intern/*.c') + env.Glob('intern/*.cpp')
+
+ incs = '#/intern/guardedalloc #/intern/iksolver/extern ../makesdna ../blenlib'
+-incs += ' ../blenkernel ../include ../ikplugin #/intern/itasc #/extern/Eigen2'
++incs += ' ../blenkernel ../include ../ikplugin #/intern/itasc /usr/include/eigen2'
+
+ env.BlenderLib ( 'bf_ikplugin', sources, Split(incs), [], libtype=['core','player'], priority=[180, 190] )
+--- source/gameengine/Converter/SConscript 2009-09-26 09:14:02.000000000 +0200
++++ source/gameengine/Converter/SConscript 2009-09-26 09:14:54.000000000 +0200
+@@ -21,7 +21,8 @@
+ incs += ' #source/blender/makesrna'
+ incs += ' #source/blender/ikplugin'
+ incs += ' #extern/recastnavigation/Detour/Include'
+-incs += ' #extern/Eigen2'
++#incs += ' #extern/Eigen2'
++incs += ' /usr/include/eigen2'
+
+ incs += ' ' + env['BF_BULLET_INC']
+
+--- intern/itasc/CMakeLists.txt 2011-11-10 23:34:31.391907001 +0100
++++ intern/itasc/CMakeLists.txt 2011-11-10 23:35:17.588906231 +0100
+@@ -25,11 +25,11 @@
+ # ***** END GPL LICENSE BLOCK *****
+
+ set(INC
+- ../../extern/Eigen2
++ /usr/include/eigen2
+ )
+
+ set(INC_SYS
+-
++ /usr/include/eigen2
+ )
+
+ set(SRC
+@@ -117,113 +117,113 @@ set(SRC
+ ublas_types.hpp
+
+ # until we have another user...
+- ../../extern/Eigen2/Eigen/src/Array/BooleanRedux.h
+- ../../extern/Eigen2/Eigen/src/Array/CwiseOperators.h
+- ../../extern/Eigen2/Eigen/src/Array/Functors.h
+- ../../extern/Eigen2/Eigen/src/Array/Norms.h
+- ../../extern/Eigen2/Eigen/src/Array/PartialRedux.h
+- ../../extern/Eigen2/Eigen/src/Array/Random.h
+- ../../extern/Eigen2/Eigen/src/Array/Select.h
+- ../../extern/Eigen2/Eigen/src/Cholesky/LDLT.h
+- ../../extern/Eigen2/Eigen/src/Cholesky/LLT.h
+- ../../extern/Eigen2/Eigen/src/Core/Assign.h
+- ../../extern/Eigen2/Eigen/src/Core/Block.h
+- ../../extern/Eigen2/Eigen/src/Core/CacheFriendlyProduct.h
+- ../../extern/Eigen2/Eigen/src/Core/Coeffs.h
+- ../../extern/Eigen2/Eigen/src/Core/CommaInitializer.h
+- ../../extern/Eigen2/Eigen/src/Core/Cwise.h
+- ../../extern/Eigen2/Eigen/src/Core/CwiseBinaryOp.h
+- ../../extern/Eigen2/Eigen/src/Core/CwiseNullaryOp.h
+- ../../extern/Eigen2/Eigen/src/Core/CwiseUnaryOp.h
+- ../../extern/Eigen2/Eigen/src/Core/DiagonalCoeffs.h
+- ../../extern/Eigen2/Eigen/src/Core/DiagonalMatrix.h
+- ../../extern/Eigen2/Eigen/src/Core/DiagonalProduct.h
+- ../../extern/Eigen2/Eigen/src/Core/Dot.h
+- ../../extern/Eigen2/Eigen/src/Core/Flagged.h
+- ../../extern/Eigen2/Eigen/src/Core/Functors.h
+- ../../extern/Eigen2/Eigen/src/Core/Fuzzy.h
+- ../../extern/Eigen2/Eigen/src/Core/GenericPacketMath.h
+- ../../extern/Eigen2/Eigen/src/Core/IO.h
+- ../../extern/Eigen2/Eigen/src/Core/Map.h
+- ../../extern/Eigen2/Eigen/src/Core/MapBase.h
+- ../../extern/Eigen2/Eigen/src/Core/MathFunctions.h
+- ../../extern/Eigen2/Eigen/src/Core/Matrix.h
+- ../../extern/Eigen2/Eigen/src/Core/MatrixBase.h
+- ../../extern/Eigen2/Eigen/src/Core/MatrixStorage.h
+- ../../extern/Eigen2/Eigen/src/Core/Minor.h
+- ../../extern/Eigen2/Eigen/src/Core/NestByValue.h
+- ../../extern/Eigen2/Eigen/src/Core/NumTraits.h
+- ../../extern/Eigen2/Eigen/src/Core/Part.h
+- ../../extern/Eigen2/Eigen/src/Core/Product.h
+- ../../extern/Eigen2/Eigen/src/Core/Redux.h
+- ../../extern/Eigen2/Eigen/src/Core/SolveTriangular.h
+- ../../extern/Eigen2/Eigen/src/Core/Sum.h
+- ../../extern/Eigen2/Eigen/src/Core/Swap.h
+- ../../extern/Eigen2/Eigen/src/Core/Transpose.h
+- ../../extern/Eigen2/Eigen/src/Core/Visitor.h
+- ../../extern/Eigen2/Eigen/src/Core/arch/AltiVec/PacketMath.h
+- ../../extern/Eigen2/Eigen/src/Core/arch/SSE/PacketMath.h
+- ../../extern/Eigen2/Eigen/src/Core/util/Constants.h
+- ../../extern/Eigen2/Eigen/src/Core/util/DisableMSVCWarnings.h
+- ../../extern/Eigen2/Eigen/src/Core/util/EnableMSVCWarnings.h
+- ../../extern/Eigen2/Eigen/src/Core/util/ForwardDeclarations.h
+- ../../extern/Eigen2/Eigen/src/Core/util/Macros.h
+- ../../extern/Eigen2/Eigen/src/Core/util/Memory.h
+- ../../extern/Eigen2/Eigen/src/Core/util/Meta.h
+- ../../extern/Eigen2/Eigen/src/Core/util/StaticAssert.h
+- ../../extern/Eigen2/Eigen/src/Core/util/XprHelper.h
+- ../../extern/Eigen2/Eigen/src/Geometry/AlignedBox.h
+- ../../extern/Eigen2/Eigen/src/Geometry/AngleAxis.h
+- ../../extern/Eigen2/Eigen/src/Geometry/EulerAngles.h
+- ../../extern/Eigen2/Eigen/src/Geometry/Hyperplane.h
+- ../../extern/Eigen2/Eigen/src/Geometry/OrthoMethods.h
+- ../../extern/Eigen2/Eigen/src/Geometry/ParametrizedLine.h
+- ../../extern/Eigen2/Eigen/src/Geometry/Quaternion.h
+- ../../extern/Eigen2/Eigen/src/Geometry/Rotation2D.h
+- ../../extern/Eigen2/Eigen/src/Geometry/RotationBase.h
+- ../../extern/Eigen2/Eigen/src/Geometry/Scaling.h
+- ../../extern/Eigen2/Eigen/src/Geometry/Transform.h
+- ../../extern/Eigen2/Eigen/src/Geometry/Translation.h
+- ../../extern/Eigen2/Eigen/src/LU/Determinant.h
+- ../../extern/Eigen2/Eigen/src/LU/Inverse.h
+- ../../extern/Eigen2/Eigen/src/LU/LU.h
+- ../../extern/Eigen2/Eigen/src/LeastSquares/LeastSquares.h
+- ../../extern/Eigen2/Eigen/src/QR/EigenSolver.h
+- ../../extern/Eigen2/Eigen/src/QR/HessenbergDecomposition.h
+- ../../extern/Eigen2/Eigen/src/QR/QR.h
+- ../../extern/Eigen2/Eigen/src/QR/SelfAdjointEigenSolver.h
+- ../../extern/Eigen2/Eigen/src/QR/Tridiagonalization.h
+- ../../extern/Eigen2/Eigen/src/SVD/SVD.h
+- ../../extern/Eigen2/Eigen/src/Sparse/AmbiVector.h
+- ../../extern/Eigen2/Eigen/src/Sparse/CholmodSupport.h
+- ../../extern/Eigen2/Eigen/src/Sparse/CompressedStorage.h
+- ../../extern/Eigen2/Eigen/src/Sparse/CoreIterators.h
+- ../../extern/Eigen2/Eigen/src/Sparse/DynamicSparseMatrix.h
+- ../../extern/Eigen2/Eigen/src/Sparse/MappedSparseMatrix.h
+- ../../extern/Eigen2/Eigen/src/Sparse/RandomSetter.h
+- ../../extern/Eigen2/Eigen/src/Sparse/SparseAssign.h
+- ../../extern/Eigen2/Eigen/src/Sparse/SparseBlock.h
+- ../../extern/Eigen2/Eigen/src/Sparse/SparseCwise.h
+- ../../extern/Eigen2/Eigen/src/Sparse/SparseCwiseBinaryOp.h
+- ../../extern/Eigen2/Eigen/src/Sparse/SparseCwiseUnaryOp.h
+- ../../extern/Eigen2/Eigen/src/Sparse/SparseDiagonalProduct.h
+- ../../extern/Eigen2/Eigen/src/Sparse/SparseDot.h
+- ../../extern/Eigen2/Eigen/src/Sparse/SparseFlagged.h
+- ../../extern/Eigen2/Eigen/src/Sparse/SparseFuzzy.h
+- ../../extern/Eigen2/Eigen/src/Sparse/SparseLDLT.h
+- ../../extern/Eigen2/Eigen/src/Sparse/SparseLLT.h
+- ../../extern/Eigen2/Eigen/src/Sparse/SparseLU.h
+- ../../extern/Eigen2/Eigen/src/Sparse/SparseMatrix.h
+- ../../extern/Eigen2/Eigen/src/Sparse/SparseMatrixBase.h
+- ../../extern/Eigen2/Eigen/src/Sparse/SparseProduct.h
+- ../../extern/Eigen2/Eigen/src/Sparse/SparseRedux.h
+- ../../extern/Eigen2/Eigen/src/Sparse/SparseTranspose.h
+- ../../extern/Eigen2/Eigen/src/Sparse/SparseUtil.h
+- ../../extern/Eigen2/Eigen/src/Sparse/SparseVector.h
+- ../../extern/Eigen2/Eigen/src/Sparse/SuperLUSupport.h
+- ../../extern/Eigen2/Eigen/src/Sparse/TaucsSupport.h
+- ../../extern/Eigen2/Eigen/src/Sparse/TriangularSolver.h
+- ../../extern/Eigen2/Eigen/src/Sparse/UmfPackSupport.h
++ /usr/include/eigen2/Eigen/src/Array/BooleanRedux.h
++ /usr/include/eigen2/Eigen/src/Array/CwiseOperators.h
++ /usr/include/eigen2/Eigen/src/Array/Functors.h
++ /usr/include/eigen2/Eigen/src/Array/Norms.h
++ /usr/include/eigen2/Eigen/src/Array/PartialRedux.h
++ /usr/include/eigen2/Eigen/src/Array/Random.h
++ /usr/include/eigen2/Eigen/src/Array/Select.h
++ /usr/include/eigen2/Eigen/src/Cholesky/LDLT.h
++ /usr/include/eigen2/Eigen/src/Cholesky/LLT.h
++ /usr/include/eigen2/Eigen/src/Core/Assign.h
++ /usr/include/eigen2/Eigen/src/Core/Block.h
++ /usr/include/eigen2/Eigen/src/Core/CacheFriendlyProduct.h
++ /usr/include/eigen2/Eigen/src/Core/Coeffs.h
++ /usr/include/eigen2/Eigen/src/Core/CommaInitializer.h
++ /usr/include/eigen2/Eigen/src/Core/Cwise.h
++ /usr/include/eigen2/Eigen/src/Core/CwiseBinaryOp.h
++ /usr/include/eigen2/Eigen/src/Core/CwiseNullaryOp.h
++ /usr/include/eigen2/Eigen/src/Core/CwiseUnaryOp.h
++ /usr/include/eigen2/Eigen/src/Core/DiagonalCoeffs.h
++ /usr/include/eigen2/Eigen/src/Core/DiagonalMatrix.h
++ /usr/include/eigen2/Eigen/src/Core/DiagonalProduct.h
++ /usr/include/eigen2/Eigen/src/Core/Dot.h
++ /usr/include/eigen2/Eigen/src/Core/Flagged.h
++ /usr/include/eigen2/Eigen/src/Core/Functors.h
++ /usr/include/eigen2/Eigen/src/Core/Fuzzy.h
++ /usr/include/eigen2/Eigen/src/Core/GenericPacketMath.h
++ /usr/include/eigen2/Eigen/src/Core/IO.h
++ /usr/include/eigen2/Eigen/src/Core/Map.h
++ /usr/include/eigen2/Eigen/src/Core/MapBase.h
++ /usr/include/eigen2/Eigen/src/Core/MathFunctions.h
++ /usr/include/eigen2/Eigen/src/Core/Matrix.h
++ /usr/include/eigen2/Eigen/src/Core/MatrixBase.h
++ /usr/include/eigen2/Eigen/src/Core/MatrixStorage.h
++ /usr/include/eigen2/Eigen/src/Core/Minor.h
++ /usr/include/eigen2/Eigen/src/Core/NestByValue.h
++ /usr/include/eigen2/Eigen/src/Core/NumTraits.h
++ /usr/include/eigen2/Eigen/src/Core/Part.h
++ /usr/include/eigen2/Eigen/src/Core/Product.h
++ /usr/include/eigen2/Eigen/src/Core/Redux.h
++ /usr/include/eigen2/Eigen/src/Core/SolveTriangular.h
++ /usr/include/eigen2/Eigen/src/Core/Sum.h
++ /usr/include/eigen2/Eigen/src/Core/Swap.h
++ /usr/include/eigen2/Eigen/src/Core/Transpose.h
++ /usr/include/eigen2/Eigen/src/Core/Visitor.h
++ /usr/include/eigen2/Eigen/src/Core/arch/AltiVec/PacketMath.h
++ /usr/include/eigen2/Eigen/src/Core/arch/SSE/PacketMath.h
++ /usr/include/eigen2/Eigen/src/Core/util/Constants.h
++ /usr/include/eigen2/Eigen/src/Core/util/DisableMSVCWarnings.h
++ /usr/include/eigen2/Eigen/src/Core/util/EnableMSVCWarnings.h
++ /usr/include/eigen2/Eigen/src/Core/util/ForwardDeclarations.h
++ /usr/include/eigen2/Eigen/src/Core/util/Macros.h
++ /usr/include/eigen2/Eigen/src/Core/util/Memory.h
++ /usr/include/eigen2/Eigen/src/Core/util/Meta.h
++ /usr/include/eigen2/Eigen/src/Core/util/StaticAssert.h
++ /usr/include/eigen2/Eigen/src/Core/util/XprHelper.h
++ /usr/include/eigen2/Eigen/src/Geometry/AlignedBox.h
++ /usr/include/eigen2/Eigen/src/Geometry/AngleAxis.h
++ /usr/include/eigen2/Eigen/src/Geometry/EulerAngles.h
++ /usr/include/eigen2/Eigen/src/Geometry/Hyperplane.h
++ /usr/include/eigen2/Eigen/src/Geometry/OrthoMethods.h
++ /usr/include/eigen2/Eigen/src/Geometry/ParametrizedLine.h
++ /usr/include/eigen2/Eigen/src/Geometry/Quaternion.h
++ /usr/include/eigen2/Eigen/src/Geometry/Rotation2D.h
++ /usr/include/eigen2/Eigen/src/Geometry/RotationBase.h
++ /usr/include/eigen2/Eigen/src/Geometry/Scaling.h
++ /usr/include/eigen2/Eigen/src/Geometry/Transform.h
++ /usr/include/eigen2/Eigen/src/Geometry/Translation.h
++ /usr/include/eigen2/Eigen/src/LU/Determinant.h
++ /usr/include/eigen2/Eigen/src/LU/Inverse.h
++ /usr/include/eigen2/Eigen/src/LU/LU.h
++ /usr/include/eigen2/Eigen/src/LeastSquares/LeastSquares.h
++ /usr/include/eigen2/Eigen/src/QR/EigenSolver.h
++ /usr/include/eigen2/Eigen/src/QR/HessenbergDecomposition.h
++ /usr/include/eigen2/Eigen/src/QR/QR.h
++ /usr/include/eigen2/Eigen/src/QR/SelfAdjointEigenSolver.h
++ /usr/include/eigen2/Eigen/src/QR/Tridiagonalization.h
++ /usr/include/eigen2/Eigen/src/SVD/SVD.h
++ /usr/include/eigen2/Eigen/src/Sparse/AmbiVector.h
++ /usr/include/eigen2/Eigen/src/Sparse/CholmodSupport.h
++ /usr/include/eigen2/Eigen/src/Sparse/CompressedStorage.h
++ /usr/include/eigen2/Eigen/src/Sparse/CoreIterators.h
++ /usr/include/eigen2/Eigen/src/Sparse/DynamicSparseMatrix.h
++ /usr/include/eigen2/Eigen/src/Sparse/MappedSparseMatrix.h
++ /usr/include/eigen2/Eigen/src/Sparse/RandomSetter.h
++ /usr/include/eigen2/Eigen/src/Sparse/SparseAssign.h
++ /usr/include/eigen2/Eigen/src/Sparse/SparseBlock.h
++ /usr/include/eigen2/Eigen/src/Sparse/SparseCwise.h
++ /usr/include/eigen2/Eigen/src/Sparse/SparseCwiseBinaryOp.h
++ /usr/include/eigen2/Eigen/src/Sparse/SparseCwiseUnaryOp.h
++ /usr/include/eigen2/Eigen/src/Sparse/SparseDiagonalProduct.h
++ /usr/include/eigen2/Eigen/src/Sparse/SparseDot.h
++ /usr/include/eigen2/Eigen/src/Sparse/SparseFlagged.h
++ /usr/include/eigen2/Eigen/src/Sparse/SparseFuzzy.h
++ /usr/include/eigen2/Eigen/src/Sparse/SparseLDLT.h
++ /usr/include/eigen2/Eigen/src/Sparse/SparseLLT.h
++ /usr/include/eigen2/Eigen/src/Sparse/SparseLU.h
++ /usr/include/eigen2/Eigen/src/Sparse/SparseMatrix.h
++ /usr/include/eigen2/Eigen/src/Sparse/SparseMatrixBase.h
++ /usr/include/eigen2/Eigen/src/Sparse/SparseProduct.h
++ /usr/include/eigen2/Eigen/src/Sparse/SparseRedux.h
++ /usr/include/eigen2/Eigen/src/Sparse/SparseTranspose.h
++ /usr/include/eigen2/Eigen/src/Sparse/SparseUtil.h
++ /usr/include/eigen2/Eigen/src/Sparse/SparseVector.h
++ /usr/include/eigen2/Eigen/src/Sparse/SuperLUSupport.h
++ /usr/include/eigen2/Eigen/src/Sparse/TaucsSupport.h
++ /usr/include/eigen2/Eigen/src/Sparse/TriangularSolver.h
++ /usr/include/eigen2/Eigen/src/Sparse/UmfPackSupport.h
+ )
+
+ blender_add_lib(bf_intern_itasc "${SRC}" "${INC}" "${INC_SYS}")
+--- source/blender/ikplugin/CMakeLists.txt 2011-11-10 23:34:31.391907001 +0100
++++ source/blender/ikplugin/CMakeLists.txt 2011-11-10 23:35:17.588906231 +0100
+@@ -50,7 +50,7 @@
+ if(WITH_IK_ITASC)
+ add_definitions(-DWITH_IK_ITASC)
+ list(APPEND INC
+- ../../../extern/Eigen2
++ /usr/include/eigen2
+ ../../../intern/itasc
+ )
+ list(APPEND SRC
+--- source/gameengine/Converter/CMakeLists.txt 2011-11-10 23:34:31.391907001 +0100
++++ source/gameengine/Converter/CMakeLists.txt 2011-11-10 23:35:17.588906231 +0100
+@@ -51,7 +51,7 @@
+ ../../blender/makesrna
+ ../../blender/windowmanager
+ ../../../extern/bullet2/src
+- ../../../extern/Eigen2
++ /usr/include/eigen2
+ ../../../intern/container
+ ../../../intern/guardedalloc
+ ../../../intern/moto/include
diff --git a/media-gfx/blender/files/blender-2.60-glew.patch b/media-gfx/blender/files/blender-2.60-glew.patch
new file mode 100644
index 0000000..edc0c9b
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.60-glew.patch
@@ -0,0 +1,48 @@
+--- extern/SConscript
++++ extern/SConscript
+@@ -2,8 +2,6 @@
+
+ Import('env')
+
+-SConscript(['glew/SConscript'])
+-
+ if env['WITH_BF_GAMEENGINE']:
+ SConscript(['recastnavigation/SConscript'])
+
+ if env['WITH_BF_ELTOPO']:
+ SConscript(['eltopo/SConscript'])
+
+--- source/blender/editors/include/BIF_gl.h
++++ source/blender/editors/include/BIF_gl.h
+@@ -35,7 +35,7 @@
+ #ifndef BIF_GL_H
+ #define BIF_GL_H
+
+-#include "GL/glew.h"
++#include <GL/glew.h>
+
+ /*
+ * these should be phased out. cpack should be replaced in
+--- extern/CMakeLists.txt
++++ extern/CMakeLists.txt
+@@ -39,9 +39,6 @@
+ add_subdirectory(binreloc)
+ endif()
+
+-if(WITH_BUILTIN_GLEW)
+- add_subdirectory(glew)
+-endif()
+
+ if(WITH_GAMEENGINE)
+ add_subdirectory(recastnavigation)
+--- CMakeLists.txt
++++ CMakeLists.txt
+@@ -150,7 +150,7 @@
+
+ if(UNIX AND NOT APPLE)
+ option(WITH_X11_XINPUT "Enable X11 Xinput (tablet support)" ON)
+- option(WITH_BUILTIN_GLEW "Use GLEW OpenGL wrapper library bundled with blender" ON)
++ option(WITH_BUILTIN_GLEW "Use GLEW OpenGL wrapper library bundled with blender" OFF)
+ else()
+ # not an option for other OS's
+ set(WITH_BUILTIN_GLEW ON)
diff --git a/media-gfx/blender/files/blender-2.60-openjpeg.patch b/media-gfx/blender/files/blender-2.60-openjpeg.patch
new file mode 100644
index 0000000..74f6441
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.60-openjpeg.patch
@@ -0,0 +1,37 @@
+diff -Npur blender-2.60a.orig/extern/libredcode/SConscript blender-2.60a/extern/libredcode/SConscript
+--- blender-2.60a.orig/extern/libredcode/SConscript 2011-11-09 23:05:16.241465491 +0100
++++ blender-2.60a/extern/libredcode/SConscript 2011-11-09 23:06:24.188464236 +0100
+@@ -7,7 +7,8 @@
+ Import('env')
+
+ sources = env.Glob('*.c')
+-incs = '. ../libopenjpeg'
++#incs = '. ../libopenjpeg'
++incs = '. /usr/include'
+
+ env.BlenderLib ( libname='extern_redcode',
+ sources=sources, includes=Split(incs),
+diff -Npur blender-2.60a.orig/extern/SConscript blender-2.60a/extern/SConscript
+--- blender-2.60a.orig/extern/SConscript 2011-11-09 23:05:16.241465491 +0100
++++ blender-2.60a/extern/SConscript 2011-11-09 23:06:24.188464236 +0100
+@@ -11,8 +11,5 @@
+ if env['WITH_BF_BULLET']:
+ SConscript(['bullet2/src/SConscript'])
+
+-if env['WITH_BF_OPENJPEG'] and env['BF_OPENJPEG_LIB'] == '':
+- SConscript(['libopenjpeg/SConscript'])
+-
+ if env['WITH_BF_REDCODE'] and env['BF_REDCODE_LIB'] == '':
+ SConscript(['libredcode/SConscript'])
+diff -Npur blender-2.60a.orig/build_files/scons/tools/Blender.py blender-2.60a/build_files/scons/tools/Blender.py
+--- blender-2.60a.orig/build_files/scons/tools/Blender.py 2011-11-09 23:05:16.241465491 +0100
++++ blender-2.60a/build_files/scons/tools/Blender.py 2011-11-09 23:06:24.188464236 +0100
+@@ -246,6 +246,8 @@
+ syslibs += Split(lenv['BF_FFMPEG_LIB'])
+ if lenv['WITH_BF_OGG']:
+ syslibs += Split(lenv['BF_OGG_LIB'])
++ if lenv['WITH_BF_OPENJPEG']:
++ syslibs += Split(lenv['BF_OPENJPEG_LIB'])
+ if lenv['WITH_BF_JACK']:
+ syslibs += Split(lenv['BF_JACK_LIB'])
+ if lenv['WITH_BF_SNDFILE'] and not lenv['WITH_BF_STATICSNDFILE']:
diff --git a/media-gfx/blender/files/blender-2.60a-CVE-2009-3850-v3.patch b/media-gfx/blender/files/blender-2.60a-CVE-2009-3850-v3.patch
new file mode 100644
index 0000000..fc0278d
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.60a-CVE-2009-3850-v3.patch
@@ -0,0 +1,149 @@
+diff -Npur blender-2.60a.orig/source/blender/blenkernel/intern/blender.c blender-2.60a/source/blender/blenkernel/intern/blender.c
+--- blender-2.60a.orig/source/blender/blenkernel/intern/blender.c 2011-11-09 20:56:11.905602401 +0100
++++ blender-2.60a/source/blender/blenkernel/intern/blender.c 2011-11-09 20:56:42.827601857 +0100
+@@ -145,6 +145,7 @@ void initglobals(void)
+ G.f |= G_SCRIPT_AUTOEXEC;
+ #else
+ G.f &= ~G_SCRIPT_AUTOEXEC;
++ G.f |= G_SCRIPT_OVERRIDE_PREF; /* Disables turning G_SCRIPT_AUTOEXEC on from user prefs */
+ #endif
+ }
+
+diff -Npur blender-2.60a.orig/source/blender/makesrna/intern/rna_userdef.c blender-2.60a/source/blender/makesrna/intern/rna_userdef.c
+--- blender-2.60a.orig/source/blender/makesrna/intern/rna_userdef.c 2011-11-09 20:56:12.003602399 +0100
++++ blender-2.60a/source/blender/makesrna/intern/rna_userdef.c 2011-11-09 21:02:43.204595484 +0100
+@@ -116,9 +116,17 @@ static void rna_userdef_show_manipulator
+
+ static void rna_userdef_script_autoexec_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
+ {
+- UserDef *userdef = (UserDef*)ptr->data;
+- if (userdef->flag & USER_SCRIPT_AUTOEXEC_DISABLE) G.f &= ~G_SCRIPT_AUTOEXEC;
+- else G.f |= G_SCRIPT_AUTOEXEC;
++ if ((G.f & G_SCRIPT_OVERRIDE_PREF) == 0) {
++ /* Blender run with --enable-autoexec */
++ UserDef *userdef = (UserDef*)ptr->data;
++ if (userdef->flag & USER_SCRIPT_AUTOEXEC_DISABLE) G.f &= ~G_SCRIPT_AUTOEXEC;
++ else G.f |= G_SCRIPT_AUTOEXEC;
++ }
++}
++
++static int rna_userdef_script_autoexec_editable(Main *bmain, Scene *scene, PointerRNA *ptr) {
++ /* Disable "Auto Run Python Scripts" checkbox unless Blender run with --enable-autoexec */
++ return !(G.f & G_SCRIPT_OVERRIDE_PREF);
+ }
+
+ static void rna_userdef_mipmap_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+@@ -2630,6 +2638,8 @@ static void rna_def_userdef_system(Blend
+ "Allow any .blend file to run scripts automatically "
+ "(unsafe with blend files from an untrusted source)");
+ RNA_def_property_update(prop, 0, "rna_userdef_script_autoexec_update");
++ /* Disable "Auto Run Python Scripts" checkbox unless Blender run with --enable-autoexec */
++ RNA_def_property_editable_func(prop, "rna_userdef_script_autoexec_editable");
+
+ prop= RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TXT_TABSTOSPACES_DISABLE);
+diff -Npur blender-2.60a.orig/source/blender/windowmanager/intern/wm_files.c blender-2.60a/source/blender/windowmanager/intern/wm_files.c
+--- blender-2.60a.orig/source/blender/windowmanager/intern/wm_files.c 2011-11-09 20:56:12.458602413 +0100
++++ blender-2.60a/source/blender/windowmanager/intern/wm_files.c 2011-11-09 21:05:16.768592770 +0100
+@@ -285,12 +285,17 @@ static void wm_init_userdef(bContext *C)
+
+ /* set the python auto-execute setting from user prefs */
+ /* enabled by default, unless explicitly enabled in the command line which overrides */
+- if((G.f & G_SCRIPT_OVERRIDE_PREF) == 0) {
++ if (! G.background && ((G.f & G_SCRIPT_OVERRIDE_PREF) == 0)) {
++ /* Blender run with --enable-autoexec */
+ if ((U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0) G.f |= G_SCRIPT_AUTOEXEC;
+ else G.f &= ~G_SCRIPT_AUTOEXEC;
+ }
+ /* update tempdir from user preferences */
+ BLI_where_is_temp(btempdir, FILE_MAX, 1);
++
++ /* Workaround to fix default of "Auto Run Python Scripts" checkbox */
++ if ((G.f & G_SCRIPT_OVERRIDE_PREF) && !(G.f & G_SCRIPT_AUTOEXEC))
++ U.flag |= USER_SCRIPT_AUTOEXEC_DISABLE;
+ }
+
+
+diff -Npur blender-2.60a.orig/source/blender/windowmanager/intern/wm_operators.c blender-2.60a/source/blender/windowmanager/intern/wm_operators.c
+--- blender-2.60a.orig/source/blender/windowmanager/intern/wm_operators.c 2011-11-09 20:56:12.458602413 +0100
++++ blender-2.60a/source/blender/windowmanager/intern/wm_operators.c 2011-11-09 21:07:09.746590772 +0100
+@@ -1583,12 +1583,13 @@ static int wm_open_mainfile_exec(bContex
+ G.fileflags &= ~G_FILE_NO_UI;
+ else
+ G.fileflags |= G_FILE_NO_UI;
+-
+- if(RNA_boolean_get(op->ptr, "use_scripts"))
++
++ /* Restrict "Trusted Source" mode to Blender in --enable-autoexec mode */
++ if(RNA_boolean_get(op->ptr, "use_scripts") && (!(G.f & G_SCRIPT_OVERRIDE_PREF)))
+ G.f |= G_SCRIPT_AUTOEXEC;
+ else
+ G.f &= ~G_SCRIPT_AUTOEXEC;
+-
++
+ // XXX wm in context is not set correctly after WM_read_file -> crash
+ // do it before for now, but is this correct with multiple windows?
+ WM_event_add_notifier(C, NC_WINDOW, NULL);
+@@ -1600,6 +1601,8 @@ static int wm_open_mainfile_exec(bContex
+
+ static void WM_OT_open_mainfile(wmOperatorType *ot)
+ {
++ PropertyRNA * use_scripts_checkbox = NULL;
++
+ ot->name= "Open Blender File";
+ ot->idname= "WM_OT_open_mainfile";
+ ot->description="Open a Blender file";
+@@ -1611,7 +1614,12 @@ static void WM_OT_open_mainfile(wmOperat
+ WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_OPENFILE, WM_FILESEL_FILEPATH);
+
+ RNA_def_boolean(ot->srna, "load_ui", 1, "Load UI", "Load user interface setup in the .blend file");
+- RNA_def_boolean(ot->srna, "use_scripts", 1, "Trusted Source", "Allow blend file execute scripts automatically, default available from system preferences");
++ use_scripts_checkbox = RNA_def_boolean(ot->srna, "use_scripts",
++ !!(G.f & G_SCRIPT_AUTOEXEC), "Trusted Source",
++ "Allow blend file execute scripts automatically, default available from system preferences");
++ /* Disable "Trusted Source" checkbox unless Blender run with --enable-autoexec */
++ if (use_scripts_checkbox && (G.f & G_SCRIPT_OVERRIDE_PREF))
++ RNA_def_property_clear_flag(use_scripts_checkbox, PROP_EDITABLE);
+ }
+
+ /* **************** link/append *************** */
+diff -Npur blender-2.60a.orig/source/creator/creator.c blender-2.60a/source/creator/creator.c
+--- blender-2.60a.orig/source/creator/creator.c 2011-11-09 20:56:11.899602401 +0100
++++ blender-2.60a/source/creator/creator.c 2011-11-09 21:17:22.278579932 +0100
+@@ -258,6 +258,7 @@ static int print_help(int UNUSED(argc),
+
+ printf("\n");
+
++ BLI_argsPrintArgDoc(ba, "-666");
+ BLI_argsPrintArgDoc(ba, "--enable-autoexec");
+ BLI_argsPrintArgDoc(ba, "--disable-autoexec");
+
+@@ -326,14 +327,14 @@ static int end_arguments(int UNUSED(argc
+ static int enable_python(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
+ {
+ G.f |= G_SCRIPT_AUTOEXEC;
+- G.f |= G_SCRIPT_OVERRIDE_PREF;
++ G.f &= ~G_SCRIPT_OVERRIDE_PREF; /* Enables turning G_SCRIPT_AUTOEXEC off from user prefs */
+ return 0;
+ }
+
+ static int disable_python(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
+ {
+ G.f &= ~G_SCRIPT_AUTOEXEC;
+- G.f |= G_SCRIPT_OVERRIDE_PREF;
++ G.f |= G_SCRIPT_OVERRIDE_PREF; /* Disables turning G_SCRIPT_AUTOEXEC on from user prefs */
+ return 0;
+ }
+
+@@ -1055,8 +1056,9 @@ static void setupArguments(bContext *C,
+ # define PY_DISABLE_AUTO ", (compiled as non-standard default)"
+ #endif
+
+- BLI_argsAdd(ba, 1, "-y", "--enable-autoexec", "\n\tEnable automatic python script execution" PY_ENABLE_AUTO, enable_python, NULL);
+- BLI_argsAdd(ba, 1, "-Y", "--disable-autoexec", "\n\tDisable automatic python script execution (pydrivers, pyconstraints, pynodes)" PY_DISABLE_AUTO, disable_python, NULL);
++ BLI_argsAdd(ba, 1, NULL, "-666", "\n\tEnable automatic python script execution (port from CVE-2009-3850 patch to Blender 2.60a)" PY_ENABLE_AUTO, enable_python, NULL);
++ BLI_argsAdd(ba, 1, "-y", "--enable-autoexec", "\n\tEnable automatic python script execution" PY_ENABLE_AUTO, enable_python, NULL);
++ BLI_argsAdd(ba, 1, "-Y", "--disable-autoexec", "\n\tDisable automatic python script execution (pydrivers, pyconstraints, pynodes)" PY_DISABLE_AUTO, disable_python, NULL);
+
+ #undef PY_ENABLE_AUTO
+ #undef PY_DISABLE_AUTO
diff --git a/media-gfx/blender/files/blender-2.60a-collada.patch b/media-gfx/blender/files/blender-2.60a-collada.patch
new file mode 100644
index 0000000..980b640
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.60a-collada.patch
@@ -0,0 +1,11 @@
+--- source/blender/collada/SConscript 2012-01-16 19:04:02.438027832 +0100
++++ source/blender/collada/SConscript 2012-01-16 19:03:59.787060970 +0100
+@@ -35,7 +35,7 @@
+ if env['OURPLATFORM']=='darwin':
+ incs = '../blenlib ../blenkernel ../windowmanager ../blenloader ../makesdna ../makesrna ../editors/include ../../../intern/guardedalloc [OPENCOLLADA]/COLLADAStreamWriter [OPENCOLLADA]/COLLADABaseUtils [OPENCOLLADA]/COLLADAFramework [OPENCOLLADA]/COLLADASaxFrameworkLoader [OPENCOLLADA]/GeneratedSaxParser '.replace('[OPENCOLLADA]', env['BF_OPENCOLLADA_INC'])
+ else:
+- incs = '../blenlib ../blenkernel ../windowmanager ../makesdna ../blenloader ../makesrna ../editors/include ../../../intern/guardedalloc [OPENCOLLADA]/COLLADAStreamWriter/include [OPENCOLLADA]/COLLADABaseUtils/include [OPENCOLLADA]/COLLADAFramework/include [OPENCOLLADA]/COLLADASaxFrameworkLoader/include [OPENCOLLADA]/GeneratedSaxParser/include '.replace('[OPENCOLLADA]', env['BF_OPENCOLLADA_INC'])
++ incs = '../blenlib ../blenkernel ../windowmanager ../makesdna ../blenloader ../makesrna ../editors/include ../../../intern/guardedalloc [OPENCOLLADA]/COLLADAStreamWriter [OPENCOLLADA]/COLLADABaseUtils [OPENCOLLADA]/COLLADAFramework [OPENCOLLADA]/COLLADASaxFrameworkLoader [OPENCOLLADA]/GeneratedSaxParser '.replace('[OPENCOLLADA]', env['BF_OPENCOLLADA_INC'])
+
+ if env['BF_BUILDINFO']:
+ defs.append('WITH_BUILDINFO')
diff --git a/media-gfx/blender/files/blender-2.60a-desktop.patch b/media-gfx/blender/files/blender-2.60a-desktop.patch
new file mode 100644
index 0000000..c774cbe
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.60a-desktop.patch
@@ -0,0 +1,20 @@
+--- release/freedesktop/blender.desktop 2010-09-12 00:05:51.000000000 -0700
++++ release/freedesktop/blender.desktop 2010-09-12 00:07:32.000000000 -0700
+@@ -1,5 +1,5 @@
+ [Desktop Entry]
+-Name=Blender
++Name=Blender-2.60a
+ GenericName=3D modeller
+ GenericName[es]=modelador 3D
+ GenericName[de]=3D Modellierer
+@@ -7,8 +7,8 @@
+ GenericName[ru]=Редактор 3D-моделей
+ Comment=3D modeling, animation, rendering and post-production
+ Comment[es]=modelado 3D, animación, renderizado y post-producción
+-Exec=blender
+-Icon=blender
++Exec=blender-2.60
++Icon=blender-2.60
+ Terminal=false
+ Type=Application
+ Categories=Graphics;3DGraphics;
diff --git a/media-gfx/blender/files/blender-2.60a-enable_site_module.patch b/media-gfx/blender/files/blender-2.60a-enable_site_module.patch
new file mode 100644
index 0000000..8a44c36
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.60a-enable_site_module.patch
@@ -0,0 +1,32 @@
+--- source/blender/python/intern/bpy_interface.c
++++ source/blender/python/intern/bpy_interface.c
+@@ -203,11 +203,6 @@
+ /* allow to use our own included python */
+ PyC_SetHomePath(BLI_get_folder(BLENDER_SYSTEM_PYTHON, NULL));
+
+- /* Python 3.2 now looks for '2.58/python/include/python3.2d/pyconfig.h' to parse
+- * from the 'sysconfig' module which is used by 'site', so for now disable site.
+- * alternatively we could copy the file. */
+- Py_NoSiteFlag= 1;
+-
+ Py_Initialize();
+
+ // PySys_SetArgv(argc, argv); // broken in py3, not a huge deal
+--- source/gameengine/Ketsji/KX_PythonInit.cpp
++++ source/gameengine/Ketsji/KX_PythonInit.cpp
+@@ -1825,7 +1825,6 @@
+ STR_String pname = progname;
+ Py_SetProgramName(pname.Ptr());
+ #endif
+- Py_NoSiteFlag=1;
+ Py_FrozenFlag=1;
+
+ /* must run before python initializes */
+@@ -1898,7 +1897,6 @@
+ STR_String pname = progname;
+ Py_SetProgramName(pname.Ptr());
+ #endif
+- Py_NoSiteFlag=1;
+ Py_FrozenFlag=1;
+
+ initPyTypes();
diff --git a/media-gfx/blender/files/blender-2.60a-insecure.desktop b/media-gfx/blender/files/blender-2.60a-insecure.desktop
new file mode 100644
index 0000000..d033ae9
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.60a-insecure.desktop
@@ -0,0 +1,15 @@
+[Desktop Entry]
+Name=Blender-2.60a (reduced security)
+GenericName=3D modeller (reduced security)
+GenericName[es]=modelador 3D (reduced security)
+GenericName[de]=3D Modellierer (weniger Sicherheit)
+GenericName[fr]=modeleur 3D (reduced security)
+GenericName[ru]=Редактор 3D-моделей (reduced security)
+Comment=3D modeling, animation, rendering and post-production
+Comment[es]=modelado 3D, animación, renderizado y post-producción
+Exec=blender-2.60 --enable-autoexec
+Icon=blender-2.60
+Terminal=false
+Type=Application
+Categories=Graphics;3DGraphics;
+MimeType=application/x-blender;
diff --git a/media-gfx/blender/files/blender-2.60a-libav-0.7.patch b/media-gfx/blender/files/blender-2.60a-libav-0.7.patch
new file mode 100644
index 0000000..3bae020
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.60a-libav-0.7.patch
@@ -0,0 +1,30 @@
+--- blender-2.60a.orig/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp 2011-10-24 20:09:01.000000000 +0200
++++ blender-2.60a/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp 2011-11-13 12:34:01.000000000 +0100
+@@ -40,6 +40,8 @@
+ #include <libavcodec/avcodec.h>
+ #include <libavformat/avformat.h>
+ #include <libavformat/avio.h>
++#include <libavutil/mathematics.h>
++#include <libavutil/avstring.h>
+ #include "ffmpeg_compat.h"
+ }
+
+@@ -57,10 +58,15 @@
+ {
+ static const char* formats[] = { NULL, "ac3", "flac", "matroska", "mp2", "mp3", "ogg", "wav" };
+
+- if(avformat_alloc_output_context2(&m_formatCtx, NULL, formats[format], filename.c_str()))
+- AUD_THROW(AUD_ERROR_FFMPEG, context_error);
++ m_formatCtx = avformat_alloc_context();
++ if (!m_formatCtx) AUD_THROW(AUD_ERROR_FFMPEG, context_error);
+
+- m_outputFmt = m_formatCtx->oformat;
++ av_strlcpy(m_formatCtx->filename, filename.c_str(), sizeof(m_formatCtx->filename));
++ m_outputFmt = m_formatCtx->oformat = av_guess_format(formats[format], filename.c_str(), NULL);
++ if (!m_outputFmt) {
++ avformat_free_context(m_formatCtx);
++ AUD_THROW(AUD_ERROR_FFMPEG, context_error);
++ }
+
+ switch(codec)
+ {
diff --git a/media-gfx/blender/files/blender-2.60a-linux-3.patch b/media-gfx/blender/files/blender-2.60a-linux-3.patch
new file mode 100644
index 0000000..6a96b49
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.60a-linux-3.patch
@@ -0,0 +1,12 @@
+--- SConstruct 2011-10-29 05:18:43.149564401 +0200
++++ SConstruct 2011-10-29 05:19:37.332887017 +0200
+@@ -165,6 +165,9 @@
+ if crossbuild and platform not in ('win32-vc', 'win64-vc'):
+ platform = 'linuxcross'
+
++if platform == 'linux3':
++ platform = 'linux2' # Workaround for Linux 3.x
++
+ env['OURPLATFORM'] = platform
+
+ configfile = os.path.join("build_files", "scons", "config", platform + "-config.py")
diff --git a/media-gfx/blender/files/blender.desktop b/media-gfx/blender/files/blender.desktop
new file mode 100644
index 0000000..14cef34
--- /dev/null
+++ b/media-gfx/blender/files/blender.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=Blender 2.4x
+Comment=3D modeling, animation, rendering and post-production.
+Exec=blender
+Icon=blender
+Terminal=0
+Type=Application
+Categories=Graphics;Application;
diff --git a/media-gfx/blender/files/blender.png b/media-gfx/blender/files/blender.png
new file mode 100644
index 0000000..864a97a
--- /dev/null
+++ b/media-gfx/blender/files/blender.png
Binary files differ