# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/media-gfx/blender/blender-2.37a.ebuild,v 1.6 2005/12/15 04:59:59 spyderous Exp $ inherit flag-o-matic eutils python IUSE="ffmpeg fmod gameengine iconv jpeg nls openal openexr sdl" 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 ~sparc ~x86" RDEPEND="ffmpeg? ( media-video/ffmpeg ) fmod? ( media-libs/fmod ) iconv? ( virtual/libiconv ) jpeg? ( media-libs/jpeg ) nls? ( >=media-libs/freetype-2.0 >=media-libs/ftgl-2.1 virtual/libintl ) openal? ( ~media-libs/openal ) openexr? ( media-libs/openexr ) sdl? ( >=media-libs/libsdl-1.2 ) virtual/opengl" DEPEND="dev-util/scons || ( x11-libs/libXt virtual/x11 ) ${RDEPEND}" S=${WORKDIR}/${PN}${PV} #S=${WORKDIR}/${PN} set_flag() { local UWORD="$2" if [ -z "${UWORD}" ]; then UWORD="$1" fi # convert UWORD to upper characters UWORD=`echo $UWORD | tr '[:lower:]' '[:upper:]'` if useq $1; then einfo "Enabling $1 support" sed -i -e "s:WITH_BF_${UWORD}.*$:WITH_BF_${UWORD} = 'true':" \ ${S}/config/linux2-config.py else einfo "Disabling $1 support" sed -i -e "s:WITH_BF_${UWORD}.*$:WITH_BF_${UWORD} = 'false':" \ ${S}/config/linux2-config.py fi return 0 } src_unpack() { unpack ${A} cd ${S} epatch ${FILESDIR}/blender-2.37-dirs.patch mkdir -p ${WORKDIR}/install/linux2/plugins/ cd ${WORKDIR}/install/linux2/plugins/ cp -pPR ${S}/source/blender/blenpluginapi include } src_compile() { # Blender uses SConstruct instead of autoconf and make. # Read more: # http://www.blender3d.org/cms/Building_Blender.117.0.html set_flag ffmpeg set_flag fmod set_flag gameengine set_flag iconv set_flag jpeg set_flag nls international set_flag openal set_flag openexr set_flag sdl if use gameengine; then echo "WITH_BF_PLAYER = 'true'" >> ${S}/config/linux2-config.py fi #Using our own build flags -- crazy build options will cause problems, use at your own risk replace-flags "-O3" "-O2" sed -i -e "s/-O2/${CXXFLAGS// /\' ,\'}/g" ${S}/config/linux2-config.py scons ${MAKEOPTS} || die cd ${WORKDIR}/install/linux2/plugins chmod 755 bmake emake || die } src_install() { #this ebuild installs to /usr/lib instead of /opt #(I see no advantage to using /opt) exeinto /usr/bin doexe ${WORKDIR}/install/linux2/blender if use gameengine; then doexe ${WORKDIR}/install/linux2/blenderplayer; fi # Install plugins exeinto /usr/$(get_libdir)/${PN}/texture doexe ${WORKDIR}/install/linux2/plugins/texture/*.so exeinto /usr/$(get_libdir)/${PN}/sequence doexe ${WORKDIR}/install/linux2/plugins/sequence/*.so #Install support for building 3rd party plugins from source # The blender/plugins directory is where source is kept and where # plugins are built. After building them, the .so files need to # be manually moved to either blender/texture or blender/sequence # depending on the plugin type. exeinto /usr/$(get_libdir)/${PN}/plugins chmod 755 ${S}/release/plugins/bmake doexe ${S}/release/plugins/bmake exeinto /usr/$(get_libdir)/${PN}/plugins/include doexe ${S}/source/blender/blenpluginapi/*.h # Install scripts insinto /usr/$(get_libdir)/${PN} doins -r ${S}/release/scripts if use nls; then # Copy language files insinto /usr/lib/${PN} doins -r ${S}/bin/.blender/{.bfont.ttf,.Blanguages,locale} fi insinto /usr/share/pixmaps doins ${FILESDIR}/${PN}.png insinto /usr/share/applications doins ${FILESDIR}/${PN}.desktop dodoc ${WORKDIR}/install/linux2/{BlenderQuickStart.pdf,*.txt} } pkg_preinst() { if [ -h "/usr/$(get_libdir)/blender/plugins/include" ]; then rm -f /usr/$(get_libdir)/blender/plugins/include fi }