add media-gfx/blender

This commit is contained in:
Martin Sekera 2018-12-15 13:04:26 +01:00
parent 4ab59d1924
commit e437f8c29b
6 changed files with 337 additions and 0 deletions

View file

@ -13,3 +13,4 @@ net-p2p
sys-apps sys-apps
x11-apps x11-apps
app-security app-security
media-gfx

View file

@ -0,0 +1,12 @@
# Copyright 2009 Michael Forney
# Copyright 2011-2015 Pierre Lejeune <superheron@gmail.com>
# Distributed under the terms of the GNU General Public License v2
require blender
PLATFORMS="~amd64"
DEFAULT_SRC_PREPARE_PATCHES=(
"${FILES}"/4e4a93bc454d93ec8523f44b73a42977e2868ecc.patch
)

View file

@ -0,0 +1,216 @@
# Copyright 2009 Michael Forney
# Copyright 2011-2015 Pierre Lejeune <superheron@gmail.com>
# Copyright 2014 Johannes Nixdorf <mixi@exherbo.org>
# Copyright 2018 Martin Sekera <sekerama@gmail.com>
# Distributed under the terms of the GNU General Public License v2
MY_PV=${PV/b}
require cmake [ api=2 ] \
flag-o-matic \
freedesktop-desktop \
python [ blacklist="2 3.4 3.7" multibuild=false ] \
toolchain-funcs
export_exlib_phases src_prepare src_configure src_install
SUMMARY="Blender is the free open source 3D content creation suite"
HOMEPAGE="https://www.blender.org"
DOWNLOADS="https://download.blender.org/source/${PNV}.tar.gz"
LICENCES="GPL-2"
SLOT="0"
MYOPTIONS="
ffmpeg
fftw [[ description = [ Support for smoke, audio effects and the ocean simulator ] ]]
jack [[ description = [ Support for sound output through jack ] ]]
jpeg2000
openal [[ description = [ Support for sound output using openal ] ]]
openmp
sdl [[ description = [ Support for sound output using SDL and joystick support ] ]]
sndfile [[ description = [ Support for some audio codecs through libsndfile ] ]]
ffmpeg? ( ( providers: ffmpeg libav ) [[ number-selected = exactly-one ]] )
( providers: ijg-jpeg jpeg-turbo ) [[ number-selected = exactly-one ]]
"
# FIXME: Tests fire tons of sydbox violations
RESTRICT="test"
DEPENDENCIES="
build:
sci-libs/eigen:3[>=3.2.7]
x11-proto/xorgproto
build+run:
app-arch/lzo:2
dev-libs/boost[>=1.48.0]
dev-python/numpy[>=1.7.0][python_abis:*(-)?]
media-libs/OpenImageIO
media-libs/freetype:2
media-libs/glew
media-libs/ilmbase
media-libs/libpng:=
media-libs/openexr
media-libs/tiff
sys-libs/zlib
x11-dri/glu
x11-dri/mesa
x11-libs/libX11
x11-libs/libXfixes
x11-libs/libXi
x11-libs/libXrender
x11-libs/libXxf86vm
ffmpeg? (
providers:ffmpeg? ( media/ffmpeg )
providers:libav? ( media/libav )
)
fftw? ( sci-libs/fftw[>=3.0] )
jack? ( media-sound/jack-audio-connection-kit )
jpeg2000? ( media-libs/OpenJPEG:0 )
openal? ( media-libs/openal )
sdl? ( media-libs/SDL:2 )
sndfile? ( media-libs/libsndfile )
providers:ijg-jpeg? ( media-libs/jpeg:= )
providers:jpeg-turbo? ( media-libs/libjpeg-turbo )
suggestion:
dev-python/requests[python_abis:*(-)?] [[ description = [ Support to upload models to sketchfab ] ]]
"
blender_src_prepare() {
if option openmp; then
# stolen from the cmake test
# we can't just test for the flag because clang ignores it and returns 0
cat > "${WORKBASE}"/openmp-test.c <<HERE
#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}
HERE
if ! ${CC} ${CFLAGS} -fopenmp "${WORKBASE}"/openmp-test.c -o /dev/null &> /dev/null ||
! ${CXX} ${CXXFLAGS} -fopenmp "${WORKBASE}"/openmp-test.c -o /dev/null &> /dev/null; then
eerror "You enabled the openmp option for blender but your selected compiler doesn't support it."
eerror "Either use a different compiler or disable the openmp option."
die
fi
fi
# fix c++ errors on gcc-8.x
if cc-is-gcc && ever at_least 8.0 $(gcc-version); then
einfo "Applying GCC 8 patches"
edo pushd ${WORKBASE}/${PNV}
expatch "${FILES}"/tree_hpp.patch
expatch "${FILES}"/util_sseb.patch
edo popd
fi
cmake_src_prepare
}
blender_src_configure() {
# WITH_OPENIMAGEIO: required for cycles
# WITH_INSTALL_PORTABLE: respect CMAKE_INSTALL_PREFIX
# WITH_PYTHON_INSTALL*: use the system python modules
# WITH_OPENCOLORIO, WITH_INPUT_NDOF: unwritten dependencies
# no WITH_SYSTEM_BULLET: not supported by upstream because of missing features
local args=(
-DCMAKE_BUILD_TYPE:STRING=Release
-DCMAKE_SKIP_BUILD_RPATH:BOOL=TRUE
-DPYTHON_VERSION:STRING=$(python_get_abi)
-DWITH_ALEMBIC:BOOL=FALSE
-DWITH_ALEMBIC_HDF5:BOOL=FALSE
-DWITH_BOOST:BOOL=TRUE
-DWITH_BUILDINFO:BOOL=TRUE
-DWITH_BULLET:BOOL=TRUE
-DWITH_CODEC_AVI:BOOL=TRUE
-DWITH_COMPOSITOR:BOOL=TRUE
-DWITH_CYCLES:BOOL=TRUE
-DWITH_CYCLES_CUDA_BINARIES:BOOL=FALSE
-DWITH_CYCLES_OPENSUBDIV:BOOL=FALSE
-DWITH_CYCLES_OSL:BOOL=FALSE
-DWITH_CYCLES_STANDALONE:BOOL=FALSE
-DWITH_CYCLES_STANDALONE_GUI:BOOL=FALSE
-DWITH_DOC_MANPAGE:BOOL=TRUE
-DWITH_FREESTYLE:BOOL=TRUE
-DWITH_GAMEENGINE:BOOL=TRUE
-DWITH_GAMEENGINE_DECKLINK:BOOL=TRUE
-DWITH_GHOST_XDND:BOOL=TRUE
-DWITH_GTESTS:BOOL=FALSE
-DWITH_HEADLESS:BOOL=FALSE
-DWITH_IK_ITASC:BOOL=TRUE
-DWITH_IK_SOLVER:BOOL=TRUE
-DWITH_IMAGE_CINEON:BOOL=TRUE
-DWITH_IMAGE_DDS:BOOL=TRUE
-DWITH_IMAGE_FRAMESERVER:BOOL=TRUE
-DWITH_IMAGE_HDR:BOOL=TRUE
-DWITH_IMAGE_OPENEXR:BOOL=TRUE
-DWITH_IMAGE_TIFF:BOOL=TRUE
-DWITH_INPUT_NDOF:BOOL=FALSE
-DWITH_INSTALL_PORTABLE:BOOL=FALSE
-DWITH_INTERNATIONAL:BOOL=TRUE
-DWITH_LIBMV:BOOL=TRUE
-DWITH_LLVM:BOOL=FALSE
-DWITH_LZMA:BOOL=TRUE
-DWITH_LZO:BOOL=TRUE
-DWITH_MEM_JEMALLOC:BOOL=FALSE
-DWITH_MEM_VALGRIND:BOOL=FALSE
-DWITH_MOD_BOOLEAN:BOOL=TRUE
-DWITH_MOD_FLUID:BOOL=TRUE
-DWITH_MOD_REMESH:BOOL=TRUE
-DWITH_MOD_SMOKE:BOOL=TRUE
-DWITH_OPENCOLLADA:BOOL=FALSE
-DWITH_OPENCOLORIO:BOOL=FALSE
-DWITH_OPENGL_TESTS:BOOL=FALSE
-DWITH_OPENIMAGEIO:BOOL=TRUE
-DWITH_OPENSUBDIV:BOOL=FALSE
-DWITH_OPENVDB:BOOL=FALSE
-DWITH_OPENVDB_BLOSC:BOOL=FALSE
-DWITH_PLAYER:BOOL=TRUE
-DWITH_PYTHON_INSTALL:BOOL=FALSE
-DWITH_PYTHON_INSTALL_NUMPY:BOOL=FALSE
-DWITH_PYTHON_INSTALL_REQUESTS:BOOL=FALSE
-DWITH_PYTHON_MODULE:BOOL=FALSE
-DWITH_RAYOPTIMIZATION:BOOL=TRUE
-DWITH_STATIC_LIBS:BOOL=FALSE
-DWITH_SYSTEM_EIGEN3:BOOL=TRUE
-DWITH_SYSTEM_GLES:BOOL=TRUE
-DWITH_SYSTEM_GLEW:BOOL=TRUE
-DWITH_SYSTEM_LZO:BOOL=TRUE
-DWITH_SYSTEM_OPENJPEG:BOOL=TRUE
-DWITH_X11_ALPHA:BOOL=TRUE
-DWITH_X11_XF86VMODE:BOOL=TRUE
-DWITH_X11_XFIXES:BOOL=TRUE
-DWITH_X11_XINPUT:BOOL=TRUE
$(cmake_with ffmpeg CODEC_FFMPEG)
$(cmake_with fftw FFTW3)
$(cmake_with fftw MOD_OCEANSIM)
$(cmake_with jack JACK)
$(cmake_with jpeg2000 IMAGE_OPENJPEG)
$(cmake_with openal OPENAL)
$(cmake_with openmp OPENMP)
$(cmake_with sdl SDL)
$(cmake_with sndfile CODEC_SNDFILE)
)
ecmake "${args[@]}"
}
blender_src_install() {
cmake_src_install
# TODO: Use CMAKE_INSTALL_FULL_DATAROOTDIR
edo mv "${IMAGE}"/usr/{$(exhost --target)/,}share
# TODO: blender fails to run otherwise
dodir /usr/$(exhost --target)/share
dosym /usr/share/${PN} /usr/$(exhost --target)/share/${PN}
edo mv "${IMAGE}"/usr/share/doc/{${PN},${PNV}}
keepdir /usr/share/${PN}/${MY_PV}/scripts/addons_contrib
}

