From e80549e5969f84798943235bbe66e40d35cd7967 Mon Sep 17 00:00:00 2001 From: jca Date: Fri, 21 Jun 2019 22:44:14 +0000 Subject: [PATCH] Backport python3.7 upstream fix and switch back to default python3 version ok danj@ pascal@ (maintainer) --- graphics/blender/Makefile | 6 ++--- ...tch-source_blender_python_intern_bpy_rna_c | 26 +++++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 graphics/blender/patches/patch-source_blender_python_intern_bpy_rna_c diff --git a/graphics/blender/Makefile b/graphics/blender/Makefile index 8a41c3140fc..92db791eb54 100644 --- a/graphics/blender/Makefile +++ b/graphics/blender/Makefile @@ -1,11 +1,11 @@ -# $OpenBSD: Makefile,v 1.92 2019/05/26 11:09:30 jca Exp $ +# $OpenBSD: Makefile,v 1.93 2019/06/21 22:44:14 jca Exp $ ONLY_FOR_ARCHS = amd64 i386 COMMENT = 3D creation software DISTNAME = blender-2.79 -REVISION = 6 +REVISION = 7 CATEGORIES = graphics @@ -32,7 +32,7 @@ MODULES = devel/cmake \ COMPILER = base-clang ports-gcc -MODPY_VERSION = 3.6 +MODPY_VERSION = ${MODPY_DEFAULT_VERSION_3} CONFIGURE_ARGS = -DPYTHON_INCLUDE_DIR="${MODPY_INCDIR}" \ -DPYTHON_VERSION=${MODPY_VERSION} \ diff --git a/graphics/blender/patches/patch-source_blender_python_intern_bpy_rna_c b/graphics/blender/patches/patch-source_blender_python_intern_bpy_rna_c new file mode 100644 index 00000000000..b54f8345d09 --- /dev/null +++ b/graphics/blender/patches/patch-source_blender_python_intern_bpy_rna_c @@ -0,0 +1,26 @@ +$OpenBSD: patch-source_blender_python_intern_bpy_rna_c,v 1.1 2019/06/21 22:44:14 jca Exp $ + +Fix PyRNA class registration w/ Python 3.7 +https://developer.blender.org/rB1db47a2ccd1e68994bf8140eba6cc2a26a2bc91f + +Index: source/blender/python/intern/bpy_rna.c +--- source/blender/python/intern/bpy_rna.c.orig ++++ source/blender/python/intern/bpy_rna.c +@@ -7389,6 +7389,7 @@ static int bpy_class_validate_recursive(PointerRNA *du + 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) \ +@@ -7404,6 +7405,9 @@ static int bpy_class_validate_recursive(PointerRNA *du + } \ + Py_DECREF(item); \ + } \ ++ else { \ ++ PyErr_Clear(); \ ++ } \ + } /* intentionally allow else here */ + + if (false) {} /* needed for macro */