graphics/Blender: Added (3D Content Creation Suite).

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Christoph Willing 2015-08-02 13:58:51 +07:00 committed by Willy Sudiarto Raharjo
parent 402bb2c1c1
commit 26472c0da3
8 changed files with 307 additions and 0 deletions

View File

@ -0,0 +1,141 @@
#!/bin/sh
# Slackware build script for blender
# Copyright 2015 Chrisoph Willing Brisbane, Australia
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
SRCNAM=blender
PKGNAM=Blender
VERSION=${VERSION:-2.74}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PYTHON_VERSION=$(python3 -c "import sys; print(sys.version[:3])")
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$SRCNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $SRCNAM-$VERSION
tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
cd $SRCNAM-$VERSION
patch -p0 < $CWD/buildinfo-$VERSION.diff
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
mkdir -p build
cd build
cmake ../ \
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DWITH_INSTALL_PORTABLE:BOOL=OFF \
-DWITH_BUILDINFO:BOOL=ON \
-DWITH_OPENCOLLADA:BOOL=ON \
-DWITH_OPENCOLORIO:BOOL=ON \
-DPYTHON_VERSION=$PYTHON_VERSION \
-DWITH_PYTHON_INSTALL:BOOL=ON \
-DWITH_PYTHON_INSTALL_NUMPY:BOOL=ON \
-DWITH_CODEC_FFMPEG:BOOL=ON \
-DWITH_OPENAL:BOOL=ON \
-DWITH_JACK:BOOL=ON \
-DWITH_JACK_DYNLOAD:BOOL=ON \
-DPYTHON_LIBPATH:PATH=/usr/lib${LIBDIRSUFFIX} \
-DWITH_CODEC_SNDFILE:BOOL=ON \
-DWITH_FFTW3:BOOL=ON \
-DWITH_GAMEENGINE:BOOL=ON \
-DWITH_PLAYER:BOOL=ON \
-DWITH_IMAGE_REDCODE:BOOL=ON \
-DWITH_IMAGE_OPENJPEG:BOOL=ON \
-DWITH_SYSTEM_OPENJPEG:BOOL=ON \
-DWITH_MEM_JEMALLOC:BOOL=ON \
-DWITH_MEM_VALGRIND:BOOL=ON \
-DWITH_MOD_OCEANSIM:BOOL=ON \
-DWITH_SDL:BOOL=ON \
-DWITH_SDL_DYNLOAD:BOOL=ON \
-DCMAKE_BUILD_TYPE=Release \
make
make install DESTDIR=$PKG
cd ..
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
BLENDERBINS="blender blenderplayer"
for bin in $BLENDERBINS ; do
mv $PKG/usr/bin/$bin $PKG/usr/bin/$bin.bin
cat <<EOF >$PKG/usr/bin/$bin
#!/bin/sh
export PYTHONPATH=/usr/share/$SRCNAM/$VERSION/python/lib$LIBDIRSUFFIX/python$PYTHON_VERSION
export LD_LIBRARY_PATH=/usr/lib$LIBDIRSUFFIX/opencollada
exec $bin.bin
EOF
chmod 0755 $PKG/usr/bin/$bin
done
mkdir -p $PKG/usr/man/man1
./doc/manpage/blender.1.py build/bin/blender $PKG/usr/man/man1/blender.1
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
mv $PKG/usr/share/doc/$SRCNAM/* $PKG/usr/doc/$PKGNAM-$VERSION/
rm -rf $PKG/usr/share/doc
cat $CWD/$PKGNAM.SlackBuild > $PKG/usr/doc/$PKGNAM-$VERSION/$PKGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PKGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

View File

@ -0,0 +1,10 @@
PRGNAM="Blender"
VERSION="2.74"
HOMEPAGE="http://blender.org"
DOWNLOAD="http://mirror.cs.umn.edu/blender.org/source/blender-2.74.tar.gz"
MD5SUM="488151953d69d63bedd8ed59f92daf3b"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="ffmpeg jack-audio-connection-kit opencollada openjpeg python-requests valgrind numpy3 SDL2 openimageio freealut jemalloc"
MAINTAINER="Christoph Willing"
EMAIL="chris.willing@iinet.net.au"

9
graphics/Blender/README Normal file
View File

@ -0,0 +1,9 @@
Blender is an integrated suite of free and open source tools enabling
the creation of a broad range of 3D content with the singular
benefits of cross- platform interoperability. It can be used to
create 3D visualizations, stills as well as broadcast and cinema
quality video. It features fully integrated creation suite, offering
a broad range of essential tools for the creation of 3D content,
including modeling, uv-mapping, texturing, particle and other
simulation, scripting, rendering, compositing,post-production, and
game creation.

View File

@ -0,0 +1,83 @@
This script builds Blender from its source code, rather than repackaging
an existing binary version. The process is therefore more complex and
time consuming but allows finer tuning of capabilities of the resulting
package. Working through the prerequisite packages from the REQUIRES field
of Blender.info results in the following basic build order:
multimedia/ffmpeg
audio/jack-audio-connection-kit
libraries/opencv
graphics/opencollada
libraries/OpenAL
libraries/openjpeg
python/python3
python/python-requests
development/valgrind
libraries/LibRaw
libraries/libwebp
development/numpy3
development/SDL2
graphics/opencolorio
graphics/openimageio
libraries/jemalloc
libraries/freealut
graphics/Blender
When generating a new build order, python3 should first be added to the
REQUIRES field of python-requests.info.
To facilitate the greatest utility for Blender, its is strongly
suggested that a number of standard SBo packages be built with
a more complete set of features than provided by the default scripts:
1. the opencv package could/should first be built with additional
features by preinstalling some other packages e.g.
REQUIRES="
opencl-headers libjpeg-turbo ffmpeg Sphinx libdc1394
numpy3 gtkglext tbb jdk
"
The cmake configuration in opencv.SlackBuild can be replaced with:
cmake \
-DCMAKE_C_FLAGS="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_SHARED_LIBS=ON \
-DENABLE_PRECOMPILED_HEADERS=OFF \
-DLIB_SUFFIX=$LIBDIRSUFFIX \
-DWITH_TBB=ON \
-DWITH_OPENCL=ON \
-DWITH_OPENGL=ON \
-DWITH_QT=ON \
-DWITH_XINE=ON \
-DBUILD_EXAMPLES=ON \
-DINSTALL_C_EXAMPLES=ON \
-DINSTALL_PYTHON_EXAMPLES=ON \
-DBUILD_NEW_PYTHON_SUPPORT=ON \
-DWITH_FFMPEG=ON \
-DCMAKE_SKIP_RPATH=ON \
-DWITH_1394:BOOL=ON \
..
If resources allow, the very large cudatoolkit package is another
possible package which may be preinstalled and be utilised by the
opencv build process.
2. the ffmpeg package could/should first be built with additional
features by preinstalling some other packages e.g.
REQUIRES="lame x264
speex libbluray xvidcore OpenAL libmodplug frei0r libdc1394 libavc1394
libiec61883 ladspa_sdk gsm rtmpdump libvpx libva twolame celt faac
dirac schroedinger openjpeg "
3. the numpy SlackBuild at SBo does not build the python3 modules
which are needed to be useful for any numpy-related python scripting in
blender. It is therefore numpy3 which is the prerequisite for this build
of blender.
Due to the official versions of some software packages included in
Slackware 14.1, the most recent version of Blender that can be built from
the source code is Blender-2.74. Building more recent versions of
Blender would require replacement of at least the openexr and ilmbase
packages (both already updated in -current).
NB. if building for -current (14.2), use SBo's openjpeg1 instead of
Slackware -current's official openjpeg (version 2.x.x).

View File

@ -0,0 +1,18 @@
--- build_files/cmake/buildinfo.cmake.orig 2015-07-28 11:59:14.020100604 +0000
+++ build_files/cmake/buildinfo.cmake 2015-07-28 12:18:20.021045004 +0000
@@ -138,11 +138,12 @@
execute_process(COMMAND cmd /c time /t OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
+# Timestamp from $(date --date='TZ="UTC" 16:56 07-Jul-15' +%s) - time & date of commit
# Write a file with the BUILD_HASH define
file(WRITE buildinfo.h.txt
- "#define BUILD_HASH \"${MY_WC_HASH}\"\n"
- "#define BUILD_COMMIT_TIMESTAMP ${MY_WC_COMMIT_TIMESTAMP}\n"
- "#define BUILD_BRANCH \"${MY_WC_BRANCH}\"\n"
+ "#define BUILD_HASH \"rB000dfc03190d\"\n"
+ "#define BUILD_COMMIT_TIMESTAMP 1427816340\n"
+ "#define BUILD_BRANCH \"master\"\n"
"#define BUILD_DATE \"${BUILD_DATE}\"\n"
"#define BUILD_TIME \"${BUILD_TIME}\"\n"
)

View File

@ -0,0 +1,18 @@
--- build_files/cmake/buildinfo.cmake.orig 2015-07-28 11:59:14.020100604 +0000
+++ build_files/cmake/buildinfo.cmake 2015-07-28 12:18:20.021045004 +0000
@@ -138,11 +138,12 @@
execute_process(COMMAND cmd /c time /t OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
+# Timestamp from $(date --date='TZ="UTC" 16:56 07-Jul-15' +%s) - time & date of commit
# Write a file with the BUILD_HASH define
file(WRITE buildinfo.h.txt
- "#define BUILD_HASH \"${MY_WC_HASH}\"\n"
- "#define BUILD_COMMIT_TIMESTAMP ${MY_WC_COMMIT_TIMESTAMP}\n"
- "#define BUILD_BRANCH \"${MY_WC_BRANCH}\"\n"
+ "#define BUILD_HASH \"rBc27589e19fc0\"\n"
+ "#define BUILD_COMMIT_TIMESTAMP 1436288160\n"
+ "#define BUILD_BRANCH \"master\"\n"
"#define BUILD_DATE \"${BUILD_DATE}\"\n"
"#define BUILD_TIME \"${BUILD_TIME}\"\n"
)

View File

@ -0,0 +1,9 @@
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi
if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
if [ -x /usr/bin/gtk-update-icon-cache ]; then
/usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
fi
fi

View File

@ -0,0 +1,19 @@
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
Blender: Blender (3D Content Creation Suite)
Blender:
Blender: Blender is the free open source 3D content creation suite, available
Blender: for all major operating systems under the GNU General Public License.
Blender:
Blender: http://blender.org
Blender:
Blender:
Blender:
Blender:
Blender: