blender-2.79b.recipe revision 0c947718
1SUMMARY="3D Creation/Animation/Publishing System"
2DESCRIPTION="Blender is the free and open source 3D creation suite. It \
3supports the entirety of the 3D pipeline���modeling, rigging, animation, \
4simulation, rendering, compositing and motion tracking, even video editing \
5and game creation.
6Advanced users employ Blender���s API for Python scripting to customize the \
7application and write specialized tools; often these are included in Blender���s \
8future releases. Blender is well suited to individuals and small studios who \
9benefit from its unified pipeline and responsive development process."
10HOMEPAGE="https://www.blender.org/"
11COPYRIGHT="2002-2017 Blender Foundation"
12LICENSE="GNU GPL v2"
13REVISION="14"
14SOURCE_URI="https://download.blender.org/source/blender-$portVersion.tar.gz"
15CHECKSUM_SHA256="4c944c304a49e68ac687ea06f5758204def049b66dc211e1cffa1857716393bc"
16PATCHES="
17	blender-$portVersion.patchset
18	blender-$portVersion-gcc-8.patch
19	"
20ADDITIONAL_FILES="
21	blender.rdef.in
22	Blender.sh
23	"
24
25ARCHITECTURES="!x86_gcc2 ?x86 x86_64"
26SECONDARY_ARCHITECTURES="?x86"
27
28PYTHON_VERSION="3.6"
29
30PROVIDES="
31	blender$secondaryArchSuffix = $portVersion
32	app:blender
33	cmd:blender_thumbnailer.py
34	"
35REQUIRES="
36	haiku$secondaryArchSuffix
37	numpy_python3
38	requests_python3
39	lib:libalembic$secondaryArchSuffix
40	lib:libavcodec$secondaryArchSuffix
41	lib:libavdevice$secondaryArchSuffix
42	lib:libboost_atomic$secondaryArchSuffix
43	lib:libboost_chrono$secondaryArchSuffix
44	lib:libboost_date_time$secondaryArchSuffix
45	lib:libboost_filesystem$secondaryArchSuffix
46	lib:libboost_locale$secondaryArchSuffix
47	lib:libboost_regex$secondaryArchSuffix
48	lib:libboost_system$secondaryArchSuffix
49	lib:libboost_thread$secondaryArchSuffix
50	lib:libexecinfo$secondaryArchSuffix
51	lib:libfftw3$secondaryArchSuffix
52	lib:libfreetype$secondaryArchSuffix
53	lib:libgcc_s$secondaryArchSuffix
54#	lib:libgflags$secondaryArchSuffix
55	lib:libgl$secondaryArchSuffix
56	lib:libglew$secondaryArchSuffix
57#	lib:libglog$secondaryArchSuffix
58	lib:libglu$secondaryArchSuffix
59	lib:libgomp$secondaryArchSuffix
60#	lib:libgtest$secondaryArchSuffix
61	lib:libhalf$secondaryArchSuffix
62	lib:libhdf5$secondaryArchSuffix
63	lib:libiconv$secondaryArchSuffix
64	lib:libiex_2_2$secondaryArchSuffix
65	lib:libilmimf_2_2$secondaryArchSuffix
66	lib:libilmthread_2_2$secondaryArchSuffix
67	lib:libimath_2_2$secondaryArchSuffix
68	lib:libjpeg$secondaryArchSuffix
69	lib:libLLVM_8$secondaryArchSuffix
70	lib:liblzma$secondaryArchSuffix
71	lib:liblzo2$secondaryArchSuffix
72	lib:libopenal$secondaryArchSuffix
73	lib:libopencolladabaseutils$secondaryArchSuffix
74	lib:libopencolorio$secondaryArchSuffix
75	lib:libopenimageio$secondaryArchSuffix
76#	lib:libopenjp2$secondaryArchSuffix
77	lib:libopenvdb$secondaryArchSuffix
78	lib:libosdCPU$secondaryArchSuffix
79	lib:libosdGPU$secondaryArchSuffix
80	lib:liboslcomp$secondaryArchSuffix
81	lib:libpcre$secondaryArchSuffix
82	lib:libpng16$secondaryArchSuffix
83	lib:libpugixml$secondaryArchSuffix
84	lib:libpython${PYTHON_VERSION}m
85	lib:libsdl2_2.0$secondaryArchSuffix
86	lib:libsndfile$secondaryArchSuffix
87	lib:libtbb$secondaryArchSuffix
88	lib:libtiff$secondaryArchSuffix
89	lib:libtinyxml$secondaryArchSuffix
90	lib:libxml2$secondaryArchSuffix
91	lib:libyaml_cpp$secondaryArchSuffix
92	lib:libz$secondaryArchSuffix
93	"
94
95BUILD_REQUIRES="
96	haiku${secondaryArchSuffix}_devel
97	llvm8$secondaryArchSuffix
98	devel:eigen$secondaryArchSuffix
99	devel:libalembic$secondaryArchSuffix
100	devel:libavcodec$secondaryArchSuffix
101	devel:libavdevice$secondaryArchSuffix
102	devel:libboost_atomic$secondaryArchSuffix
103	devel:libboost_chrono$secondaryArchSuffix
104	devel:libboost_date_time$secondaryArchSuffix
105	devel:libboost_filesystem$secondaryArchSuffix
106	devel:libboost_locale$secondaryArchSuffix
107	devel:libboost_regex$secondaryArchSuffix
108	devel:libboost_system$secondaryArchSuffix
109	devel:libboost_thread$secondaryArchSuffix
110	devel:libexecinfo$secondaryArchSuffix
111	devel:libfftw3$secondaryArchSuffix
112	devel:libfreetype$secondaryArchSuffix
113#	devel:libgflags$secondaryArchSuffix
114	devel:libgl$secondaryArchSuffix
115	devel:libglew$secondaryArchSuffix
116#	devel:libglog$secondaryArchSuffix
117	devel:libglu$secondaryArchSuffix
118	devel:libgomp$secondaryArchSuffix
119#	devel:libgtest$secondaryArchSuffix
120	devel:libhalf$secondaryArchSuffix
121	devel:libhdf5$secondaryArchSuffix
122	devel:libiconv$secondaryArchSuffix
123	devel:libiex_2_2$secondaryArchSuffix
124	devel:libilmimf_2_2$secondaryArchSuffix
125	devel:libilmthread_2_2$secondaryArchSuffix
126	devel:libimath_2_2$secondaryArchSuffix
127	devel:libjpeg$secondaryArchSuffix
128	devel:liblzma$secondaryArchSuffix
129	devel:liblzo2$secondaryArchSuffix
130	devel:libopenal$secondaryArchSuffix
131	devel:libopencolladabaseutils$secondaryArchSuffix
132	devel:libopencolorio$secondaryArchSuffix
133	devel:libopenimageio$secondaryArchSuffix
134#	devel:libopenjp2$secondaryArchSuffix
135	devel:libopenvdb$secondaryArchSuffix
136	devel:libosdCPU$secondaryArchSuffix
137	devel:libosdGPU$secondaryArchSuffix
138	devel:liboslcomp$secondaryArchSuffix
139	devel:libpcre$secondaryArchSuffix
140	devel:libpng16$secondaryArchSuffix
141	devel:libpugixml$secondaryArchSuffix
142	devel:libpython${PYTHON_VERSION}m
143	devel:libsdl2_2.0$secondaryArchSuffix
144	devel:libsndfile$secondaryArchSuffix
145	devel:libtbb$secondaryArchSuffix
146	devel:libtiff$secondaryArchSuffix
147	devel:libtinyxml$secondaryArchSuffix
148	devel:libxml2$secondaryArchSuffix
149	devel:libyaml_cpp$secondaryArchSuffix
150	devel:libz$secondaryArchSuffix
151	lib:libavdevice$secondaryArchSuffix # REQUIRED
152	"
153BUILD_PREREQUIRES="
154	llvm8$secondaryArchSuffix
155	numpy_python3
156	requests_python3
157	cmd:cmake
158	cmd:find
159	cmd:gcc$secondaryArchSuffix
160	cmd:git
161	cmd:ld$secondaryArchSuffix
162	cmd:make
163	cmd:python${PYTHON_VERSION}
164	cmd:sed
165	cmd:strip
166	"
167
168defineDebugInfoPackage blender$secondaryArchSuffix \
169	$appsDir/Blender/Blender
170
171BUILD()
172{
173	NUMPY_FOLDER=`finddir B_SYSTEM_LIB_DIRECTORY`/python${PYTHON_VERSION}/vendor-packages/
174	PORT_SUBFOLDER=`echo $portVersion | sed 's/.$//'`
175
176	# OpenCOLLADA workaround
177	COLLADA_HEADERS="`finddir B_SYSTEM_HEADERS_DIRECTORY`/opencollada"
178	COLLADA_INC_FLAGS="-I$COLLADA_HEADERS/COLLADABaseUtils \
179		-I$COLLADA_HEADERS/COLLADAFramework \
180		-I$COLLADA_HEADERS/COLLADASaxFrameworkLoader \
181		-I$COLLADA_HEADERS/COLLADAStreamWriter \
182		-I$COLLADA_HEADERS/GeneratedSaxParser"
183
184	# Haiku specific settings
185	BLENDER_PLATFORM_SPECIFIC="-DCMAKE_INSTALL_PREFIX:PATH=$appsDir/Blender \
186		-DPYTHON_VERSION=${PYTHON_VERSION} \
187		-DPYTHON_INCLUDE_DIR=`finddir B_SYSTEM_HEADERS_DIRECTORY`/python${PYTHON_VERSION}m/ \
188		-DPYTHON_LIBRARY=`finddir B_SYSTEM_LIB_DIRECTORY`/libpython${PYTHON_VERSION}m.so.1.0 \
189		-DPYTHON_EXECUTABLE=/bin/python${PYTHON_VERSION} \
190		-DPYTHON_NUMPY_PATH=$NUMPY_FOLDER \
191		-DWITH_GHOST_SDL=ON \
192		-Wno-dev"
193
194	# Release settings breaks build on Haiku
195	BLENDER_BUGOUS="-DWITH_CYCLES_LOGGING=OFF \
196		-DWITH_GAMEENGINE_DECKLINK=OFF \
197		-DWITH_GTESTS=OFF \
198		-DWITH_SYSTEM_EIGEN3=ON \
199		-DWITH_SYSTEM_LZO=ON"
200
201	# Missing deps on Haiku
202	BLENDER_MISSING="-DWITH_JACK=OFF \
203		-DWITH_MEM_JEMALLOC=OFF \
204		-DWITH_INPUT_NDOF=OFF"
205
206	# Release build settings
207	BLENDER_RELEASE="-DWITH_ALEMBIC=ON \
208		-DWITH_BUILDINFO=ON \
209		-DWITH_BULLET=ON \
210		-DWITH_CODEC_AVI=ON \
211		-DWITH_CODEC_FFMPEG=ON \
212		-DWITH_CODEC_SNDFILE=ON \
213		-DWITH_CYCLES=ON \
214		-DWITH_CYCLES_OPENSUBDIV=ON \
215		-DWITH_CYCLES_OSL=ON \
216		-DWITH_FFTW3=ON \
217		-DWITH_LIBMV=ON \
218		-DWITH_LIBMV_SCHUR_SPECIALIZATIONS=ON \
219		-DWITH_GAMEENGINE=ON \
220		-DWITH_COMPOSITOR=ON \
221		-DWITH_FREESTYLE=ON \
222		-DWITH_GHOST_XDND=ON \
223		-DWITH_IK_SOLVER=ON \
224		-DWITH_IK_ITASC=ON \
225		-DWITH_IMAGE_CINEON=ON \
226		-DWITH_IMAGE_DDS=ON \
227		-DWITH_IMAGE_FRAMESERVER=ON \
228		-DWITH_IMAGE_HDR=ON \
229		-DWITH_IMAGE_OPENEXR=ON \
230		-DWITH_IMAGE_TIFF=ON \
231		-DWITH_INTERNATIONAL=ON \
232		-DWITH_LZMA=ON \
233		-DWITH_LZO=ON \
234		-DWITH_MOD_BOOLEAN=ON \
235		-DWITH_MOD_FLUID=ON \
236		-DWITH_MOD_REMESH=ON \
237		-DWITH_MOD_SMOKE=ON \
238		-DWITH_MOD_OCEANSIM=ON \
239		-DWITH_AUDASPACE=ON \
240		-DWITH_OPENAL=ON \
241		-DWITH_OPENCOLLADA=ON \
242		-DWITH_OPENCOLORIO=ON \
243		-DWITH_OPENMP=ON \
244		-DWITH_OPENVDB=ON \
245		-DWITH_OPENVDB_BLOSC=ON \
246		-DWITH_PYTHON_INSTALL=ON \
247		-DWITH_RAYOPTIMIZATION=ON \
248		-DWITH_SDL=ON \
249		-DWITH_PLAYER=OFF \
250		-DWITH_OPENSUBDIV=ON \
251		-DWITH_PYTHON_INSTALL=ON \
252		-DWITH_PYTHON_INSTALL_NUMPY=ON \
253		-DWITH_PYTHON_INSTALL_REQUESTS=ON"
254
255	# Extra CXX Flags
256	BLENDER_CXX="-std=c++11 $COLLADA_INC_FLAGS"
257
258	mkdir -p build_haiku
259	cd build_haiku
260
261	cmake .. \
262		$BLENDER_PLATFORM_SPECIFIC \
263		$BLENDER_BUGOUS \
264		$BLENDER_MISSING \
265		$BLENDER_RELEASE \
266		-DCMAKE_CXX_FLAGS="$BLENDER_CXX"
267
268	make $jobArgs
269}
270
271INSTALL()
272{
273	cd build_haiku
274	make install $jobArgs
275
276	mv $appsDir/Blender/blender $appsDir/Blender/Blender
277
278	local MAJOR="`echo "$portVersion" | cut -d. -f1`"
279	local MIDDLE="`echo "$portVersion" | cut -d. -f2 | sed 's/[a-z]*//g'`"
280	local MINOR="`echo 0`"
281	sed \
282		-e "s|@MAJOR@|$MAJOR|" \
283		-e "s|@MIDDLE@|$MIDDLE|" \
284		-e "s|@MINOR@|$MINOR|" \
285		$portDir/additional-files/blender.rdef.in > blender.rdef
286
287	addResourcesToBinaries blender.rdef \
288		$appsDir/Blender/Blender
289
290	# Startscript for windowed mode (WORKAROUND)
291	cp $portDir/additional-files/Blender.sh $appsDir/Blender/
292	chmod +x $appsDir/Blender/Blender.sh
293
294	# Installing extra-attribs
295	rc blender.rdef
296	resattr -o $appsDir/Blender/Blender.sh \
297		blender.rsrc
298
299	cd $appsDir/Blender
300	mkdir -p $docDir/blender
301
302	mv GPL-license.txt GPL3-license.txt \
303		LICENSE-bfont.ttf.txt jemalloc-license.txt \
304		Python-license.txt copyright.txt readme.html \
305		blender.svg ocio-license.txt LICENSE-bmonofont-i18n.ttf.txt \
306		LICENSE-droidsans.ttf.txt $docDir/blender
307
308	rm -rf blender.desktop
309
310	addAppDeskbarSymlink $appsDir/Blender/Blender.sh Blender
311
312	mkdir -p $binDir
313	ln -s $appsDir/Blender/blender_thumbnailer.py \
314		$binDir/blender_thumbnailer.py
315}
316
317TEST()
318{
319	cd build_haiku
320	# The whole testcase is around 1GB and not included. Get it from here:
321	# svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/tests
322	# and put it in "work-2.xx/sources/lib"
323	make test
324}
325