add media-gfx/blender
This commit is contained in:
parent
4ab59d1924
commit
e437f8c29b
6 changed files with 337 additions and 0 deletions
216
packages/media-gfx/blender/blender.exlib
Normal file
216
packages/media-gfx/blender/blender.exlib
Normal 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
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue