| 1 |
# Copyright 1999-2008 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/media-gfx/blender/blender-2.45.ebuild,v 1.5 2008/04/07 21:58:02 yngwin Exp $ |
| 4 |
|
| 5 |
inherit multilib flag-o-matic eutils python |
| 6 |
|
| 7 |
#IUSE="jpeg mozilla png sdl static truetype" |
| 8 |
IUSE="blender-game ffmpeg jpeg nls openal openexr png verse" |
| 9 |
DESCRIPTION="3D Creation/Animation/Publishing System" |
| 10 |
HOMEPAGE="http://www.blender.org/" |
| 11 |
SRC_URI="http://download.blender.org/source/${P}.tar.gz" |
| 12 |
|
| 13 |
SLOT="0" |
| 14 |
LICENSE="|| ( GPL-2 BL )" |
| 15 |
KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" |
| 16 |
|
| 17 |
RDEPEND=">=dev-libs/openssl-0.9.6 |
| 18 |
ffmpeg? ( >=media-video/ffmpeg-0.4.9_p20070616-r1 |
| 19 |
media-libs/x264 ) |
| 20 |
jpeg? ( media-libs/jpeg ) |
| 21 |
media-libs/tiff |
| 22 |
>=dev-lang/python-2.4 |
| 23 |
nls? ( >=media-libs/freetype-2.0 |
| 24 |
virtual/libintl |
| 25 |
>=media-libs/ftgl-2.1 ) |
| 26 |
openal? ( media-libs/openal |
| 27 |
media-libs/freealut ) |
| 28 |
openexr? ( media-libs/openexr ) |
| 29 |
png? ( media-libs/libpng ) |
| 30 |
>=media-libs/libsdl-1.2 |
| 31 |
virtual/opengl" |
| 32 |
|
| 33 |
DEPEND="dev-util/scons |
| 34 |
x11-libs/libXt |
| 35 |
x11-proto/inputproto |
| 36 |
${RDEPEND}" |
| 37 |
|
| 38 |
blend_with() { |
| 39 |
local UWORD="$2" |
| 40 |
if [ -z "${UWORD}" ]; then |
| 41 |
UWORD="$1" |
| 42 |
fi |
| 43 |
if useq $1; then |
| 44 |
echo "WITH_BF_${UWORD}=1" | tr '[:lower:]' '[:upper:]' \ |
| 45 |
>> "${S}"/user-config.py |
| 46 |
else |
| 47 |
echo "WITH_BF_${UWORD}=0" | tr '[:lower:]' '[:upper:]' \ |
| 48 |
>> "${S}"/user-config.py |
| 49 |
fi |
| 50 |
} |
| 51 |
|
| 52 |
src_unpack() { |
| 53 |
unpack ${A} |
| 54 |
cd "${S}"/release/plugins |
| 55 |
chmod 755 bmake |
| 56 |
cp -pPR "${S}"/source/blender/blenpluginapi include |
| 57 |
|
| 58 |
cd "${S}" |
| 59 |
epatch "${FILESDIR}"/blender-2.37-dirs.patch |
| 60 |
epatch "${FILESDIR}"/blender-2.44-scriptsdir.patch |
| 61 |
epatch "${FILESDIR}"/blender-2.44-swscale.patch |
| 62 |
epatch "${FILESDIR}"/${P}-missing_includes.patch |
| 63 |
|
| 64 |
if use ffmpeg ; then |
| 65 |
cd "${S}"/extern |
| 66 |
rm -rf ffmpeg |
| 67 |
fi |
| 68 |
# pass compiler flags to the scons build system |
| 69 |
# and set python version to current version in use |
| 70 |
python_version |
| 71 |
cat <<- EOF >> "${S}"/user-config.py |
| 72 |
CFLAGS += '${CFLAGS}' |
| 73 |
BF_PYTHON_VERSION="${PYVER}" |
| 74 |
BF_PYTHON_INC="/usr/include/python${PYVER}" |
| 75 |
BF_PYTHON_BINARY="/usr/bin/python${PYVER}" |
| 76 |
BF_PYTHON_LIB="python${PYVER}" |
| 77 |
EOF |
| 78 |
|
| 79 |
} |
| 80 |
|
| 81 |
src_compile() { |
| 82 |
for arg in 'openal' \ |
| 83 |
'openexr' \ |
| 84 |
'jpeg' \ |
| 85 |
'ffmpeg' \ |
| 86 |
'png' \ |
| 87 |
'verse' \ |
| 88 |
'nls international' \ |
| 89 |
'blender-game gameengine'; do |
| 90 |
blend_with ${arg} |
| 91 |
done |
| 92 |
|
| 93 |
# scons uses -l differently -> remove it |
| 94 |
scons ${MAKEOPTS/-l[0-9]} -h > scons.config |
| 95 |
scons ${MAKEOPTS/-l[0-9]} || die \ |
| 96 |
"!!! Please add ${S}/scons.config when filing bugs reports to bugs.gentoo.org" |
| 97 |
|
| 98 |
cd "${S}"/release/plugins |
| 99 |
emake || die |
| 100 |
} |
| 101 |
|
| 102 |
src_install() { |
| 103 |
exeinto /usr/bin/ |
| 104 |
doexe "${WORKDIR}"/install/linux2/blender |
| 105 |
|
| 106 |
dodir /usr/share/${PN} |
| 107 |
|
| 108 |
exeinto /usr/$(get_libdir)/${PN}/textures |
| 109 |
doexe "${S}"/release/plugins/texture/*.so |
| 110 |
exeinto /usr/$(get_libdir)/${PN}/sequences |
| 111 |
doexe "${S}"/release/plugins/sequence/*.so |
| 112 |
insinto /usr/include/${PN} |
| 113 |
doins "${S}"/release/plugins/include/*.h |
| 114 |
|
| 115 |
if use nls ; then |
| 116 |
mv "${WORKDIR}"/install/linux2/.blender/{.Blanguages,.bfont.ttf} \ |
| 117 |
"${D}"/usr/share/${PN} |
| 118 |
mv "${WORKDIR}"/install/linux2/.blender/locale \ |
| 119 |
"${D}"/usr/share/locale |
| 120 |
fi |
| 121 |
|
| 122 |
mv "${WORKDIR}"/install/linux2/.blender/scripts "${D}"/usr/share/${PN} |
| 123 |
|
| 124 |
insinto /usr/share/pixmaps |
| 125 |
doins "${FILESDIR}"/${PN}.png |
| 126 |
insinto /usr/share/applications |
| 127 |
doins "${FILESDIR}"/${PN}.desktop |
| 128 |
|
| 129 |
dodoc INSTALL README |
| 130 |
} |
| 131 |
|
| 132 |
pkg_preinst(){ |
| 133 |
if [ -h "${ROOT}/usr/$(get_libdir)/blender/plugins/include" ]; |
| 134 |
then |
| 135 |
rm -f "${ROOT}"/usr/$(get_libdir)/blender/plugins/include |
| 136 |
fi |
| 137 |
} |