From 2f43a5cd0f532369d7982d07a6e8d9147f9e3ad6 Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Wed, 7 Oct 2020 09:54:56 -0400 Subject: [PATCH] blender: rebuild for Python 3.9 --- srcpkgs/blender/patches/python39.patch | 153 +++++++++++++++++++++++++ srcpkgs/blender/template | 2 +- 2 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/blender/patches/python39.patch diff --git a/srcpkgs/blender/patches/python39.patch b/srcpkgs/blender/patches/python39.patch new file mode 100644 index 00000000000..9c87fa95c6f --- /dev/null +++ b/srcpkgs/blender/patches/python39.patch @@ -0,0 +1,153 @@ +From 56d0df51a36fdce7ec2d1fbb7b47b1d95b591b5f Mon Sep 17 00:00:00 2001 +From: Campbell Barton +Date: Mon, 22 Jun 2020 14:51:20 +1000 +Subject: [PATCH] Python: support building again version 3.9 (unreleased) + +Resolves T78089, no functional changes. +--- + .../blender/python/mathutils/mathutils_Matrix.c | 16 +++++++++------- + .../python/mathutils/mathutils_Quaternion.c | 14 ++++++++------ + .../blender/python/mathutils/mathutils_Vector.c | 6 +++--- + 3 files changed, 20 insertions(+), 16 deletions(-) + +diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c +index 327ee4dd1c3..63137e094b7 100644 +--- a/source/blender/python/mathutils/mathutils_Matrix.c ++++ b/source/blender/python/mathutils/mathutils_Matrix.c +@@ -42,7 +42,8 @@ static PyObject *Matrix_copy_notest(MatrixObject *self, const float *matrix); + static PyObject *Matrix_copy(MatrixObject *self); + static PyObject *Matrix_deepcopy(MatrixObject *self, PyObject *args); + static int Matrix_ass_slice(MatrixObject *self, int begin, int end, PyObject *value); +-static PyObject *matrix__apply_to_copy(PyNoArgsFunction matrix_func, MatrixObject *self); ++static PyObject *matrix__apply_to_copy(PyObject *(*matrix_func)(MatrixObject *), ++ MatrixObject *self); + static PyObject *MatrixAccess_CreatePyObject(MatrixObject *matrix, const eMatrixAccess_t type); + + static int matrix_row_vector_check(MatrixObject *mat, VectorObject *vec, int row) +@@ -395,14 +396,15 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds) + return NULL; + } + +-static PyObject *matrix__apply_to_copy(PyNoArgsFunction matrix_func, MatrixObject *self) ++static PyObject *matrix__apply_to_copy(PyObject *(*matrix_func)(MatrixObject *), ++ MatrixObject *self) + { + PyObject *ret = Matrix_copy(self); + if (ret) { +- PyObject *ret_dummy = matrix_func(ret); ++ PyObject *ret_dummy = matrix_func((MatrixObject *)ret); + if (ret_dummy) { + Py_DECREF(ret_dummy); +- return (PyObject *)ret; ++ return ret; + } + else { /* error */ + Py_DECREF(ret); +@@ -1738,7 +1740,7 @@ PyDoc_STRVAR( + " .. note:: When the matrix cant be adjugated a :exc:`ValueError` exception is raised.\n"); + static PyObject *Matrix_adjugated(MatrixObject *self) + { +- return matrix__apply_to_copy((PyNoArgsFunction)Matrix_adjugate, self); ++ return matrix__apply_to_copy(Matrix_adjugate, self); + } + + PyDoc_STRVAR( +@@ -1946,7 +1948,7 @@ PyDoc_STRVAR(Matrix_transposed_doc, + " :rtype: :class:`Matrix`\n"); + static PyObject *Matrix_transposed(MatrixObject *self) + { +- return matrix__apply_to_copy((PyNoArgsFunction)Matrix_transpose, self); ++ return matrix__apply_to_copy(Matrix_transpose, self); + } + + /*---------------------------matrix.normalize() ------------------*/ +@@ -1992,7 +1994,7 @@ PyDoc_STRVAR(Matrix_normalized_doc, + " :rtype: :class:`Matrix`\n"); + static PyObject *Matrix_normalized(MatrixObject *self) + { +- return matrix__apply_to_copy((PyNoArgsFunction)Matrix_normalize, self); ++ return matrix__apply_to_copy(Matrix_normalize, self); + } + + /*---------------------------matrix.zero() -----------------------*/ +diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c +index 39d84c1ac96..7ce0ea5f249 100644 +--- a/source/blender/python/mathutils/mathutils_Quaternion.c ++++ b/source/blender/python/mathutils/mathutils_Quaternion.c +@@ -34,7 +34,8 @@ + + #define QUAT_SIZE 4 + +-static PyObject *quat__apply_to_copy(PyNoArgsFunction quat_func, QuaternionObject *self); ++static PyObject *quat__apply_to_copy(PyObject *(*quat_func)(QuaternionObject *), ++ QuaternionObject *self); + static void quat__axis_angle_sanitize(float axis[3], float *angle); + static PyObject *Quaternion_copy(QuaternionObject *self); + static PyObject *Quaternion_deepcopy(QuaternionObject *self, PyObject *args); +@@ -463,7 +464,7 @@ PyDoc_STRVAR(Quaternion_normalized_doc, + " :rtype: :class:`Quaternion`\n"); + static PyObject *Quaternion_normalized(QuaternionObject *self) + { +- return quat__apply_to_copy((PyNoArgsFunction)Quaternion_normalize, self); ++ return quat__apply_to_copy(Quaternion_normalize, self); + } + + PyDoc_STRVAR(Quaternion_invert_doc, +@@ -490,7 +491,7 @@ PyDoc_STRVAR(Quaternion_inverted_doc, + " :rtype: :class:`Quaternion`\n"); + static PyObject *Quaternion_inverted(QuaternionObject *self) + { +- return quat__apply_to_copy((PyNoArgsFunction)Quaternion_invert, self); ++ return quat__apply_to_copy(Quaternion_invert, self); + } + + PyDoc_STRVAR(Quaternion_identity_doc, +@@ -553,7 +554,7 @@ PyDoc_STRVAR(Quaternion_conjugated_doc, + " :rtype: :class:`Quaternion`\n"); + static PyObject *Quaternion_conjugated(QuaternionObject *self) + { +- return quat__apply_to_copy((PyNoArgsFunction)Quaternion_conjugate, self); ++ return quat__apply_to_copy(Quaternion_conjugate, self); + } + + PyDoc_STRVAR(Quaternion_copy_doc, +@@ -1385,10 +1386,11 @@ static PyObject *Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kw + return Quaternion_CreatePyObject(quat, type); + } + +-static PyObject *quat__apply_to_copy(PyNoArgsFunction quat_func, QuaternionObject *self) ++static PyObject *quat__apply_to_copy(PyObject *(*quat_func)(QuaternionObject *), ++ QuaternionObject *self) + { + PyObject *ret = Quaternion_copy(self); +- PyObject *ret_dummy = quat_func(ret); ++ PyObject *ret_dummy = quat_func((QuaternionObject *)ret); + if (ret_dummy) { + Py_DECREF(ret_dummy); + return ret; +diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c +index ace7480ee81..15ae811fd91 100644 +--- a/source/blender/python/mathutils/mathutils_Vector.c ++++ b/source/blender/python/mathutils/mathutils_Vector.c +@@ -96,10 +96,10 @@ static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *kwds) + return Vector_CreatePyObject_alloc(vec, size, type); + } + +-static PyObject *vec__apply_to_copy(PyNoArgsFunction vec_func, VectorObject *self) ++static PyObject *vec__apply_to_copy(PyObject *(*vec_func)(VectorObject *), VectorObject *self) + { + PyObject *ret = Vector_copy(self); +- PyObject *ret_dummy = vec_func(ret); ++ PyObject *ret_dummy = vec_func((VectorObject *)ret); + if (ret_dummy) { + Py_DECREF(ret_dummy); + return (PyObject *)ret; +@@ -376,7 +376,7 @@ PyDoc_STRVAR(Vector_normalized_doc, + " :rtype: :class:`Vector`\n"); + static PyObject *Vector_normalized(VectorObject *self) + { +- return vec__apply_to_copy((PyNoArgsFunction)Vector_normalize, self); ++ return vec__apply_to_copy(Vector_normalize, self); + } + + PyDoc_STRVAR(Vector_resize_doc, diff --git a/srcpkgs/blender/template b/srcpkgs/blender/template index 559a5311288..731f4af9f68 100644 --- a/srcpkgs/blender/template +++ b/srcpkgs/blender/template @@ -1,7 +1,7 @@ # Template file for 'blender' pkgname=blender version=2.83.6 -revision=2 +revision=3 archs="x86_64* i686* ppc64*" build_style="cmake" pycompile_dirs="/usr/share/blender/${version%.*}/scripts"