aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2022-03-22 16:11:32 -0400
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2022-03-26 01:20:09 +0700
commit59efd1ebb128f6d79c2a1069819872621afe5201 (patch)
treedd91ca5e9230e87dc0b86512a2daf692b0821b59 /graphics
parentf128f913539e020394e379eeb64be99a90871478 (diff)
graphics/Blender: Fix 32-bit build (make embree optional).
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'graphics')
-rw-r--r--graphics/Blender/Blender.SlackBuild27
-rw-r--r--graphics/Blender/Blender.info2
-rw-r--r--graphics/Blender/README23
-rw-r--r--graphics/Blender/overloaded_min.diff51
4 files changed, 78 insertions, 25 deletions
diff --git a/graphics/Blender/Blender.SlackBuild b/graphics/Blender/Blender.SlackBuild
index 6debc5493e323..6436396a755a9 100644
--- a/graphics/Blender/Blender.SlackBuild
+++ b/graphics/Blender/Blender.SlackBuild
@@ -22,11 +22,16 @@
# 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:-3.0.1}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -43,9 +48,6 @@ if [ -z "$ARCH" ]; then
esac
fi
-# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
-# the name of the created package would be, and then exit. This information
-# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@@ -79,14 +81,10 @@ if [ -d /usr/include/cuda ]; then
fi
fi
-embree=""
-if [ -d /usr/include/embree3 ]; then
- # If embree is installed, assume we want to use it
+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"
- # However disable embree if requested by e.g. EMBREE=no
- if [ ${EMBREE:-yes} != "yes" ]; then
- embree="-DWITH_CYCLES_EMBREE=OFF"
- fi
fi
set -e
@@ -100,9 +98,12 @@ 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 {} \+
+
+# 20220322 bkw: 32-bit needs this
+[ -z "$LIBDIRSUFFIX" ] && patch -p1 < $CWD/overloaded_min.diff
mkdir -p build
cd build
diff --git a/graphics/Blender/Blender.info b/graphics/Blender/Blender.info
index d169c2ab9536c..c4c49dc93498d 100644
--- a/graphics/Blender/Blender.info
+++ b/graphics/Blender/Blender.info
@@ -5,6 +5,6 @@ DOWNLOAD="https://download.blender.org/source/blender-3.0.1.tar.xz"
MD5SUM="41cccf2fe68b9b307204e9b9b2278b0c"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES="potrace OpenSubdiv pugixml jack opencollada valgrind numpy3 openimageio freealut embree"
+REQUIRES="potrace OpenSubdiv pugixml jack opencollada valgrind numpy3 openimageio freealut"
MAINTAINER="Christoph Willing"
EMAIL="chris.willing@linux.com"
diff --git a/graphics/Blender/README b/graphics/Blender/README
index d4af55d7523d8..2cefbda47dc13 100644
--- a/graphics/Blender/README
+++ b/graphics/Blender/README
@@ -7,19 +7,20 @@ 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.
-CUDA support is included if a CUDA installation is detected at build
-time. It may be disabled by passing CUDA=no when building:
+CUDA support is included if cudatoolkit is installed.
+It may be disabled by passing CUDA=no when building:
CUDA=no sh ./Blender.SlackBuild
-Since Blender-2.83.0, SBo's cudatoolkit-8.0.61 is insufficient for a
-successful build. The CUDA handling above remains for cases which may:
- - use a newer CUDA version toolkit
- - require the existing cudatoolkit for other purposes
- (so need CUDA=no for Blender)
+CUDA support hasn't been thorougly tested, and may break the build. If
+so, build with CUDA=no and report a bug to the maintainer of this
+script.
-Support for embree may be disabled by passing EMBREE=no when building:
+Optional dependency: embree. If installed, Blender will be built with
+support for it. It may be disabled by passing EMBREE=no when building:
EMBREE=no sh ./Blender.SlackBuild
-Version 2.83.8 is the last SBo supported version of Blender for
-building from source code in Slackware64-14.2. A more recent compiler
-(gcc-9.3.1) is required for 2.90.x and later blender versions.
+Note for 32-bit users: embree is 64-bit only, and can't be built on
+32-bit Slackware.
+
+See also: graphics/blender (note, lowercase B), which repackages the
+official Blender x86_64 release binary.
diff --git a/graphics/Blender/overloaded_min.diff b/graphics/Blender/overloaded_min.diff
new file mode 100644
index 0000000000000..5612d01599c16
--- /dev/null
+++ b/graphics/Blender/overloaded_min.diff
@@ -0,0 +1,51 @@
+diff -Naur blender-3.0.1/intern/cycles/scene/hair.cpp blender-3.0.1.patched/intern/cycles/scene/hair.cpp
+--- blender-3.0.1/intern/cycles/scene/hair.cpp 2021-10-27 15:21:51.000000000 -0400
++++ blender-3.0.1.patched/intern/cycles/scene/hair.cpp 2022-03-22 14:54:15.181140060 -0400
+@@ -119,7 +119,7 @@
+ {
+ /* Figure out which steps we need to fetch and their interpolation factor. */
+ const size_t max_step = num_steps - 1;
+- const size_t step = min((int)(time * max_step), max_step - 1);
++ const size_t step = min((int)(time * max_step), (int)(max_step - 1));
+ const float t = time * max_step - step;
+ /* Fetch vertex coordinates. */
+ float4 curr_keys[2];
+@@ -147,7 +147,7 @@
+ {
+ /* Figure out which steps we need to fetch and their interpolation factor. */
+ const size_t max_step = num_steps - 1;
+- const size_t step = min((int)(time * max_step), max_step - 1);
++ const size_t step = min((int)(time * max_step), (int)(max_step - 1));
+ const float t = time * max_step - step;
+ /* Fetch vertex coordinates. */
+ float4 curr_keys[4];
+@@ -192,7 +192,7 @@
+ float4 r_keys[2]) const
+ {
+ k0 = max(k0, 0);
+- k1 = min(k1, num_keys - 1);
++ k1 = min((int)k1, (int)(num_keys - 1));
+ const size_t center_step = ((num_steps - 1) / 2);
+ if (step == center_step) {
+ /* Center step: regular key location. */
+@@ -238,7 +238,7 @@
+ float4 r_keys[4]) const
+ {
+ k0 = max(k0, 0);
+- k3 = min(k3, num_keys - 1);
++ k3 = min((int)k3, (int)(num_keys - 1));
+ const size_t center_step = ((num_steps - 1) / 2);
+ if (step == center_step) {
+ /* Center step: regular key location. */
+diff -Naur blender-3.0.1/intern/cycles/scene/mesh.cpp blender-3.0.1.patched/intern/cycles/scene/mesh.cpp
+--- blender-3.0.1/intern/cycles/scene/mesh.cpp 2021-10-27 15:21:51.000000000 -0400
++++ blender-3.0.1.patched/intern/cycles/scene/mesh.cpp 2022-03-22 15:35:52.169528851 -0400
+@@ -53,7 +53,7 @@
+ {
+ /* Figure out which steps we need to fetch and their interpolation factor. */
+ const size_t max_step = num_steps - 1;
+- const size_t step = min((int)(time * max_step), max_step - 1);
++ const size_t step = min((int)(time * max_step), (int)(max_step - 1));
+ const float t = time * max_step - step;
+ /* Fetch vertex coordinates. */
+ float3 curr_verts[3];