summaryrefslogtreecommitdiff
path: root/graphics/Blender
diff options
context:
space:
mode:
authorChristoph Willing <chris.willing@linux.com>2019-03-24 18:54:22 +1000
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2019-03-30 07:18:25 +0700
commitdd5050df2ddca3f659dfa419ede559c2fef9aae5 (patch)
tree19ca5aa0e61f806e88ff6d7ec6afeb0f99d89996 /graphics/Blender
parent6a693f8eacd9abf3ce312426feabbbc6e3c05647 (diff)
downloadslackbuilds-dd5050df2ddca3f659dfa419ede559c2fef9aae5.tar.gz
graphics/Blender: Patch for python3.7
Signed-off-by: Christoph Willing <chris.willing@linux.com>
Diffstat (limited to 'graphics/Blender')
-rw-r--r--graphics/Blender/Blender.SlackBuild7
-rw-r--r--graphics/Blender/PyRNA-python3.7.diff35
2 files changed, 39 insertions, 3 deletions
diff --git a/graphics/Blender/Blender.SlackBuild b/graphics/Blender/Blender.SlackBuild
index 9e545177ad..7852440f49 100644
--- a/graphics/Blender/Blender.SlackBuild
+++ b/graphics/Blender/Blender.SlackBuild
@@ -26,7 +26,7 @@ SRCNAM=blender
PKGNAM=Blender
VERSION=${VERSION:-2.79b}
BASE_VERSION=${BASE_VERSION:-$( echo $VERSION | sed -e 's/[^0-9.]*//g')}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PYTHON_VERSION=$(python3 -c "import sys; print(sys.version[:3])")
@@ -74,6 +74,7 @@ find -L . \
patch -p0 < $CWD/buildinfo-$VERSION.diff
patch -p1 < $CWD/use-libopenmj2-for-openjpeg.diff
+patch -p1 < $CWD/PyRNA-python3.7.diff
mkdir -p build
cd build
@@ -87,7 +88,7 @@ cd build
-DWITH_OPENCOLLADA:BOOL=ON \
-DWITH_OPENCOLORIO:BOOL=ON \
-DPYTHON_VERSION=$PYTHON_VERSION \
- -DWITH_PYTHON_INSTALL:BOOL=ON \
+ -DWITH_PYTHON_INSTALL:BOOL=OFF \
-DWITH_PYTHON_INSTALL_NUMPY:BOOL=ON \
-DWITH_CODEC_FFMPEG:BOOL=ON \
-DWITH_OPENAL:BOOL=ON \
@@ -120,7 +121,7 @@ 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 PYTHONPATH=/usr/share/$SRCNAM/$BASE_VERSION/python/lib$LIBDIRSUFFIX/python$PYTHON_VERSION
export LD_LIBRARY_PATH=/usr/lib$LIBDIRSUFFIX/opencollada
exec $bin.bin "\$@"
EOF
diff --git a/graphics/Blender/PyRNA-python3.7.diff b/graphics/Blender/PyRNA-python3.7.diff
new file mode 100644
index 0000000000..ac5f72e474
--- /dev/null
+++ b/graphics/Blender/PyRNA-python3.7.diff
@@ -0,0 +1,35 @@
+commit 1db47a2ccd1e68994bf8140eba6cc2a26a2bc91f
+Author: Campbell Barton <ideasman42@gmail.com>
+Date: Thu Jul 12 08:28:06 2018 +0200
+
+ Fix PyRNA class registration w/ Python 3.7
+
+ In Python3.7 this now raises an error.
+
+diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
+index 9052b6f580a..80b0aa7a51b 100644
+--- a/source/blender/python/intern/bpy_rna.c
++++ b/source/blender/python/intern/bpy_rna.c
+@@ -7577,10 +7577,12 @@ static int bpy_class_validate_recursive(PointerRNA *dummyptr, StructRNA *srna, v
+ if (!(flag & PROP_REGISTER))
+ continue;
+
++ /* TODO(campbell): Use Python3.7x _PyObject_LookupAttr(), also in the macro below. */
+ identifier = RNA_property_identifier(prop);
+ item = PyObject_GetAttrString(py_class, identifier);
+
+ if (item == NULL) {
++ PyErr_Clear();
+ /* Sneaky workaround to use the class name as the bl_idname */
+
+ #define BPY_REPLACEMENT_STRING(rna_attr, py_attr) \
+@@ -7596,6 +7598,9 @@ static int bpy_class_validate_recursive(PointerRNA *dummyptr, StructRNA *srna, v
+ } \
+ Py_DECREF(item); \
+ } \
++ else { \
++ PyErr_Clear(); \
++ } \
+ } /* intentionally allow else here */
+
+ if (false) {} /* needed for macro */