# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="2" NEED_PYTHON="3.1" inherit flag-o-matic subversion eutils python cmake-utils IUSE="game-engine player nls elbeem openexr +ffmpeg jpeg openal web openmp verse \ physic +dds debug doc +fftw jack +guardedalloc apidoc sndfile" LANGS="en ar bg ca cs de el es fi fr hr hr_HR it ja ko nl pl pt_BR ro ru sr \ sv uk zh_CN" for X in ${LANGS} ; do IUSE="${IUSE} linguas_${X}" done DESCRIPTION="3D Creation/Animation/Publishing System" HOMEPAGE="http://www.blender.org/" ESVN_REPO_URI="https://svn.blender.org/svnroot/bf-blender/branches/blender2.5/blender/" SLOT="0" LICENSE="|| ( GPL-2 BL )" KEYWORDS="" # NOTES: # - cmake 2.6.4-r2 is required to correctly detect python 3.1; RDEPEND="media-libs/jpeg media-libs/libpng >=media-libs/libsdl-1.2 x11-libs/libXi x11-libs/libX11 sys-libs/zlib media-libs/tiff media-libs/libsamplerate virtual/opengl >=media-libs/freetype-2.0 virtual/libintl virtual/libiconv game-engine? ( >=media-libs/libsdl-1.2[joystick] ) openexr? ( media-libs/openexr ) ffmpeg? ( >=media-video/ffmpeg-0.5[x264,xvid,mp3] ) jpeg? ( media-libs/openjpeg ) openal? ( >=media-libs/openal-1.6.372 ) web? ( >=net-libs/xulrunner-1.9.0.10:1.9 ) fftw? ( sci-libs/fftw:3.0 ) jack? ( media-sound/jack-audio-connection-kit ) sndfile? ( media-libs/libsndfile )" DEPEND=">=sys-devel/gcc-4.3.2[openmp?] >=dev-util/cmake-2.6.4-r2[python3] apidoc? ( dev-python/epydoc >=app-doc/doxygen-1.5.7[-nodot] ) ${RDEPEND}" S="${WORKDIR}/${PN}" src_unpack() { subversion_src_unpack } src_prepare() { #epatch "${FILESDIR}"/${PN}-2.5-CVE-2008-1103.patch epatch "${FILESDIR}"/${PN}-2.5-CVE-2008-4863.patch epatch "${FILESDIR}"/${PN}-2.49a-sys-openjpeg.patch epatch "${FILESDIR}"/${PN}-desktop.patch einfo "Removing bundled FFmpeg ..." rm -r extern/ffmpeg #einfo "Removing bundled Bullet2 ..." #rm -r extern/bullet2 #einfo "Removing bundled Glew ..." #rm -r extern/glew einfo "Removing bundled LAME ..." rm -r extern/libmp3lame #einfo "Removing bundled OpenJPEG ..." #rm -r extern/libopenjpeg einfo "Removing bundled x264 ..." rm -r extern/x264 einfo "Removing bundled Xvid ..." rm -r extern/xvidcore #einfo "Removing bundled LZMA ..." #rm -r extern/lzma #einfo "Removing bundled LZO ..." #rm -r extern/lzo #einfo "Removing binreloc ..." #rm -r extern/binreloc } src_configure() { use debug && append-flags -ggdb # FIX: internationalization support is enable only is there are other # linguas than 'en' if [[ "${LINGUAS}" == "en" ]]; then mycmakeargs="${mycmakeargs} -DWITH_INTERNATIONAL:BOOL=OFF" else mycmakeargs="${mycmakeargs} -DWITH_INTERNATIONAL:BOOL=ON" fi # FIX: Game Engine module needs to be active to build the Blender Player if ! use game-engine && use player; then elog "Forcing Game Engine [+game-engine] as required by Blender Player [+player]" mycmakeargs="${mycmakeargs} -DWITH_GAMEENGINE:BOOL=ON" else mycmakeargs="${mycmakeargs} \ $(cmake-utils_use_with game-engine GAMEENGINE)" fi # FIX: Physic Engine module needs to be acteve to build Game Engine if ! use physic && use game-engine; then elog "Forcing Physic Engine [+physic] as required by Game Engine [+game-engine]" mycmakeargs="${mycmakeargs} -DWITH_BULLET:BOOL=ON" else mycmakeargs="${mycmakeargs} \ $(cmake-utils_use_with physic BULLET)" fi mycmakeargs="${mycmakeargs} \ $(cmake-utils_use debug CMAKE_VERBOSE_MAKEFILE) \ $(cmake-utils_use_with elbeem ELBEEM) \ -DWITH_QUICKTIME:BOOL=OFF \ $(cmake-utils_use_with openexr OPENEXR) \ $(cmake-utils_use_with dds DDS) \ $(cmake-utils_use_with ffmpeg FFMPEG) \ -DWITH_PYTHON:BOOL=ON \ -DWITH_SDL:BOOL=ON \ $(cmake-utils_use_with jpeg OPENJPEG) \ $(cmake-utils_use_with openal OPENAL) \ $(cmake-utils_use_with openmp OPENMP) \ $(cmake-utils_use_with web WEBPLUGIN) \ $(cmake-utils_use_with fftw FFTW3) \ $(cmake-utils_use_with jack JACK) \ $(cmake-utils_use_with sndfile SNDFILE) \ $(cmake-utils_use_with guardedalloc CXX_GUARDEDALLOC) \ $(cmake-utils_use_with player PLAYER) \ -DWITH_INSTALL:BOOL=ON \ -DWITH_BUILDINFO:BOOL=ON" cmake-utils_src_configure } # NOTE: blender lacks a CMake install target src_install() { exeinto /usr/bin/ # FIX: make blender detects all the plugin paths mv "${CMAKE_BUILD_DIR}"/bin/blender "${CMAKE_BUILD_DIR}"/bin/blender-bin doexe "${CMAKE_BUILD_DIR}"/bin/blender-bin doexe "${FILESDIR}"/blender use player && doexe "${CMAKE_BUILD_DIR}"/bin/blenderplayer use verse && doexe "${CMAKE_BUILD_DIR}"/bin/verse # NOTE: textures and plugins are missing from the SVN # 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 # installing localizations insinto /usr/share/locale if [[ ${LINGUAS} != "en" && -n ${LINGUAS} ]]; then insinto /usr/share/locale doins "${CMAKE_BUILD_DIR}"/bin/.blender/.Blanguages for LANG in ${LINGUAS}; do [[ ${LANG} == "en" ]] && continue doins -r "${CMAKE_BUILD_DIR}/bin/.blender/locale/${LANG}" || die "failed '${LANG}' locale installation" done fi # installing fonts insinto /usr/share/blender doins "${CMAKE_BUILD_DIR}"/bin/.blender/.bfont.ttf doins release/VERSION # installing python scripts insinto /usr/share/blender/scripts doins -r "${CMAKE_BUILD_DIR}"/bin/.blender/io doins -r "${CMAKE_BUILD_DIR}"/bin/.blender/ui # FIX: chown root:users -R "${D}/usr/share/${PN}" # installing desktop file insinto /usr/share/pixmaps doins release/freedesktop/icons/scalable/blender.svg insinto /usr/share/applications doins release/freedesktop/blender.desktop dodoc INSTALL README use doc && dodoc "${WORKDIR}"/install/linux2/BlenderQuickStart.pdf if use apidoc; then einfo "Removing bundled python ..." rm -r "${CMAKE_BUILD_DIR}"/bin/.blender/python "${CMAKE_BUILD_DIR}"/bin/blender-bin -P \ source/blender/python/epy_doc_gen.py \ || die "epy_doc_gen.py failed." epydoc source/blender/python/doc/*.py -v \ -o source/blender/python/doc/html \ --inheritance=included \ --no-sourcecode \ --graph=classtree \ --graph-font-size=8 \ || die "epydoc failed." # pushd "${S}"/doc > /dev/null # doxygen -u Doxyfile # doxygen || die "doxygen failed to build API docs." # dohtml -r html/* # popd > /dev/null fi } pkg_preinst() { if [ -h "${ROOT}/usr/$(get_libdir)/blender/plugins/include" ]; then rm "${ROOT}"/usr/$(get_libdir)/blender/plugins/include fi } pkg_postinst() { echo 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." elog elog "Blender has its own internal rendering engine but you" elog "can export to external renderers for image computation" elog "like: YafRay[1], sunflow[2], PovRay[3] and luxrender[4]" elog elog "If you need one of them just emerge it:" elog " [1] emerge -av media-gfx/yafray" elog " [2] emerge -av media-gfx/sunflow" elog " [3] emerge -av media-gfx/povray" elog " [4] emerge -av media-gfx/luxrender" }