# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit multilib flag-o-matic eutils python IUSE="openal sdl openexr jpeg png nls iconv blender-game ffmpeg yafray tiff fmod zlib ode quicktime mesa blender-player bullet plugins scripts verse" 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 )" KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" RDEPEND=" jpeg? ( >=media-libs/jpeg-6b ) png? ( >=media-libs/libpng-1.0.14 ) media-libs/tiff nls? ( >=media-libs/freetype-2.0 virtual/libintl ) iconv? ( virtual/libiconv ) openal? ( media-libs/openal media-libs/freealut ) sdl? ( >=media-libs/libsdl-1.2 ) ffmpeg? ( media-video/ffmpeg ) >=dev-libs/openssl-0.9.6 nls? ( >=media-libs/ftgl-2.1 ) openexr? ( media-libs/openexr ) virtual/opengl yafray? ( >=media-gfx/yafray-0.0.7 ) fmod? ( media-libs/fmod ) zlib? ( sys-libs/zlib ) ode? ( dev-games/ode ) quicktime? ( virtual/quicktime ) mesa? ( >=media-libs/mesa-3.4.2 ) >=dev-lang/python-2.2 " DEPEND=">=dev-util/scons-0.96.1 || ( x11-libs/libXt virtual/x11 ) ${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:]' else echo "WITH_BF_${UWORD}=0" | tr '[:lower:]' '[:upper:]' fi return 0 } src_unpack() { unpack ${A} if use "plugins"; then mkdir -p ${WORKDIR}/install/linux2/plugins/ cd ${WORKDIR}/install/linux2/plugins/ cp -pPR ${S}/source/blender/blenpluginapi include fi cp ${FILESDIR}/user-config.py ${S}/user-config.py } src_compile() { # echo "export NAN_YESIAMSTUPID ?= true" >> ${S}/blender/user-def.mk local myconf="" myconf="${myconf} $(blend_with openal)" myconf="${myconf} $(blend_with sdl)" myconf="${myconf} $(blend_with openexr)" myconf="${myconf} $(blend_with jpeg)" myconf="${myconf} $(blend_with ffmpeg)" myconf="${myconf} $(blend_with png)" myconf="${myconf} $(blend_with nls international)" myconf="${myconf} $(blend_with iconv)" myconf="${myconf} $(blend_with blender-game gameengine)" myconf="${myconf} $(blend_with yafray)" myconf="${myconf} $(blend_with fmod)" myconf="${myconf} $(blend_with zlib)" myconf="${myconf} $(blend_with ode)" myconf="${myconf} $(blend_with bullet)" myconf="${myconf} $(blend_with quicktime)" myconf="${myconf} $(blend_with blender-player player)" myconf="${myconf} $(blend_with mesa staticopengl)" myconf="${myconf} $(blend_with verse)" if use "quicktime"; then elog "" elog "" elog "NOTICE: quicktime is known to cause problems on some systems." elog "" elog "" sleep 3 fi #my ~amd64 hack # echo "export NAN_YESIAMSTUPID ?= true" >> ${S}/source/blender/user-def.mk # echo "export NAN_YESIAMSTUPID ?= true" >> ${S}/source/user-def.mk scons ${MAKEOPTS} ${myconf} || die if use "plugins"; then cd ${WORKDIR}/install/linux2/plugins/ chmod 755 bmake emake || die fi } src_install() { exeinto /usr/bin/ doexe ${WORKDIR}/install/linux2/blender if use "blender-player"; then doexe ${WORKDIR}/install/linux2/blenderplayer fi if use "plugins"; then 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 fi dodir /usr/share/${PN} cp -pPR ${WORKDIR}/install/linux2/.blender/.bfont.ttf \ ${D}/usr/share/${PN} cp -pPR ${WORKDIR}/install/linux2/.blender/.Blanguages \ ${D}/usr/share/${PN} if use "nls"; then cp -pPR ${WORKDIR}/install/linux2/.blender/locale \ ${D}/usr/share/ fi if use "scripts"; then cp -pPR ${WORKDIR}/install/linux2/.blender/scripts \ ${D}/usr/share/${PN} fi insinto /usr/share/pixmaps doins release/freedesktop/icons/32x32/${PN}.png dodoc COPYING INSTALL README ChangeLog } pkg_postinst() { if use "scripts"; then elog elog "Some builtin scripts were installed in /usr/share/${PN}/scripts/" elog fi }