# 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="blenderplayer nls static openal" IUSE="blenderplayer nls openal" 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="media-libs/libsdl media-libs/jpeg media-libs/libpng nls? (>=media-libs/freetype-2.0) nls? (>=media-libs/ftgl-2.1) openal? (media-libs/openal)" DEPEND="dev-util/scons || ( x11-libs/libXt virtual/x11 ) ${RDEPEND}" S=${WORKDIR}/${PN} src_unpack() { unpack ${A} cd ${S}/release/plugins chmod 755 bmake # Make the blenpluginapi accessible for the plugins ln -sf ../../source/blender/blenpluginapi/ include } src_compile() { # Blender uses SConstruct instead of autoconf and make. # We need to run "scons" once, to generate "config.opts" file, where all # options are stored. Then, according to useflags, we change options in that # file. Read more: # http://www.blender3d.org/cms/Building_Blender.117.0.html # http://www.blender3d.org/cms/Config_opts.152.0.html scons -q # Support for OpenAL if use openal; then einfo "Enabling OpenAL support" sed -i -e "s:USE_OPENAL.*$:USE_OPENAL = 'true':" \ ${S}/config.opts else einfo "Disabling OpenAL support" sed -i -e "s:USE_OPENAL.*$:USE_OPENAL = 'false':" \ ${S}/config.opts fi # Static Build #if use static; #then # einfo "Enabling static build" # sed -i -e "s:BUILD_BLENDER_STATIC.*$:BUILD_BLENDER_STATIC = 'true':" \ # -e "s:BUILD_BLENDER_DYNAMIC.*$:BUILD_BLENDER_DYNAMIC = 'false':" \ # -e "s:/usr/lib/libGL.a:/usr/lib/opengl/xorg-x11/lib/libGL.a:" \ # ${S}/config.opts #fi # Internationalization if use nls; then einfo "Enabling internationalization" sed -i -e "s:USE_INTERNATIONAL.*$:USE_INTERNATIONAL = 'true':" \ -e "s:FTGL_INCLUDE.*$:FTGL_INCLUDE = ['/usr/include/FTGL']:" \ -e "s:FTGL_LIBPATH.*$:FTGL_LIBPATH = ['/usr/$(get_libdir)']:" \ ${S}/config.opts else einfo "Enabling internationalization" sed -i -e "s:USE_INTERNATIONAL.*$:USE_INTERNATIONAL = 'false':" \ ${S}/config.opts fi # blenderplayer if use blenderplayer; then einfo "Enabling blenderplayer" sed -i -e "s:BUILD_BLENDER_PLAYER.*$:BUILD_BLENDER_PLAYER = 'true':" \ ${S}/config.opts else einfo "Disabling blenderplayer" sed -i -e "s:BUILD_BLENDER_PLAYER.*$:BUILD_BLENDER_PLAYER = 'false':" \ ${S}/config.opts fi # The user-defined CFLAGS/CXXFLAGS will be added to blender default flags. sed -i -e "s/^CCFLAGS.*\$/CCFLAGS = ['${CFLAGS// /\', \'}']/" config.opts sed -i -e "s/^CXXFLAGS.*\$/CXXFLAGS = ['${CXXFLAGS// /\', \'}']/" config.opts # Make wrapper scripts for blender and (if existant) blenderplayer # Symlinking will not work! mkdir wrappers echo '#!/bin/sh' > wrappers/blender echo 'cd /opt/blender' >> wrappers/blender echo './blender "$@"' >> wrappers/blender if use blenderplayer; then echo '#!/bin/sh' > wrappers/blenderplayer echo 'cd /opt/blender' >> wrappers/blenderplayer echo './blenderplayer "$@"' >> wrappers/blenderplayer fi scons || die cd ${S}/release/plugins emake || die } src_install() { exeinto /opt/${PN} doexe ${S}/blender doexe ${S}/blenderplayer # Install wrapper scripts exeinto /usr/bin doexe ${S}/wrappers/blender if use blenderplayer; then doexe ${S}/wrappers/blenderplayer; fi # Install plugins exeinto /opt/${PN}/plugins/texture doexe ${S}/release/plugins/texture/*.so exeinto /opt/${PN}/plugins/sequence doexe ${S}/release/plugins/sequence/*.so # Install scripts insinto /opt/${PN}/release doins -r ${S}/release/scripts if use nls; then # Copy language files insinto /opt/${PN} doins -r ${S}/bin/.blender/ fi insinto /usr/share/pixmaps doins ${FILESDIR}/${PN}.png insinto /usr/share/applications doins ${FILESDIR}/${PN}.desktop dodoc ChangeLog COPYING INSTALL README } pkg_preinst() { if [ -h "/usr/$(get_libdir)/blender/plugins/include" ]; then rm -f /usr/$(get_libdir)/blender/plugins/include fi } pkg_postinst() { einfo "For generating higher-quality ray tracing images, please emerge" einfo "media-gfx/yafray. Blender has many options designed to work" einfo "specifically with YafRay." }