View file

@ -0,0 +1,85 @@
Source/Upstream: Yes, fixed in git master
Reason: Fix build with ffmpeg4
From 4e4a93bc454d93ec8523f44b73a42977e2868ecc Mon Sep 17 00:00:00 2001
From: Bastien Montagne <montagne29@wanadoo.fr>
Date: Tue, 8 May 2018 16:00:52 +0200
Subject: [PATCH] Fix building with latest versions of ffmpeg.
Some years-old deprecated stuff has now been removed.
Correct solution is probably to use valid defines etc. in own code, but
this is more FFMEPG maintainer task (since it also may change how old
FFMPEG we do support...).
---
intern/ffmpeg/ffmpeg_compat.h | 39 ++++++++++++++++++++++++++
source/blender/blenkernel/intern/writeffmpeg.c | 3 +-
2 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/intern/ffmpeg/ffmpeg_compat.h b/intern/ffmpeg/ffmpeg_compat.h
index 1eb6c3ba2dc..bc65f19ef59 100644
--- a/intern/ffmpeg/ffmpeg_compat.h
+++ b/intern/ffmpeg/ffmpeg_compat.h
@@ -119,6 +119,45 @@ int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt)
#endif
+/* XXX TODO Probably fix to correct modern flags in code? Not sure how old FFMPEG we want to support though,
+ * so for now this will do. */
+
+#ifndef FF_MIN_BUFFER_SIZE
+# ifdef AV_INPUT_BUFFER_MIN_SIZE
+# define FF_MIN_BUFFER_SIZE AV_INPUT_BUFFER_MIN_SIZE
+# endif
+#endif
+
+#ifndef FF_INPUT_BUFFER_PADDING_SIZE
+# ifdef AV_INPUT_BUFFER_PADDING_SIZE
+# define FF_INPUT_BUFFER_PADDING_SIZE AV_INPUT_BUFFER_PADDING_SIZE
+# endif
+#endif
+
+#ifndef CODEC_FLAG_GLOBAL_HEADER
+# ifdef AV_CODEC_FLAG_GLOBAL_HEADER
+# define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER
+# endif
+#endif
+
+#ifndef CODEC_FLAG_GLOBAL_HEADER
+# ifdef AV_CODEC_FLAG_GLOBAL_HEADER
+# define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER
+# endif
+#endif
+
+#ifndef CODEC_FLAG_INTERLACED_DCT
+# ifdef AV_CODEC_FLAG_INTERLACED_DCT
+# define CODEC_FLAG_INTERLACED_DCT AV_CODEC_FLAG_INTERLACED_DCT
+# endif
+#endif
+
+#ifndef CODEC_FLAG_INTERLACED_ME
+# ifdef AV_CODEC_FLAG_INTERLACED_ME
+# define CODEC_FLAG_INTERLACED_ME AV_CODEC_FLAG_INTERLACED_ME
+# endif
+#endif
+
/* FFmpeg upstream 1.0 is the first who added AV_ prefix. */
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 59, 100)
# define AV_CODEC_ID_NONE CODEC_ID_NONE
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index d7fcd896e11..fc719634ff5 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -619,7 +619,8 @@ static AVStream *alloc_video_stream(FFMpegContext *context, RenderData *rd, int
c->rc_buffer_aggressivity = 1.0;
#endif
- c->me_method = ME_EPZS;
+ /* Deprecated and not doing anything since July 2015, deleted in recent ffmpeg */
+ //c->me_method = ME_EPZS;
codec = avcodec_find_encoder(c->codec_id);
if (!codec)
--
2.16.3

View file

@ -0,0 +1,11 @@
--- a/intern/itasc/kdl/tree.hpp 2018-03-23 16:22:25.000000000 +0100
+++ b/intern/itasc/kdl/tree.hpp 2018-08-13 19:31:32.101185313 +0200
@@ -34,7 +34,7 @@
//Forward declaration
class TreeElement;
// Eigen allocator is needed for alignment of Eigen data types
- typedef std::map<std::string,TreeElement, std::less<std::string>, Eigen::aligned_allocator<std::pair<std::string, TreeElement> > > SegmentMap;
+ typedef std::map<std::string,TreeElement, std::less<std::string>, Eigen::aligned_allocator<std::pair<const std::string, TreeElement> > > SegmentMap;
class TreeElement
{

View file

@ -0,0 +1,12 @@
--- a/intern/cycles/util/util_sseb.h
+++ b/intern/cycles/util/util_sseb.h
@@ -116,7 +116,7 @@ __forceinline const sseb unpacklo( const sseb& a, const sseb& b ) { return _mm_u
__forceinline const sseb unpackhi( const sseb& a, const sseb& b ) { return _mm_unpackhi_ps(a, b); }
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const sseb shuffle( const sseb& a ) {
- return _mm_shuffle_epi32(a, _MM_SHUFFLE(i3, i2, i1, i0));
+ return _mm_castsi128_ps(_mm_shuffle_epi32(a, _MM_SHUFFLE(i3, i2, i1, i0)));
}
template<> __forceinline const sseb shuffle<0, 1, 0, 1>( const sseb& a ) {