summaryrefslogtreecommitdiffstats
path: root/graphics/Blender/Blender.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/Blender/Blender.SlackBuild')
-rw-r--r--graphics/Blender/Blender.SlackBuild59
1 files changed, 44 insertions, 15 deletions
diff --git a/graphics/Blender/Blender.SlackBuild b/graphics/Blender/Blender.SlackBuild
index 06d9917ec5..93a62dc7a4 100644
--- a/graphics/Blender/Blender.SlackBuild
+++ b/graphics/Blender/Blender.SlackBuild
@@ -1,8 +1,8 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for Blender
-# Copyright 2015-2020 Christoph Willing, Brisbane Australia
+# Copyright 2015-2023 Christoph Willing, Brisbane Australia
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,15 +22,23 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 20220322 bkw: Modified by SlackBuilds.org, BUILD=2:
+# - make embree optional (makes it possible to build Blender on 32-bit,
+# since embree is 64-bit-only).
+# - add patch to fix 32-bit compilation.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=Blender
-VERSION=${VERSION:-2.83.8}
-BUILD=${BUILD:-1}
+VERSION=${VERSION:-3.3.10}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
SRCNAM=blender
BASE_VERSION=${BASE_VERSION:-$( echo $VERSION | sed -e 's/[^0-9.]*//g')}
-PYTHON_VERSION=$(python3 -c "import sys; print(sys.version[:3])")
+PYTHON_VERSION=$(python3 -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))')
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -40,9 +48,13 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
-PKG=$TMP/package-$SRCNAM
+PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
@@ -69,6 +81,12 @@ if [ -d /usr/include/cuda ]; then
fi
fi
+embree="-DWITH_CYCLES_EMBREE=OFF"
+# If embree is installed, use it unless user says EMBREE=no.
+if [ -d /usr/include/embree3 -a "${EMBREE:-yes}" = "yes" ]; then
+ embree="-DWITH_CYCLES_EMBREE=ON"
+fi
+
set -e
rm -rf $PKG
@@ -80,9 +98,16 @@ cd $SRCNAM-$VERSION
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 \
+ -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 {} \;
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
+
+sed -i -e '/#include <stdio.h>/a #include <iostream>' intern/locale/boost_locale_wrapper.cpp
+sed -i -e '/#include "util\/windows.h"/a #include <system_error>' intern/cycles/util/thread.cpp
+sed -i -e '/#include <fstream>/a #include <cstdint>' extern/quadriflow/src/loader.cpp
+
+# 20220322 bkw: 32-bit needs this
+[ -z "$LIBDIRSUFFIX" ] && patch -p1 < $CWD/overloaded_min.diff
mkdir -p build
cd build
@@ -115,6 +140,8 @@ cd build
-DWITH_SDL_DYNLOAD:BOOL=ON \
-DCMAKE_BUILD_TYPE=Release \
$cuda \
+ $embree \
+ -DCMAKE_EXE_LINKER_FLAGS:STRING="-lboost_locale"
make
make install DESTDIR=$PKG
@@ -128,17 +155,19 @@ 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/$BASE_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
+# Recent OSL breaks manpage generation
+if [ ! -e "/usr/lib$LIBDIRSUFFIX/liboslcomp.so" ]; then
+ mkdir -p $PKG/usr/man/man1
+ ./doc/manpage/blender.1.py --blender build/bin/blender --output $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
+fi
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
mv $PKG/usr/share/doc/$SRCNAM/* $PKG/usr/doc/$PRGNAM-$VERSION/
@@ -150,4 +179,4 @@ 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/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE