mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-04 20:29:09 +01:00
graphics/Blender: Patch for python3.7
Signed-off-by: Christoph Willing <chris.willing@linux.com>
This commit is contained in:
parent
6a693f8eac
commit
dd5050df2d
2 changed files with 39 additions and 3 deletions
|
@ -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
|
||||
|
|
35
graphics/Blender/PyRNA-python3.7.diff
Normal file
35
graphics/Blender/PyRNA-python3.7.diff
Normal file
|
@ -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 */
|
Loading…
Reference in a new issue