/[gentoo-x86]/media-gfx/blender/blender-2.49b-r2.ebuild
Gentoo

Contents of /media-gfx/blender/blender-2.49b-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.19 - (show annotations) (download)
Thu Jan 17 16:52:21 2013 UTC (15 months ago) by ssuominen
Branch: MAIN
Changes since 1.18: +3 -2 lines
Fix building with sys-devel/gcc >= 4.6.0 wrt #452694 by Alexandre Borges Marcelo

(Portage version: 2.2.0_alpha154/cvs/Linux x86_64, signed Manifest commit with key 4868F14D)

1 # Copyright 1999-2013 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.49b-r2.ebuild,v 1.18 2012/12/11 09:59:54 xarthisius Exp $
4
5 EAPI=2
6
7 PYTHON_DEPEND="2:2.6"
8
9 inherit scons-utils multilib eutils python
10
11 IUSE="blender-game ffmpeg nls ogg openmp verse openal"
12
13 DESCRIPTION="3D Creation/Animation/Publishing System"
14 HOMEPAGE="http://www.blender.org/"
15 SRC_URI="http://download.blender.org/source/${P}.tar.gz"
16
17 SLOT="0"
18 LICENSE="|| ( GPL-2 BL BSD )"
19 KEYWORDS="amd64 x86"
20
21 RDEPEND="ffmpeg? ( virtual/ffmpeg[encode,theora] )
22 >=media-libs/openjpeg-1.5.0
23 media-libs/tiff:0
24 nls? ( >=media-libs/freetype-2.0
25 virtual/libintl
26 >=media-libs/ftgl-2.1 )
27 openal? ( >=media-libs/openal-1.6.372
28 >=media-libs/freealut-1.1.0-r1 )
29 media-libs/openexr
30 media-libs/libpng:0
31 blender-game? ( >=media-libs/libsdl-1.2[joystick] )
32 >=media-libs/libsdl-1.2
33 ogg? ( media-libs/libogg )
34 virtual/jpeg
35 virtual/opengl"
36 DEPEND=">=dev-util/scons-2
37 sys-devel/gcc[openmp?]
38 x11-base/xorg-server
39 ${RDEPEND}"
40
41 blend_with() {
42 local UWORD="$2"
43 if [ -z "${UWORD}" ]; then
44 UWORD="$1"
45 fi
46 if use $1; then
47 echo "WITH_BF_${UWORD}=1" | tr '[:lower:]' '[:upper:]' \
48 >> "${S}"/user-config.py
49 else
50 echo "WITH_BF_${UWORD}=0" | tr '[:lower:]' '[:upper:]' \
51 >> "${S}"/user-config.py
52 fi
53 }
54
55 pkg_setup() {
56 python_set_active_version 2
57 python_pkg_setup
58 }
59
60 src_prepare() {
61 epatch "${FILESDIR}"/blender-2.48a-CVE-2008-4863.patch
62 epatch "${FILESDIR}"/${PN}-2.37-dirs.patch
63 epatch "${FILESDIR}"/${PN}-2.44-scriptsdir.patch
64 epatch "${FILESDIR}"/${PN}-2.49a-sys-openjpeg.patch
65 epatch "${FILESDIR}"/${PN}-2.49b-CVE-2009-3850-v4.patch
66 epatch "${FILESDIR}"/${PN}-2.49b-linux-3.patch # Bug #381099
67 epatch "${FILESDIR}"/${PN}-2.49b-subversion-1.7.patch
68 epatch "${FILESDIR}"/${P}-libav-0.7.patch
69 epatch "${FILESDIR}"/${P}-gcc46.patch
70 rm -f "${S}/release/scripts/bpymodules/"*.pyc
71
72 # Fix building with >=media-libs/openjpeg-1.5.0 (bug #409283)
73 sed -i \
74 -e '/parameters.*tile_size_on/s:false:FALSE:' \
75 source/blender/imbuf/intern/jp2.c || die
76 }
77
78 src_configure() {
79
80 # add ffmpeg info to the scons build info
81 cat <<- EOF >> "${S}"/user-config.py
82 BF_FFMPEG="/usr"
83 BF_FFMPEG_LIB="avdevice avformat avcodec swscale avutil"
84 EOF
85
86 # set python version to current version in use
87 cat <<- EOF >> "${S}"/user-config.py
88 BF_PYTHON_VERSION="$(python_get_version)"
89 BF_PYTHON_INC="$(python_get_includedir)"
90 BF_PYTHON_BINARY="$(PYTHON -a)"
91 BF_PYTHON_LIB="python$(python_get_version)"
92 EOF
93
94 # add system openjpeg into scons build.
95 cat <<- EOF >> "${S}"/user-config.py
96 BF_OPENJPEG = "/usr"
97 BF_OPENJPEG_INC = "/usr/include"
98 BF_OPENJPEG_LIB = "openjpeg"
99 EOF
100
101 #set CFLAGS used in /etc/make.conf correctly
102
103 echo "CFLAGS= [`for i in ${CFLAGS[@]}; do printf "%s \'$i"\',; done`] " \
104 | sed -e "s:,]: ]:" >> "${S}"/user-config.py
105
106 echo "CXXFLAGS= [`for i in ${CFLAGS[@]}; do printf "%s \'$i"\',; done`]" \
107 | sed -e "s:,]: ]:" >> "${S}"/user-config.py
108
109 # check for blender-game USE flag.
110 # blender-game will merge with blenderplayer.
111
112 for arg in \
113 'openal'\
114 'ffmpeg' \
115 'blender-game player' \
116 'blender-game gameengine' \
117 'nls international' \
118 'ogg' \
119 'openmp' \
120 'verse' ; do
121 blend_with ${arg}
122 done
123 }
124
125 src_compile() {
126 escons || die \
127 '!!! Please add "${S}/scons.config" when filing bugs reports \
128 to bugs.gentoo.org'
129
130 cd "${WORKDIR}"/install/linux2/plugins
131 chmod 755 bmake
132 emake || die
133 }
134
135 src_install() {
136 exeinto /usr/bin/
137 doexe "${WORKDIR}"/install/linux2/blender
138 use blender-game && doexe "${WORKDIR}"/install/linux2/blenderplayer
139
140 dodir /usr/share/${PN}
141
142 exeinto /usr/$(get_libdir)/${PN}/textures
143 doexe "${WORKDIR}"/install/linux2/plugins/texture/*.so
144 exeinto /usr/$(get_libdir)/${PN}/sequences
145 doexe "${WORKDIR}"/install/linux2/plugins/sequence/*.so
146 insinto /usr/include/${PN}
147 doins "${WORKDIR}"/install/linux2/plugins/include/*.h
148
149 if use nls ; then
150 mv "${WORKDIR}"/install/linux2/.blender/{.Blanguages,.bfont.ttf} \
151 "${D}"/usr/share/${PN}
152 mv "${WORKDIR}"/install/linux2/.blender/locale \
153 "${D}"/usr/share/locale
154 fi
155
156 mv "${WORKDIR}"/install/linux2/.blender/scripts "${D}"/usr/share/${PN}
157
158 insinto /usr/share/pixmaps
159 doins "${WORKDIR}"/install/linux2/icons/scalable/blender.svg
160 domenu "${FILESDIR}"/${PN}.desktop || die
161 domenu "${FILESDIR}"/${P}-insecure.desktop || die
162
163 dodoc INSTALL README
164 dodoc "${WORKDIR}"/install/linux2/BlenderQuickStart.pdf
165
166 }
167
168 pkg_preinst(){
169 if [ -h "${ROOT}/usr/$(get_libdir)/blender/plugins/include" ];
170 then
171 rm -f "${ROOT}"/usr/$(get_libdir)/blender/plugins/include
172 fi
173 }
174
175 pkg_postinst(){
176 elog "blender uses python integration. As such, may have some"
177 elog "inherit risks with running unknown python scripting."
178 elog " "
179 elog "CVE-2008-1103-1.patch has been removed as it interferes"
180 elog "with autosave undo features. Up stream blender coders"
181 elog "have not addressed the CVE issue as the status is still"
182 elog "a CANDIDATE and not CONFIRMED."
183 elog " "
184 elog "It is recommended to change your blender temp directory"
185 elog "from /tmp to ~tmp or another tmp file under your home"
186 elog "directory. This can be done by starting blender, then"
187 elog "dragging the main menu down do display all paths."
188 }

  ViewVC Help
Powered by ViewVC 1.1.20