0
0
Fork 0
haikuports/media-gfx/blender/blender-2.79b.recipe

297 lines
10 KiB
Bash
Raw Permalink Normal View History

SUMMARY="3D Creation/Animation/Publishing System"
DESCRIPTION="Blender is the free and open source 3D creation suite. It \
supports the entirety of the 3D pipeline—modeling, rigging, animation, \
simulation, rendering, compositing and motion tracking, even video editing \
and game creation.
Advanced users employ Blenders API for Python scripting to customize the \
application and write specialized tools; often these are included in Blenders \
future releases. Blender is well suited to individuals and small studios who \
benefit from its unified pipeline and responsive development process."
2018-05-30 05:02:58 +00:00
HOMEPAGE="https://www.blender.org/"
2021-02-27 18:53:22 +00:00
COPYRIGHT="2002-2018 Blender Foundation"
LICENSE="GNU GPL v2"
REVISION="25"
2018-05-30 08:21:13 +00:00
SOURCE_URI="https://download.blender.org/source/blender-$portVersion.tar.gz"
2018-05-07 18:05:52 +00:00
CHECKSUM_SHA256="4c944c304a49e68ac687ea06f5758204def049b66dc211e1cffa1857716393bc"
2019-07-26 10:19:29 +00:00
PATCHES="
blender-$portVersion.patchset
"
ADDITIONAL_FILES="
blender.rdef.in
Blender.sh
"
ARCHITECTURES="?all !x86_gcc2"
SECONDARY_ARCHITECTURES="?x86"
PYTHON_VERSION="3.6"
PROVIDES="
blender$secondaryArchSuffix = $portVersion
app:blender
cmd:blender_thumbnailer.py${secondaryArchSuffix}
"
REQUIRES="
haiku$secondaryArchSuffix
2021-02-27 18:53:22 +00:00
# numpy${secondaryArchSuffix}_python3
# requests_python3
lib:libalembic$secondaryArchSuffix
lib:libavcodec$secondaryArchSuffix
lib:libavdevice$secondaryArchSuffix
lib:libboost_atomic$secondaryArchSuffix
lib:libboost_chrono$secondaryArchSuffix
lib:libboost_date_time$secondaryArchSuffix
lib:libboost_filesystem$secondaryArchSuffix
lib:libboost_locale$secondaryArchSuffix
lib:libboost_regex$secondaryArchSuffix
lib:libboost_system$secondaryArchSuffix
lib:libboost_thread$secondaryArchSuffix
2018-05-07 18:05:52 +00:00
lib:libexecinfo$secondaryArchSuffix
lib:libfftw3$secondaryArchSuffix
lib:libfreetype$secondaryArchSuffix
lib:libgcc_s$secondaryArchSuffix
lib:libgl$secondaryArchSuffix
lib:libglew$secondaryArchSuffix
lib:libglu$secondaryArchSuffix
lib:libgomp$secondaryArchSuffix
lib:libhalf_2_4$secondaryArchSuffix
lib:libhdf5$secondaryArchSuffix
lib:libiconv$secondaryArchSuffix
lib:libiex_2_4$secondaryArchSuffix
lib:libilmimf_2_4$secondaryArchSuffix
lib:libilmthread_2_4$secondaryArchSuffix
lib:libimath_2_4$secondaryArchSuffix
lib:libLLVM_9$secondaryArchSuffix
lib:liblzma$secondaryArchSuffix
lib:liblzo2$secondaryArchSuffix
lib:libopenal$secondaryArchSuffix
lib:libopencolladabaseutils$secondaryArchSuffix
lib:libopencolorio$secondaryArchSuffix
lib:libopenimageio$secondaryArchSuffix
2021-02-27 18:53:22 +00:00
# lib:libopenvdb$secondaryArchSuffix
lib:libosdCPU$secondaryArchSuffix
lib:libosdGPU$secondaryArchSuffix
# lib:liboslcomp$secondaryArchSuffix
lib:libpcre$secondaryArchSuffix
lib:libpng16$secondaryArchSuffix
lib:libpugixml$secondaryArchSuffix
lib:libpython${PYTHON_VERSION}m$secondaryArchSuffix
lib:libsdl2_2.0$secondaryArchSuffix
lib:libsndfile$secondaryArchSuffix
lib:libtbb$secondaryArchSuffix
lib:libtiff$secondaryArchSuffix
2018-09-07 14:15:17 +00:00
lib:libtinyxml$secondaryArchSuffix
2021-02-27 18:53:22 +00:00
lib:libturbojpeg$secondaryArchSuffix
lib:libxml2$secondaryArchSuffix
lib:libyaml_cpp$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:eigen$secondaryArchSuffix
devel:libalembic$secondaryArchSuffix
devel:libavcodec$secondaryArchSuffix
devel:libavdevice$secondaryArchSuffix
2021-03-01 22:11:10 +00:00
devel:libboost_atomic$secondaryArchSuffix >= 1.69.0
devel:libboost_chrono$secondaryArchSuffix >= 1.69.0
devel:libboost_date_time$secondaryArchSuffix >= 1.69.0
devel:libboost_filesystem$secondaryArchSuffix >= 1.69.0
devel:libboost_locale$secondaryArchSuffix >= 1.69.0
devel:libboost_regex$secondaryArchSuffix >= 1.69.0
devel:libboost_system$secondaryArchSuffix >= 1.69.0
devel:libboost_thread$secondaryArchSuffix >= 1.69.0
2018-05-07 18:05:52 +00:00
devel:libexecinfo$secondaryArchSuffix
devel:libfftw3$secondaryArchSuffix
devel:libfreetype$secondaryArchSuffix
devel:libgl$secondaryArchSuffix
devel:libglew$secondaryArchSuffix
devel:libglu$secondaryArchSuffix
devel:libgomp$secondaryArchSuffix
devel:libhalf_2_4$secondaryArchSuffix
devel:libhdf5$secondaryArchSuffix
devel:libiconv$secondaryArchSuffix
devel:libiex_2_4$secondaryArchSuffix
devel:libilmimf_2_4$secondaryArchSuffix
devel:libilmthread_2_4$secondaryArchSuffix
devel:libimath_2_4$secondaryArchSuffix
devel:libllvm_9$secondaryArchSuffix
devel:liblzma$secondaryArchSuffix
devel:liblzo2$secondaryArchSuffix
devel:libopenal$secondaryArchSuffix
devel:libopencolladabaseutils$secondaryArchSuffix
devel:libopencolorio$secondaryArchSuffix
devel:libopenimageio$secondaryArchSuffix
2021-02-27 18:53:22 +00:00
# devel:libopenvdb$secondaryArchSuffix
devel:libosdCPU$secondaryArchSuffix
devel:libosdGPU$secondaryArchSuffix
# devel:liboslcomp$secondaryArchSuffix
devel:libpcre$secondaryArchSuffix
devel:libpng16$secondaryArchSuffix
devel:libpugixml$secondaryArchSuffix
devel:libpython${PYTHON_VERSION}m$secondaryArchSuffix
devel:libsdl2_2.0$secondaryArchSuffix
devel:libsndfile$secondaryArchSuffix
devel:libtbb$secondaryArchSuffix
devel:libtiff$secondaryArchSuffix
2018-09-07 14:15:17 +00:00
devel:libtinyxml$secondaryArchSuffix
2021-02-27 18:53:22 +00:00
devel:libturbojpeg$secondaryArchSuffix
devel:libxml2$secondaryArchSuffix
devel:libyaml_cpp$secondaryArchSuffix
devel:libz$secondaryArchSuffix
2018-09-07 14:15:17 +00:00
lib:libavdevice$secondaryArchSuffix # REQUIRED
"
BUILD_PREREQUIRES="
2021-02-27 18:53:22 +00:00
# numpy${secondaryArchSuffix}_python3
# requests_python3
cmd:cmake
cmd:find
2018-09-07 14:15:17 +00:00
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:ninja
cmd:python${PYTHON_VERSION}
cmd:sed
cmd:strip
"
2018-05-07 18:05:52 +00:00
defineDebugInfoPackage blender$secondaryArchSuffix \
$appsDir/Blender/Blender
PATCH()
{
# Blender 2.79 doesn't support Python3.7 correctly
# and Python3.6 package doesn't provide cmd:python3.
# This should be removed if we switch to Blender 2.8x.
find . -type f -name "*.py" | xargs sed -i -e 's,python3,python3.6,g'
}
BUILD()
{
# IMPORTANT INFORMATION, PLEASE READ BEFORE CHANGE ANYTHING.
# Please do not make any changes here if they not *REALLY* necessary.
# Keep this list short and tidy.
# Blender uses the following settings to produce the official releases:
# https://github.com/blender/blender/blob/master/build_files/cmake/config/blender_release.cmake
# This settings are used on Haiku too, but we had to override some settings.
# We should follow their settings as closely as possible to make interoperability possible between diferent platforms.
# In the recipe there are 3 group for the compiler flags:
# - platform specific (required to build Blender on Haiku)
# - bugous (these settings should work but they breaks build / functionality on Haiku, should be fixed)
# - missing deps (required dependency is not (yet) available for Haiku, should be ported)
# If a change required please put it in the correct category, if you are unsure, ask at HaikuPorts.
INCLUDE_DIR="`finddir B_SYSTEM_HEADERS_DIRECTORY`${secondaryArchSubDir}"
# Haiku specific settings
BLENDER_PLATFORM_SPECIFIC="-DCMAKE_INSTALL_PREFIX:PATH=$appsDir/Blender \
-DPYTHON_VERSION=${PYTHON_VERSION} \
-DPYTHON_INCLUDE_DIR=`finddir B_SYSTEM_HEADERS_DIRECTORY`/python${PYTHON_VERSION}m/ \
-DPYTHON_LIBRARY=`finddir B_SYSTEM_LIB_DIRECTORY`${secondaryArchSubDir}/libpython${PYTHON_VERSION}m.so.1.0 \
-DPYTHON_EXECUTABLE=/bin/python${PYTHON_VERSION} \
-DPYTHON_NUMPY_PATH=`finddir B_SYSTEM_LIB_DIRECTORY`/python${PYTHON_VERSION}/vendor-packages \
-DPYTHON_REQUESTS_PATH=`finddir B_SYSTEM_LIB_DIRECTORY`/python${PYTHON_VERSION}/vendor-packages \
-DOPENCOLLADA_COLLADABASEUTILS_INCLUDE_DIR=${INCLUDE_DIR}/opencollada/COLLADABaseUtils \
-DOPENCOLLADA_COLLADAFRAMEWORK_INCLUDE_DIR=${INCLUDE_DIR}/opencollada/COLLADAFramework \
-DOPENCOLLADA_COLLADASAXFRAMEWORKLOADER_INCLUDE_DIR=${INCLUDE_DIR}/opencollada/COLLADASaxFrameworkLoader \
-DOPENCOLLADA_COLLADASTREAMWRITER_INCLUDE_DIR=${INCLUDE_DIR}/opencollada/COLLADAStreamWriter \
-DOPENCOLLADA_GENERATEDSAXPARSER_INCLUDE_DIR=${INCLUDE_DIR}/opencollada/GeneratedSaxParser \
-DOPENJPEG_INCLUDE_DIR=${INCLUDE_DIR} \
-DOPENJPEG_LIBRARY=`finddir B_SYSTEM_LIB_DIRECTORY`${secondaryArchSubDir} \
-DOPENSUBDIV_INCLUDE_DIR=${INCLUDE_DIR} \
-DZLIB_LIBRARY_RELEASE=`finddir B_SYSTEM_LIB_DIRECTORY`${secondaryArchSubDir}/libz.so.1 \
2018-05-07 18:05:52 +00:00
-DWITH_GHOST_SDL=ON \
-DWITH_BUILDINFO=OFF \
-DWITH_PYTHON_INSTALL=OFF \
-DWITH_PYTHON_INSTALL_NUMPY=OFF \
-DWITH_PYTHON_INSTALL_REQUESTS=OFF \
2021-02-27 18:53:22 +00:00
-DWITH_PYTHON_MODULE=OFF \
-DWITH_PYTHON_SAFETY=OFF \
-DCMAKE_SKIP_RPATH=ON \
-Wno-dev"
# Release settings breaks build on Haiku
BLENDER_BUGOUS="-DWITH_CYCLES_LOGGING=OFF \
2018-05-07 18:05:52 +00:00
-DWITH_GAMEENGINE_DECKLINK=OFF \
-DWITH_GTESTS=OFF \
-DWITH_SYSTEM_EIGEN3=ON \
-DWITH_SYSTEM_LZO=ON"
# Missing deps on Haiku
BLENDER_MISSING="-DWITH_JACK=OFF \
-DWITH_MEM_JEMALLOC=OFF \
-DWITH_INPUT_NDOF=OFF"
# Extra CXX Flags
BLENDER_CXX="-std=c++11"
mkdir -p build_haiku
cd build_haiku
cmake .. \
-G Ninja \
-C ../build_files/cmake/config/blender_release.cmake \
$BLENDER_PLATFORM_SPECIFIC \
$BLENDER_BUGOUS \
$BLENDER_MISSING \
-DCMAKE_CXX_FLAGS="$BLENDER_CXX"
ninja $jobArgs
}
INSTALL()
{
cd build_haiku
ninja install $jobArgs
mv $appsDir/Blender/blender $appsDir/Blender/Blender
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2 | sed 's/[a-z]*//g'`"
local MINOR="`echo 0`"
sed \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|$MINOR|" \
$portDir/additional-files/blender.rdef.in > blender.rdef
addResourcesToBinaries blender.rdef \
$appsDir/Blender/Blender
# Startscript for windowed mode (WORKAROUND)
cp $portDir/additional-files/Blender.sh $appsDir/Blender/
chmod +x $appsDir/Blender/Blender.sh
# Installing extra-attribs
rc blender.rdef
resattr -o $appsDir/Blender/Blender.sh \
blender.rsrc
cd $appsDir/Blender
mkdir -p $docDir/blender
mv GPL-license.txt GPL3-license.txt \
LICENSE-bfont.ttf.txt jemalloc-license.txt \
Python-license.txt copyright.txt readme.html \
blender.svg ocio-license.txt LICENSE-bmonofont-i18n.ttf.txt \
LICENSE-droidsans.ttf.txt $docDir/blender
rm -rf blender.desktop
addAppDeskbarSymlink $appsDir/Blender/Blender.sh Blender
mkdir -p $binDir
ln -s $appsDir/Blender/blender_thumbnailer.py \
$binDir/blender_thumbnailer.py
}
TEST()
{
cd build_haiku
# The whole testcase is around 1GB and not included. Get it from here:
# svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/tests
# and put it in "work-2.xx/sources/lib"
make test
}