summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreroen <eroen@occam.eroen.eu>2013-02-24 14:02:31 +0100
committereroen <eroen@occam.eroen.eu>2013-02-24 14:02:31 +0100
commit2e32819b500eedcc46c8d89bb6dc29491796cfc8 (patch)
treed043b88662e3a9832f4e215c09d5be38ba273a28 /media-gfx
parentblender_nif_scripts-2.5.9 (diff)
downloaderoen-2e32819b500eedcc46c8d89bb6dc29491796cfc8.tar.gz
eroen-2e32819b500eedcc46c8d89bb6dc29491796cfc8.tar.bz2
eroen-2e32819b500eedcc46c8d89bb6dc29491796cfc8.zip
add blender-2.49b-r2 from portage
Was removed 2013-02-05 > Tue Feb 5 16:11:10 2013 UTC (2 weeks, 4 days ago) by flameeyes > Branch: MAIN > CVS Tags: HEAD > Remove version 2.49b as it's way too buggy at this point. > > (Portage version: 2.2.0_alpha161/cvs/Linux x86_64, signed Manifest > commit with key 1CD13C8AD4301342)
Diffstat (limited to 'media-gfx')
-rw-r--r--media-gfx/blender/Manifest14
-rw-r--r--media-gfx/blender/blender-2.49b-r2.ebuild188
-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.48a-CVE-2008-4863.patch15
-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-v4.patch139
-rw-r--r--media-gfx/blender/files/blender-2.49b-gcc46.patch32
-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-linux-3.patch12
-rw-r--r--media-gfx/blender/files/blender-2.49b-subversion-1.7.patch14
-rw-r--r--media-gfx/blender/files/blender.desktop9
-rw-r--r--media-gfx/blender/metadata.xml65
14 files changed, 1040 insertions, 0 deletions
diff --git a/media-gfx/blender/Manifest b/media-gfx/blender/Manifest
new file mode 100644
index 0000000..b0fff17
--- /dev/null
+++ b/media-gfx/blender/Manifest
@@ -0,0 +1,14 @@
+AUX blender-2.37-dirs.patch 727 SHA256 beb5e5835cde71a00712ddf600278ca0bbdb6020123faeb6ea7a53e8f6812e5e SHA512 1917da0d774082e22d1ed82803708b1aa32a3372fb35d14852198d49eada82a5f3755b3e6249ba2c17546e766f0e15a472e9d599718173e3c5ae85ef8c52ec82 WHIRLPOOL b2b23f455239ddbb29fc531e2533877d98ffd9d1d72cdb645ac25455cff15dd8afb2e307bbd5e5e9283b7f7e00dc20a4addf3ead295ca12fc9c22d9f3fbda720
+AUX blender-2.44-scriptsdir.patch 2586 SHA256 a7afac10ce2431cd94d10dc3f4cae33423b5a59d0c6918199006f623cd6d68e4 SHA512 d41e9acca544d35d6e193905443ae7a3c242e8fcd19a50cd23696369036a5682a92bc250c2728859d6215087633ea8eb1d86f21b72d35e4678f4d32249bd3066 WHIRLPOOL 5431e5db75a276b6d4b4c811c8d0f9b8c740b86c8869b669808f5c7b4d9a67c11f2743c603e0ae532f5798aae2cd2fe7b9e8ea70c5a6faf28d90518dfc054aa5
+AUX blender-2.48a-CVE-2008-4863.patch 696 SHA256 fee1896c791a623181ebf681f4ad67c610677e82575a95a46e896b747f980418 SHA512 9b466f00e548f135fd5013dc5b756556c7f4a2288916822110639c5a1cb8932b6f828edaf4731414670b415649cb06131fd9b488f82aae5ed8ecd40f8eb4ff1b WHIRLPOOL bcdd881c60ebd6325e0461cd9ee6f00f9bceb0fd34252e1819b166bce08105c2e0fce205ce272e9a26897ebf34f60a7f742d94b3dcb50a1698b27d408ac32ee2
+AUX blender-2.49a-sys-openjpeg.patch 452 SHA256 437f016b9f7c48281015838a22203c4db9ef6b62dac01aa86faa1c9793bff182 SHA512 ae30c35622908bf633af7f0491af716ed838a830214e7b6f9c6c014187984673e43de19c0d96a1395aa7902813fee2cdab209615f5210fbd70aff7a8a31370b4 WHIRLPOOL ab4b50c5a35d6d9e1d01f28000f349e5c452592aecc5e8d3194d04456abf4be2f32b13dffb7d1e325e0bdf1ff4ac8238c609c19a1b017c729c5bd1c9da193f49
+AUX blender-2.49b-CVE-2009-3850-v4.patch 5222 SHA256 0707904cd3b627cfeac19d4d775ee4a019ba395251c9318dbb356e3b8de19124 SHA512 83d639ab73c579dd7e202139696b9a9dd12cc1824218d04c5259dbb73fbc8b73dcc72d2a8032c2b954a10d3c4dd363ce15a10dec1017fcebc76237aa0e1984aa WHIRLPOOL a70a87aae3cd453e0b483f3dd6185a3391b6badd9810108ab9ab599e55b3dd0d10387d2174105249381e4b57e538748c05c9672abe13ea8646fab66a210f382e
+AUX blender-2.49b-gcc46.patch 854 SHA256 57661ab5bd4bc163a63e77ef4fcd9828a20b1fe48f269405e4696d544ae90fdc SHA512 9e4300dc327debebde7248e070ccd1b579b9ad0e37ae691d285f102b3708384158ff19ed5ad1ce63a9e2f234e4607739b2109cd89df8c3379ac09d0cf79e2ce0 WHIRLPOOL 9e83b6181f8a9bccd082d252402ef2ec5dd5606cfbc4bd9685fc69fd6798796c64d001e43a6fdcd8e21cdf2dbd468b1fc10b06bcaf07c230e440961ead4c45ae
+AUX blender-2.49b-insecure.desktop 223 SHA256 dfd0a438ebf792071fc9f12036f07b0f14277b2bf34050bf4d57ffceeff55555 SHA512 aa93dc9777ca08df7b44d6b637b5aa0514e5133bb330e245a8d975e31534a83ba5e991ad7e5b8122d163d0ac2416706a84acbbf8d60dfd84c589b0880b4a8e89 WHIRLPOOL b30b9a1de44c29b1fb244a2d5333f058f409f0db8d7f1af2935e07d6f02490ab149f34a75afdb504c1e896692ebd0e6dd4db7551e8d23ca7f818e5246f0b1422
+AUX blender-2.49b-libav-0.7.patch 15251 SHA256 636244001abc882887b7c72f665c751a86a96f355ec196a49390b8d13180cec5 SHA512 a1dfab93b6dab0424002fc9ed49de990d2ecb0814ed4c44b26484dfd3f3b3987cd2dae2514e6a68db6fec91f74924428ef79fd7514572e285caef03c0e5aeb06 WHIRLPOOL 6e126329a3ffd1f438853e1f9d5ef5c2684c667f4a9c19f49c2908492e05ec9802b6996972837ffac91c6690bc9ebfcb1dbc23c9dd048434c18d285fea6d7c1a
+AUX blender-2.49b-linux-3.patch 414 SHA256 4f1f8960e1b5706b426e272c17b70682b1eaa5903fa325e4d4db21efd540d732 SHA512 2dc9b6e8599254e88aa1fa529c30a38247551c67ac6b393071e5226b6f3495d4a4a696f39741a23c75746132f8c012247cf434cf0d9ff546207c98b74ef4f3f8 WHIRLPOOL 8be68aff5a7e801eb4871ff5e62481bff18b92372268730fcc4236ff32a5795fcc699ae52262c09f196b30eeef85b4374416bd957fe589ebb925c16558db1353
+AUX blender-2.49b-subversion-1.7.patch 477 SHA256 744c7af5f0fdc24c84262748991c397b171c33246bb319ba5d3a54a4eda5da2a SHA512 d145e2c0a8c6d92c834ce11061dcce613f3e4c284038fc3d208621ca6c0cacfacfb35f6d61bc2e6e20896a571e3224bbf1f16f0d07ada1fa009f4a4c0018d3bb WHIRLPOOL d196325348926ad6e73e4935e32c1ad0689d829fa4a75ef60da09c65bf3f5e6fcb876b7db9b1d67b1c036891dd78b8c2ed5e3944a679d655f3a26e7fb3f779e8
+AUX blender.desktop 199 SHA256 3fbab5be3f52ce56f285e422c856aecd15627cffeadcb07af313e0d64c4803ad SHA512 f5674f4a9ebe70170e8bcde1fd31cd5bd569ca0f66866a23c5239ae97e9d4d7de083c835e166085848b7420d6778a0469e6868628ff5020b44faac6582ac77d0 WHIRLPOOL b259746b3c412a1101a5bec84eac411dc34dc104053a7e6f09351c4b03b3202a74f1eb5fae9b2d87aa0a91f9ddc6ea274ad2a9ae14da817d30c8dc60d4516747
+DIST blender-2.49b.tar.gz 22918377 SHA256 23554db4aa10b00e0e760a8bf9c4a9f749670d815c8bc874a04746adc4752488 SHA512 0e83388849898a61a308584be05307697ef8d0e67c5f161eea0d11f75a29d14c26547aa7b20f356065e70db823082e11a39dc06e59d3d73ef8c87738d2f88460 WHIRLPOOL d8b54b39eb47841c7e93157726f55c855d0930b89e4cbe8f093dcd7110978ed267ca96517281861bd6d62c1108a8068c5a863452d3208b1f4ad3d374f1e74f7d
+EBUILD blender-2.49b-r2.ebuild 5300 SHA256 f6a8eac179096868b3ea6c575f83350ca2b541cdee84e7ef35c6b1c3fc74b975 SHA512 5292c8ac760a08d93f034f3497b737ae385881b19b1f8cc2497603dd237c2ef34a5a0a2fd6882ff1e572e491f0da9d81679791e18c4b9d283486e1349e9e56ac WHIRLPOOL b5a90a86e4aaf23542eb03901a3aee42554842856e8541c38668b3debbaa2e7bfea5accfcf18b39510b29e6243b6c23b58045ca833cc28f4c8f4d93d8155606e
+MISC metadata.xml 2158 SHA256 bff4c3ff97b8c96d1175eec436c9c2f583ec461f1546b1a0edee9767d89641ba SHA512 c0d0b4ff2b886a4a4ab2596e427113caa4379705113197021fab490953520368fa98bef40379dde6c508a3ec57df89a34121dfdef5ffdfbeca608cc3355c05c6 WHIRLPOOL 15ade3751c5017cc4c2f537b65f00d39bec68ccc15a1a0ac81ac8cb904f43bec10abf395d0834071873952391bb33bf2aee00d4c6007b7d8aeb52a599f15f287
diff --git a/media-gfx/blender/blender-2.49b-r2.ebuild b/media-gfx/blender/blender-2.49b-r2.ebuild
new file mode 100644
index 0000000..b9d1f65
--- /dev/null
+++ b/media-gfx/blender/blender-2.49b-r2.ebuild
@@ -0,0 +1,188 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-gfx/blender/Attic/blender-2.49b-r2.ebuild,v 1.19 2013/01/17 16:52:21 ssuominen Exp $
+
+EAPI=2
+
+PYTHON_DEPEND="2:2.6"
+
+inherit scons-utils multilib eutils python
+
+IUSE="blender-game ffmpeg nls ogg openmp verse openal"
+
+DESCRIPTION="3D Creation/Animation/Publishing System"
+HOMEPAGE="http://www.blender.org/"
+SRC_URI="http://download.blender.org/source/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="|| ( GPL-2 BL BSD )"
+KEYWORDS="amd64 x86"
+
+RDEPEND="ffmpeg? ( virtual/ffmpeg[encode,theora] )
+ >=media-libs/openjpeg-1.5.0
+ media-libs/tiff:0
+ nls? ( >=media-libs/freetype-2.0
+ virtual/libintl
+ >=media-libs/ftgl-2.1 )
+ openal? ( >=media-libs/openal-1.6.372
+ >=media-libs/freealut-1.1.0-r1 )
+ media-libs/openexr
+ media-libs/libpng:0
+ blender-game? ( >=media-libs/libsdl-1.2[joystick] )
+ >=media-libs/libsdl-1.2
+ ogg? ( media-libs/libogg )
+ virtual/jpeg
+ virtual/opengl"
+DEPEND=">=dev-util/scons-2
+ sys-devel/gcc[openmp?]
+ x11-base/xorg-server
+ ${RDEPEND}"
+
+blend_with() {
+ local UWORD="$2"
+ if [ -z "${UWORD}" ]; then
+ UWORD="$1"
+ fi
+ if use $1; then
+ echo "WITH_BF_${UWORD}=1" | tr '[:lower:]' '[:upper:]' \
+ >> "${S}"/user-config.py
+ else
+ echo "WITH_BF_${UWORD}=0" | tr '[:lower:]' '[:upper:]' \
+ >> "${S}"/user-config.py
+ fi
+}
+
+pkg_setup() {
+ python_set_active_version 2
+ python_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/blender-2.48a-CVE-2008-4863.patch
+ epatch "${FILESDIR}"/${PN}-2.37-dirs.patch
+ epatch "${FILESDIR}"/${PN}-2.44-scriptsdir.patch
+ epatch "${FILESDIR}"/${PN}-2.49a-sys-openjpeg.patch
+ epatch "${FILESDIR}"/${PN}-2.49b-CVE-2009-3850-v4.patch
+ epatch "${FILESDIR}"/${PN}-2.49b-linux-3.patch # Bug #381099
+ epatch "${FILESDIR}"/${PN}-2.49b-subversion-1.7.patch
+ epatch "${FILESDIR}"/${P}-libav-0.7.patch
+ epatch "${FILESDIR}"/${P}-gcc46.patch
+ rm -f "${S}/release/scripts/bpymodules/"*.pyc
+
+ # Fix building with >=media-libs/openjpeg-1.5.0 (bug #409283)
+ sed -i \
+ -e '/parameters.*tile_size_on/s:false:FALSE:' \
+ source/blender/imbuf/intern/jp2.c || die
+}
+
+src_configure() {
+
+ # add ffmpeg info to the scons build info
+ cat <<- EOF >> "${S}"/user-config.py
+ BF_FFMPEG="/usr"
+ BF_FFMPEG_LIB="avdevice avformat avcodec swscale avutil"
+ EOF
+
+ # set python version to current version in use
+ cat <<- EOF >> "${S}"/user-config.py
+ BF_PYTHON_VERSION="$(python_get_version)"
+ BF_PYTHON_INC="$(python_get_includedir)"
+ BF_PYTHON_BINARY="$(PYTHON -a)"
+ BF_PYTHON_LIB="python$(python_get_version)"
+ EOF
+
+ # add system openjpeg into scons build.
+ cat <<- EOF >> "${S}"/user-config.py
+ BF_OPENJPEG = "/usr"
+ BF_OPENJPEG_INC = "/usr/include"
+ BF_OPENJPEG_LIB = "openjpeg"
+ EOF
+
+ #set CFLAGS used in /etc/make.conf correctly
+
+ echo "CFLAGS= [`for i in ${CFLAGS[@]}; do printf "%s \'$i"\',; done`] " \
+ | sed -e "s:,]: ]:" >> "${S}"/user-config.py
+
+ echo "CXXFLAGS= [`for i in ${CFLAGS[@]}; do printf "%s \'$i"\',; done`]" \
+ | sed -e "s:,]: ]:" >> "${S}"/user-config.py
+
+ # check for blender-game USE flag.
+ # blender-game will merge with blenderplayer.
+
+ for arg in \
+ 'openal'\
+ 'ffmpeg' \
+ 'blender-game player' \
+ 'blender-game gameengine' \
+ 'nls international' \
+ 'ogg' \
+ 'openmp' \
+ 'verse' ; do
+ blend_with ${arg}
+ done
+}
+
+src_compile() {
+ escons || die \
+ '!!! Please add "${S}/scons.config" when filing bugs reports \
+ to bugs.gentoo.org'
+
+ cd "${WORKDIR}"/install/linux2/plugins
+ chmod 755 bmake
+ emake || die
+}
+
+src_install() {
+ exeinto /usr/bin/
+ doexe "${WORKDIR}"/install/linux2/blender
+ use blender-game && doexe "${WORKDIR}"/install/linux2/blenderplayer
+
+ dodir /usr/share/${PN}
+
+ exeinto /usr/$(get_libdir)/${PN}/textures
+ doexe "${WORKDIR}"/install/linux2/plugins/texture/*.so
+ exeinto /usr/$(get_libdir)/${PN}/sequences
+ doexe "${WORKDIR}"/install/linux2/plugins/sequence/*.so
+ insinto /usr/include/${PN}
+ doins "${WORKDIR}"/install/linux2/plugins/include/*.h
+
+ if use nls ; then
+ mv "${WORKDIR}"/install/linux2/.blender/{.Blanguages,.bfont.ttf} \
+ "${D}"/usr/share/${PN}
+ mv "${WORKDIR}"/install/linux2/.blender/locale \
+ "${D}"/usr/share/locale
+ fi
+
+ mv "${WORKDIR}"/install/linux2/.blender/scripts "${D}"/usr/share/${PN}
+
+ insinto /usr/share/pixmaps
+ doins "${WORKDIR}"/install/linux2/icons/scalable/blender.svg
+ domenu "${FILESDIR}"/${PN}.desktop || die
+ domenu "${FILESDIR}"/${P}-insecure.desktop || die
+
+ dodoc INSTALL README
+ dodoc "${WORKDIR}"/install/linux2/BlenderQuickStart.pdf
+
+}
+
+pkg_preinst(){
+ if [ -h "${ROOT}/usr/$(get_libdir)/blender/plugins/include" ];
+ then
+ rm -f "${ROOT}"/usr/$(get_libdir)/blender/plugins/include
+ fi
+}
+
+pkg_postinst(){
+ elog "blender uses python integration. As such, may have some"
+ elog "inherit risks with running unknown python scripting."
+ elog " "
+ elog "CVE-2008-1103-1.patch has been removed as it interferes"
+ elog "with autosave undo features. Up stream blender coders"
+ elog "have not addressed the CVE issue as the status is still"
+ elog "a CANDIDATE and not CONFIRMED."
+ elog " "
+ elog "It is recommended to change your blender temp directory"
+ elog "from /tmp to ~tmp or another tmp file under your home"
+ elog "directory. This can be done by starting blender, then"
+ elog "dragging the main menu down do display all paths."
+}
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.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-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-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-gcc46.patch b/media-gfx/blender/files/blender-2.49b-gcc46.patch
new file mode 100644
index 0000000..195ca0c
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.49b-gcc46.patch
@@ -0,0 +1,32 @@
+http://bugs.gentoo.org/452694
+
+--- extern/bullet2/src/BulletSoftBody/btSoftBodyInternals.h
++++ extern/bullet2/src/BulletSoftBody/btSoftBodyInternals.h
+@@ -18,6 +18,7 @@
+ #define _BT_SOFT_BODY_INTERNALS_H
+
+ #include "btSoftBody.h"
++#include <string.h>
+
+ #include "LinearMath/btQuickprof.h"
+ #include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
+@@ -171,8 +172,7 @@
+ template <typename T>
+ static inline void ZeroInitialize(T& value)
+ {
+- static const T zerodummy;
+- value=zerodummy;
++ memset(&value,0,sizeof(T));
+ }
+ //
+ template <typename T>
+--- intern/memutil/MEM_Allocator.h
++++ intern/memutil/MEM_Allocator.h
+@@ -24,6 +24,7 @@
+ #ifndef __MEM_Allocator_h_included__
+ #define __MEM_Allocator_h_included__ 1
+
++#include <cstddef>
+ #include "guardedalloc/MEM_guardedalloc.h"
+ #include "guardedalloc/BLO_sys_types.h"
+
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-linux-3.patch b/media-gfx/blender/files/blender-2.49b-linux-3.patch
new file mode 100644
index 0000000..6a96b49
--- /dev/null
+++ b/media-gfx/blender/files/blender-2.49b-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.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.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/metadata.xml b/media-gfx/blender/metadata.xml
new file mode 100644
index 0000000..755c971
--- /dev/null
+++ b/media-gfx/blender/metadata.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>graphics</herd>
+
+ <maintainer>
+ <email>lu_zero@gentoo.org</email>
+ <name>Luca Barbato</name>
+ </maintainer>
+
+ <maintainer>
+ <email>flameeyes@gentoo.org</email>
+ </maintainer>
+
+ <longdescription>
+ Blender, the open source software for 3D modeling, animation,
+ rendering, post-production, interactive creation and playback.
+ </longdescription>
+
+ <use>
+ <flag name='3dmouse'>
+ Adds support for space navigator devices through package
+ <pkg>dev-libs/libspnav</pkg>.
+ </flag>
+ <flag name='blender-game' restrict='&lt;media-gfx/blender-2.50'>
+ Adds Game Engine support to Blender.
+ </flag>
+ <flag name='game-engine' restrict='&gt;=media-gfx/blender-2.50'>
+ Adds Game Engine support to Blender.
+ </flag>
+ <flag name='collada'>
+ Add support for Collada interchange format through
+ <pkg>media-libs/opencollada</pkg>.
+ </flag>
+ <flag name='cycles'>
+ Build cycles renderer (requires <pkg>media-libs/openimageio</pkg> and
+ <pkg>dev-libs/boost</pkg>).
+ </flag>
+ <flag name='verse'>
+ Adds verse clustering features to Blender.
+ </flag>
+ <flag name='dds'>
+ Adds DDS textures support to Blender.
+ </flag>
+ <flag name='player'>
+ Build the Blender Player. THis requires the Game engine.
+ </flag>
+ <flag name='elbeem'>
+ Adds surface fluid simulation to Blender using El'Beem library.
+ </flag>
+ <flag name="doc">
+ Build C and Python API documentation directly from the source code.
+ </flag>
+ <flag name="tweak-mode">
+ This flag allows you to model without confirming each translation,
+ in particular it lets you grab with left mouse button (LMB) and not
+ having to confirm by another click. Blender 'Tweak Mode' is similar
+ to the 'Tweak Mode' of the Wings modeller (<pkg>media-gfx/wings</pkg>).
+ </flag>
+ <flag name="redcode">
+ This flag add support for RED CODE camera digital format (5K HD
+ images *.r3d) - EXPERIMENTAL.
+ </flag>
+ </use>
+</pkgmetadata>